Skip to content

Commit

Permalink
Broadcasting transaction error is fixed with using a Promise object (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaci authored Mar 29, 2022
1 parent 1e11948 commit 0d609f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/stargate/src/stargateclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,10 @@ export class StargateClient {

const broadcasted = await this.forceGetTmClient().broadcastTxSync({ tx });
if (broadcasted.code) {
throw new Error(
`Broadcasting transaction failed with code ${broadcasted.code} (codespace: ${broadcasted.codeSpace}). Log: ${broadcasted.log}`,
return Promise.reject(
new Error(
`Broadcasting transaction failed with code ${broadcasted.code} (codespace: ${broadcasted.codeSpace}). Log: ${broadcasted.log}`,
),
);
}
const transactionId = toHex(broadcasted.hash).toUpperCase();
Expand Down

0 comments on commit 0d609f1

Please sign in to comment.