feat: add getVersion method

This commit is contained in:
Justin Starry
2019-11-11 20:09:00 -05:00
committed by Michael Vines
parent 979a707c94
commit f3d9ab75e6
3 changed files with 57 additions and 0 deletions

View File

@ -475,6 +475,25 @@ test('get recent blockhash', async () => {
expect(feeCalculator.lamportsPerSignature).toBeGreaterThanOrEqual(0);
});
test('getVersion', async () => {
const connection = new Connection(url);
mockRpc.push([
url,
{
method: 'getVersion',
params: [],
},
{
error: null,
result: {'solana-core': '0.20.4'},
},
]);
const version = await connection.getVersion();
expect(version['solana-core']).toBeTruthy();
});
test('request airdrop', async () => {
const account = new Account();
const connection = new Connection(url, 'recent');