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

32 lines
655 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,
result: [
recentBlockhash.publicKey.toBase58(),
2019-05-23 09:44:55 -07:00
{
2019-06-12 14:36:05 -07:00
lamportsPerSignature: 42,
burnPercent: 50,
maxLamportsPerSignature: 42,
minLamportsPerSignature: 42,
targetLamportsPerSignature: 42,
targetSignaturesPerSlot: 42,
2019-05-23 09:44:55 -07:00
},
],
2018-11-04 11:41:21 -08:00
},
]);
}