pra_scatter_middleware icon indicating copy to clipboard operation
pra_scatter_middleware copied to clipboard

contract_push合约调用成功了 我返回了交易id,dapp h5页面就没反应了

Open dinghu opened this issue 5 years ago • 5 comments

contract_push合约调用成功了 我返回了交易id,dapp h5页面就没反应了.请问合约调用成功了,是否就是返回交易id字符串?

dinghu avatar Mar 07 '19 07:03 dinghu

Android demo 里面的 pushTxnResponse.toString();这个????是什么数据格式啊

dinghu avatar Mar 07 '19 07:03 dinghu

成功了以后返回 交易id就可以了, 错误的时候 带一个 error前缀,demo里的应该就是链上返回的对象json

oday0311 avatar Mar 07 '19 08:03 oday0311

成功了以后返回 交易id就可以了, 错误的时候 带一个 error前缀,demo里的应该就是链上返回的对象json

都试过了 报错:03-07 16:44:55.751 26045-26045/com.cph.topay I/chromium: [INFO:CONSOLE(491)] "TypeError: Cannot read property 'length' of undefined", source: https://enbk.io/candy/js/main.js?v1.8.1 (491) 03-07 16:44:55.751 26045-26045/com.cph.topay I/chromium: [INFO:CONSOLE(492)] "Uncaught (in promise) SyntaxError: Unexpected token T in JSON at position 0", source: https://enbk.io/candy/js/main.js?v1.8.1 (492)

运行到:这个js函数报错了: eos.contract(candy_contract, options).then(contract => { contract.useenbank(account.name, quantity, memo, options).then(function (tx) { //console.log(tx); var txid = tx.transaction_id; if (txid.length == 64) { todb(account.name, id, type, txid, symbol, cur_contract, res.ticket, res.randstr, num, refer); Dialog.init('Success!'); }

                            }).catch(function (e) {
                                console.log(e);
                                e = JSON.parse(e);
                                if (e.error.details[0].message != "Invalid packed transaction") {
                                    Dialog.init(e.error.details[0].message);
                                }
                            });
                        });

dinghu avatar Mar 07 '19 08:03 dinghu

成功了以后返回 交易id就可以了, 错误的时候 带一个 error前缀,demo里的应该就是链上返回的对象json

返回json 和 返回交易id 都会 报这个错。。。。

dinghu avatar Mar 07 '19 08:03 dinghu

你可以看一下dapp的调试返回吗

发自我的 iPhone

在 2019年3月7日,下午4:47,dinghu <[email protected]mailto:[email protected]> 写道:

成功了以后返回 交易id就可以了, 错误的时候 带一个 error前缀,demo里的应该就是链上返回的对象json

返回json 和 返回交易id 都会 报这个错。。。。

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ProChain/pra_scatter_middleware/issues/13#issuecomment-470437800, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AA2e5MjsKM-zv9lCpitG5fiRkrduTRUvks5vUNIQgaJpZM4bijpf.

oday0311 avatar Mar 07 '19 09:03 oday0311