diff --git a/trie/zk_trie.go b/trie/zk_trie.go index fc6ea25..3e9d967 100644 --- a/trie/zk_trie.go +++ b/trie/zk_trie.go @@ -145,7 +145,7 @@ func (t *ZkTrie) Copy() *ZkTrie { } } -// Prove is a simlified calling of ProveWithDeletion +// Prove is a simplified calling of ProveWithDeletion func (t *ZkTrie) Prove(key []byte, fromLevel uint, writeNode func(*Node) error) error { return t.ProveWithDeletion(key, fromLevel, writeNode, nil) } @@ -159,7 +159,7 @@ func (t *ZkTrie) Prove(key []byte, fromLevel uint, writeNode func(*Node) error) // with the node that proves the absence of the key. // // If the trie contain value for key, the onHit is called BEFORE writeNode being called, -// both the hitted leaf node and its sibling node is provided as arguments so caller +// both the hit leaf node and its sibling node is provided as arguments so caller // would receive enough information for launch a deletion and calculate the new root // base on the proof data // Also notice the sibling can be nil if the trie has only one leaf diff --git a/trie/zk_trie_impl.go b/trie/zk_trie_impl.go index 96d32a4..9e122c2 100644 --- a/trie/zk_trie_impl.go +++ b/trie/zk_trie_impl.go @@ -579,7 +579,7 @@ type NodeAux struct { // Proof defines the required elements for a MT proof of existence or // non-existence. type Proof struct { - // existence indicates wether this is a proof of existence or + // existence indicates weather, whether this is a proof of existence or // non-existence. Existence bool // depth indicates how deep in the tree the proof goes. diff --git a/trie/zk_trie_node.go b/trie/zk_trie_node.go index 51921de..6419e68 100644 --- a/trie/zk_trie_node.go +++ b/trie/zk_trie_node.go @@ -99,7 +99,7 @@ type Node struct { ChildR *zkt.Hash // NodeKey is the node's key stored in a leaf node. NodeKey *zkt.Hash - // ValuePreimage can store at most 256 byte32 as fields (represnted by BIG-ENDIAN integer) + // ValuePreimage can store at most 256 byte32 as fields (represented by BIG-ENDIAN integer) // and the first 24 can be compressed (each bytes32 consider as 2 fields), in hashing the compressed // elemments would be calculated first ValuePreimage []zkt.Byte32 diff --git a/types/util.go b/types/util.go index 4b96108..006340c 100644 --- a/types/util.go +++ b/types/util.go @@ -5,7 +5,7 @@ import ( ) // HashElemsWithDomain performs a recursive poseidon hash over the array of ElemBytes, each hash -// reduce 2 fieds into one, with a specified domain field which would be used in +// reduce 2 fields, fiends into one, with a specified domain field which would be used in // every recursiving call func HashElemsWithDomain(domain, fst, snd *big.Int, elems ...*big.Int) (*Hash, error) { @@ -43,7 +43,7 @@ func HashElems(fst, snd *big.Int, elems ...*big.Int) (*Hash, error) { fst, snd, elems...) } -// HandlingElemsAndByte32 hash an arry mixed with field and byte32 elements, turn each byte32 into +// HandlingElemsAndByte32 hash an array, carry mixed with field and byte32 elements, turn each byte32 into // field elements first then calculate the hash with HashElems func HandlingElemsAndByte32(flagArray uint32, elems []Byte32) (*Hash, error) {