Documentation ¶
Index ¶
- Constants
- Variables
- func ComputeSiblings(rollupIndex uint, 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, networkID int, dbTx pgx.Tx) ([]byte, error)
- func (bt *BridgeController) GetNetworkID(networkID uint) (uint8, error)
- func (bt *BridgeController) ReorgMT(ctx context.Context, depositCount uint, networkID uint, 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, networks []uint, 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, networkID int, dbTx pgx.Tx) ([]byte, error)
GetExitRoot returns the dedicated merkle tree's root. only use for the test purpose
func (*BridgeController) GetNetworkID ¶ added in v0.4.0
func (bt *BridgeController) GetNetworkID(networkID uint) (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, network uint) (*MerkleTree, error)
NewMerkleTree creates new MerkleTree.
Click to show internal directories.
Click to hide internal directories.