mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Broadcasting transaction error is fixed with using a Promise object (#1101)
This commit is contained in:
parent
1e11948c07
commit
0d609f1292
@ -372,8 +372,10 @@ export class StargateClient {
|
|||||||
|
|
||||||
const broadcasted = await this.forceGetTmClient().broadcastTxSync({ tx });
|
const broadcasted = await this.forceGetTmClient().broadcastTxSync({ tx });
|
||||||
if (broadcasted.code) {
|
if (broadcasted.code) {
|
||||||
throw new Error(
|
return Promise.reject(
|
||||||
`Broadcasting transaction failed with code ${broadcasted.code} (codespace: ${broadcasted.codeSpace}). Log: ${broadcasted.log}`,
|
new Error(
|
||||||
|
`Broadcasting transaction failed with code ${broadcasted.code} (codespace: ${broadcasted.codeSpace}). Log: ${broadcasted.log}`,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const transactionId = toHex(broadcasted.hash).toUpperCase();
|
const transactionId = toHex(broadcasted.hash).toUpperCase();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user