Documentation ¶
Index ¶
- Variables
- type Assets
- type Collateral
- type Config
- type ERC20BridgeView
- type Engine
- func (e *Engine) BridgeResumed(ctx context.Context, resumed bool, id string, block, logIndex uint64, ...) error
- func (e *Engine) BridgeStopped(ctx context.Context, stopped bool, id string, block, logIndex uint64, ...) error
- func (e *Engine) CancelTransferFunds(ctx context.Context, cancel *types.CancelTransferFunds) error
- func (e *Engine) Checkpoint() ([]byte, error)
- func (e *Engine) DepositBuiltinAsset(ctx context.Context, d *types.BuiltinAssetDeposit, id string, nonce uint64) error
- func (e *Engine) DepositERC20(ctx context.Context, d *types.ERC20Deposit, id string, ...) error
- func (e *Engine) ERC20WithdrawalEvent(ctx context.Context, w *types.ERC20Withdrawal, blockNumber, txIndex uint64, ...) error
- func (e *Engine) EnableBuiltinAsset(ctx context.Context, assetID string) error
- func (e *Engine) EnableERC20(_ context.Context, al *types.ERC20AssetList, id string, ...) error
- func (e *Engine) GetState(k string) ([]byte, []types.StateProvider, error)
- func (e *Engine) HasChanged(k string) bool
- func (e *Engine) Keys() []string
- func (e *Engine) Load(ctx context.Context, data []byte) error
- func (e *Engine) LoadState(ctx context.Context, p *types.Payload) ([]types.StateProvider, error)
- func (e *Engine) Name() types.CheckpointName
- func (e *Engine) Namespace() types.SnapshotNamespace
- func (e *Engine) OnEpoch(ctx context.Context, ep types.Epoch)
- func (e *Engine) OnEpochRestore(ctx context.Context, ep types.Epoch)
- func (e *Engine) OnMinTransferQuantumMultiple(ctx context.Context, f num.Decimal) error
- func (e *Engine) OnTick(ctx context.Context, _ time.Time)
- func (e *Engine) OnTransferFeeFactorUpdate(ctx context.Context, f num.Decimal) error
- func (e *Engine) ReloadConf(cfg Config)
- func (e *Engine) Stopped() bool
- func (e *Engine) TransferFunds(ctx context.Context, transfer *types.TransferFunds) error
- func (e *Engine) UpdateERC20(_ context.Context, event *types.ERC20AssetLimitsUpdated, id string, ...) error
- func (e *Engine) WithdrawBuiltinAsset(ctx context.Context, id, party, assetID string, amount *num.Uint) error
- func (e *Engine) WithdrawERC20(ctx context.Context, id, party, assetID string, amount *num.Uint, ...) error
- type EpochService
- type MarketActivityTracker
- type Notary
- type TimeService
- type Topology
- type Witness
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRecurringTransferDoesNotExists = errors.New("recurring transfer does not exists") ErrCannotCancelOtherPartiesRecurringTransfers = errors.New("cannot cancel other parties recurring transfers") )
View Source
var ( ErrWrongAssetTypeUsedInBuiltinAssetChainEvent = errors.New("non builtin asset used for builtin asset chain event") ErrWrongAssetTypeUsedInERC20ChainEvent = errors.New("non ERC20 for ERC20 chain event") ErrWrongAssetUsedForERC20Withdraw = errors.New("non erc20 asset used for lock withdraw") ErrInvalidWithdrawalState = errors.New("invalid withdrawal state") ErrNotMatchingWithdrawalForReference = errors.New("invalid reference for withdrawal chain event") ErrWithdrawalNotReady = errors.New("withdrawal not ready") ErrNotEnoughFundsToTransfer = errors.New("not enough funds to transfer") )
View Source
var ( ErrInvalidWithdrawalReferenceNonce = errors.New("invalid withdrawal reference nonce") ErrAssetAlreadyBeingListed = errors.New("asset already being listed") ErrWithdrawalDisabledWhenBridgeIsStopped = errors.New("withdrawal issuance is disabled when the erc20 is stopped") )
View Source
var ( ErrStartEpochInThePast = errors.New("start epoch in the past") ErrCannotSubmitDuplicateRecurringTransferWithSameFromAndTo = errors.New("cannot submit duplicate recurring transfer with same from and to") )
View Source
var ErrUnknownAssetAction = errors.New("unknown asset action")
View Source
var ErrUnsupportedTransferKind = errors.New("unsupported transfer kind")
Functions ¶
This section is empty.
Types ¶
type Collateral ¶
type Collateral interface { Deposit(ctx context.Context, party, asset string, amount *num.Uint) (*types.TransferResponse, error) Withdraw(ctx context.Context, party, asset string, amount *num.Uint) (*types.TransferResponse, error) EnableAsset(ctx context.Context, asset types.Asset) error GetPartyGeneralAccount(party, asset string) (*types.Account, error) TransferFunds(ctx context.Context, transfers []*types.Transfer, accountTypes []types.AccountType, references []string, feeTransfers []*types.Transfer, feeTransfersAccountTypes []types.AccountType, ) ([]*types.TransferResponse, error) PropagateAssetUpdate(ctx context.Context, asset types.Asset) error }
Collateral engine.
type Config ¶
Config represents governance specific configuration.
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration.
type ERC20BridgeView ¶
type ERC20BridgeView interface { FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64) error FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64) error FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64) error FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string) error FindAssetLimitsUpdated(update *types.ERC20AssetLimitsUpdated, blockNumber uint64, logIndex uint64, ethAssetAddress string) error }
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func New ¶
func New( log *logging.Logger, cfg Config, col Collateral, witness Witness, tsvc TimeService, assets Assets, notary Notary, broker broker.Interface, top Topology, epoch EpochService, marketActivityTracker MarketActivityTracker, bridgeView ERC20BridgeView, ) (e *Engine)
func (*Engine) BridgeResumed ¶
func (*Engine) BridgeStopped ¶
func (*Engine) CancelTransferFunds ¶
func (*Engine) Checkpoint ¶
func (*Engine) DepositBuiltinAsset ¶
func (*Engine) DepositERC20 ¶
func (*Engine) ERC20WithdrawalEvent ¶
func (*Engine) EnableBuiltinAsset ¶
func (*Engine) EnableERC20 ¶
func (*Engine) HasChanged ¶
func (*Engine) Name ¶
func (e *Engine) Name() types.CheckpointName
func (*Engine) Namespace ¶
func (e *Engine) Namespace() types.SnapshotNamespace
func (*Engine) OnEpochRestore ¶
func (*Engine) OnMinTransferQuantumMultiple ¶
func (*Engine) OnTransferFeeFactorUpdate ¶
func (*Engine) ReloadConf ¶
ReloadConf updates the internal configuration.
func (*Engine) TransferFunds ¶
func (*Engine) UpdateERC20 ¶
func (*Engine) WithdrawBuiltinAsset ¶
type EpochService ¶
type EpochService interface {
NotifyOnEpoch(f func(context.Context, types.Epoch), r func(context.Context, types.Epoch))
}
Epochervice ...
type MarketActivityTracker ¶
type MarketActivityTracker interface { GetMarketScores(asset string, markets []string, dispatchMetric proto.DispatchMetric) []*types.MarketContributionScore GetMarketsWithEligibleProposer(asset string, markets []string, payoutAsset string, funder string) []*types.MarketContributionScore MarkPaidProposer(market, payoutAsset string, marketsInScope []string, funder string) }
type Notary ¶
type Notary interface { StartAggregate(resID string, kind types.NodeSignatureKind, signature []byte) IsSigned(ctx context.Context, id string, kind types.NodeSignatureKind) ([]types.NodeSignature, bool) OfferSignatures(kind types.NodeSignatureKind, f func(resources string) []byte) }
type TimeService ¶
TimeService provide the time of the vega node using the tm time.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.