From 6efa1285f96624b389b58e6d87b3095510339661 Mon Sep 17 00:00:00 2001 From: zeekay Date: Sun, 12 Jul 2026 22:32:45 -0700 Subject: [PATCH] =?UTF-8?q?lint:=20clean=20all=2021=20staticcheck=20findin?= =?UTF-8?q?gs=20=E2=80=94=20CI=20green,=20drop=20last=20codec=20reference?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- bls12381fx/fx_test.go | 2 +- ed25519fx/fx.go | 2 +- ed25519fx/fx_bench_test.go | 4 ++-- ed25519fx/fx_test.go | 6 +++--- ed25519fx/input.go | 2 +- ed25519fx/transfer_output.go | 2 -- ed25519fx/wire_test.go | 2 +- flow_checker.go | 2 +- mldsafx/fx_bench_test.go | 4 ++-- mldsafx/fx_test.go | 6 +++--- mldsafx/input.go | 2 +- mldsafx/keychain.go | 8 -------- mldsafx/transfer_output.go | 2 -- nftfx/fx.go | 2 +- propertyfx/fx.go | 2 +- schnorrfx/credential.go | 2 +- schnorrfx/fx_bench_test.go | 2 +- schnorrfx/fx_test.go | 4 ++-- schnorrfx/input.go | 2 +- schnorrfx/transfer_output.go | 2 -- secp256k1fx/sort_helpers.go | 10 ---------- secp256k1fx/transfer_output.go | 2 -- secp256r1fx/fx_bench_test.go | 4 ++-- secp256r1fx/fx_test.go | 6 +++--- secp256r1fx/transfer_output.go | 2 -- slhdsafx/fx_bench_test.go | 4 ++-- slhdsafx/fx_test.go | 6 +++--- slhdsafx/transfer_output.go | 2 -- sort_helpers.go | 10 ---------- state.go | 4 ---- utxo_fetching.go | 2 +- utxo_state.go | 2 +- utxo_wire.go | 2 +- utxo_wire_test.go | 2 +- 34 files changed, 37 insertions(+), 81 deletions(-) diff --git a/bls12381fx/fx_test.go b/bls12381fx/fx_test.go index ba885cc..f7dacb4 100644 --- a/bls12381fx/fx_test.go +++ b/bls12381fx/fx_test.go @@ -23,7 +23,7 @@ func (t *testTx) Bytes() []byte { return t.b } func newTestFx(t *testing.T) *Fx { t.Helper() vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) fx := &Fx{} diff --git a/ed25519fx/fx.go b/ed25519fx/fx.go index b7b5e27..207a1ea 100644 --- a/ed25519fx/fx.go +++ b/ed25519fx/fx.go @@ -134,7 +134,7 @@ func (fx *Fx) verifyOperation(tx UnsignedTx, op *MintOperation, cred *Credential if err := verify.All(op, cred, utxo); err != nil { return err } - if !utxo.OutputOwners.Equals(&op.MintOutput.OutputOwners) { + if !utxo.Equals(&op.MintOutput.OutputOwners) { return ErrWrongMintCreated } return fx.VerifyCredentials(tx, &op.MintInput, cred, &utxo.OutputOwners) diff --git a/ed25519fx/fx_bench_test.go b/ed25519fx/fx_bench_test.go index 79f5be2..8d85cee 100644 --- a/ed25519fx/fx_bench_test.go +++ b/ed25519fx/fx_bench_test.go @@ -29,7 +29,7 @@ func BenchmarkEd25519Verify(b *testing.B) { } vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -79,7 +79,7 @@ func BenchmarkEd25519VerifyCached(b *testing.B) { } vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/ed25519fx/fx_test.go b/ed25519fx/fx_test.go index 1ae54e8..d9d3c8d 100644 --- a/ed25519fx/fx_test.go +++ b/ed25519fx/fx_test.go @@ -24,7 +24,7 @@ func newTestFx(t *testing.T) (*Fx, ed25519.PrivateKey, ed25519.PublicKey, ids.Sh require.NoError(err) vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -42,7 +42,7 @@ func newTestFx(t *testing.T) (*Fx, ed25519.PrivateKey, ed25519.PublicKey, ids.Sh func TestFxInitialize(t *testing.T) { vm := TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } fx := Fx{} require.NoError(t, fx.Initialize(&vm)) @@ -235,7 +235,7 @@ func TestFxVerifyTransferBootstrapping(t *testing.T) { require.NoError(err) vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/ed25519fx/input.go b/ed25519fx/input.go index b6a1b27..53e481d 100644 --- a/ed25519fx/input.go +++ b/ed25519fx/input.go @@ -29,7 +29,7 @@ type Input struct { func (in *Input) Cost() (uint64, error) { numSigs := uint64(len(in.SigIndices)) - return math.Mul64(numSigs, CostPerSignature) + return math.Mul(numSigs, CostPerSignature) } // Verify this input is syntactically valid diff --git a/ed25519fx/transfer_output.go b/ed25519fx/transfer_output.go index 2e446ae..67811ca 100644 --- a/ed25519fx/transfer_output.go +++ b/ed25519fx/transfer_output.go @@ -41,5 +41,3 @@ func (out *TransferOutput) Verify() error { func (out *TransferOutput) Owners() interface{} { return &out.OutputOwners } - -func (*TransferOutput) isState() {} diff --git a/ed25519fx/wire_test.go b/ed25519fx/wire_test.go index ce68926..d6e10fc 100644 --- a/ed25519fx/wire_test.go +++ b/ed25519fx/wire_test.go @@ -44,7 +44,7 @@ func TestWire_TransferOutput_RoundTrip(t *testing.T) { if got.Amt != in.Amt { t.Errorf("Amt: got %d, want %d", got.Amt, in.Amt) } - if !in.OutputOwners.Equals(&got.OutputOwners) { + if !in.Equals(&got.OutputOwners) { t.Errorf("OutputOwners mismatch") } } diff --git a/flow_checker.go b/flow_checker.go index 3233581..13faf13 100644 --- a/flow_checker.go +++ b/flow_checker.go @@ -34,7 +34,7 @@ func (fc *FlowChecker) Produce(assetID ids.ID, amount uint64) { func (fc *FlowChecker) add(value map[ids.ID]uint64, assetID ids.ID, amount uint64) { var err error - value[assetID], err = math.Add64(value[assetID], amount) + value[assetID], err = math.Add(value[assetID], amount) if err != nil { fc.errs = append(fc.errs, err) } diff --git a/mldsafx/fx_bench_test.go b/mldsafx/fx_bench_test.go index 9ee15a4..8d5d6ad 100644 --- a/mldsafx/fx_bench_test.go +++ b/mldsafx/fx_bench_test.go @@ -23,7 +23,7 @@ func BenchmarkMLDSA65Verify(b *testing.B) { pkBytes := sk.PublicKey.Bytes() vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -71,7 +71,7 @@ func BenchmarkMLDSA65VerifyCached(b *testing.B) { pkBytes := sk.PublicKey.Bytes() vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/mldsafx/fx_test.go b/mldsafx/fx_test.go index 89babf3..48d17fc 100644 --- a/mldsafx/fx_test.go +++ b/mldsafx/fx_test.go @@ -24,7 +24,7 @@ func newTestFx(t *testing.T) (*Fx, *mldsa.PrivateKey, []byte) { require.NoError(err) vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -39,7 +39,7 @@ func newTestFx(t *testing.T) (*Fx, *mldsa.PrivateKey, []byte) { func TestFxInitialize(t *testing.T) { vm := TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } fx := Fx{} require.NoError(t, fx.Initialize(&vm)) @@ -301,7 +301,7 @@ func TestFxVerifyTransferBootstrapping(t *testing.T) { pkBytes := sk.PublicKey.Bytes() vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/mldsafx/input.go b/mldsafx/input.go index 45be3f3..f591d41 100644 --- a/mldsafx/input.go +++ b/mldsafx/input.go @@ -29,7 +29,7 @@ type Input struct { func (in *Input) Cost() (uint64, error) { numSigs := uint64(len(in.SigIndices)) - return math.Mul64(numSigs, CostPerSignature) + return math.Mul(numSigs, CostPerSignature) } // Verify this input is syntactically valid diff --git a/mldsafx/keychain.go b/mldsafx/keychain.go index a538609..5f87c35 100644 --- a/mldsafx/keychain.go +++ b/mldsafx/keychain.go @@ -148,11 +148,3 @@ func (kc *Keychain) Match(owners *OutputOwners, time uint64) ([]uint32, []*mldsa } return sigs, keys, uint32(len(keys)) == owners.Threshold } - -// get returns the raw private key for the given address -func (kc Keychain) get(id ids.ShortID) (*mldsa.PrivateKey, bool) { - if i, ok := kc.addrToKeyIndex[id]; ok { - return kc.Keys[i], true - } - return nil, false -} diff --git a/mldsafx/transfer_output.go b/mldsafx/transfer_output.go index 0e1b3d4..ec0a0b9 100644 --- a/mldsafx/transfer_output.go +++ b/mldsafx/transfer_output.go @@ -41,5 +41,3 @@ func (out *TransferOutput) Verify() error { func (out *TransferOutput) Owners() interface{} { return &out.OutputOwners } - -func (*TransferOutput) isState() {} diff --git a/nftfx/fx.go b/nftfx/fx.go index dd36154..c6b7f91 100644 --- a/nftfx/fx.go +++ b/nftfx/fx.go @@ -75,7 +75,7 @@ func (fx *Fx) VerifyMintOperation(tx secp256k1fx.UnsignedTx, op *MintOperation, case out.GroupID != op.GroupID: return errWrongUniqueID default: - return fx.Fx.VerifyCredentials(tx, &op.MintInput, &cred.Credential, &out.OutputOwners) + return fx.VerifyCredentials(tx, &op.MintInput, &cred.Credential, &out.OutputOwners) } } diff --git a/propertyfx/fx.go b/propertyfx/fx.go index e7c9e4d..45db502 100644 --- a/propertyfx/fx.go +++ b/propertyfx/fx.go @@ -73,7 +73,7 @@ func (fx *Fx) VerifyMintOperation(tx secp256k1fx.UnsignedTx, op *MintOperation, case !out.OutputOwners.Equals(&op.MintOutput.OutputOwners): return errWrongMintOutput default: - return fx.Fx.VerifyCredentials(tx, &op.MintInput, &cred.Credential, &out.OutputOwners) + return fx.VerifyCredentials(tx, &op.MintInput, &cred.Credential, &out.OutputOwners) } } diff --git a/schnorrfx/credential.go b/schnorrfx/credential.go index c667cb8..130d397 100644 --- a/schnorrfx/credential.go +++ b/schnorrfx/credential.go @@ -28,7 +28,7 @@ var ( ErrNilCredential = errors.New("nil Schnorr credential") ErrEmptyCredential = errors.New("empty Schnorr credential") ErrInvalidSignature = errors.New("invalid Schnorr signature") - ErrWrongSigLen = errors.New("Schnorr signature wrong length") + ErrWrongSigLen = errors.New("wrong Schnorr signature length") ) // Credential contains BIP-340 Schnorr signatures for spending UTXOs. diff --git a/schnorrfx/fx_bench_test.go b/schnorrfx/fx_bench_test.go index f1924cc..83f1de5 100644 --- a/schnorrfx/fx_bench_test.go +++ b/schnorrfx/fx_bench_test.go @@ -28,7 +28,7 @@ func benchSetup(b *testing.B) (*Fx, *TransferOutput, *TransferInput, *Credential } vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/schnorrfx/fx_test.go b/schnorrfx/fx_test.go index 1a2f3be..c2ae21b 100644 --- a/schnorrfx/fx_test.go +++ b/schnorrfx/fx_test.go @@ -24,7 +24,7 @@ func newTestFx(t *testing.T) (*Fx, *btcec.PrivateKey, []byte, ids.ShortID) { require.NoError(err) vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -52,7 +52,7 @@ func signSchnorr(t *testing.T, sk *btcec.PrivateKey, msg []byte) [SigLen]byte { func TestFxInitialize(t *testing.T) { vm := TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } fx := Fx{} require.NoError(t, fx.Initialize(&vm)) diff --git a/schnorrfx/input.go b/schnorrfx/input.go index c87e436..edb4e06 100644 --- a/schnorrfx/input.go +++ b/schnorrfx/input.go @@ -30,7 +30,7 @@ type Input struct { func (in *Input) Cost() (uint64, error) { numSigs := uint64(len(in.SigIndices)) - return math.Mul64(numSigs, CostPerSignature) + return math.Mul(numSigs, CostPerSignature) } // Verify this input is syntactically valid diff --git a/schnorrfx/transfer_output.go b/schnorrfx/transfer_output.go index bcb82c9..391c4b9 100644 --- a/schnorrfx/transfer_output.go +++ b/schnorrfx/transfer_output.go @@ -41,5 +41,3 @@ func (out *TransferOutput) Verify() error { func (out *TransferOutput) Owners() interface{} { return &out.OutputOwners } - -func (*TransferOutput) isState() {} diff --git a/secp256k1fx/sort_helpers.go b/secp256k1fx/sort_helpers.go index 162e00e..fbd01ff 100644 --- a/secp256k1fx/sort_helpers.go +++ b/secp256k1fx/sort_helpers.go @@ -4,7 +4,6 @@ package secp256k1fx import ( - "cmp" "slices" ) @@ -22,12 +21,3 @@ func isSortedAndUniqueByCompare[T interface{ Compare(T) int }](s []T) bool { } return true } - -func isSortedAndUniqueOrdered[T cmp.Ordered](s []T) bool { - for i := 1; i < len(s); i++ { - if s[i-1] >= s[i] { - return false - } - } - return true -} diff --git a/secp256k1fx/transfer_output.go b/secp256k1fx/transfer_output.go index 4fddfb8..9d33384 100644 --- a/secp256k1fx/transfer_output.go +++ b/secp256k1fx/transfer_output.go @@ -67,5 +67,3 @@ func (out *TransferOutput) Verify() error { func (out *TransferOutput) Owners() interface{} { return &out.OutputOwners } - -func (*TransferOutput) isState() {} diff --git a/secp256r1fx/fx_bench_test.go b/secp256r1fx/fx_bench_test.go index ace117b..9ece987 100644 --- a/secp256r1fx/fx_bench_test.go +++ b/secp256r1fx/fx_bench_test.go @@ -30,7 +30,7 @@ func BenchmarkP256Verify(b *testing.B) { } vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -83,7 +83,7 @@ func BenchmarkP256VerifyCached(b *testing.B) { } vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/secp256r1fx/fx_test.go b/secp256r1fx/fx_test.go index 1f94c3c..86d1d5b 100644 --- a/secp256r1fx/fx_test.go +++ b/secp256r1fx/fx_test.go @@ -25,7 +25,7 @@ func newTestFx(t *testing.T) (*Fx, *ecdsa.PrivateKey, []byte, ids.ShortID) { require.NoError(err) vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -44,7 +44,7 @@ func newTestFx(t *testing.T) (*Fx, *ecdsa.PrivateKey, []byte, ids.ShortID) { func TestFxInitialize(t *testing.T) { vm := TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } fx := Fx{} require.NoError(t, fx.Initialize(&vm)) @@ -241,7 +241,7 @@ func TestFxVerifyTransferBootstrapping(t *testing.T) { require.NoError(err) vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/secp256r1fx/transfer_output.go b/secp256r1fx/transfer_output.go index 607d4de..5e58c53 100644 --- a/secp256r1fx/transfer_output.go +++ b/secp256r1fx/transfer_output.go @@ -41,5 +41,3 @@ func (out *TransferOutput) Verify() error { func (out *TransferOutput) Owners() interface{} { return &out.OutputOwners } - -func (*TransferOutput) isState() {} diff --git a/slhdsafx/fx_bench_test.go b/slhdsafx/fx_bench_test.go index d56b105..ab5cba7 100644 --- a/slhdsafx/fx_bench_test.go +++ b/slhdsafx/fx_bench_test.go @@ -22,7 +22,7 @@ func BenchmarkSLH192fVerify(b *testing.B) { pkBytes := sk.PublicKey.Bytes() vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -69,7 +69,7 @@ func BenchmarkSLH192fVerifyCached(b *testing.B) { pkBytes := sk.PublicKey.Bytes() vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/slhdsafx/fx_test.go b/slhdsafx/fx_test.go index c295d56..1fe8bb6 100644 --- a/slhdsafx/fx_test.go +++ b/slhdsafx/fx_test.go @@ -24,7 +24,7 @@ func newTestFx(t *testing.T) (*Fx, *slhdsa.PrivateKey, []byte) { require.NoError(err) vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) @@ -39,7 +39,7 @@ func newTestFx(t *testing.T) (*Fx, *slhdsa.PrivateKey, []byte) { func TestFxInitialize(t *testing.T) { vm := TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } fx := Fx{} require.NoError(t, fx.Initialize(&vm)) @@ -257,7 +257,7 @@ func TestFxVerifyTransferBootstrapping(t *testing.T) { pkBytes := sk.PublicKey.Bytes() vm := &TestVM{ - Log: log.NewNoOpLogger(), + Log: log.NewNoOpLogger(), } vm.Clk.Set(time.Date(2026, time.January, 1, 0, 0, 0, 0, time.UTC)) diff --git a/slhdsafx/transfer_output.go b/slhdsafx/transfer_output.go index de4024b..b7573de 100644 --- a/slhdsafx/transfer_output.go +++ b/slhdsafx/transfer_output.go @@ -41,5 +41,3 @@ func (out *TransferOutput) Verify() error { func (out *TransferOutput) Owners() interface{} { return &out.OutputOwners } - -func (*TransferOutput) isState() {} diff --git a/sort_helpers.go b/sort_helpers.go index c7ac926..243b66c 100644 --- a/sort_helpers.go +++ b/sort_helpers.go @@ -4,7 +4,6 @@ package utxo import ( - "cmp" "slices" ) @@ -22,12 +21,3 @@ func isSortedAndUniqueByCompare[T interface{ Compare(T) int }](s []T) bool { } return true } - -func isSortedAndUniqueOrdered[T cmp.Ordered](s []T) bool { - for i := 1; i < len(s); i++ { - if s[i-1] >= s[i] { - return false - } - } - return true -} diff --git a/state.go b/state.go index 7972b96..c1ee5d4 100644 --- a/state.go +++ b/state.go @@ -3,10 +3,6 @@ package utxo -const ( - codecVersion = 0 -) - // Addressable is the interface a feature extension must provide to be able to // be tracked as a part of the utxo set for a set of addresses type Addressable interface { diff --git a/utxo_fetching.go b/utxo_fetching.go index b58c309..b053fe2 100644 --- a/utxo_fetching.go +++ b/utxo_fetching.go @@ -23,7 +23,7 @@ func GetBalance(db UTXOReader, addrs set.Set[ids.ShortID]) (uint64, error) { balance := uint64(0) for _, utxo := range utxos { if out, ok := utxo.Out.(Amounter); ok { - balance, err = safemath.Add64(out.Amount(), balance) + balance, err = safemath.Add(out.Amount(), balance) if err != nil { return 0, err } diff --git a/utxo_state.go b/utxo_state.go index 38ab489..64437f5 100644 --- a/utxo_state.go +++ b/utxo_state.go @@ -264,7 +264,7 @@ func (s *utxoState) getIndexDB(addr []byte) linkeddb.LinkedDB { return indexList } - indexDB := prefixdb.NewNested(addr, s.indexDB) + indexDB := prefixdb.New(addr, s.indexDB) indexList := linkeddb.NewDefault(indexDB) s.indexCache.Put(addrStr, indexList) return indexList diff --git a/utxo_wire.go b/utxo_wire.go index 834f1c2..14aec8b 100644 --- a/utxo_wire.go +++ b/utxo_wire.go @@ -49,7 +49,7 @@ func (u *UTXO) WireBytes() ([]byte, error) { return wire.NewUTXO(wire.UTXOInput{ TxID: u.TxID, OutputIndex: u.OutputIndex, - AssetID: u.Asset.ID, + AssetID: u.ID, Output: outputBytes, }), nil } diff --git a/utxo_wire_test.go b/utxo_wire_test.go index d031287..27074c1 100644 --- a/utxo_wire_test.go +++ b/utxo_wire_test.go @@ -73,7 +73,7 @@ func TestUTXO_WireBytes_Secp256k1_TransferOutput_RoundTrip(t *testing.T) { if gotOut.Amt != inOut.Amt { t.Errorf("Out.Amt: got %d, want %d", gotOut.Amt, inOut.Amt) } - if !gotOut.OutputOwners.Equals(&inOut.OutputOwners) { + if !gotOut.Equals(&inOut.OutputOwners) { t.Errorf("Out.OutputOwners mismatch") } }