Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Still fixing index out of range in (*Accumulator) ChangeStorage (ledg…
Browse files Browse the repository at this point in the history
  • Loading branch information
yperbasis committed Jul 19, 2022
1 parent b70abd7 commit ab28089
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions turbo/shards/state_change_accumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (a *Accumulator) ChangeAccount(address common.Address, incarnation uint64,
i = len(a.latestChange.Changes)
a.latestChange.Changes = append(a.latestChange.Changes, &remote.AccountChange{Address: gointerfaces.ConvertAddressToH160(address)})
a.accountChangeIndex[address] = i
delete(a.storageChangeIndex, address)
}
accountChange := a.latestChange.Changes[i]
switch accountChange.Action {
Expand Down Expand Up @@ -116,6 +117,7 @@ func (a *Accumulator) ChangeCode(address common.Address, incarnation uint64, cod
i = len(a.latestChange.Changes)
a.latestChange.Changes = append(a.latestChange.Changes, &remote.AccountChange{Address: gointerfaces.ConvertAddressToH160(address), Action: remote.Action_CODE})
a.accountChangeIndex[address] = i
delete(a.storageChangeIndex, address)
}
accountChange := a.latestChange.Changes[i]
switch accountChange.Action {
Expand All @@ -137,6 +139,7 @@ func (a *Accumulator) ChangeStorage(address common.Address, incarnation uint64,
i = len(a.latestChange.Changes)
a.latestChange.Changes = append(a.latestChange.Changes, &remote.AccountChange{Address: gointerfaces.ConvertAddressToH160(address), Action: remote.Action_STORAGE})
a.accountChangeIndex[address] = i
delete(a.storageChangeIndex, address)
}
accountChange := a.latestChange.Changes[i]
if accountChange.Action == remote.Action_REMOVE {
Expand Down

0 comments on commit ab28089

Please sign in to comment.