Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeCall(call types.Call) []byte
- func NewListener(conn *Connection, name string, id msg.ChainId, startBlock uint64, ...) *listener
- func NewWriter(conn *Connection, listener *listener, log log15.Logger, sysErr chan<- error, ...) *writer
- type BlockNumber
- type Chain
- type Connection
- type Dest
- type MsgStatus
- type MultiSigAsMulti
- type OtherSignatories
- type RedeemStatusCode
- type Relayer
- type Round
- type TimePointSafe32
Constants ¶
View Source
const ( FindNewMultiSigTx string = "Find a multiSig New extrinsic" FindApproveMultiSigTx string = "Find a multiSig Approve extrinsic" FindExecutedMultiSigTx string = "Find a multiSig Executed extrinsic" FindBatchMultiSigTx string = "Find a multiSig Batch Extrinsic" FindFailedBatchMultiSigTx string = "But Batch Extrinsic Failed" StartATx string = "Start a redeemTx..." MeetARepeatTx string = "Meet a Repeat Transaction" FindLostMultiSigTx string = "Find a Lost BatchTx" TryToMakeNewMultiSigTx string = "Try to make a New multiSig Tx!" TryToApproveMultiSigTx string = "Try to Approve a multiSigTx!" FinishARedeemTx string = "Finish a redeemTx" MultiSigExtrinsicExecuted string = "MultiSig extrinsic executed!" BlockNotYetFinalized string = "Block not yet finalized" SubListenerWorkFinished string = "Sub listener work is Finished" FailedToProcessCurrentBlock string = "Failed to process current block" FailedToWriteToBlockStore string = "Failed to write to blockStore" RelayerFinishTheTx string = "Relayer Finish the Tx" LineLog string = "------------------------------------" MaybeAProblem string = "There may be a problem with the deal" RedeemTxTryTooManyTimes string = "Redeem Tx failed, try too many times" MultiSigExtrinsicError string = "MultiSig extrinsic err! UnknownError(amount、chainId...)" RedeemNegAmountError string = "Redeem a neg amount" NewBalancesTransferCallError string = "New Balances.transfer err" NewBalancesTransferKeepAliveCallError string = "New Balances.transferKeepAlive err" NewXAssetsTransferCallError string = "New XAssets.Transfer err" NewCrossChainTransferCallError string = "New Cross-Chain Transfer err" NewMultiCallError string = "New MultiCall err" NewApiError string = "New api error" SignmultiSigTxFailed string = "Sign multiSigTx failed" SubmitExtrinsicFailed string = "Submit Extrinsic Failed" GetMetadataError string = "Get Metadata Latest err" GetBlockHashError string = "Get BlockHash Latest err" GetBlockByNumberError string = "Get BlockByNumber err" GetRuntimeVersionLatestError string = "Get RuntimeVersionLatest Latest err" GetStorageLatestError string = "Get StorageLatest Latest err" CreateStorageKeyError string = "Create StorageKey err" ProcessBlockError string = "ProcessBlock err, check it" )
View Source
const FungibleTransfer eventName = "FungibleTransfer"
View Source
const GenericTransfer eventName = "GenericTransfer"
View Source
const HexPrefix = "hex"
View Source
const InitCapacity = 100
Frequency of polling for a new block
View Source
const NativeTransfer eventName = "NativeTransfer"
View Source
const NonFungibleTransfer eventName = "NonFungibleTransfer"
View Source
const RoundInterval = time.Second * 6
Variables ¶
View Source
var ( StartBlockOpt = "startBlock" EndBlockOpt = "endBlock" LostAddressOpt = "lostAddress" UseExtendedCallOpt = "useExtendedCall" TotalRelayerOpt = "totalRelayer" //OtherRelayerOpt = "otherRelayer" RelayerOpt = "relayerId" MultiSigAddressOpt = "multiSigAddress" MaxWeightOpt = "maxWeight" DestIdOpt = "destId" ResourceIdOpt = "resourceId" MultiSigThresholdOpt = "multiSigThreshold" OtherRelayerOpt = "otherRelayer" )
Chain specific options
View Source
var AcknowledgeProposal utils.Method = utils.BridgePalletName + ".acknowledge_proposal"
View Source
var BlockRetryInterval = time.Second * 5
View Source
var BlockRetryLimit = 15
View Source
var ErrBlockNotReady = errors.New("required result to be 32 bytes, but got 0")
View Source
var RedeemRetryLimit = 15
View Source
var Subscriptions = []struct { name eventName handler eventHandler }{ {NativeTransfer, nativeTransferHandler}, {FungibleTransfer, fungibleTransferHandler}, {NonFungibleTransfer, nonFungibleTransferHandler}, {GenericTransfer, genericTransferHandler}, }
View Source
var TerminatedError = errors.New("terminated")
Functions ¶
func EncodeCall ¶
func NewListener ¶
func NewListener( conn *Connection, name string, id msg.ChainId, startBlock uint64, endBlock uint64, lostAddress string, log log15.Logger, bs blockstore.Blockstorer, stop <-chan int, sysErr chan<- error, m *metrics.ChainMetrics, multiSigAddress types.AccountID, relayer Relayer, bc *chainset.ChainCore) *listener
Types ¶
type BlockNumber ¶
type BlockNumber int64
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func InitializeChain ¶
func InitializeChain(cfg *core.ChainConfig, logger log15.Logger, sysErr chan<- error, m *metrics.ChainMetrics) (*Chain, error)
func (*Chain) LatestBlock ¶
func (c *Chain) LatestBlock() metrics.LatestBlock
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(url string, endpoint []string, name string, key *signature.KeyringPair, log log15.Logger, stop <-chan int, sysErr chan<- error) *Connection
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) Connect ¶
func (c *Connection) Connect() error
func (*Connection) Reconnect ¶
func (c *Connection) Reconnect() error
func (*Connection) SubmitTx ¶
func (c *Connection) SubmitTx(method utils.Method, args ...interface{}) error
SubmitTx constructs and submits an extrinsic to call the method with the given arguments. All args are passed directly into GSRPC. GSRPC types are recommended to avoid serialization inconsistencies.
type MsgStatus ¶ added in v1.0.2
type MsgStatus struct {
// contains filtered or unexported fields
}
func NewMsgStatus ¶ added in v1.0.2
type MultiSigAsMulti ¶
type OtherSignatories ¶
type OtherSignatories []string
type RedeemStatusCode ¶ added in v1.0.2
type RedeemStatusCode int
const ( IsExecuted RedeemStatusCode = iota NotExecuted YesVoted UnKnownError )
Click to show internal directories.
Click to hide internal directories.