Commit bfe51cf4 authored by shajiaiming's avatar shajiaiming

生成撤销创建token 的交易

parent 1d33f3e2
......@@ -226,15 +226,34 @@ class IssueChainTransferController extends Controller
$chain_service = new Chain33Service($node);
foreach ($issue_coin_model as $val) {
$data = [];
$result = $chain_service->createRawTokenRevokeTx($val->symbol, $val->owner);
if (null == $val->transfer) {
//执行1.3构造
$result = $chain_service->CreateRawTokenRevokeTx($val->symbol, $val->owner);
if (null != $result['error']) {
$status = CoinIssueCoin::CANCEL_FAIL;
$data = [
'pre_query_transaction' => 'fail'
];
goto doEnd;
}
if (null != $result['error']) {
$txHex = $result['result'];
$privkey = '8ac19c0b8858ccd6ed34e2bce0f11be2fc696e658d0b98fb1d3ef85ec5a3992c';
$expire = '1m';
//执行1.3签名
$signRawTx = $chain_service->signRawTx($privkey, $txHex, $expire);
if (0 != $signRawTx['code']) {
$status = CoinIssueCoin::CANCEL_FAIL;
$data = [
'pre_query_transaction' => $result['error']
'pre_query_transaction' => 'fail'
];
goto doEnd;
}
//执行1.3交易
$result = $chain_service->sendTransaction($signRawTx['result']);
if (0 != $result['code']) {
$status = CoinIssueCoin::CANCEL_FAIL;
$data = [
'pre_query_transaction' => 'fail'
];
goto doEnd;
}
......@@ -246,11 +265,9 @@ class IssueChainTransferController extends Controller
CoinIssueCoin::updateAll(['status' => $status], [
'id' => $val->id,
]);
if (false != $data) {
CoinIssueChainRecord::updateAll($data, [
'issue_coin_id' => $val->id,
]);
}
CoinIssueChainRecord::updateAll($data, [
'issue_coin_id' => $val->id,
]);
}
echo date('Y-m-d H:i:s') . '已撤消' . PHP_EOL;
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment