gecko/vms/nftfx/transfer_operation.go

34 lines
675 B
Go
Raw Normal View History

2020-03-30 13:23:06 -07:00
package nftfx
import (
"errors"
"github.com/ava-labs/gecko/vms/components/verify"
"github.com/ava-labs/gecko/vms/secp256k1fx"
)
var (
errNilTransferOperation = errors.New("nil transfer operation")
)
// TransferOperation ...
type TransferOperation struct {
2020-03-30 22:09:49 -07:00
Input secp256k1fx.Input `serialize:"true" json:"input"`
Output TransferOutput `serialize:"true" json:"output"`
2020-03-30 13:23:06 -07:00
}
// Outs ...
func (op *TransferOperation) Outs() []verify.Verifiable {
return []verify.Verifiable{&op.Output}
}
// Verify ...
func (op *TransferOperation) Verify() error {
switch {
case op == nil:
return errNilTransferOperation
default:
return verify.All(&op.Input, &op.Output)
}
}