feat: add binding for getEpochVoteAccounts

This commit is contained in:
Michael Vines
2019-06-12 10:26:55 -07:00
parent 45a42374f2
commit e23d2453d7
2 changed files with 67 additions and 12 deletions

View File

@ -115,7 +115,7 @@ test('get cluster nodes', async () => {
error: null,
result: [
{
id: '11111111111111111111111111111111',
pubkey: '11111111111111111111111111111111',
gossip: '127.0.0.0:1234',
tpu: '127.0.0.0:1235',
rpc: null,
@ -127,7 +127,7 @@ test('get cluster nodes', async () => {
const clusterNodes = await connection.getClusterNodes();
if (mockRpcEnabled) {
expect(clusterNodes).toHaveLength(1);
expect(clusterNodes[0].id).toBe('11111111111111111111111111111111');
expect(clusterNodes[0].pubkey).toBe('11111111111111111111111111111111');
expect(typeof clusterNodes[0].gossip).toBe('string');
expect(typeof clusterNodes[0].tpu).toBe('string');
expect(clusterNodes[0].rpc).toBeNull();
@ -137,6 +137,17 @@ test('get cluster nodes', async () => {
}
});
test('getEpochVoteAccounts', async () => {
if (mockRpcEnabled) {
console.log('non-live test skipped');
return;
}
const connection = new Connection(url);
const voteAccounts = await connection.getEpochVoteAccounts();
expect(voteAccounts.length).toBeGreaterThan(0);
});
test('confirm transaction - error', () => {
const connection = new Connection(url);