Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeSiblings(rollupIndex uint32, leaves [][KeyLen]byte, height uint8) ([][KeyLen]byte, common.Hash, error)
- func Hash(data ...[KeyLen]byte) [KeyLen]byte
- type BridgeController
- func (bt *BridgeController) AddDeposit(ctx context.Context, deposit *etherman.Deposit, depositID uint64, dbTx pgx.Tx) error
- func (bt *BridgeController) AddRollupExitLeaf(ctx context.Context, rollupLeaf etherman.RollupExitLeaf, dbTx pgx.Tx) error
- func (bt *BridgeController) GetExitRoot(ctx context.Context, tID uint8, dbTx pgx.Tx) ([]byte, error)
- func (bt *BridgeController) GetMerkleTreeID(networkID uint32) (uint8, error)
- func (bt *BridgeController) ReorgMT(ctx context.Context, depositCount uint32, networkID uint32, dbTx pgx.Tx) error
- type Config
- type MerkleTree
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 ¶
func ComputeSiblings ¶ added in v0.4.0
Types ¶
type BridgeController ¶
type BridgeController struct {
// contains filtered or unexported fields
}
BridgeController struct
func NewBridgeController ¶
func NewBridgeController(ctx context.Context, cfg Config, networkIDs []uint32, mtStore interface{}) (*BridgeController, error)
NewBridgeController creates new BridgeController.
func (*BridgeController) AddDeposit ¶
func (bt *BridgeController) AddDeposit(ctx context.Context, deposit *etherman.Deposit, depositID uint64, dbTx pgx.Tx) error
AddDeposit adds deposit information to the bridge tree.
func (*BridgeController) AddRollupExitLeaf ¶ added in v0.4.0
func (bt *BridgeController) AddRollupExitLeaf(ctx context.Context, rollupLeaf etherman.RollupExitLeaf, dbTx pgx.Tx) error
func (*BridgeController) GetExitRoot ¶ added in v0.1.0
func (bt *BridgeController) GetExitRoot(ctx context.Context, tID uint8, dbTx pgx.Tx) ([]byte, error)
GetExitRoot returns the dedicated merkle tree's root. only use for the test purpose
func (*BridgeController) GetMerkleTreeID ¶
func (bt *BridgeController) GetMerkleTreeID(networkID uint32) (uint8, error)
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, networkID uint32) (*MerkleTree, error)
NewMerkleTree creates new MerkleTree.
Click to show internal directories.
Click to hide internal directories.