Remove some duplication in builder
This commit is contained in:
parent
ade4a8efdc
commit
0dacc940fd
@ -158,30 +158,16 @@ func (sdb *builder) buildDiffEventual(accounts map[common.Address]*state.Account
|
|||||||
codeBytes, err := sdb.chainDB.Get(val.CodeHash)
|
codeBytes, err := sdb.chainDB.Get(val.CodeHash)
|
||||||
codeHash := hexutil.Encode(val.CodeHash)
|
codeHash := hexutil.Encode(val.CodeHash)
|
||||||
hexRoot := val.Root.Hex()
|
hexRoot := val.Root.Hex()
|
||||||
|
nonce := DiffUint64{Value: &val.Nonce}
|
||||||
if created {
|
balance := DiffBigInt{Value: val.Balance}
|
||||||
nonce := DiffUint64{Value: &val.Nonce}
|
contractRoot := DiffString{Value: &hexRoot}
|
||||||
balance := DiffBigInt{Value: val.Balance}
|
accountDiffs[addr] = AccountDiffEventual{
|
||||||
contractRoot := DiffString{Value: &hexRoot}
|
Nonce: nonce,
|
||||||
accountDiffs[addr] = AccountDiffEventual{
|
Balance: balance,
|
||||||
Nonce: nonce,
|
CodeHash: codeHash,
|
||||||
Balance: balance,
|
Code: codeBytes,
|
||||||
CodeHash: codeHash,
|
ContractRoot: contractRoot,
|
||||||
Code: codeBytes,
|
Storage: storageDiffs,
|
||||||
ContractRoot: contractRoot,
|
|
||||||
Storage: storageDiffs,
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
nonce := DiffUint64{Value: &val.Nonce}
|
|
||||||
balance := DiffBigInt{Value: val.Balance}
|
|
||||||
contractRoot := DiffString{Value: &hexRoot}
|
|
||||||
accountDiffs[addr] = AccountDiffEventual{
|
|
||||||
Nonce: nonce,
|
|
||||||
Balance: balance,
|
|
||||||
CodeHash: codeHash,
|
|
||||||
ContractRoot: contractRoot,
|
|
||||||
Storage: storageDiffs,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user