github.com/ava-labs/avalanchego@v1.11.11/vms/propertyfx/mint_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 propertyfx 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 TestMintOperationVerifyNil(t *testing.T) { 16 op := (*MintOperation)(nil) 17 err := op.Verify() 18 require.ErrorIs(t, err, errNilMintOperation) 19 } 20 21 func TestMintOperationVerifyInvalidOutput(t *testing.T) { 22 op := MintOperation{ 23 OwnedOutput: OwnedOutput{ 24 OutputOwners: secp256k1fx.OutputOwners{ 25 Threshold: 1, 26 }, 27 }, 28 } 29 err := op.Verify() 30 require.ErrorIs(t, err, secp256k1fx.ErrOutputUnspendable) 31 } 32 33 func TestMintOperationOuts(t *testing.T) { 34 op := MintOperation{} 35 require.Len(t, op.Outs(), 2) 36 } 37 38 func TestMintOperationState(t *testing.T) { 39 intf := interface{}(&MintOperation{}) 40 _, ok := intf.(verify.State) 41 require.False(t, ok) 42 }