Error reporting not working
kjawadDeveloper2 opened this issue · 2 comments
When i do a transaction with invalid address. It returns the transaction hash and even though through CLI query i see the error. The transaction signing gateway is not throwing this error.
logs: []
raw_log: 'failed to execute message; message index: 0: ID cookbookLOUD already set:
invalid request'
final result = await _transactionSigningGateway.signTransaction(transaction: unsignedTransaction, walletLookupKey: walletLookupKey).mapError<dynamic>((error) { print(error); throw error; }).flatMap( (signed) => _transactionSigningGateway.broadcastTransaction( walletLookupKey: walletLookupKey, transaction: signed, ), );
@kjawadDeveloper2
This is probably an issue with alan
library.
If this is fixed there, transaction_signing_gateway
will automatically start returning an error returned by the library.
For reference, I ran this code with hello
as an address to sign a transaction, and it worked. The code is from alan library completely independent of the transaction signing gateway.
final networkInfo = NetworkInfo.fromSingleHost(
bech32Hrp: 'cosmos',
host: 'localhost',
);
const mnemonicString =
'inherit rely glide angry destroy achieve talk scan bulk step discover quit talk vintage round grief mimic mad nuclear gym never develop skin seek';
final mnemonic = mnemonicString.split(' ');
final wallet = Wallet.derive(mnemonic, networkInfo);
// 3. Create and sign the transaction
final message = bank.MsgSend.create()
..fromAddress = wallet.bech32Address
..toAddress = 'hello';
message.amount.add(
Coin.create()
..denom = 'token'
..amount = '100',
);
final signer = TxSigner.fromNetworkInfo(networkInfo);
final tx = await signer.createAndSign(wallet, [message]);
print(tx);