Skip to content

Commit

Permalink
add comment for rpc client wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
EasterTheBunny committed Dec 10, 2024
1 parent a91dfde commit 9b2b804
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/solana/chainreader/client_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ import (
"github.com/gagliardetto/solana-go/rpc"
)

// RPCClientWrapper is a wrapper for an RPC client. This was necessary due to the solana RPC interface not
// providing directly mockable components in the GetMultipleAccounts response.
type RPCClientWrapper struct {
*rpc.Client
}

// GetMultipleAccountData is a helper function that extracts byte data from a GetMultipleAccounts rpc call.
func (w *RPCClientWrapper) GetMultipleAccountData(ctx context.Context, keys ...solana.PublicKey) ([][]byte, error) {
result, err := w.Client.GetMultipleAccountsWithOpts(ctx, keys, &rpc.GetMultipleAccountsOpts{
Encoding: solana.EncodingBase64,
Expand Down

0 comments on commit 9b2b804

Please sign in to comment.