substrate_eth

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockInterval              = 20 * time.Second
	BlockHeightPollInterval    = BlockInterval * 3
	BlockFinalityConfirmations = 5
	MonitorBlockMaxConcurrency = 300 // number of concurrent requests to synchronize older blocks from source chain
	RPCCallRetry               = 5
)
View Source
const BMCABI = "" /* 4315-byte string literal not displayed */

BMCABI is the input ABI used to generate the binding from.

View Source
const (
	DefaultGasLimit = 25000000
)

Variables

This section is empty.

Functions

func HexToAddress

func HexToAddress(s string) common.Address

func NewReceiver

func NewReceiver(
	src, dst chain.BTPAddress, urls []string,
	rawOpts json.RawMessage, l log.Logger) (chain.Receiver, error)

func NewSender

func NewSender(
	src, dst chain.BTPAddress,
	urls []string, w wallet.Wallet,
	rawOpts json.RawMessage, l log.Logger) (chain.Sender, error)

Types

type Address

type Address string

Address T_ADDR_EOA, T_ADDR_SCORE

func (Address) Value

func (a Address) Value() ([]byte, error)

type BMC

type BMC struct {
	BMCCaller     // Read-only binding to the contract
	BMCTransactor // Write-only binding to the contract
	BMCFilterer   // Log filterer for contract events
}

BMC is an auto generated Go binding around an Ethereum contract.

func NewBMC

func NewBMC(address common.Address, backend bind.ContractBackend) (*BMC, error)

NewBMC creates a new instance of BMC, bound to a specific deployed contract.

type BMCCaller

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

BMCCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewBMCCaller

func NewBMCCaller(address common.Address, caller bind.ContractCaller) (*BMCCaller, error)

NewBMCCaller creates a new read-only instance of BMC, bound to a specific deployed contract.

func (*BMCCaller) GetBmcBtpAddress

func (_BMC *BMCCaller) GetBmcBtpAddress(opts *bind.CallOpts) (string, error)

GetBmcBtpAddress is a free data retrieval call binding the contract method 0x2a4011e9.

Solidity: function getBmcBtpAddress() view returns(string)

func (*BMCCaller) GetStatus

func (_BMC *BMCCaller) GetStatus(opts *bind.CallOpts, _link string) (TypesLinkStats, error)

GetStatus is a free data retrieval call binding the contract method 0x22b05ed2.

Solidity: function getStatus(string _link) view returns((uint256,uint256,uint256,uint256) _linkStats)

func (*BMCCaller) TryDecodeBMCService

func (_BMC *BMCCaller) TryDecodeBMCService(opts *bind.CallOpts, _msg []byte) (TypesBMCService, error)

TryDecodeBMCService is a free data retrieval call binding the contract method 0x2294c488.

Solidity: function tryDecodeBMCService(bytes _msg) pure returns((string,bytes))

func (*BMCCaller) TryDecodeBTPMessage

func (_BMC *BMCCaller) TryDecodeBTPMessage(opts *bind.CallOpts, _rlp []byte) (TypesBMCMessage, error)

TryDecodeBTPMessage is a free data retrieval call binding the contract method 0x23c31a43.

Solidity: function tryDecodeBTPMessage(bytes _rlp) pure returns((string,string,string,int256,bytes))

func (*BMCCaller) TryDecodeGatherFeeMessage

func (_BMC *BMCCaller) TryDecodeGatherFeeMessage(opts *bind.CallOpts, _msg []byte) (TypesGatherFeeMessage, error)

TryDecodeGatherFeeMessage is a free data retrieval call binding the contract method 0x9624379f.

Solidity: function tryDecodeGatherFeeMessage(bytes _msg) pure returns((string,string[]))

type BMCCallerRaw

type BMCCallerRaw struct {
	Contract *BMCCaller // Generic read-only contract binding to access the raw methods on
}

BMCCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*BMCCallerRaw) Call

func (_BMC *BMCCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type BMCCallerSession

type BMCCallerSession struct {
	Contract *BMCCaller    // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts // Call options to use throughout this session
}

BMCCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*BMCCallerSession) GetBmcBtpAddress

func (_BMC *BMCCallerSession) GetBmcBtpAddress() (string, error)

GetBmcBtpAddress is a free data retrieval call binding the contract method 0x2a4011e9.

Solidity: function getBmcBtpAddress() view returns(string)

func (*BMCCallerSession) GetStatus

