Skip to content

Commit

Permalink
Fix function name
Browse files Browse the repository at this point in the history
  • Loading branch information
scorbajio committed Jul 23, 2024
1 parent 731ab8b commit 46f5617
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/trie/src/util/encoding.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { hexToBytes, toBytes, unprefixedHexToBytes } from '@ethereumjs/util'

import type { Nibbles } from '../types.js'
import { nibblesTypeToPackedBytes } from './nibbles.js'

// Reference: https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/
//
Expand Down Expand Up @@ -151,7 +152,7 @@ export const pathToHexKey = (path: string, extension: Nibbles, retType: string):
if (retType === 'hex') {
return nibbleTypeToByteType(n.concat(extension))
} else if (retType === 'keybyte') {
return nibbleTypeToPackedBytes(n.concat(extension))
return nibblesTypeToPackedBytes(n.concat(extension))
}
throw Error('retType must be either "keybyte" or "hex"')
}
Expand Down
2 changes: 1 addition & 1 deletion packages/trie/src/util/nibbles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function bytesToNibbles(key: Uint8Array): Nibbles {
* @private
* @param arr - Nibble array
*/
export function nibbleTypeToPackedBytes(arr: Nibbles): Uint8Array {
export function nibblesTypeToPackedBytes(arr: Nibbles): Uint8Array {
const buf = new Uint8Array(arr.length / 2)
for (let i = 0; i < buf.length; i++) {
let q = i * 2
Expand Down

0 comments on commit 46f5617

Please sign in to comment.