Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
fix: missed return from setKeyValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
KimiWu123 committed Apr 18, 2024
1 parent 9b0eb3f commit 59cf1b3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions geth-utils/gethutil/mpt/witness/leaf.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func prepareStorageLeafPlaceholderNode(storage_key common.Hash, key []byte, keyI
return prepareStorageLeafNode(leaf, leaf, nil, storage_key, key, false, true, true, false, false)
}

func setKeyValue(row, keyRlp []byte, keyLen, offset byte, valueIsZero, isPlaceholder bool) ([]byte, []byte) {
func setKeyValue(row, keyRlp []byte, keyLen, offset byte, valueIsZero, isPlaceholder bool) ([]byte, []byte, []byte) {
var valueRlp []byte
value := make([]byte, valueLen)

Expand All @@ -507,15 +507,13 @@ func setKeyValue(row, keyRlp []byte, keyLen, offset byte, valueIsZero, isPlaceho
}
}

return keyRlp, valueRlp
return value, keyRlp, valueRlp
}

func prepareTxLeafInfo(row []byte, valueIsZero, isPlaceholder bool) ([]byte, []byte, []byte, []byte) {
var keyRlp []byte
var valueRlp []byte
var keyRlpLen byte
key := make([]byte, valueLen)
value := make([]byte, valueLen)

keyLen := byte(0)
offset := byte(1)
Expand All @@ -528,17 +526,15 @@ func prepareTxLeafInfo(row []byte, valueIsZero, isPlaceholder bool) ([]byte, []b
keyLen = byte(2)
offset = byte(0)

keyRlp, valueRlp = setKeyValue(row, keyRlp, keyLen, offset, valueIsZero, isPlaceholder)
value, keyRlp, valueRlp := setKeyValue(row, keyRlp, keyLen, offset, valueIsZero, isPlaceholder)

return key, value, keyRlp, valueRlp
}

func prepareStorageLeafInfo(row []byte, valueIsZero, isPlaceholder bool) ([]byte, []byte, []byte, []byte) {
var keyRlp []byte
var valueRlp []byte
var keyRlpLen byte
key := make([]byte, valueLen)
value := make([]byte, valueLen)

keyLen := byte(0)
offset := byte(1)
Expand Down Expand Up @@ -591,7 +587,7 @@ func prepareStorageLeafInfo(row []byte, valueIsZero, isPlaceholder bool) ([]byte
}
}

keyRlp, valueRlp = setKeyValue(row, keyRlp, keyLen, offset, valueIsZero, isPlaceholder)
value, keyRlp, valueRlp := setKeyValue(row, keyRlp, keyLen, offset, valueIsZero, isPlaceholder)

return key, value, keyRlp, valueRlp
}
Expand Down

0 comments on commit 59cf1b3

Please sign in to comment.