Use new ethers.js NonceManager to handle transaction nonces
So far we have failed to globally handle the transaction nonces. The new ethers.js v5 comes with a NonceManager that helps us handling transaction nonces and automatically increases the nonce for each transaction.
This commit is contained in:
3
index.js
3
index.js
@@ -2,6 +2,7 @@ const fs = require('fs');
|
||||
const util = require('util');
|
||||
const fetch = require('node-fetch');
|
||||
const ethers = require('ethers');
|
||||
const NonceManager = require('@ethersproject/experimental').NonceManager;
|
||||
const Kredits = require('kredits-contracts');
|
||||
|
||||
const walletPath = process.env.KREDITS_WALLET_PATH || './wallet.json';
|
||||
@@ -43,7 +44,7 @@ module.exports = async function(robot) {
|
||||
} else {
|
||||
ethProvider = new ethers.getDefaultProvider('rinkeby');
|
||||
}
|
||||
const signer = wallet.connect(ethProvider);
|
||||
const signer = new NonceManager(wallet.connect(ethProvider));
|
||||
|
||||
//
|
||||
// Kredits contracts setup
|
||||
|
||||
Reference in New Issue
Block a user