func (_BMC *BMCCallerSession) GetStatus(_link string) (TypesLinkStats, error)

GetStatus is a free data retrieval call binding the contract method 0x22b05ed2.

Solidity: function getStatus(string _link) view returns((uint256,uint256,uint256,uint256) _linkStats)

func (*BMCCallerSession) TryDecodeBMCService

func (_BMC *BMCCallerSession) TryDecodeBMCService(_msg []byte) (TypesBMCService, error)

TryDecodeBMCService is a free data retrieval call binding the contract method 0x2294c488.

Solidity: function tryDecodeBMCService(bytes _msg) pure returns((string,bytes))

func (*BMCCallerSession) TryDecodeBTPMessage

func (_BMC *BMCCallerSession) TryDecodeBTPMessage(_rlp []byte) (TypesBMCMessage, error)

TryDecodeBTPMessage is a free data retrieval call binding the contract method 0x23c31a43.

Solidity: function tryDecodeBTPMessage(bytes _rlp) pure returns((string,string,string,int256,bytes))

func (*BMCCallerSession) TryDecodeGatherFeeMessage

func (_BMC *BMCCallerSession) TryDecodeGatherFeeMessage(_msg []byte) (TypesGatherFeeMessage, error)

TryDecodeGatherFeeMessage is a free data retrieval call binding the contract method 0x9624379f.

Solidity: function tryDecodeGatherFeeMessage(bytes _msg) pure returns((string,string[]))

type BMCErrorOnBTPError

type BMCErrorOnBTPError struct {
	Svc        string
	Sn         *big.Int
	Code       *big.Int
	ErrMsg     string
	SvcErrCode *big.Int
	SvcErrMsg  string
	Raw        types.Log // Blockchain specific contextual infos
}

BMCErrorOnBTPError represents a ErrorOnBTPError event raised by the BMC contract.

type BMCErrorOnBTPErrorIterator

