substrate

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

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 EncodeCall(call types.Call) []byte

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

func NewWriter

func NewWriter(conn *Connection, listener *listener, log log15.Logger, sysErr chan<- error,
	m *metrics.ChainMetrics, extendCall bool, relayer Relayer, bc *chainset.ChainCore) *writer

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) Id

func (c *Chain) Id() msg.ChainId

func (*Chain) LatestBlock

func (c *Chain) LatestBlock() metrics.LatestBlock

func (*Chain) Name

func (c *Chain) Name() string

func (*Chain) SetRouter

func (c *Chain) SetRouter(r *core.Router)

func (*Chain) Start

func (c *Chain) Start() error

func (*Chain) Stop

func (c *Chain) Stop()

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 Dest

type Dest struct {
	DepositNonce msg.Nonce
	DestAddress  string
	DestAmount   string
}

type MsgStatus added in v1.0.2

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

func NewMsgStatus added in v1.0.2

func NewMsgStatus(msg msg.Message) *MsgStatus

type MultiSigAsMulti

type MultiSigAsMulti struct {
	OriginMsTx     multiSigTx
	Executed       bool
	Threshold      uint16
	Others         []OtherSignatories
	MaybeTimePoint expand.TimePointSafe32
	DestAddress    string
	DestAmount     string
	StoreCall      bool
	MaxWeight      uint64
	DepositNonce   msg.Nonce
	YesVote        []types.AccountID
}

type OtherSignatories

type OtherSignatories []string

type RedeemStatusCode added in v1.0.2

type RedeemStatusCode int
const (
	IsExecuted RedeemStatusCode = iota
	NotExecuted
	YesVoted
	UnKnownError
)

type Relayer

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

func NewRelayer

func NewRelayer(kr signature.KeyringPair, otherSignatories []types.AccountID, totalRelayers uint64,
	multiSigThreshold uint16, relayerId uint64, maxWeight uint64) Relayer

type Round

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

type TimePointSafe32

type TimePointSafe32 struct {
	Height types.OptionU32
	Index  types.U32
}

Jump to

Keyboard shortcuts

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