node/pkg/solana: rename ParseMessagePublicationAccount and delete tests

The tests were never updated for Wormhole v2 and don't work.

commit-id:d5b153db
This commit is contained in:
Leo 2021-12-19 18:39:01 +01:00 committed by Leopold Schabel
parent e7d07dfded
commit ceff5a0954
2 changed files with 2 additions and 22 deletions

View File

@ -506,7 +506,7 @@ func (s *SolanaWatcher) fetchMessageAccount(ctx context.Context, logger *zap.Log
}
func (s *SolanaWatcher) processMessageAccount(logger *zap.Logger, data []byte, acc solana.PublicKey) {
proposal, err := ParseTransferOutProposal(data)
proposal, err := ParseMessagePublicationAccount(data)
if err != nil {
solanaAccountSkips.WithLabelValues("parse_transfer_out").Inc()
logger.Error(
@ -563,7 +563,7 @@ type (
}
)
func ParseTransferOutProposal(data []byte) (*MessagePublicationAccount, error) {
func ParseMessagePublicationAccount(data []byte) (*MessagePublicationAccount, error) {
prop := &MessagePublicationAccount{}
// Skip the b"msg" prefix
if err := borsh.Deserialize(prop, data[3:]); err != nil {

View File

@ -1,20 +0,0 @@
package solana
import (
"encoding/hex"
"encoding/json"
"github.com/stretchr/testify/require"
"testing"
)
func TestParseTransferOutProposal(t *testing.T) {
data, err := hex.DecodeString("809698000000000000000000000000000000000000000000000000000000000002bd84f96dc4955d6c7f876de115738476ddd343fe1019d139534addc907018cfb0000000000000000000000008d689476eb446a1fb0065bffac32398ed7f89165000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48020600263a000001000000000060075fe01000003a260102bd84f96dc4955d6c7f876de115738476ddd343fe1019d139534addc907018cfb0000000000000000000000008d689476eb446a1fb0065bffac32398ed7f8916502000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48060000000000000000000000000000000000000000000000000000000000989680ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e05f0760e05f076003a4f2e022fec85b8bcbfec192d71a5d38e482f1328da6bf4d14a92f7755fc2ecc010000")
require.NoError(t, err)
proposal, err := ParseTransferOutProposal(data)
require.NoError(t, err)
s, err := json.Marshal(proposal)
require.NoError(t, err)
require.Equal(t, "{\"Amount\":10000000,\"ToChainID\":2,\"SourceAddress\":[189,132,249,109,196,149,93,108,127,135,109,225,21,115,132,118,221,211,67,254,16,25,209,57,83,74,221,201,7,1,140,251],\"ForeignAddress\":[0,0,0,0,0,0,0,0,0,0,0,0,141,104,148,118,235,68,106,31,176,6,91,255,172,50,57,142,215,248,145,101],\"Asset\":{\"Chain\":2,\"Address\":[0,0,0,0,0,0,0,0,0,0,0,0,160,184,105,145,198,33,139,54,193,209,157,74,46,158,176,206,54,6,235,72],\"Decimals\":6},\"Nonce\":14886,\"VAA\":[1,0,0,0,0,0,96,7,95,224,16,0,0,58,38,1,2,189,132,249,109,196,149,93,108,127,135,109,225,21,115,132,118,221,211,67,254,16,25,209,57,83,74,221,201,7,1,140,251,0,0,0,0,0,0,0,0,0,0,0,0,141,104,148,118,235,68,106,31,176,6,91,255,172,50,57,142,215,248,145,101,2,0,0,0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