mirror of
https://github.com/luxfi/utxo.git
synced 2026-10-30 15:13:57 +00:00
37 lines
745 B
Go
37 lines
745 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package mldsafx
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/luxfi/runtime"
|
|
)
|
|
|
|
var ErrNoValueInput = errors.New("input has no value")
|
|
|
|
type TransferInput struct {
|
|
Amt uint64 `serialize:"true" json:"amount"`
|
|
Input `serialize:"true"`
|
|
}
|
|
|
|
func (*TransferInput) InitRuntime(*runtime.Runtime) {}
|
|
|
|
// Amount returns the quantity of the asset this input produces
|
|
func (in *TransferInput) Amount() uint64 {
|
|
return in.Amt
|
|
}
|
|
|
|
// Verify this input is syntactically valid
|
|
func (in *TransferInput) Verify() error {
|
|
switch {
|
|
case in == nil:
|
|
return ErrNilInput
|
|
case in.Amt == 0:
|
|
return ErrNoValueInput
|
|
default:
|
|
return in.Input.Verify()
|
|
}
|
|
}
|