diff --git a/zetaclient/chains/solana/rpc/rpc_live_test.go b/zetaclient/chains/solana/rpc/rpc_live_test.go index 531cdd0cdf..e5d47b7302 100644 --- a/zetaclient/chains/solana/rpc/rpc_live_test.go +++ b/zetaclient/chains/solana/rpc/rpc_live_test.go @@ -2,14 +2,11 @@ package rpc_test import ( "context" - "fmt" "testing" "github.com/gagliardetto/solana-go" solanarpc "github.com/gagliardetto/solana-go/rpc" "github.com/stretchr/testify/require" - "github.com/zeta-chain/node/pkg/coin" - "github.com/zeta-chain/node/zetaclient/chains/solana/observer" "github.com/zeta-chain/node/zetaclient/chains/solana/rpc" "github.com/zeta-chain/node/zetaclient/common" ) @@ -20,7 +17,6 @@ func Test_SolanaRPCLive(t *testing.T) { return } - LiveTest_GetTransactionMessage(t) LiveTest_GetTransactionWithVersion(t) LiveTest_GetFirstSignatureForAddress(t) LiveTest_GetSignaturesForAddressUntil(t) @@ -45,46 +41,6 @@ func LiveTest_GetTransactionWithVersion(t *testing.T) { }) } -func LiveTest_GetTransactionMessage(t *testing.T) { - // create a Solana devnet RPC client - client := solanarpc.New(solanarpc.DevNet_RPC) - - // program address - gateway := solana.MustPublicKeyFromBase58("ZETAjseVjuFsxdRxo6MmTCvqFwb3ZHUx56Co3vCmGis") - - // get all signatures for the address until the first signature - sig := solana.MustSignatureFromBase58( - "hrjQH7CJgZU675eDbM3JKKf3tAd3AYtKjtpdSN7bHT4FYPDsFKeJq1BMWjjYLsTJVh1xqE4YNBXwAh2sCE4nxUL", - ) - - txResult, err := client.GetTransaction(context.Background(), sig, &solanarpc.GetTransactionOpts{ - Commitment: solanarpc.CommitmentFinalized, - MaxSupportedTransactionVersion: &solanarpc.MaxSupportedTransactionVersion0, - }) - require.NoError(t, err) - require.Nil(t, txResult.Meta.Err) - - // parse gateway instruction from tx result - inst, err := observer.ParseGatewayInstruction(txResult, gateway, coin.CoinType_Gas) - require.NoError(t, err) - - // get the message - fmt.Printf("inst: %+v\n", inst) - - // example transaction of version "0" - // https://explorer.solana.com/tx/Wqgj7hAaUUSfLzieN912G7GxyGHijzBZgY135NtuFtPRjevK8DnYjWwQZy7LAKFQZu582wsjuab2QP27VMUJzAi?cluster=devnet - txSig := solana.MustSignatureFromBase58( - "Wqgj7hAaUUSfLzieN912G7GxyGHijzBZgY135NtuFtPRjevK8DnYjWwQZy7LAKFQZu582wsjuab2QP27VMUJzAi", - ) - - t.Run("should get the transaction if the version is supported", func(t *testing.T) { - ctx := context.Background() - txResult, err := rpc.GetTransaction(ctx, client, txSig) - require.NoError(t, err) - require.NotNil(t, txResult) - }) -} - func LiveTest_GetFirstSignatureForAddress(t *testing.T) { // create a Solana devnet RPC client client := solanarpc.New(solanarpc.DevNet_RPC)