From 4a51115fed22f2f6137e67aaaca6e42284a916f7 Mon Sep 17 00:00:00 2001 From: Ceyhun Onur Date: Mon, 30 Dec 2024 21:18:15 +0300 Subject: [PATCH] triedb/pathdb: fix tester generator --- triedb/pathdb/database_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/triedb/pathdb/database_test.go b/triedb/pathdb/database_test.go index 648230df15..3b35370c84 100644 --- a/triedb/pathdb/database_test.go +++ b/triedb/pathdb/database_test.go @@ -222,7 +222,12 @@ func (t *tester) generate(parent common.Hash) (common.Hash, *trienode.MergedNode dirties = make(map[common.Hash]struct{}) ) for i := 0; i < 20; i++ { - switch rand.Intn(opLen) { + // Start with account creation always + op := createAccountOp + if i > 0 { + op = rand.Intn(opLen) + } + switch op { case createAccountOp: // account creation addr := testrand.Address()