Skip to content

Commit

Permalink
feat(trie): One more test to cover all lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dimartiro committed Jun 14, 2023
1 parent c4a7d46 commit a1a9037
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions internal/trie/node/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,27 @@ func Test_Node_Encode(t *testing.T) {
{written: hashedValue.ToBytes()},
},
},
"leaf_with_hashed_value_fail": {
node: &Node{
PartialKey: []byte{1, 2, 3},
StorageValue: hashedValue.ToBytes(),
HashedValue: true,
},
writes: []writeCall{
{
written: []byte{leafWithHashedValueVariant.bits | 3},
},
{
written: []byte{0x01, 0x23},
},
{
written: hashedValue.ToBytes(),
err: errTest,
},
},
wrappedErr: errTest,
errMessage: "encoding hashed storage value: test error",
},
"leaf_with_hashed_value_fail_too_short": {
node: &Node{
PartialKey: []byte{1, 2, 3},
Expand Down

0 comments on commit a1a9037

Please sign in to comment.