Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rian committed Jun 7, 2024
1 parent 84e6442 commit 54d0c4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/trie/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewKey(length uint8, keyBytes []byte) Key {

func (k *Key) SubKey(n uint8) (*Key, error) {
if n > k.len {
return nil, errors.New(fmt.Sprint("cannot subtract key by len %i", n))
return nil, errors.New(fmt.Sprint("cannot subtract key of length %i from key of length %i", n, k.len))
}

newKey := &Key{len: n}
Expand Down
4 changes: 1 addition & 3 deletions core/trie/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ func GetProof(key *Key, tri *Trie) ([]ProofNode, error) {

var parentKey *Key

for i := 0; i < len(nodesFromRoot); i++ {
sNode := nodesFromRoot[i]

for i, sNode := range nodesFromRoot {
sNodeEdge, sNodeBinary, err := transformNode(tri, parentKey, sNode)
if err != nil {
return nil, err
Expand Down

0 comments on commit 54d0c4e

Please sign in to comment.