Skip to content

Commit a087e40

Browse files
author
Darioush Jalali
authored
restore TestReorgReInsert (#762)
1 parent d00d1db commit a087e40

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/test_blockchain.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ var tests = []ChainTest{
6767
"EmptyBlocks",
6868
TestEmptyBlocks,
6969
},
70+
{
71+
"ReorgReInsert",
72+
TestReorgReInsert,
73+
},
7074
{
7175
"AcceptBlockIdenticalStateRoot",
7276
TestAcceptBlockIdenticalStateRoot,
@@ -880,9 +884,6 @@ func TestReorgReInsert(t *testing.T, create func(db ethdb.Database, gspec *Genes
880884
key2, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a")
881885
addr1 = crypto.PubkeyToAddress(key1.PublicKey)
882886
addr2 = crypto.PubkeyToAddress(key2.PublicKey)
883-
// We use two separate databases since GenerateChain commits the state roots to its underlying
884-
// database.
885-
genDB = rawdb.NewMemoryDatabase()
886887
chainDB = rawdb.NewMemoryDatabase()
887888
)
888889

@@ -892,7 +893,6 @@ func TestReorgReInsert(t *testing.T, create func(db ethdb.Database, gspec *Genes
892893
Config: &params.ChainConfig{HomesteadBlock: new(big.Int)},
893894
Alloc: types.GenesisAlloc{addr1: {Balance: genesisBalance}},
894895
}
895-
genesis := gspec.ToBlock()
896896

897897
blockchain, err := create(chainDB, gspec, common.Hash{})
898898
if err != nil {
@@ -902,7 +902,7 @@ func TestReorgReInsert(t *testing.T, create func(db ethdb.Database, gspec *Genes
902902

903903
signer := types.HomesteadSigner{}
904904
numBlocks := 3
905-
chain, _, err := GenerateChain(gspec.Config, genesis, blockchain.engine, genDB, numBlocks, 10, func(i int, gen *BlockGen) {
905+
_, chain, _, err := GenerateChainWithGenesis(gspec, blockchain.engine, numBlocks, 10, func(i int, gen *BlockGen) {
906906
// Generate a transaction to create a unique block
907907
tx, _ := types.SignTx(types.NewTransaction(gen.TxNonce(addr1), addr2, big.NewInt(10000), params.TxGas, nil, nil), signer, key1)
908908
gen.AddTx(tx)

0 commit comments

Comments
 (0)