solana-go/rpc/client_test.go

23 lines
557 B
Go
Raw Normal View History

package rpc
import (
2020-11-06 08:20:48 -08:00
"context"
"encoding/json"
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
func TestClient_GetAccountInfo(t *testing.T) {
//rpcClient := NewRPCClient("api.mainnet-beta.solana.com:443")
2020-11-06 08:20:48 -08:00
c := NewClient("http://api.mainnet-beta.solana.com:80/rpc")
//c := NewClient("testnet.solana.com:8899")
2020-11-06 08:38:43 -08:00
accInfo, err := c.GetAccountInfo(context.Background(), "7xLk17EQQ5KLDLDe44wCmupJKJjTGd8hs3eSVVhCx932")
require.NoError(t, err)
d, err := json.MarshalIndent(accInfo, "", " ")
require.NoError(t, err)
fmt.Println(string(d))
}