type BMCErrorOnBTPErrorIterator struct {
	Event *BMCErrorOnBTPError // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

BMCErrorOnBTPErrorIterator is returned from FilterErrorOnBTPError and is used to iterate over the raw logs and unpacked data for ErrorOnBTPError events raised by the BMC contract.

func (*BMCErrorOnBTPErrorIterator) Close

func (it *BMCErrorOnBTPErrorIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*BMCErrorOnBTPErrorIterator) Error

func (it *BMCErrorOnBTPErrorIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*BMCErrorOnBTPErrorIterator) Next

func (it *BMCErrorOnBTPErrorIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type BMCFilterer

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

BMCFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewBMCFilterer

func NewBMCFilterer(address common.Address, filterer bind.ContractFilterer) (*BMCFilterer, error)

NewBMCFilterer creates a new log filterer instance of BMC, bound to a specific deployed contract.

func (*BMCFilterer) FilterErrorOnBTPError

func (_BMC *BMCFilterer) FilterErrorOnBTPError(opts *bind.FilterOpts) (*BMCErrorOnBTPErrorIterator, error)

FilterErrorOnBTPError is a free log retrieval operation binding the contract event 0x45eab163faa71c8b113fcbc0dcc77bd39e7e3365be446895b5169bd97fc5522a.

Solidity: event ErrorOnBTPError(string _svc, int256 _sn, uint256 _code, string _errMsg, uint256 _svcErrCode, string _svcErrMsg)

func (*BMCFilterer) FilterInitialized

func (_BMC *BMCFilterer) FilterInitialized(opts *bind.FilterOpts) (*BMCInitializedIterator, error)

FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498.

Solidity: event Initialized(uint8 version)

func (*BMCFilterer) FilterMessage

func (_BMC *BMCFilterer) FilterMessage(opts *bind.FilterOpts) (*BMCMessageIterator, error)

FilterMessage is a free log retrieval operation binding the contract event 0x37be353f216cf7e33639101fd610c542e6a0c0109173fa1c1d8b04d34edb7c1b.

Solidity: event Message(string _next, uint256 _seq, bytes _msg)

func (*BMCFilterer) ParseErrorOnBTPError

func (_BMC *BMCFilterer) ParseErrorOnBTPError(log types.Log) (*BMCErrorOnBTPError, error)

ParseErrorOnBTPError is a log parse operation binding the contract event 0x45eab163faa71c8b113fcbc0dcc77bd39e7e3365be446895b5169bd97fc5522a.

Solidity: event ErrorOnBTPError(string _svc, int256 _sn, uint256 _code, string _errMsg, uint256 _svcErrCode, string _svcErrMsg)

func (*BMCFilterer) ParseInitialized

func (_BMC *BMCFilterer) ParseInitialized(log types.Log) (*BMCInitialized, error)

ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498.

Solidity: event Initialized(uint8 version)

func (*BMCFilterer) ParseMessage

func (_BMC *BMCFilterer) ParseMessage(log types.Log) (*BMCMessage, error)

ParseMessage is a log parse operation binding the contract event 0x37be353f216cf7e33639101fd610c542e6a0c0109173fa1c1d8b04d34edb7c1b.

Solidity: event Message(string _next, uint256 _seq, bytes _msg)

func (*BMCFilterer) WatchErrorOnBTPError

func (_BMC *BMCFilterer) WatchErrorOnBTPError(opts *bind.WatchOpts, sink chan<- *BMCErrorOnBTPError) (event.Subscription, error)

WatchErrorOnBTPError is a free log subscription operation binding the contract event 0x45eab163faa71c8b113fcbc0dcc77bd39e7e3365be446895b5169bd97fc5522a.

Solidity: event ErrorOnBTPError(string _svc, int256 _sn, uint256 _code, string _errMsg, uint256 _svcErrCode, string _svcErrMsg)

func (*BMCFilterer) WatchInitialized

func (_BMC *BMCFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *BMCInitialized) (event.Subscription, error)

WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498.

Solidity: event Initialized(uint8 version)

func (*BMCFilterer) WatchMessage

func (_BMC *BMCFilterer) WatchMessage(opts *bind.WatchOpts, sink chan<- *BMCMessage) (event.Subscription, error)

WatchMessage is a free log subscription operation binding the contract event 0x37be353f216cf7e33639101fd610c542e6a0c0109173fa1c1d8b04d34edb7c1b.

Solidity: event Message(string _next, uint256 _seq, bytes _msg)

type BMCInitialized

type BMCInitialized struct {
	Version uint8
	Raw     types.Log // Blockchain specific contextual infos
}

BMCInitialized represents a Initialized event raised by the BMC contract.

type BMCInitializedIterator

type BMCInitializedIterator struct {
	Event *BMCInitialized // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

BMCInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the BMC contract.

func (*BMCInitializedIterator) Close

func (it *BMCInitializedIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*BMCInitializedIterator) Error

func (it *BMCInitializedIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*BMCInitializedIterator) Next

func (it *BMCInitializedIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type BMCMessage

type BMCMessage struct {
	Next string
	Seq  *big.Int
	Msg  []byte
	Raw  types.Log // Blockchain specific contextual infos
}

BMCMessage represents a Message event raised by the BMC contract.

type BMCMessageIterator

type BMCMessageIterator struct {
	Event *BMCMessage // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

BMCMessageIterator is returned from FilterMessage and is used to iterate over the raw logs and unpacked data for Message events raised by the BMC contract.

func (*BMCMessageIterator) Close

func (it *BMCMessageIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*BMCMessageIterator) Error

func (it *BMCMessageIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*BMCMessageIterator) Next

func (it *BMCMessageIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type BMCRaw

type BMCRaw struct {
	Contract *BMC // Generic contract binding to access the raw methods on
}

BMCRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*BMCRaw) Call

func (_BMC *BMCRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*BMCRaw) Transact

func (_BMC *BMCRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*BMCRaw) Transfer

func (_BMC *BMCRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type BMCRelayMethodParams

type BMCRelayMethodParams struct {
	Prev     string `json:"_prev"`
	Messages string `json:"_msg"`
}

type BMCSession

type BMCSession struct {
	Contract     *BMC              // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

BMCSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*BMCSession) GetBmcBtpAddress

func (_BMC *BMCSession) GetBmcBtpAddress() (string, error)

GetBmcBtpAddress is a free data retrieval call binding the contract method 0x2a4011e9.

Solidity: function getBmcBtpAddress() view returns(string)

func (*BMCSession) GetStatus

func (_BMC *BMCSession) GetStatus(_link string) (TypesLinkStats, error)

GetStatus is a free data retrieval call binding the contract method 0x22b05ed2.

Solidity: function getStatus(string _link) view returns((uint256,uint256,uint256,uint256) _linkStats)

func (*BMCSession) HandleRelayMessage

func (_BMC *BMCSession) HandleRelayMessage(_prev string, _msg []byte) (*types.Transaction, error)

HandleRelayMessage is a paid mutator transaction binding the contract method 0x21b1e9bb.

Solidity: function handleRelayMessage(string _prev, bytes _msg) returns()

func (*BMCSession) Initialize

func (_BMC *BMCSession) Initialize(_network string, _bmcManagementAddr common.Address) (*types.Transaction, error)

Initialize is a paid mutator transaction binding the contract method 0x7ab4339d.

Solidity: function initialize(string _network, address _bmcManagementAddr) returns()

func (*BMCSession) SendMessage

func (_BMC *BMCSession) SendMessage(_to string, _svc string, _sn *big.Int, _msg []byte) (*types.Transaction, error)

SendMessage is a paid mutator transaction binding the contract method 0xbf6c1d9a.

Solidity: function sendMessage(string _to, string _svc, uint256 _sn, bytes _msg) returns()

func (*BMCSession) TryDecodeBMCService

func (_BMC *BMCSession) TryDecodeBMCService(_msg []byte) (TypesBMCService, error)

TryDecodeBMCService is a free data retrieval call binding the contract method 0x2294c488.

Solidity: function tryDecodeBMCService(bytes _msg) pure returns((string,bytes))

func (*BMCSession) TryDecodeBTPMessage

func (_BMC *BMCSession) TryDecodeBTPMessage(_rlp []byte) (TypesBMCMessage, error)

TryDecodeBTPMessage is a free data retrieval call binding the contract method 0x23c31a43.

Solidity: function tryDecodeBTPMessage(bytes _rlp) pure returns((string,string,string,int256,bytes))

func (*BMCSession) TryDecodeGatherFeeMessage

func (_BMC *BMCSession) TryDecodeGatherFeeMessage(_msg []byte) (TypesGatherFeeMessage, error)

TryDecodeGatherFeeMessage is a free data retrieval call binding the contract method 0x9624379f.

Solidity: function tryDecodeGatherFeeMessage(bytes _msg) pure returns((string,string[]))

type BMCStatus

type BMCStatus struct {
	TxSeq            HexInt `json:"tx_seq"`
	RxSeq            HexInt `json:"rx_seq"`
	BMRIndex         HexInt `json:"relay_idx"`
	RotateHeight     HexInt `json:"rotate_height"`
	RotateTerm       HexInt `json:"rotate_term"`
	DelayLimit       HexInt `json:"delay_limit"`
	MaxAggregation   HexInt `json:"max_agg"`
	CurrentHeight    HexInt `json:"cur_height"`
	RxHeight         HexInt `json:"rx_height"`
	RxHeightSrc      HexInt `json:"rx_height_src"`
	BlockIntervalSrc HexInt `json:"block_interval_src"`
	BlockIntervalDst HexInt `json:"block_interval_dst"`
}

type BMCTransactor

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

BMCTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewBMCTransactor

func NewBMCTransactor(address common.Address, transactor bind.ContractTransactor) (*BMCTransactor, error)

NewBMCTransactor creates a new write-only instance of BMC, bound to a specific deployed contract.

func (*BMCTransactor) HandleRelayMessage

func (_BMC *BMCTransactor) HandleRelayMessage(opts *bind.TransactOpts, _prev string, _msg []byte) (*types.Transaction, error)

HandleRelayMessage is a paid mutator transaction binding the contract method 0x21b1e9bb.

Solidity: function handleRelayMessage(string _prev, bytes _msg) returns()

func (*BMCTransactor) Initialize

func (_BMC *BMCTransactor) Initialize(opts *bind.TransactOpts, _network string, _bmcManagementAddr common.Address) (*types.Transaction, error)

Initialize is a paid mutator transaction binding the contract method 0x7ab4339d.

Solidity: function initialize(string _network, address _bmcManagementAddr) returns()

func (*BMCTransactor) SendMessage

func (_BMC *BMCTransactor) SendMessage(opts *bind.TransactOpts, _to string, _svc string, _sn *big.Int, _msg []byte) (*types.Transaction, error)

SendMessage is a paid mutator transaction binding the contract method 0xbf6c1d9a.

Solidity: function sendMessage(string _to, string _svc, uint256 _sn, bytes _msg) returns()

type BMCTransactorRaw

type BMCTransactorRaw struct {
	Contract *BMCTransactor // Generic write-only contract binding to access the raw methods on
}

BMCTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*BMCTransactorRaw) Transact

func (_BMC *BMCTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*BMCTransactorRaw) Transfer

func (_BMC *BMCTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type BMCTransactorSession

type BMCTransactorSession struct {
	Contract     *BMCTransactor    // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

BMCTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*BMCTransactorSession) HandleRelayMessage

func (_BMC *BMCTransactorSession) HandleRelayMessage(_prev string, _msg []byte) (*types.Transaction, error)

HandleRelayMessage is a paid mutator transaction binding the contract method 0x21b1e9bb.

Solidity: function handleRelayMessage(string _prev, bytes _msg) returns()

func (*BMCTransactorSession) Initialize

func (_BMC *BMCTransactorSession) Initialize(_network string, _bmcManagementAddr common.Address) (*types.Transaction, error)

Initialize is a paid mutator transaction binding the contract method 0x7ab4339d.

Solidity: function initialize(string _network, address _bmcManagementAddr) returns()

func (*BMCTransactorSession) SendMessage

func (_BMC *BMCTransactorSession) SendMessage(_to string, _svc string, _sn *big.Int, _msg []byte) (*types.Transaction, error)

SendMessage is a paid mutator transaction binding the contract method 0xbf6c1d9a.

Solidity: function sendMessage(string _to, string _svc, uint256 _sn, bytes _msg) returns()

type BlockNotification

type BlockNotification struct {
	Hash          common.Hash
	Height        *big.Int
	Header        *subEthTypes.Header
	Receipts      types.Receipts
	HasBTPMessage *bool
}

type BlockRequest

type BlockRequest struct {
	Height             *big.Int       `json:"height"`
	EventFilters       []*EventFilter `json:"eventFilters,omitempty"`
	SrcContractAddress common.Address `json:"srcContractAddress,omitempty"`
}

type BnOptions

type BnOptions struct {
	StartHeight uint64
	Concurrency uint64
}

type Client

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

grouped rpc api clients

func (*Client) GetBalance

func (cl *Client) GetBalance(ctx context.Context, hexAddr string) (*big.Int, error)

func (*Client) GetBlockNumber

func (cl *Client) GetBlockNumber() (uint64, error)

func (*Client) GetBlockReceiptsFromHeight

func (cl *Client) GetBlockReceiptsFromHeight(height *big.Int) (ethTypes.Receipts, error)

func (*Client) GetChainID

func (c *Client) GetChainID() *big.Int

func (*Client) GetEthClient

func (c *Client) GetEthClient() *ethclient.Client

func (*Client) GetHeaderByHeight

func (cl *Client) GetHeaderByHeight(height *big.Int) (*subEthTypes.Header, error)

func (*Client) GetMedianGasPriceForBlock

func (c *Client) GetMedianGasPriceForBlock(ctx context.Context) (gasPrice *big.Int, gasHeight *big.Int, err error)

func (*Client) Log

func (c *Client) Log() log.Logger

type EVMLog

type EVMLog struct {
	Address     string
	Topics      [][]byte
	Data        []byte
	BlockNumber uint64
	TxHash      []byte
	TxIndex     uint
	BlockHash   []byte
	Index       uint
	Removed     bool
}

func MakeLog

func MakeLog(log *types.Log) *EVMLog

type EventFilter

type EventFilter struct {
	Addr      Address   `json:"addr,omitempty"`
	Signature string    `json:"event"`
	Indexed   []*string `json:"indexed,omitempty"`
	Data      []*string `json:"data,omitempty"`
}

type EventLog

type EventLog struct {
	Addr    []byte
	Indexed [][]byte
	Data    [][]byte
}

type HexBytes

type HexBytes string

HexBytes T_BIN_DATA, T_HASH

func (HexBytes) Value

func (hs HexBytes) Value() ([]byte, error)

type HexInt

type HexInt string

HexInt T_INT

func (HexInt) Int

func (i HexInt) Int() (int, error)

func (HexInt) Value

func (i HexInt) Value() (int64, error)

type IClient

type IClient interface {
	GetBalance(ctx context.Context, hexAddr string) (*big.Int, error)
	GetBlockNumber() (uint64, error)
	//GetBlockByHash(hash common.Hash) (*snowTypes.Block, error)
	GetHeaderByHeight(height *big.Int) (*subEthTypes.Header, error)
	//GetBlockReceipts(hash common.Hash) (ethTypes.Receipts, error)
	GetBlockReceiptsFromHeight(height *big.Int) (ethTypes.Receipts, error)
	GetChainID() *big.Int
	GetEthClient() *ethclient.Client
	Log() log.Logger
}

type Receipt

type Receipt struct {
	// Consensus fields: These fields are defined by the Yellow Paper
	Type              uint8
	PostState         []byte
	Status            uint64
	CumulativeGasUsed uint64
	Bloom             []byte
	Logs              []*EVMLog

	TxHash          common.Hash
	ContractAddress common.Address
	GasUsed         uint64

	BlockHash        common.Hash
	BlockNumber      uint64
	TransactionIndex uint
}

func MakeReceipt

func MakeReceipt(receipt *types.Receipt) *Receipt

type ReceiptProof

type ReceiptProof struct {
	Index  int
	Events []byte
	Height int64
}

type ReceiverOptions

type ReceiverOptions struct {
	SyncConcurrency uint64           `json:"syncConcurrency"`
	Verifier        *VerifierOptions `json:"verifier"`
}

func (*ReceiverOptions) Unmarshal

func (opts *ReceiverOptions) Unmarshal(v map[string]interface{}) error

type RelayMessage

type RelayMessage struct {
	ReceiptProofs [][]byte
	// contains filtered or unexported fields
}

type Signature

type Signature string

Signature T_SIG

type TransactionHashParam

type TransactionHashParam struct {
	Hash common.Hash
}

type TransactionParam

type TransactionParam struct {
	FromAddress string      `json:"from" validate:"required,t_addr_eoa"`
	ToAddress   string      `json:"to" validate:"required,t_addr"`
	NetworkID   HexInt      `json:"nid" validate:"required,t_int"`
	Params      interface{} `json:"params,omitempty"`
	TransactOpt *bind.TransactOpts
}

type TransactionResult

type TransactionResult struct {
	To                 Address `json:"to"`
	CumulativeStepUsed HexInt  `json:"cumulativeStepUsed"`
	StepUsed           HexInt  `json:"stepUsed"`
	StepPrice          HexInt  `json:"stepPrice"`
	EventLogs          []struct {
		Addr    Address  `json:"scoreAddress"`
		Indexed []string `json:"indexed"`
		Data    []string `json:"data"`
	} `json:"eventLogs"`
	LogsBloom HexBytes `json:"logsBloom"`
	Status    HexInt   `json:"status"`
	Failure   *struct {
		CodeValue    HexInt `json:"code"`
		MessageValue string `json:"message"`
	} `json:"failure,omitempty"`
	SCOREAddress Address  `json:"scoreAddress,omitempty"`
	BlockHash    HexBytes `json:"blockHash" validate:"required,t_hash"`
	BlockHeight  HexInt   `json:"blockHeight" validate:"required,t_int"`
	TxIndex      HexInt   `json:"txIndex" validate:"required,t_int"`
	TxHash       HexBytes `json:"txHash" validate:"required,t_int"`
}

type TypesBMCMessage

type TypesBMCMessage struct {
	Src     string
	Dst     string
	Svc     string
	Sn      *big.Int
	Message []byte
}

TypesBMCMessage is an auto generated low-level Go binding around an user-defined struct.

type TypesBMCService

type TypesBMCService struct {
	ServiceType string
	Payload     []byte
}

TypesBMCService is an auto generated low-level Go binding around an user-defined struct.

type TypesGatherFeeMessage

type TypesGatherFeeMessage struct {
	Fa   string
	Svcs []string
}

TypesGatherFeeMessage is an auto generated low-level Go binding around an user-defined struct.

type TypesLinkStats

type TypesLinkStats struct {
	RxSeq         *big.Int
	TxSeq         *big.Int
	RxHeight      *big.Int
	CurrentHeight *big.Int
}

TypesLinkStats is an auto generated low-level Go binding around an user-defined struct.

type Verifier

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

next points to height whose parentHash is expected parentHash of height h is got from next-1's hash

func (*Verifier) Next

func (vr *Verifier) Next() *big.Int

func (*Verifier) Verify

func (vr *Verifier) Verify(h *subEthTypes.Header, newHeader *subEthTypes.Header) error

type VerifierOptions

type VerifierOptions struct {
	BlockHeight uint64          `json:"blockHeight"`
	BlockHash   common.HexBytes `json:"parentHash"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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