fix naming + failing tests

This commit is contained in:
Guillaume Ballet 2026-04-28 17:16:10 +02:00
parent 72577bb37e
commit b7c1d9166b
No known key found for this signature in database
2 changed files with 15 additions and 14 deletions

View file

@ -136,8 +136,9 @@ func hashAlloc(ga *types.GenesisAlloc, isUBT bool) (common.Hash, error) {
var config *triedb.Config var config *triedb.Config
if isUBT { if isUBT {
config = &triedb.Config{ config = &triedb.Config{
PathDB: pathdb.Defaults, PathDB: pathdb.Defaults,
IsUBT: true, IsUBT: true,
BinTrieGroupDepth: triedb.UBTDefaults.BinTrieGroupDepth,
} }
} }
// Create an ephemeral in-memory database for computing hash, // Create an ephemeral in-memory database for computing hash,

View file

@ -261,9 +261,9 @@ func newDbConfig(scheme string) *triedb.Config {
return &triedb.Config{PathDB: &config} return &triedb.Config{PathDB: &config}
} }
func TestVerkleGenesisCommit(t *testing.T) { func TestBinaryGenesisCommit(t *testing.T) {
var verkleTime uint64 = 0 var ubtTime uint64 = 0
verkleConfig := &params.ChainConfig{ ubtConfig := &params.ChainConfig{
ChainID: big.NewInt(1), ChainID: big.NewInt(1),
HomesteadBlock: big.NewInt(0), HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil, DAOForkBlock: nil,
@ -281,11 +281,11 @@ func TestVerkleGenesisCommit(t *testing.T) {
ArrowGlacierBlock: big.NewInt(0), ArrowGlacierBlock: big.NewInt(0),
GrayGlacierBlock: big.NewInt(0), GrayGlacierBlock: big.NewInt(0),
MergeNetsplitBlock: nil, MergeNetsplitBlock: nil,
ShanghaiTime: &verkleTime, ShanghaiTime: &ubtTime,
CancunTime: &verkleTime, CancunTime: &ubtTime,
PragueTime: &verkleTime, PragueTime: &ubtTime,
OsakaTime: &verkleTime, OsakaTime: &ubtTime,
UBTTime: &verkleTime, UBTTime: &ubtTime,
TerminalTotalDifficulty: big.NewInt(0), TerminalTotalDifficulty: big.NewInt(0),
EnableUBTAtGenesis: true, EnableUBTAtGenesis: true,
Ethash: nil, Ethash: nil,
@ -300,8 +300,8 @@ func TestVerkleGenesisCommit(t *testing.T) {
genesis := &Genesis{ genesis := &Genesis{
BaseFee: big.NewInt(params.InitialBaseFee), BaseFee: big.NewInt(params.InitialBaseFee),
Config: verkleConfig, Config: ubtConfig,
Timestamp: verkleTime, Timestamp: ubtTime,
Difficulty: big.NewInt(0), Difficulty: big.NewInt(0),
Alloc: types.GenesisAlloc{ Alloc: types.GenesisAlloc{
{1}: {Balance: big.NewInt(1), Storage: map[common.Hash]common.Hash{{1}: {1}}}, {1}: {Balance: big.NewInt(1), Storage: map[common.Hash]common.Hash{{1}: {1}}},
@ -329,9 +329,9 @@ func TestVerkleGenesisCommit(t *testing.T) {
t.Fatalf("invalid genesis state root, expected %x, got %x", expected, block.Root()) t.Fatalf("invalid genesis state root, expected %x, got %x", expected, block.Root())
} }
// Test that the trie is verkle // Test that the trie is a unified binary trie
if !triedb.IsUBT() { if !triedb.IsUBT() {
t.Fatalf("expected trie to be verkle") t.Fatalf("expected trie to be a unified binary trie")
} }
vdb := rawdb.NewTable(db, string(rawdb.VerklePrefix)) vdb := rawdb.NewTable(db, string(rawdb.VerklePrefix))
if !rawdb.HasAccountTrieNode(vdb, nil) { if !rawdb.HasAccountTrieNode(vdb, nil) {