Clear timeout before resolving/rejecting
This commit is contained in:
parent
5cd4041666
commit
33ff4754a7
@ -259,9 +259,16 @@ export class CosmWasmClient {
|
||||
}
|
||||
const transactionId = toHex(broadcasted.hash).toUpperCase();
|
||||
return new Promise((resolve, reject) =>
|
||||
pollForTx(transactionId)
|
||||
.then(resolve, reject)
|
||||
.finally(() => clearTimeout(txPollTimeout)),
|
||||
pollForTx(transactionId).then(
|
||||
(value) => {
|
||||
clearTimeout(txPollTimeout);
|
||||
resolve(value);
|
||||
},
|
||||
(error) => {
|
||||
clearTimeout(txPollTimeout);
|
||||
reject(error);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -351,9 +351,16 @@ export class StargateClient {
|
||||
}
|
||||
const transactionId = toHex(broadcasted.hash).toUpperCase();
|
||||
return new Promise((resolve, reject) =>
|
||||
pollForTx(transactionId)
|
||||
.then(resolve, reject)
|
||||
.finally(() => clearTimeout(txPollTimeout)),
|
||||
pollForTx(transactionId).then(
|
||||
(value) => {
|
||||
clearTimeout(txPollTimeout);
|
||||
resolve(value);
|
||||
},
|
||||
(error) => {
|
||||
clearTimeout(txPollTimeout);
|
||||
reject(error);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user