Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructErc20ProposalData(amount []byte, recipient []byte) []byte
- func ConstructErc721ProposalData(tokenId []byte, recipient []byte, metadata []byte) []byte
- func ConstructGenericProposalData(metadata []byte) []byte
- func CreateProposalDataHash(data []byte, handler common.Address, mp *utils.MerkleProof, ...) common.Hash
- func NewWriter(client ContractCaller, cfg *config.CeloChainConfig, stop <-chan struct{}, ...) *writer
- type Bridger
- type ContractCaller
Constants ¶
View Source
const ExecuteBlockWatchLimit = 100
Number of blocks to wait for an finalization event
View Source
const TxRetryInterval = time.Second * 2
Time between retrying a failed tx
View Source
const TxRetryLimit = 10
Time between retrying a failed tx
Variables ¶
View Source
var BlockRetryLimit = 5
View Source
var ErrFatalQuery = errors.New("query of chain state failed")
View Source
var ErrFatalTx = errors.New("submission of transaction failed")
View Source
var ErrNonceTooLow = errors.New("nonce too low")
View Source
var ErrTxUnderpriced = errors.New("replacement transaction underpriced")
View Source
var ProposalNotPassedStatus uint8 = 1
View Source
var ProposalStatusCancelled uint8 = 4
View Source
var ProposalStatusPassed uint8 = 2
View Source
var ProposalStatusTransferred uint8 = 3
Functions ¶
func ConstructErc20ProposalData ¶
constructErc20ProposalData returns the bytes to construct a proposal suitable for Erc20
func ConstructErc721ProposalData ¶
ConstructErc721ProposalData returns the bytes to construct a proposal suitable for Erc721
func ConstructGenericProposalData ¶
constructGenericProposalData returns the bytes to construct a generic proposal
func CreateProposalDataHash ¶
func CreateProposalDataHash(data []byte, handler common.Address, mp *utils.MerkleProof, sv *utils.SignatureVerification) common.Hash
CreateProposalDataHash constructs and returns proposal data hash https://github.com/ChainSafe/chainbridge-celo-solidity/blob/1fae9c66a07139c277b03a09877414024867a8d9/contracts/Bridge.sol#L452-L454
func NewWriter ¶
func NewWriter(client ContractCaller, cfg *config.CeloChainConfig, stop <-chan struct{}, sysErr chan<- error, m *metrics.ChainMetrics) *writer
NewWriter creates and returns writer
Types ¶
type Bridger ¶
type Bridger interface { GetProposal(opts *bind.CallOpts, originChainID uint8, depositNonce uint64, dataHash [32]byte) (Bridge.BridgeProposal, error) HasVotedOnProposal(opts *bind.CallOpts, arg0 *big.Int, arg1 [32]byte, arg2 common.Address) (bool, error) VoteProposal(opts *bind.TransactOpts, chainID uint8, depositNonce uint64, resourceID [32]byte, dataHash [32]byte) (*types.Transaction, error) ExecuteProposal(opts *bind.TransactOpts, chainID uint8, depositNonce uint64, data []byte, resourceID [32]byte, signatureHeader []byte, aggregatePublicKey []byte, hashedMessage [32]byte, rootHash [32]byte, key []byte, nodes []byte) (*types.Transaction, error) }
type ContractCaller ¶
type ContractCaller interface { client.LogFilterWithLatestBlock CallOpts() *bind.CallOpts Opts() *bind.TransactOpts LockAndUpdateOpts() error UnlockOpts() WaitForBlock(block *big.Int) error }
Click to show internal directories.
Click to hide internal directories.