Files
coreth/params/config_test.go
zeekay 017968151d decomplect: test suite alignment after NetworkUpgrades rip + Test*Config inline; bump luxfi/geth pin to v1.16.94
- params/config_test.go: delete TestConfigRules (exercised IsCortina gating
  that no longer exists under activate-all-implicitly)
- plugin/evm/header/{base_fee,block_gas_cost,extra,gas_limit}_test.go: drop
  extras.NetworkUpgrades field from test config literals; replace
  extras.LuxRules{IsFortuna: true} with extras.LuxRules{} (only IsGenesis
  remains as a runtime axis)
- plugin/evm/header/dynamic_fee_windower_test.go: delete (selectBigWithinBounds
  function was ripped along with the legacy windower fee model)
- plugin/evm/header/block_gas_cost_test.go: update TestBlockGasCost/
  TestBlockGasCostWithStep/TestEstimateRequiredTip to expect 0 (BlockGasCost
  and BlockGasCostWithStep now always return zero under LP-176)
- consensus/dummy/consensus_test.go: delete "tx only base fee" and "extra
  state contribution insufficient" subtests (assertions no longer fire because
  BlockGasCostWithStep returns 0)
- eth/gasprice/gasprice_test.go: update TestSuggestTipCapIncludesExtraDataGas
  expectedTip to 1 (block-gas-cost surcharge gone under activate-all-implicitly)
- plugin/evm/lux_security_profile_f118_test.go,
  plugin/evm/lux_strict_pq_test.go,
  plugin/evm/vm.go: replace gethvm.SetActiveSecurityProfile +
  gethvm.LuxSecurityProfile{ForbidECDSAContractAuth} with the geth v1.16.94+
  gethvm.SetPQProfile + gethvm.PQProfile{ForbidEcrecover}; replace
  gethvm.ActiveSecurityProfile with gethvm.ActivePQProfile; switch the
  direct precompile-gate test from ecrec.Run(input) +
  gethvm.ErrClassicalAuthForbidden to (*gethvm.PQProfile).RefuseUnder(Op) +
  gethvm.ErrEcrecoverForbidden (per-precompile Run() no longer gates)
- go.mod: github.com/luxfi/geth v1.16.88 → v1.16.94 (+ indirect luxfi/pq pull)
2026-05-19 08:19:48 -07:00

67 lines
2.6 KiB
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
//
// This file is a derived work, based on the go-ethereum library whose original
// notices appear below.
//
// It is distributed under a license compatible with the licensing terms of the
// original code from which it is derived.
//
// Much love to the original authors for their work.
// **********
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package params
import (
"reflect"
"testing"
"time"
ethparams "github.com/luxfi/geth/params"
)
// Note: This file tests config compatibility. With the simplified Lux chain config
// (only Genesis and Mainnet), we only need to verify that configs are compatible
// with themselves. The TestConfigRules suite that exercised pre-upgrade gating
// (IsCortina at different timestamps) was removed under the activate-all-
// implicitly directive: all upgrades are live from genesis, so there is no
// runtime axis left to test besides the genesis-block discriminator, which is
// exercised by extras.GetLuxRules tests directly.
func TestCheckCompatible(t *testing.T) {
type test struct {
stored, new *ChainConfig
headBlock uint64
headTimestamp uint64
wantErr *ethparams.ConfigCompatError
}
tests := []test{
// Test configs are compatible with themselves
{stored: TestChainConfig, new: TestChainConfig, headBlock: 0, headTimestamp: 0, wantErr: nil},
{stored: TestChainConfig, new: TestChainConfig, headBlock: 0, headTimestamp: uint64(time.Now().Unix()), wantErr: nil},
{stored: TestChainConfig, new: TestChainConfig, headBlock: 100, wantErr: nil},
}
for _, test := range tests {
err := CheckCompatible(test.stored, test.new, test.headBlock, test.headTimestamp)
if !reflect.DeepEqual(err, test.wantErr) {
t.Errorf("error mismatch:\nstored: %v\nnew: %v\nblockHeight: %v\nerr: %v\nwant: %v", test.stored, test.new, test.headBlock, err, test.wantErr)
}
}
}