mirror of
https://github.com/luxfi/utxo.git
synced 2026-10-30 15:13:57 +00:00
Completes the second cut of FINAL_RIP.md. The first cut (a0aab0a) dropped
the codec.Registry field from each fx's VM interface and the public API
codec.Manager params. This cut removes the remaining test-side residue:
- Strip `linearcodec.NewDefault()` Codec field literals from every TestVM
(the field no longer exists on TestVM).
- Drop the obsolete `TestCredentialSerialize`, `TestTransferInputSerialize`,
and `TestOutputSerialize` tests in secp256k1fx — they asserted the
legacy linearcodec wire-byte format. ZAP-native round-trips are covered
in wire/wire_test.go and the per-fx wire_test.go files.
- `go mod edit -droprequire github.com/luxfi/codec` + tidy — codec is now
indirect-only (transitively required via github.com/luxfi/vm for the
verify.State interface).
Build + test clean across all 11 packages. ZAP-native at the activation
boundary 2025-12-25T16:20:00-08:00.
33 lines
745 B
Go
33 lines
745 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package secp256k1fx
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/luxfi/vm/components/verify"
|
|
)
|
|
|
|
func TestCredentialVerify(t *testing.T) {
|
|
cred := Credential{}
|
|
require.NoError(t, cred.Verify())
|
|
}
|
|
|
|
func TestCredentialVerifyNil(t *testing.T) {
|
|
cred := (*Credential)(nil)
|
|
err := cred.Verify()
|
|
require.ErrorIs(t, err, ErrNilCredential)
|
|
}
|
|
|
|
// Legacy linearcodec wire-format test deleted with the codec rip.
|
|
// ZAP-native wire round-trip is covered in wire_test.go.
|
|
|
|
func TestCredentialNotState(t *testing.T) {
|
|
intf := interface{}(&Credential{})
|
|
_, ok := intf.(verify.State)
|
|
require.False(t, ok)
|
|
}
|