You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
437 B

package merkle
import (
"fmt"
)
type Db interface {
Get([]byte) []byte
Set([]byte, []byte)
}
type Tree interface {
Size() uint64
Height() uint8
Has(key []byte) bool
Get(key []byte) []byte
HashWithCount() ([]byte, uint64)
Hash() []byte
Save()
SaveKey(string)
Set(key []byte, vlaue []byte) bool
Remove(key []byte) ([]byte, error)
Copy() Tree
}
func NotFound(key []byte) error {
return fmt.Errorf("Key was not found.")
}