feat: add commitment param to JSON RPC API requests (#549)
* feat: add commitment param to json rpc requests * fix: tests and examples * fix: docs * fix: epoch info test * fix: budget example * fix: test timeout * fix: remove MAX_COMMITMENT and RECENT_COMMITMENT types
This commit is contained in:
committed by
Michael Vines
parent
d0c89f7fa3
commit
189807f5a5
@ -1,17 +1,22 @@
|
||||
// @flow
|
||||
|
||||
import {Account} from '../../src';
|
||||
import type {Commitment} from '../../src/connection';
|
||||
import {url} from '../url';
|
||||
import {mockRpc} from '../__mocks__/node-fetch';
|
||||
|
||||
export function mockGetRecentBlockhash() {
|
||||
export function mockGetRecentBlockhash(commitment: ?Commitment) {
|
||||
const recentBlockhash = new Account();
|
||||
const params = [];
|
||||
if (commitment) {
|
||||
params.push({commitment});
|
||||
}
|
||||
|
||||
mockRpc.push([
|
||||
url,
|
||||
{
|
||||
method: 'getRecentBlockhash',
|
||||
params: [],
|
||||
params,
|
||||
},
|
||||
{
|
||||
error: null,
|
||||
|
Reference in New Issue
Block a user