Skip to content

Commit

Permalink
Merge pull request #25 from 0chain/feat/weighted-merkle-trie
Browse files Browse the repository at this point in the history
Weighted merkle trie
  • Loading branch information
dabasov authored Oct 22, 2024
2 parents d467d06 + e2c4e7e commit 8f86ebe
Show file tree
Hide file tree
Showing 27 changed files with 2,070 additions and 1,718 deletions.
8 changes: 4 additions & 4 deletions core/encryption/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"golang.org/x/crypto/sha3"
)

//ErrInvalidHash - hash is invalid error
// ErrInvalidHash - hash is invalid error
var ErrInvalidHash = common.NewError("invalid_hash", "Invalid hash")

const HASH_LENGTH = 32
Expand All @@ -24,10 +24,10 @@ func IsHash(str string) bool {
return err == nil && len(bytes) == HASH_LENGTH
}

//EmptyHash - hash of an empty string
// EmptyHash - hash of an empty string
var EmptyHash = Hash("")

//EmptyHashBytes - hash bytes of an empty string
// EmptyHashBytes - hash bytes of an empty string
var EmptyHashBytes = RawHash("")

/*RawHash - Logic to hash the text and return the hash bytes */
Expand All @@ -45,6 +45,6 @@ func RawHash(data interface{}) []byte {
}
hash := sha3.New256()
hash.Write(databuf)
var buf []byte
buf := make([]byte, 0, hash.Size())
return hash.Sum(buf)
}
130 changes: 0 additions & 130 deletions core/mocks/change_collector_i.go

This file was deleted.

55 changes: 0 additions & 55 deletions core/mocks/hashable.go

This file was deleted.

Loading

0 comments on commit 8f86ebe

Please sign in to comment.