Skip to content

Commit

Permalink
chore: fix Test_Node_Encode
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Feb 27, 2024
1 parent 15f7305 commit 8ef2e21
Show file tree
Hide file tree
Showing 3 changed files with 308 additions and 313 deletions.
12 changes: 6 additions & 6 deletions pkg/trie/node/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ import (
// of this package, and specified in the Polkadot spec at
// https://spec.polkadot.network/#sect-state-storage
func (n *Node) Encode(buffer Buffer) (err error) {
if n == nil {
_, err = buffer.Write([]byte{emptyVariant.bits})
return err
}

err = encodeHeader(n, n.MustBeHashed, buffer)
if err != nil {
return fmt.Errorf("cannot encode header: %w", err)
}

if n == nil {
// only encode the empty variant byte header
return nil
}

keyLE := codec.NibblesToKeyLE(n.PartialKey)
_, err = buffer.Write(keyLE)
if err != nil {
Expand Down Expand Up @@ -55,7 +55,7 @@ func (n *Node) Encode(buffer Buffer) (err error) {

_, err = buffer.Write(hashedValue.ToBytes())
if err != nil {
return fmt.Errorf("scale encoding storage value: %w", err)
return fmt.Errorf("writting hashed storage value: %w", err)

Check failure on line 58 in pkg/trie/node/encode.go

View workflow job for this annotation

GitHub Actions / linting

`writting` is a misspelling of `writing` (misspell)
}
default:
encoder := scale.NewEncoder(buffer)
Expand Down
Loading

0 comments on commit 8ef2e21

Please sign in to comment.