Files
utxo/slhdsafx/transfer_output.go
zeekayandHanzo Dev 3b9e1149ec lint: clean all 21 staticcheck findings — CI green, drop last codec reference
- SA1019: math.Mul64/Add64 -> generic math.Mul/Add (ed25519fx, mldsafx,
  schnorrfx inputs; flow_checker; utxo_fetching); prefixdb.NewNested -> New (alias)
- unused: DELETE dead codecVersion const (last codec reference in utxo — full
  ZAP native now), isSortedAndUniqueOrdered (root + secp256k1fx), mldsafx
  Keychain.get, and all 6 redundant TransferOutput.isState() markers (the
  embedded verify.IsState already provides State membership)
- QF1008: drop embedded-field selectors (utxo_wire, ed25519fx, nftfx,
  propertyfx + tests); ST1005: lowercase Schnorr error string

Behavior-identical; 11/11 packages pass.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-12 22:32:45 -07:00

44 lines
868 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package slhdsafx
import (
"errors"
"github.com/luxfi/vm/components/verify"
)
var (
_ verify.State = (*TransferOutput)(nil)
ErrNoValueOutput = errors.New("output has no value")
)
type TransferOutput struct {
verify.IsState `serialize:"-" json:"-"`
Amt uint64 `serialize:"true" json:"amount"`
OutputOwners `serialize:"true"`
}
// Amount returns the quantity of the asset this output consumes
func (out *TransferOutput) Amount() uint64 {
return out.Amt
}
func (out *TransferOutput) Verify() error {
switch {
case out == nil:
return ErrNilOutputOwners
case out.Amt == 0:
return ErrNoValueOutput
default:
return out.OutputOwners.Verify()
}
}
func (out *TransferOutput) Owners() interface{} {
return &out.OutputOwners
}