mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
checkpoint commit
This commit is contained in:
parent
9444281eab
commit
6f727a66f9
1 changed files with 38 additions and 0 deletions
|
|
@ -174,6 +174,44 @@ func (c *ConstructionBlockAccessList) Apply(idx uint16, diff *StateDiff, accesse
|
|||
acctChanges = &ConstructionAccountAccesses{}
|
||||
c.Accounts[addr] = acctChanges
|
||||
}
|
||||
|
||||
if stateDiff.Nonce != nil {
|
||||
if acctChanges.NonceChanges == nil {
|
||||
acctChanges.NonceChanges = make(map[uint16]uint64)
|
||||
}
|
||||
acctChanges.NonceChanges[idx] = *stateDiff.Nonce
|
||||
}
|
||||
if stateDiff.Balance != nil {
|
||||
if acctChanges.BalanceChanges == nil {
|
||||
acctChanges.BalanceChanges = make(map[uint16]*uint256.Int)
|
||||
}
|
||||
acctChanges.BalanceChanges[idx] = stateDiff.Balance
|
||||
}
|
||||
if stateDiff.Code != nil {
|
||||
if acctChanges.CodeChanges == nil {
|
||||
acctChanges.CodeChanges = make(map[uint16]CodeChange)
|
||||
}
|
||||
acctChanges.CodeChanges[idx] = CodeChange{idx, stateDiff.Code}
|
||||
}
|
||||
if stateDiff.StorageWrites != nil {
|
||||
if acctChanges.StorageWrites == nil {
|
||||
acctChanges.StorageWrites = make(map[common.Hash]map[uint16]common.Hash)
|
||||
}
|
||||
for key, val := range stateDiff.StorageWrites {
|
||||
acctChanges.StorageWrites[key][idx] = val
|
||||
}
|
||||
}
|
||||
}
|
||||
for addr, stateAccesses := range accesses {
|
||||
acctAccess, ok := c.Accounts[addr]
|
||||
if !ok {
|
||||
acctAccess = &ConstructionAccountAccesses{}
|
||||
c.Accounts[addr] = acctAccess
|
||||
}
|
||||
|
||||
for key := range stateAccesses {
|
||||
acctAccess.StorageReads[key] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue