core/state/snapshot: full featured account iteration

This commit is contained in:
Péter Szilágyi
2019-12-10 11:00:03 +02:00
parent e570835356
commit 6ddb92a089
10 changed files with 717 additions and 524 deletions

View File

@ -18,7 +18,6 @@ package snapshot
import (
"bytes"
"math/big"
"math/rand"
"testing"
@ -26,21 +25,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb/memorydb"
"github.com/ethereum/go-ethereum/rlp"
)
func randomAccount() []byte {
root := randomHash()
a := Account{
Balance: big.NewInt(rand.Int63()),
Nonce: rand.Uint64(),
Root: root[:],
CodeHash: emptyCode[:],
}
data, _ := rlp.EncodeToBytes(a)
return data
}
// TestMergeBasics tests some simple merges
func TestMergeBasics(t *testing.T) {
var (