medibloc/panacea-js

Need a way to check if TxResponse is successful

Closed this issue · 1 comments

BroadcastReq req = new BroadcastReq(tx, "block");
TxResponse res = client.broadcast(req);

When the broadcast mode is block, the TxResponse could contain an error message if tx is failed:

TxResponse[height=0,txHash=34CD44AD255B896F8B9C34EE89E00E0C8E3A7B305BF825515BD88174E07E1239,code=4,data=<null>,rawLog={"codespace":"sdk","code":4,"message":"signature verification failed; verify correct account sequence and chain-id"},info=<null>,gasWanted=<null>,gasUsed=20421,codespace=<null>,timestamp=<null>,tx=<null>]

If it's not okay to make broadcast() throws an Exception in this case, we need to provide the way to check if tx was successful, at least.