mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-21 17:01:35 +00:00
IAVLTree supports Codec.
This commit is contained in:
@ -1,29 +1,18 @@
|
||||
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
|
||||
Set(key []byte, value []byte) bool
|
||||
Remove(key []byte) ([]byte, error)
|
||||
HashWithCount() ([]byte, uint64)
|
||||
Hash() []byte
|
||||
Save() []byte
|
||||
Copy() Tree
|
||||
}
|
||||
|
||||
func NotFound(key []byte) error {
|
||||
return fmt.Errorf("Key was not found.")
|
||||
Size() (size uint64)
|
||||
Height() (height uint8)
|
||||
Has(key interface{}) (has bool)
|
||||
Get(key interface{}) (index uint64, value interface{})
|
||||
GetByIndex(index uint64) (key interface{}, value interface{})
|
||||
Set(key interface{}, value interface{}) (updated bool)
|
||||
Remove(key interface{}) (value interface{}, removed bool)
|
||||
HashWithCount() (hash []byte, count uint64)
|
||||
Hash() (hash []byte)
|
||||
Save() (hash []byte)
|
||||
Checkpoint() (checkpoint interface{})
|
||||
Restore(checkpoint interface{})
|
||||
}
|
||||
|
||||
type Hashable interface {
|
||||
|
Reference in New Issue
Block a user