solana/web3.js/test/mockrpc/get-recent-blockhash.js

22 lines
393 B
JavaScript
Raw Normal View History

// @flow
2018-11-04 11:41:21 -08:00
import {Account} from '../../src';
import {url} from '../url';
import {mockRpc} from '../__mocks__/node-fetch';
2019-03-04 08:06:33 -08:00
export function mockGetRecentBlockhash() {
const recentBlockhash = new Account();
mockRpc.push([
url,
{
2019-03-04 08:06:33 -08:00
method: 'getRecentBlockhash',
params: [],
},
{
error: null,
2019-03-04 08:06:33 -08:00
result: recentBlockhash.publicKey.toBase58(),
2018-11-04 11:41:21 -08:00
},
]);
}