executor

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGasPrice                = 20000000000 // 20 GWei
	FallBehindThreshold            = 5
	SleepSecondForUpdateClient     = 10
	DataSeedDenyServiceThreshold   = 60
	RPCTimeout                     = 3 * time.Second
	RelayerBytesLength             = 48
	UpdateCachedValidatorsInterval = 1 * time.Minute
)

Variables

This section is empty.

Functions

func Cdc

func Cdc() *codec.ProtoCodec

func HexToEthSecp256k1PrivKey

func HexToEthSecp256k1PrivKey(hexString string) (*ethsecp256k1.PrivKey, error)

func InitExecutors

func InitExecutors() (*BSCExecutor, *GreenfieldExecutor)

func InitTestConfig

func InitTestConfig() *config.Config

func NewRpcClient

func NewRpcClient(addr string) *http.HTTP

Types

type BSCClient

type BSCClient struct {
	// contains filtered or unexported fields
}

type BSCExecutor

type BSCExecutor struct {
	GreenfieldExecutor *GreenfieldExecutor
	// contains filtered or unexported fields
}

func NewBSCExecutor

func NewBSCExecutor(cfg *config.Config) *BSCExecutor

func (*BSCExecutor) CallBuildInSystemContract

func (e *BSCExecutor) CallBuildInSystemContract(blsSignature []byte, validatorSet *big.Int, msgBytes []byte) (common.Hash, error)

func (*BSCExecutor) GetBlockHeaderAtHeight

func (e *BSCExecutor) GetBlockHeaderAtHeight(height uint64) (*types.Header, error)

func (*BSCExecutor) GetLatestBlockHeightWithRetry

func (e *BSCExecutor) GetLatestBlockHeightWithRetry() (latestHeight uint64, err error)

func (*BSCExecutor) GetLightClientLatestHeight

func (e *BSCExecutor) GetLightClientLatestHeight() (uint64, error)

func (*BSCExecutor) GetNextDeliveryOracleSequence

func (e *BSCExecutor) GetNextDeliveryOracleSequence() (uint64, error)

func (*BSCExecutor) GetNextReceiveSequenceForChannel

func (e *BSCExecutor) GetNextReceiveSequenceForChannel(channelID rtypes.ChannelId) (uint64, error)

func (*BSCExecutor) GetRpcClient

func (e *BSCExecutor) GetRpcClient() *ethclient.Client

func (*BSCExecutor) GetValidatorsBlsPublicKey

func (e *BSCExecutor) GetValidatorsBlsPublicKey() ([]string, error)

func (*BSCExecutor) QueryCachedLatestValidators

func (e *BSCExecutor) QueryCachedLatestValidators() ([]rtypes.Validator, error)

Used for gnfd -> bsc

func (*BSCExecutor) QueryLatestTendermintHeaderWithRetry

func (e *BSCExecutor) QueryLatestTendermintHeaderWithRetry() (lightBlock []byte, err error)

func (*BSCExecutor) QueryLatestValidators

func (e *BSCExecutor) QueryLatestValidators() ([]rtypes.Validator, error)

used for gnfd -> bsc

func (*BSCExecutor) QueryTendermintLightBlockWithRetry

func (e *BSCExecutor) QueryTendermintLightBlockWithRetry(height int64) (lightBlock []byte, err error)

func (*BSCExecutor) SetGreenfieldExecutor

func (e *BSCExecutor) SetGreenfieldExecutor(ge *GreenfieldExecutor)

func (*BSCExecutor) SwitchClient

func (e *BSCExecutor) SwitchClient()

func (*BSCExecutor) SyncTendermintLightBlock

func (e *BSCExecutor) SyncTendermintLightBlock(height uint64) (common.Hash, error)

func (*BSCExecutor) UpdateCachedLatestValidatorsLoop

func (e *BSCExecutor) UpdateCachedLatestValidatorsLoop()

func (*BSCExecutor) UpdateClientLoop

func (e *BSCExecutor) UpdateClientLoop()

type GreenfieldClient

type GreenfieldClient struct {
	Provider  string
	Height    uint64
	UpdatedAt time.Time
	// contains filtered or unexported fields
}

type GreenfieldExecutor

type GreenfieldExecutor struct {
	BscExecutor *BSCExecutor
	// contains filtered or unexported fields
}

func NewGreenfieldExecutor

func NewGreenfieldExecutor(cfg *config.Config) *GreenfieldExecutor

func (*GreenfieldExecutor) ClaimPackages

func (e *GreenfieldExecutor) ClaimPackages(payloadBts []byte, aggregatedSig []byte, voteAddressSet []uint64, claimTs int64) (string, error)

func (*GreenfieldExecutor) GetAccount

func (e *GreenfieldExecutor) GetAccount(address string) (authtypes.AccountI, error)

func (*GreenfieldExecutor) GetBlockAtHeight

func (e *GreenfieldExecutor) GetBlockAtHeight(height int64) (*tmtypes.Block, error)

func (*GreenfieldExecutor) GetBlockResultAtHeight

func (e *GreenfieldExecutor) GetBlockResultAtHeight(height int64) (*ctypes.ResultBlockResults, error)

func (*GreenfieldExecutor) GetLatestBlockHeightWithRetry

func (e *GreenfieldExecutor) GetLatestBlockHeightWithRetry() (latestHeight uint64, err error)

func (*GreenfieldExecutor) GetNextDeliverySequenceForChannel

func (e *GreenfieldExecutor) GetNextDeliverySequenceForChannel(channelID types.ChannelId) (uint64, error)

GetNextDeliverySequenceForChannel call dest chain(BSC) to return a sequence# which should be used.

func (*GreenfieldExecutor) GetNextReceiveOracleSequence

func (e *GreenfieldExecutor) GetNextReceiveOracleSequence() (uint64, error)

func (*GreenfieldExecutor) GetNextReceiveSequenceForChannel

func (e *GreenfieldExecutor) GetNextReceiveSequenceForChannel(channelId types.ChannelId) (uint64, error)

GetNextReceiveSequenceForChannel gets the sequence specifically for cross-chain package's channel

func (*GreenfieldExecutor) GetValidatorsBlsPublicKey

func (e *GreenfieldExecutor) GetValidatorsBlsPublicKey() ([]string, error)

func (*GreenfieldExecutor) QueryCachedLatestValidators

func (e *GreenfieldExecutor) QueryCachedLatestValidators() ([]*tmtypes.Validator, error)

func (*GreenfieldExecutor) QueryTendermintLightBlock

func (e *GreenfieldExecutor) QueryTendermintLightBlock(height int64) ([]byte, error)

func (*GreenfieldExecutor) QueryValidatorsAtHeight

func (e *GreenfieldExecutor) QueryValidatorsAtHeight(height uint64) ([]*tmtypes.Validator, error)

func (*GreenfieldExecutor) SetBSCExecutor

func (e *GreenfieldExecutor) SetBSCExecutor(be *BSCExecutor)

func (*GreenfieldExecutor) UpdateCachedLatestValidatorsLoop

func (e *GreenfieldExecutor) UpdateCachedLatestValidatorsLoop()

func (*GreenfieldExecutor) UpdateClientLoop

func (e *GreenfieldExecutor) UpdateClientLoop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL