fix: wait for the next lastId before sending a new transaction

This commit is contained in:
Michael Vines
2018-10-22 15:31:56 -07:00
parent d9b98918b6
commit 9c8cc0bd24
4 changed files with 50 additions and 39 deletions

View File

@ -10,26 +10,13 @@ import {SYSTEM_TOKEN_PROGRAM_ID} from '../src/token-program';
import {mockRpc, mockRpcEnabled} from './__mocks__/node-fetch';
import {url} from './url';
import {newAccountWithTokens} from './new-account-with-tokens';
import {mockGetLastId} from './mockrpc/getlastid';
if (!mockRpcEnabled) {
// The default of 5 seconds is too slow for live testing sometimes
jest.setTimeout(10000);
}
function mockGetLastId() {
mockRpc.push([
url,
{
method: 'getLastId',
params: [],
},
{
error: null,
result: '2BjEqiiT43J6XskiHdz7aoocjPeWkCPiKD72SiFQsrA2',
}
]);
}
function mockGetSignatureStatus(result: string = 'Confirmed') {
mockRpc.push([
url,