fix: wait for the next lastId before sending a new transaction
This commit is contained in:
23
web3.js/test/mockrpc/getlastid.js
Normal file
23
web3.js/test/mockrpc/getlastid.js
Normal file
@ -0,0 +1,23 @@
|
||||
// @flow
|
||||
|
||||
import {
|
||||
Account,
|
||||
} from '../../src';
|
||||
import {url} from '../url';
|
||||
import {mockRpc} from '../__mocks__/node-fetch';
|
||||
|
||||
export function mockGetLastId() {
|
||||
const lastId = new Account();
|
||||
|
||||
mockRpc.push([
|
||||
url,
|
||||
{
|
||||
method: 'getLastId',
|
||||
params: [],
|
||||
},
|
||||
{
|
||||
error: null,
|
||||
result: lastId.publicKey.toBase58(),
|
||||
}
|
||||
]);
|
||||
}
|
Reference in New Issue
Block a user