github.com/ava-labs/avalanchego@v1.11.11/vms/nftfx/transfer_operation_test.go (about) 1 // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. 2 // See the file LICENSE for licensing terms. 3 4 package nftfx 5 6 import ( 7 "testing" 8 9 "github.com/stretchr/testify/require" 10 11 "github.com/ava-labs/avalanchego/vms/components/verify" 12 "github.com/ava-labs/avalanchego/vms/secp256k1fx" 13 ) 14 15 func TestTransferOperationVerifyNil(t *testing.T) { 16 op := (*TransferOperation)(nil) 17 err := op.Verify() 18 require.ErrorIs(t, err, errNilTransferOperation) 19 } 20 21 func TestTransferOperationInvalid(t *testing.T) { 22 op := TransferOperation{Input: secp256k1fx.Input{ 23 SigIndices: []uint32{1, 0}, 24 }} 25 err := op.Verify() 26 require.ErrorIs(t, err, secp256k1fx.ErrInputIndicesNotSortedUnique) 27 } 28 29 func TestTransferOperationOuts(t *testing.T) { 30 op := TransferOperation{ 31 Output: TransferOutput{}, 32 } 33 require.Len(t, op.Outs(), 1) 34 } 35 36 func TestTransferOperationState(t *testing.T) { 37 intf := interface{}(&TransferOperation{}) 38 _, ok := intf.(verify.State) 39 require.False(t, ok) 40 }