Remove OldValue from DiffBigInt and DiffUint64 fields
This commit is contained in:
parent
77e86a698a
commit
78d9869256
@ -156,22 +156,13 @@ 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()
|
||||||
|
|
||||||
if created {
|
if created {
|
||||||
nonce := DiffUint64{
|
nonce := DiffUint64{ Value: &val.Nonce }
|
||||||
NewValue: &val.Nonce,
|
balance := DiffBigInt{ Value: val.Balance }
|
||||||
}
|
contractRoot := DiffString{ NewValue: &hexRoot }
|
||||||
|
|
||||||
balance := DiffBigInt{
|
|
||||||
NewValue: val.Balance,
|
|
||||||
}
|
|
||||||
|
|
||||||
contractRoot := DiffString{
|
|
||||||
NewValue: &hexRoot,
|
|
||||||
}
|
|
||||||
accountDiffs[addr] = AccountDiffEventual{
|
accountDiffs[addr] = AccountDiffEventual{
|
||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
Balance: balance,
|
Balance: balance,
|
||||||
@ -181,15 +172,9 @@ func (sdb *builder) buildDiffEventual(accounts map[common.Address]*state.Account
|
|||||||
Storage: storageDiffs,
|
Storage: storageDiffs,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nonce := DiffUint64{
|
nonce := DiffUint64{ Value: &val.Nonce }
|
||||||
OldValue: &val.Nonce,
|
balance := DiffBigInt{ Value: val.Balance }
|
||||||
}
|
contractRoot := DiffString{ OldValue: &hexRoot }
|
||||||
balance := DiffBigInt{
|
|
||||||
OldValue: val.Balance,
|
|
||||||
}
|
|
||||||
contractRoot := DiffString{
|
|
||||||
OldValue: &hexRoot,
|
|
||||||
}
|
|
||||||
accountDiffs[addr] = AccountDiffEventual{
|
accountDiffs[addr] = AccountDiffEventual{
|
||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
Balance: balance,
|
Balance: balance,
|
||||||
@ -214,23 +199,12 @@ func (sdb *builder) buildDiffIncremental(creations map[common.Address]*state.Acc
|
|||||||
log.Error("Failed building storage diffs", "Address", val, "error", err)
|
log.Error("Failed building storage diffs", "Address", val, "error", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
nonce := DiffUint64{
|
nonce := DiffUint64{ Value: &createdAcc.Nonce }
|
||||||
NewValue: &createdAcc.Nonce,
|
balance := DiffBigInt{ Value: createdAcc.Balance }
|
||||||
OldValue: &deletedAcc.Nonce,
|
|
||||||
}
|
|
||||||
|
|
||||||
balance := DiffBigInt{
|
|
||||||
NewValue: createdAcc.Balance,
|
|
||||||
OldValue: deletedAcc.Balance,
|
|
||||||
}
|
|
||||||
codeHash := hexutil.Encode(createdAcc.CodeHash)
|
codeHash := hexutil.Encode(createdAcc.CodeHash)
|
||||||
|
|
||||||
nHexRoot := createdAcc.Root.Hex()
|
nHexRoot := createdAcc.Root.Hex()
|
||||||
oHexRoot := deletedAcc.Root.Hex()
|
contractRoot := DiffString{ NewValue: &nHexRoot }
|
||||||
contractRoot := DiffString{
|
|
||||||
NewValue: &nHexRoot,
|
|
||||||
OldValue: &oHexRoot,
|
|
||||||
}
|
|
||||||
|
|
||||||
updatedAccounts[common.HexToAddress(val)] = AccountDiffIncremental{
|
updatedAccounts[common.HexToAddress(val)] = AccountDiffIncremental{
|
||||||
Nonce: nonce,
|
Nonce: nonce,
|
||||||
|
@ -76,11 +76,5 @@ type DiffString struct {
|
|||||||
NewValue *string `json:"newValue" gencodec:"optional"`
|
NewValue *string `json:"newValue" gencodec:"optional"`
|
||||||
OldValue *string `json:"oldValue" gencodec:"optional"`
|
OldValue *string `json:"oldValue" gencodec:"optional"`
|
||||||
}
|
}
|
||||||
type DiffUint64 struct {
|
type DiffUint64 struct { Value *uint64 `json:"value" gencodec:"optional"` }
|
||||||
NewValue *uint64 `json:"newValue" gencodec:"optional"`
|
type DiffBigInt struct { Value *big.Int `json:"value" gencodec:"optional"` }
|
||||||
OldValue *uint64 `json:"oldValue" gencodec:"optional"`
|
|
||||||
}
|
|
||||||
type DiffBigInt struct {
|
|
||||||
NewValue *big.Int `json:"newValue" gencodec:"optional"`
|
|
||||||
OldValue *big.Int `json:"oldValue" gencodec:"optional"`
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user