Documentation ¶
Index ¶
- Constants
- Variables
- func GetBNBBlockByHeight(bnbChainState *bnbrelaying.BNBChainState, blockHeight int64) (*bnbTypes.Block, error)
- func GetLatestBNBBlockHeight(bnbChainState *bnbrelaying.BNBChainState) (int64, error)
- func HandleRelayingInsts(bc metadata.ChainRetriever, relayingState *RelayingHeaderChainState, ...) [][]string
- func ProcessRelayingBTCHeaderInst(instruction []string, relayingState *RelayingHeaderChainState) error
- func ProcessRelayingInstructions(instructions [][]string, relayingState *RelayingHeaderChainState) error
- type PortalRelayingLogger
- type RelayingBNBChain
- type RelayingBTCChain
- type RelayingChain
- type RelayingHeaderChainState
- type RelayingParams
- type RelayingProcessor
Constants ¶
View Source
const ( // Relaying header RelayingHeaderRejectedChainStatus = "rejected" RelayingHeaderConsideringChainStatus = "considering" )
Variables ¶
View Source
var Logger = PortalRelayingLogger{}
Global instant to use
Functions ¶
func GetBNBBlockByHeight ¶
func GetBNBBlockByHeight(bnbChainState *bnbrelaying.BNBChainState, blockHeight int64) (*bnbTypes.Block, error)
GetBNBBlockByHeight gets bnb header by height
func GetLatestBNBBlockHeight ¶
func GetLatestBNBBlockHeight(bnbChainState *bnbrelaying.BNBChainState) (int64, error)
GetLatestBNBBlockHeight return latest block height of bnb chain
func HandleRelayingInsts ¶
func HandleRelayingInsts( bc metadata.ChainRetriever, relayingState *RelayingHeaderChainState, relayingProcessors map[int]RelayingProcessor, ) [][]string
HandleRelayingInsts: beacon producers handle these relaying actions
func ProcessRelayingBTCHeaderInst ¶
func ProcessRelayingBTCHeaderInst( instruction []string, relayingState *RelayingHeaderChainState, ) error
func ProcessRelayingInstructions ¶
func ProcessRelayingInstructions(instructions [][]string, relayingState *RelayingHeaderChainState) error
Types ¶
type PortalRelayingLogger ¶
type PortalRelayingLogger struct {
// contains filtered or unexported fields
}
func (*PortalRelayingLogger) Init ¶
func (p *PortalRelayingLogger) Init(inst common.Logger)
type RelayingBNBChain ¶
type RelayingBNBChain struct {
*RelayingChain
}
func (*RelayingBNBChain) BuildRelayingInst ¶
func (rbnbChain *RelayingBNBChain) BuildRelayingInst( bc metadata.ChainRetriever, relayingHeaderAction metadata.RelayingHeaderAction, relayingHeaderChain *RelayingHeaderChainState, ) [][]string
type RelayingBTCChain ¶
type RelayingBTCChain struct {
*RelayingChain
}
func (*RelayingBTCChain) BuildRelayingInst ¶
func (rbtcChain *RelayingBTCChain) BuildRelayingInst( bc metadata.ChainRetriever, relayingHeaderAction metadata.RelayingHeaderAction, relayingState *RelayingHeaderChainState, ) [][]string
type RelayingChain ¶
type RelayingChain struct {
Actions [][]string
}
func (*RelayingChain) BuildHeaderRelayingInst ¶
func (rChain *RelayingChain) BuildHeaderRelayingInst( senderAddressStr string, header string, blockHeight uint64, metaType int, shardID byte, txReqID common.Hash, status string, ) []string
buildHeaderRelayingInst builds a new instruction from action received from ShardToBeaconBlock
func (*RelayingChain) GetActions ¶
func (rChain *RelayingChain) GetActions() [][]string
func (*RelayingChain) PutAction ¶
func (rChain *RelayingChain) PutAction(action []string)
type RelayingHeaderChainState ¶
type RelayingHeaderChainState struct { BNBHeaderChain *bnbrelaying.BNBChainState BTCHeaderChain *btcrelaying.BlockChain }
RelayingHeaderChainState is state of relaying header chains include btc and bnb header chain
func InitRelayingHeaderChainStateFromDB ¶
func InitRelayingHeaderChainStateFromDB(bnbChain *bnbrelaying.BNBChainState, btcChain *btcrelaying.BlockChain) (*RelayingHeaderChainState, error)
type RelayingParams ¶
type RelayingProcessor ¶
type RelayingProcessor interface { GetActions() [][]string PutAction(action []string) BuildRelayingInst( bc metadata.ChainRetriever, relayingHeaderAction metadata.RelayingHeaderAction, relayingState *RelayingHeaderChainState, ) [][]string BuildHeaderRelayingInst( senderAddressStr string, header string, blockHeight uint64, metaType int, shardID byte, txReqID common.Hash, status string, ) []string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.