mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:39:39 +00:00
Kills pcodecs from 3 complete subsystems (verified go test ./... = 155 ok / 0 FAIL):
- proposervm: block/state/summary struct-is-wire (blockwire.go + statewire.go;
deleted block/state/summary codec.go). blockKind bytes: reserved=0 signed=1
option=2. Epoch inlined in unsigned object. proposer/windower chainSource seed
= binary.LittleEndian (byte-identical to old wrappers.Packer.UnpackLong).
- example/xsvm: tx/block/genesis native Marshal (deleted 3 codec.go); create-chain
example uses genesis.Marshal().
- components: message.Tx native (deleted codec.go); keystore codec shell removed;
index pcodecs.LongLen → local const.
- evm/{predicate,lp176}: off pcodecs.
- platformvm residual: state metadata + genesis + metrics + signer + stakeable
native, vestigial serialize tags removed.
REMAINING (careful solo, agents weekly-capped): warp (reverted — agent left an
ID≠Marshal consensus inconsistency in ChainToL1Conversion; needs proper review,
not a golden-regen) + xvm (reverted — barely started). pcodecs package stays
until those 2 land. /ext/→/v1/ endpoint change also pending.
Co-authored-by: Hanzo Dev <dev@hanzo.ai>
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package summary
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/luxfi/zap"
|
|
)
|
|
|
|
func TestParse(t *testing.T) {
|
|
require := require.New(t)
|
|
|
|
forkHeight := uint64(2022)
|
|
block := []byte("blockBytes")
|
|
coreSummary := []byte("coreSummary")
|
|
builtSummary, err := Build(forkHeight, block, coreSummary)
|
|
require.NoError(err)
|
|
|
|
summaryBytes := builtSummary.Bytes()
|
|
parsedSummary, err := Parse(summaryBytes)
|
|
require.NoError(err)
|
|
|
|
require.Equal(builtSummary.Bytes(), parsedSummary.Bytes())
|
|
require.Equal(builtSummary.ID(), parsedSummary.ID())
|
|
require.Equal(builtSummary.ForkHeight(), parsedSummary.ForkHeight())
|
|
require.Equal(builtSummary.BlockBytes(), parsedSummary.BlockBytes())
|
|
require.Equal(builtSummary.InnerSummaryBytes(), parsedSummary.InnerSummaryBytes())
|
|
}
|
|
|
|
func TestParseGibberish(t *testing.T) {
|
|
require := require.New(t)
|
|
|
|
bytes := []byte{0, 1, 2, 3, 4, 5}
|
|
|
|
_, err := Parse(bytes)
|
|
require.ErrorIs(err, zap.ErrBufferTooSmall)
|
|
}
|