mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-10 17:01:35 +00:00
fix naming + failing tests
This commit is contained in:
parent
72577bb37e
commit
b7c1d9166b
2 changed files with 15 additions and 14 deletions
|
|
@ -138,6 +138,7 @@ func hashAlloc(ga *types.GenesisAlloc, isUBT bool) (common.Hash, error) {
|
||||||
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,
|
||||||
|
|
|
||||||
|
|
@ -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 := ¶ms.ChainConfig{
|
ubtConfig := ¶ms.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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue