Files
coreth/plugin/evm/atomic/gossip_test.go
zeekay 1f3c4f30ba refactor: remove github.com/luxfi/node dependency
- Changed plugin/main.go to use vm/vms/rpcchainvm
- Changed tests/warp/warp_test.go to use vm/vms/platformvm

This breaks the circular dependency between coreth and node.
2026-01-09 01:10:05 -08:00

34 lines
804 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package atomic
import (
"testing"
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/vm/components/verify"
"github.com/stretchr/testify/require"
)
func TestGossipAtomicTxMarshaller(t *testing.T) {
require := require.New(t)
want := &Tx{
UnsignedAtomicTx: &UnsignedImportTx{},
Creds: []verify.Verifiable{},
}
marshaller := TxMarshaller{}
key0, err := secp256k1.NewPrivateKey()
require.NoError(err)
require.NoError(want.Sign(Codec, [][]*secp256k1.PrivateKey{{key0}}))
bytes, err := marshaller.MarshalGossip(want)
require.NoError(err)
got, err := marshaller.UnmarshalGossip(bytes)
require.NoError(err)
require.Equal(want.GossipID(), got.GossipID())
}