Documentation ¶
Index ¶
- Variables
- func LoadGenesisState(bytes []byte) (map[string]*types.AssetDetails, error)
- type Asset
- func (a *Asset) BuiltinAsset() (*builtin.Builtin, bool)
- func (a *Asset) DecimalPlaces() uint64
- func (a *Asset) ERC20() (*erc20.ERC20, bool)
- func (a *Asset) IsBuiltinAsset() bool
- func (a *Asset) IsERC20() bool
- func (a *Asset) ToAssetType() *types.Asset
- func (a *Asset) Update(updatedAsset *Asset) error
- type AssetDetails
- type BuiltinAsset
- type Config
- type ERC20BridgeView
- type Erc20
- type GenesisState
- type Notary
- type Service
- func (s *Service) ApplyAssetUpdate(ctx context.Context, assetID string) error
- func (s *Service) Checkpoint() ([]byte, error)
- func (s *Service) Enable(ctx context.Context, assetID string) error
- func (s *Service) EnactPendingAsset(id string)
- func (s *Service) ExistsForEthereumAddress(address string) bool
- func (s *Service) Get(assetID string) (*Asset, error)
- func (s *Service) GetEnabledAssets() []*types.Asset
- func (s *Service) GetState(k string) ([]byte, []types.StateProvider, error)
- func (s *Service) GetVegaIDFromEthereumAddress(address string) string
- func (s *Service) IsEnabled(assetID string) bool
- func (s *Service) Keys() []string
- func (s *Service) Load(ctx context.Context, cp []byte) error
- func (s *Service) LoadState(ctx context.Context, p *types.Payload) ([]types.StateProvider, error)
- func (*Service) Name() types.CheckpointName
- func (s *Service) Namespace() types.SnapshotNamespace
- func (s *Service) NewAsset(ctx context.Context, proposalID string, assetDetails *types.AssetDetails) (string, error)
- func (s *Service) ReloadConf(cfg Config)
- func (s *Service) SetPendingListing(ctx context.Context, assetID string) error
- func (s *Service) SetRejected(ctx context.Context, assetID string) error
- func (s *Service) StageAssetUpdate(updatedAssetProto *types.Asset) error
- func (s *Service) Stopped() bool
- func (s *Service) ValidateAsset(assetID string) error
- func (s *Service) ValidateAssetNonValidator(assetID string) error
- type Source
Constants ¶
This section is empty.
Variables ¶
var ( ErrAssetInvalid = errors.New("asset invalid") ErrAssetDoesNotExist = errors.New("asset does not exist") ErrUnknownAssetSource = errors.New("unknown asset source") )
var ErrUpdatingAssetWithDifferentTypeOfAsset = errors.New("updating asset with different type of asset")
Functions ¶
func LoadGenesisState ¶
func LoadGenesisState(bytes []byte) (map[string]*types.AssetDetails, error)
Types ¶
type Asset ¶
type Asset struct {
// contains filtered or unexported fields
}
func (*Asset) DecimalPlaces ¶
func (*Asset) IsBuiltinAsset ¶
func (*Asset) ToAssetType ¶
type AssetDetails ¶
type AssetDetails struct { Name string `json:"name"` Symbol string `json:"symbol"` Decimals uint64 `json:"decimals"` Quantum string `json:"quantum"` Source *Source `json:"source"` }
func (*AssetDetails) IntoProto ¶
func (a *AssetDetails) IntoProto() (*types.AssetDetails, error)
type BuiltinAsset ¶
type BuiltinAsset struct {
MaxFaucetAmountMint string `json:"max_faucet_amount_mint"`
}
type Config ¶
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.
type ERC20BridgeView ¶
type ERC20BridgeView interface {
FindAsset(asset *types.AssetDetails) error
}
type GenesisState ¶
type GenesisState map[string]AssetDetails
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
type Notary ¶ added in v0.55.0
type Notary interface {
StartAggregate(resID string, kind types.NodeSignatureKind, signature []byte)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New( log *logging.Logger, cfg Config, nw *nodewallets.NodeWallets, ethClient erc20.ETHClient, broker broker.Interface, bridgeView ERC20BridgeView, notary Notary, isValidator bool, ) *Service
func (*Service) ApplyAssetUpdate ¶
func (*Service) Checkpoint ¶
func (*Service) Enable ¶
Enable move the state of an from pending the list of valid and accepted assets.
func (*Service) EnactPendingAsset ¶ added in v0.55.0
EnactPendingAsset the given id for an asset has just been enacted by the governance engine so we now need to generate signatures so that the asset can be listed.
func (*Service) ExistsForEthereumAddress ¶ added in v0.58.0
func (*Service) GetEnabledAssets ¶
func (*Service) GetVegaIDFromEthereumAddress ¶
func (*Service) Name ¶
func (*Service) Name() types.CheckpointName
func (*Service) Namespace ¶
func (s *Service) Namespace() types.SnapshotNamespace
func (*Service) NewAsset ¶
func (s *Service) NewAsset(ctx context.Context, proposalID string, assetDetails *types.AssetDetails) (string, error)
NewAsset add a new asset to the pending list of assets the ref is the reference of proposal which submitted the new asset returns the assetID and an error.
func (*Service) ReloadConf ¶
ReloadConf updates the internal configuration.
func (*Service) SetPendingListing ¶
SetPendingListing update the state of an asset from proposed to pending listing on the bridge.
func (*Service) SetRejected ¶
SetRejected update the state of an asset from proposed to pending listing on the bridge.
func (*Service) StageAssetUpdate ¶
func (*Service) ValidateAsset ¶
func (*Service) ValidateAssetNonValidator ¶
ValidateAssetNonValidator is only to be used by non-validators at startup when loading genesis file. We just assume assets are valid.
type Source ¶
type Source struct { BuiltinAsset *BuiltinAsset `json:"builtin_asset,omitempty"` Erc20 *Erc20 `json:"erc20,omitempty"` }