feat: add support for getFirstAvailableBlock method

This commit is contained in:
Justin Starry
2020-05-23 17:33:04 +08:00
committed by Michael Vines
parent 1b8fe71230
commit 925c225885
4 changed files with 39 additions and 3 deletions

View File

@ -1109,6 +1109,25 @@ test('get minimum ledger slot', async () => {
expect(minimumLedgerSlot).toBeGreaterThanOrEqual(0);
});
test('get first available block', async () => {
const connection = new Connection(url);
mockRpc.push([
url,
{
method: 'getFirstAvailableBlock',
params: [],
},
{
error: null,
result: 0,
},
]);
const firstAvailableBlock = await connection.getFirstAvailableBlock();
expect(firstAvailableBlock).toBeGreaterThanOrEqual(0);
});
test('get supply', async () => {
const connection = new Connection(url);