Broadcasting transaction error is fixed with using a Promise object (#1101)

This commit is contained in:
Furkan KAMACI
2022-03-30 00:23:46 +02:00
committed by GitHub
parent 1e11948c07
commit 0d609f1292
+4 -2
View File
@@ -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();