gecko/vms/propertyfx/mint_operation_test.go

35 lines
709 B
Go

package propertyfx
import (
"testing"
"github.com/ava-labs/gecko/vms/secp256k1fx"
)
func TestMintOperationVerifyNil(t *testing.T) {
op := (*MintOperation)(nil)
if err := op.Verify(); err == nil {
t.Fatalf("nil operation should have failed verification")
}
}
func TestMintOperationVerifyInvalidOutput(t *testing.T) {
op := MintOperation{
OwnedOutput: OwnedOutput{
OutputOwners: secp256k1fx.OutputOwners{
Threshold: 1,
},
},
}
if err := op.Verify(); err == nil {
t.Fatalf("operation should have failed verification")
}
}
func TestMintOperationOuts(t *testing.T) {
op := MintOperation{}
if outs := op.Outs(); len(outs) != 2 {
t.Fatalf("Wrong number of outputs returned")
}
}