feat: add singleGossip commitment level
This commit is contained in:
committed by
Michael Vines
parent
ed08c25d2d
commit
e2e4b47103
2
web3.js/module.d.ts
vendored
2
web3.js/module.d.ts
vendored
@ -46,7 +46,7 @@ declare module '@solana/web3.js' {
|
|||||||
value: T;
|
value: T;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Commitment = 'max' | 'recent' | 'root' | 'single';
|
export type Commitment = 'max' | 'recent' | 'root' | 'single' | 'singleGossip';
|
||||||
|
|
||||||
export type LargestAccountsFilter = 'circulating' | 'nonCirculating';
|
export type LargestAccountsFilter = 'circulating' | 'nonCirculating';
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ declare module '@solana/web3.js' {
|
|||||||
value: T,
|
value: T,
|
||||||
};
|
};
|
||||||
|
|
||||||
declare export type Commitment = 'max' | 'recent' | 'root' | 'single';
|
declare export type Commitment = 'max' | 'recent' | 'root' | 'single' | 'singleGossip';
|
||||||
|
|
||||||
declare export type LargestAccountsFilter = 'circulating' | 'nonCirculating';
|
declare export type LargestAccountsFilter = 'circulating' | 'nonCirculating';
|
||||||
|
|
||||||
|
@ -94,11 +94,12 @@ function notificationResultAndContext(resultDescription: any) {
|
|||||||
* 'recent': Query the most recent block which has reached 1 confirmation by the connected node
|
* 'recent': Query the most recent block which has reached 1 confirmation by the connected node
|
||||||
* 'root': Query the most recent block which has been rooted by the connected node
|
* 'root': Query the most recent block which has been rooted by the connected node
|
||||||
* 'single': Query the most recent block which has reached 1 confirmation by the cluster
|
* 'single': Query the most recent block which has reached 1 confirmation by the cluster
|
||||||
|
* 'singleGossip': Query the most recent block which has reached 1 confirmation according to votes seen in gossip
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @typedef {'max' | 'recent' | 'root' | 'single'} Commitment
|
* @typedef {'max' | 'recent' | 'root' | 'single' | 'singleGossip'} Commitment
|
||||||
*/
|
*/
|
||||||
export type Commitment = 'max' | 'recent' | 'root' | 'single';
|
export type Commitment = 'max' | 'recent' | 'root' | 'single' | 'singleGossip';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter for largest accounts query
|
* Filter for largest accounts query
|
||||||
|
@ -1056,7 +1056,7 @@ test('get confirmed block', async () => {
|
|||||||
|
|
||||||
test('get recent blockhash', async () => {
|
test('get recent blockhash', async () => {
|
||||||
const connection = new Connection(url);
|
const connection = new Connection(url);
|
||||||
for (const commitment of ['max', 'recent', 'root', 'single']) {
|
for (const commitment of ['max', 'recent', 'root', 'single', 'singleGossip']) {
|
||||||
mockGetRecentBlockhash(commitment);
|
mockGetRecentBlockhash(commitment);
|
||||||
|
|
||||||
const {blockhash, feeCalculator} = await connection.getRecentBlockhash(
|
const {blockhash, feeCalculator} = await connection.getRecentBlockhash(
|
||||||
|
Reference in New Issue
Block a user