mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-05 14:38:42 +00:00
parent
bc1967f088
commit
13d8df63f4
1 changed files with 5 additions and 0 deletions
|
|
@ -178,6 +178,11 @@ func isStrictlySortedFunc[S ~[]E, E any](x S, cmp func(a, b E) int) bool {
|
|||
// which are ordered ascending by transaction index and contain no duplicate
|
||||
// modifications for a given index.
|
||||
func (e *encodingSlotChanges) validate(maxBALIndex int) error {
|
||||
// Each SlotChanges entry MUST contain at least one StorageChange.
|
||||
if len(e.SlotChanges) == 0 {
|
||||
return errors.New("empty slot changes")
|
||||
}
|
||||
// Each storage key MUST appear at most once in storage_changes per account.
|
||||
if !isStrictlySortedFunc(e.SlotChanges, func(a, b encodingStorageWrite) int {
|
||||
return cmp.Compare(a.BlockAccessIndex, b.BlockAccessIndex)
|
||||
}) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue