added TestGetAssociatedVoteAccounts

This commit is contained in:
Matt Johnstone 2024-10-14 18:07:34 +02:00
parent 0523a4d506
commit 2bd9eb89d7
No known key found for this signature in database
GPG Key ID: BE985FBB9BE7D3BB
1 changed files with 11 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package main
import ( import (
"context" "context"
"github.com/asymmetric-research/solana_exporter/pkg/rpc"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing" "testing"
) )
@ -45,3 +46,13 @@ func TestFetchBalances(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, balances, fetchedBalances) assert.Equal(t, balances, fetchedBalances)
} }
func TestGetAssociatedVoteAccounts(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
client := staticRPCClient{}
voteAccounts, err := GetAssociatedVoteAccounts(ctx, &client, rpc.CommitmentFinalized, identities)
assert.NoError(t, err)
assert.Equal(t, votekeys, voteAccounts)
}