tendermint/merkle/types.go

29 lines
437 B
Go
Raw Normal View History

package merkle
import (
2014-07-01 14:50:24 -07:00
"fmt"
)
2014-05-23 17:49:28 -07:00
type Db interface {
2014-07-01 14:50:24 -07:00
Get([]byte) []byte
2014-07-19 15:19:07 -07:00
Set([]byte, []byte)
2014-05-23 17:49:28 -07:00
}
2014-05-23 23:11:22 -07:00
type Tree interface {
2014-07-01 14:50:24 -07:00
Size() uint64
Height() uint8
Has(key []byte) bool
Get(key []byte) []byte
HashWithCount() ([]byte, uint64)
Hash() []byte
2014-07-01 14:50:24 -07:00
Save()
2014-08-10 16:35:08 -07:00
SaveKey(string)
Set(key []byte, vlaue []byte) bool
Remove(key []byte) ([]byte, error)
2014-07-01 14:50:24 -07:00
Copy() Tree
2014-05-23 23:11:22 -07:00
}
func NotFound(key []byte) error {
2014-07-01 14:50:24 -07:00
return fmt.Errorf("Key was not found.")
}