@atomiqlabs/chain-starknet 7.0.1 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -250,15 +250,15 @@ class StarknetPersistentSigner extends StarknetSigner_1.StarknetSigner {
|
|
|
250
250
|
return result;
|
|
251
251
|
}
|
|
252
252
|
catch (e) {
|
|
253
|
+
this.chainInterface.Transactions._knownTxSet.delete(signedTx.txId);
|
|
254
|
+
this.pendingTxs.delete(transaction.details.nonce);
|
|
255
|
+
this.pendingNonce--;
|
|
256
|
+
this.logger.debug("sendTransaction(): Error when broadcasting transaction, reverting pending nonce to: ", this.pendingNonce);
|
|
253
257
|
if (e.baseError?.code === 52) { //Invalid transaction nonce
|
|
254
258
|
//Re-check nonce from on-chain
|
|
255
259
|
this.logger.info("sendTransaction(): Got INVALID_TRANSACTION_NONCE (52) back from backend, re-checking latest nonce from chain!");
|
|
256
260
|
await this.syncNonceFromChain();
|
|
257
261
|
}
|
|
258
|
-
this.chainInterface.Transactions._knownTxSet.delete(signedTx.txId);
|
|
259
|
-
this.pendingTxs.delete(transaction.details.nonce);
|
|
260
|
-
this.pendingNonce--;
|
|
261
|
-
this.logger.debug("sendTransaction(): Error when broadcasting transaction, reverting pending nonce to: ", this.pendingNonce);
|
|
262
262
|
throw e;
|
|
263
263
|
}
|
|
264
264
|
});
|
package/package.json
CHANGED
|
@@ -318,15 +318,15 @@ export class StarknetPersistentSigner extends StarknetSigner {
|
|
|
318
318
|
pendingTxObject.sending = false;
|
|
319
319
|
return result;
|
|
320
320
|
} catch (e) {
|
|
321
|
+
this.chainInterface.Transactions._knownTxSet.delete(signedTx.txId);
|
|
322
|
+
this.pendingTxs.delete(transaction.details.nonce);
|
|
323
|
+
this.pendingNonce--;
|
|
324
|
+
this.logger.debug("sendTransaction(): Error when broadcasting transaction, reverting pending nonce to: ", this.pendingNonce);
|
|
321
325
|
if(e.baseError?.code === 52) { //Invalid transaction nonce
|
|
322
326
|
//Re-check nonce from on-chain
|
|
323
327
|
this.logger.info("sendTransaction(): Got INVALID_TRANSACTION_NONCE (52) back from backend, re-checking latest nonce from chain!");
|
|
324
328
|
await this.syncNonceFromChain();
|
|
325
329
|
}
|
|
326
|
-
this.chainInterface.Transactions._knownTxSet.delete(signedTx.txId);
|
|
327
|
-
this.pendingTxs.delete(transaction.details.nonce);
|
|
328
|
-
this.pendingNonce--;
|
|
329
|
-
this.logger.debug("sendTransaction(): Error when broadcasting transaction, reverting pending nonce to: ", this.pendingNonce);
|
|
330
330
|
throw e;
|
|
331
331
|
}
|
|
332
332
|
});
|