chain

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EVMConfig

type EVMConfig struct {
	GeneralChainConfig GeneralChainConfig
	Bridge             string
	Erc20Handler       string
	Erc721Handler      string
	GenericHandler     string
	MaxGasPrice        *big.Int
	GasMultiplier      *big.Float
	GasLimit           *big.Int
	StartBlock         *big.Int
	BlockConfirmations *big.Int
	BlockWindow        *big.Int
	BlockRetryInterval time.Duration

	AirDropAmount        *big.Int
	AirDropErc20Contract common.Address
	AirDropErc20Amount   *big.Int
	MoonbeamFinality     bool // blocks are needed to implicitly confirm the finality
	PolygonGasStation    bool

	SignatureContract common.Address
	SignatureSubmit   bool
}

func NewEVMConfig

func NewEVMConfig(chainConfig map[string]interface{}) (*EVMConfig, error)

NewEVMConfig decodes and validates an instance of an EVMConfig from raw chain config

func (*EVMConfig) RelayId

func (c *EVMConfig) RelayId() uint8

type GeneralChainConfig

type GeneralChainConfig struct {
	Name           string `mapstructure:"name"`
	Id             *uint8 `mapstructure:"id"`
	RelayId        *uint8 `mapstructure:"relayId"`
	Endpoint       string `mapstructure:"endpoint"`
	Replica        string `mapstructure:"replica"`
	From           string `mapstructure:"from"`
	Type           string `mapstructure:"type"`
	KeystorePath   string
	Insecure       bool
	BlockstorePath string
	FreshStart     bool
	FreshDomain    uint
	LatestBlock    bool
}

func (*GeneralChainConfig) DomainIdToName

func (c *GeneralChainConfig) DomainIdToName()

func (*GeneralChainConfig) ParseFlags

func (c *GeneralChainConfig) ParseFlags()

func (*GeneralChainConfig) Validate

func (c *GeneralChainConfig) Validate() error

type RawEVMConfig

type RawEVMConfig struct {
	GeneralChainConfig `mapstructure:",squash"`
	Bridge             string  `mapstructure:"bridge"`
	Erc20Handler       string  `mapstructure:"erc20Handler"`
	Erc721Handler      string  `mapstructure:"erc721Handler"`
	GenericHandler     string  `mapstructure:"genericHandler"`
	MaxGasPrice        int64   `mapstructure:"maxGasPrice"`
	GasMultiplier      float64 `mapstructure:"gasMultiplier"`
	GasLimit           int64   `mapstructure:"gasLimit"`
	StartBlock         int64   `mapstructure:"startBlock"`
	BlockConfirmations int64   `mapstructure:"blockConfirmations"`
	BlockWindow        int64   `mapstructure:"blockWindow"`
	BlockRetryInterval uint64  `mapstructure:"blockRetryInterval"`

	AirDropAmountOpt        int64  `mapstructure:"airDropAmount"`
	AirDropErc20ContractOpt string `mapstructure:"airDropErc20Contract"`
	AirDropErc20AmountOpt   int64  `mapstructure:"airDropErc20Amount"`
	MoonbeamFinalityOpt     bool   `mapstructure:"moonbeamFinality"`
	PolygonGasStationOpt    bool   `mapstructure:"polygonGasStation"`

	SignatureContractOpt string `mapstructure:"signatureContract"`
	SignatureSubmit      bool   `mapstructure:"signatureSubmit"`
}

func (*RawEVMConfig) Validate

func (c *RawEVMConfig) Validate() error

Jump to

Keyboard shortcuts

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