Documentation ¶
Index ¶
Constants ¶
View Source
const (
// KeyLen is the length of key and value in the Merkle Tree
KeyLen = 32
)
Variables ¶
View Source
var HashZero = [KeyLen]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
HashZero is an empty hash
Functions ¶
Types ¶
type BridgeController ¶
type BridgeController struct {
// contains filtered or unexported fields
}
BridgeController struct
func NewBridgeController ¶
func NewBridgeController(cfg Config, networks []uint, mtStore interface{}) (*BridgeController, error)
NewBridgeController creates new BridgeController.
func (*BridgeController) AddDeposit ¶
func (bt *BridgeController) AddDeposit(deposit *etherman.Deposit, depositID uint64, dbTx pgx.Tx) error
AddDeposit adds deposit information to the bridge tree.
func (*BridgeController) GetExitRoot ¶ added in v0.1.0
func (bt *BridgeController) GetExitRoot(networkID int, dbTx pgx.Tx) ([]byte, error)
GetExitRoot returns the dedicated merkle tree's root. only use for the test purpose
type Config ¶
type Config struct { // Store is the kind of storage in the bridge tree Store string // Height is the depth of the merkle tree Height uint8 }
Config is state config
type MerkleTree ¶
type MerkleTree struct {
// contains filtered or unexported fields
}
MerkleTree struct
func NewMerkleTree ¶
func NewMerkleTree(ctx context.Context, store merkleTreeStore, height uint8, network uint) (*MerkleTree, error)
NewMerkleTree creates new MerkleTree.
Click to show internal directories.
Click to hide internal directories.