staking

package
v0.70.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEventAlreadyExists = errors.New("event already exists")
	ErrInvalidAmount      = errors.New("invalid amount")
	ErrInvalidEventKind   = errors.New("invalid event kind")
	ErrMissingEventID     = errors.New("missing event id")
	ErrMissingTimestamp   = errors.New("missing timestamp")
	ErrNegativeBalance    = errors.New("negative balance")
	ErrInvalidParty       = errors.New("invalid party")
)
View Source
var (
	ErrNoBalanceForParty                = errors.New("no balance for party")
	ErrStakeTotalSupplyAlreadyProcessed = errors.New("stake total supply already processed")
	ErrStakeTotalSupplyBeingProcessed   = errors.New("stake total supply being processed")
)
View Source
var (
	ErrNoStakeDepositedEventFound    = errors.New("no stake deposited event found")
	ErrNoStakeRemovedEventFound      = errors.New("no stake removed event found")
	ErrMissingConfirmations          = errors.New("not enough confirmations")
	ErrInvalidStakeRemovedEventID    = errors.New("invalid stake removed event ID")
	ErrInvalidStakeDepositedEventID  = errors.New("invalid stake deposited event ID")
	ErrDuplicatedStakeDepositedEvent = errors.New("duplicated stake deposited event")
	ErrDuplicatedStakeRemovedEvent   = errors.New("duplicated stake deposited event")
)
View Source
var StakingABI = StakingMetaData.ABI

StakingABI is the input ABI used to generate the binding from. Deprecated: Use StakingMetaData.ABI instead.

View Source
var StakingMetaData = &bind.MetaData{
	ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"vega_public_key\",\"type\":\"bytes32\"}],\"name\":\"Stake_Deposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"vega_public_key\",\"type\":\"bytes32\"}],\"name\":\"Stake_Removed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"vega_public_key\",\"type\":\"bytes32\"}],\"name\":\"Stake_Transferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"staking_token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"vega_public_key\",\"type\":\"bytes32\"}],\"name\":\"stake_balance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"total_staked\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
}

StakingMetaData contains all meta data concerning the Staking contract.

Functions

func New

func New(
	log *logging.Logger,
	cfg Config,
	ts TimeService,
	broker Broker,
	witness Witness,
	ethClient AllEthereumClient,
	netp *netparams.Store,
	evtFwd EvtForwarder,
	isValidator bool,
	ethCfns EthConfirmations,
	ethEventSource EthereumEventSource,
) (*Accounting, *StakeVerifier, *Checkpoint)

Types

type Account added in v0.55.0

type Account struct {
	Party   string
	Balance *num.Uint
	Events  []*types.StakeLinking
}

func NewStakingAccount

func NewStakingAccount(party string) *Account

func (*Account) AddEvent added in v0.55.0

func (s *Account) AddEvent(evt *types.StakeLinking) error

AddEvent will add a new event to the account.

func (*Account) GetAvailableBalance added in v0.55.0

func (s *Account) GetAvailableBalance() *num.Uint

func (*Account) GetAvailableBalanceAt added in v0.55.0

func (s *Account) GetAvailableBalanceAt(at time.Time) (*num.Uint, error)

func (*Account) GetAvailableBalanceInRange added in v0.55.0

func (s *Account) GetAvailableBalanceInRange(from, to time.Time) (*num.Uint, error)

GetAvailableBalanceInRange could return a negative balance if some event are still expected to be received from the bridge.

type Accounting

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

func NewAccounting

func NewAccounting(
	log *logging.Logger,
	cfg Config,
	ts TimeService,
	broker Broker,
	ethClient EthereumClientCaller,
	evtForward EvtForwarder,
	witness Witness,
	isValidator bool,
) (acc *Accounting)

func (*Accounting) AddEvent

func (a *Accounting) AddEvent(ctx context.Context, evt *types.StakeLinking)

func (*Accounting) GetAllAvailableBalances

func (a *Accounting) GetAllAvailableBalances() map[string]*num.Uint

GetAllAvailableBalances returns the staking balance for all parties.

func (*Accounting) GetAvailableBalance

func (a *Accounting) GetAvailableBalance(party string) (*num.Uint, error)

func (*Accounting) GetAvailableBalanceAt

func (a *Accounting) GetAvailableBalanceAt(
	party string, at time.Time,
) (*num.Uint, error)

func (*Accounting) GetAvailableBalanceInRange

func (a *Accounting) GetAvailableBalanceInRange(
	party string, from, to time.Time,
) (*num.Uint, error)

func (*Accounting) GetStakingAssetTotalSupply

func (a *Accounting) GetStakingAssetTotalSupply() *num.Uint

func (*Accounting) GetState

func (a *Accounting) GetState(k string) ([]byte, []types.StateProvider, error)

func (*Accounting) Hash

func (a *Accounting) Hash() []byte

func (*Accounting) Keys

func (a *Accounting) Keys() []string

func (*Accounting) LoadState

func (a *Accounting) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)

func (*Accounting) Namespace

func (a *Accounting) Namespace() types.SnapshotNamespace

func (*Accounting) OnStateLoadStarts

func (a *Accounting) OnStateLoadStarts(_ context.Context) error

func (*Accounting) OnStateLoaded

func (a *Accounting) OnStateLoaded(_ context.Context) error

func (*Accounting) ProcessStakeTotalSupply

func (a *Accounting) ProcessStakeTotalSupply(_ context.Context, evt *types.StakeTotalSupply) error

func (*Accounting) Stopped

func (a *Accounting) Stopped() bool

func (*Accounting) UpdateStakingBridgeAddress

func (a *Accounting) UpdateStakingBridgeAddress(stakingBridgeAddress ethcmn.Address) error

type Broker

type Broker interface {
	Send(events.Event)
	SendBatch([]events.Event)
}

Broker - the event bus.

type Checkpoint

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

func NewCheckpoint

func NewCheckpoint(
	log *logging.Logger,
	accounting *Accounting,
	stakeVerifier *StakeVerifier,
	ethEventSource EthereumEventSource,
) *Checkpoint

func (*Checkpoint) Checkpoint

func (c *Checkpoint) Checkpoint() ([]byte, error)

func (*Checkpoint) Load

func (c *Checkpoint) Load(ctx context.Context, data []byte) error

func (*Checkpoint) Name

func (c *Checkpoint) Name() types.CheckpointName

type Config

type Config struct {
	Level encoding.LogLevel `long:"log-level"`
}

Config represents the configuration of the position engine.

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 EthConfirmations

type EthConfirmations interface {
	Check(uint64) error
}

type EthOnChainVerifier

type EthOnChainVerifier interface {
	CheckStakeDeposited(*types.StakeDeposited) error
	CheckStakeRemoved(*types.StakeRemoved) error
}

type EthereumClient

type EthereumClient interface {
	bind.ContractFilterer
}

type EthereumClientCaller

type EthereumClientCaller interface {
	bind.ContractCaller
}

type EthereumClientConfirmations

type EthereumClientConfirmations interface {
	HeaderByNumber(context.Context, *big.Int) (*ethtypes.Header, error)
}

type EthereumEventSource

type EthereumEventSource interface {
	UpdateStakingStartingBlock(uint64)
}

type EvtForwarder

type EvtForwarder interface {
	ForwardFromSelf(evt *commandspb.ChainEvent)
}

EvtForwarder forwarder information to the tendermint chain to be agreed on by validators.

type OnChainVerifier

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

func NewOnChainVerifier

func NewOnChainVerifier(
	cfg Config,
	log *logging.Logger,
	ethClient EthereumClient,
	ethConfirmations EthConfirmations,
) *OnChainVerifier

func (*OnChainVerifier) CheckStakeDeposited

func (o *OnChainVerifier) CheckStakeDeposited(
	event *types.StakeDeposited,
) error

func (*OnChainVerifier) CheckStakeRemoved

func (o *OnChainVerifier) CheckStakeRemoved(event *types.StakeRemoved) error

func (*OnChainVerifier) UpdateStakingBridgeAddresses

func (o *OnChainVerifier) UpdateStakingBridgeAddresses(stakingBridgeAddresses []ethcmn.Address)

type StakeVerifier

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

func NewStakeVerifier

func NewStakeVerifier(
	log *logging.Logger,
	cfg Config,
	accs *Accounting,
	witness Witness,
	ts TimeService,

	broker Broker,
	onChainVerifier EthOnChainVerifier,
	ethEventSource EthereumEventSource,
) (sv *StakeVerifier)

func (*StakeVerifier) GetState

func (s *StakeVerifier) GetState(k string) ([]byte, []types.StateProvider, error)

func (*StakeVerifier) Keys

func (s *StakeVerifier) Keys() []string

func (*StakeVerifier) LoadState

func (s *StakeVerifier) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)

func (*StakeVerifier) Namespace

func (s *StakeVerifier) Namespace() types.SnapshotNamespace

func (*StakeVerifier) OnStateLoaded

func (s *StakeVerifier) OnStateLoaded(ctx context.Context) error

func (*StakeVerifier) OnTick

func (s *StakeVerifier) OnTick(ctx context.Context, t time.Time)

func (*StakeVerifier) ProcessStakeDeposited

func (s *StakeVerifier) ProcessStakeDeposited(
	ctx context.Context, event *types.StakeDeposited,
) error

func (*StakeVerifier) ProcessStakeRemoved

func (s *StakeVerifier) ProcessStakeRemoved(
	ctx context.Context, event *types.StakeRemoved,
) error

func (*StakeVerifier) Stopped

func (s *StakeVerifier) Stopped() bool

type Staking

type Staking struct {
	StakingCaller     // Read-only binding to the contract
	StakingTransactor // Write-only binding to the contract
	StakingFilterer   // Log filterer for contract events
}

Staking is an auto generated Go binding around an Ethereum contract.

func NewStaking

func NewStaking(address common.Address, backend bind.ContractBackend) (*Staking, error)

NewStaking creates a new instance of Staking, bound to a specific deployed contract.

type StakingCaller

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

StakingCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewStakingCaller

func NewStakingCaller(address common.Address, caller bind.ContractCaller) (*StakingCaller, error)

NewStakingCaller creates a new read-only instance of Staking, bound to a specific deployed contract.

func (*StakingCaller) StakeBalance

func (_Staking *StakingCaller) StakeBalance(opts *bind.CallOpts, target common.Address, vega_public_key [32]byte) (*big.Int, error)

StakeBalance is a free data retrieval call binding the contract method 0x274abf34.

Solidity: function stake_balance(address target, bytes32 vega_public_key) view returns(uint256)

func (*StakingCaller) StakingToken

func (_Staking *StakingCaller) StakingToken(opts *bind.CallOpts) (common.Address, error)

StakingToken is a free data retrieval call binding the contract method 0x2dc7d74c.

Solidity: function staking_token() view returns(address)

func (*StakingCaller) TotalStaked

func (_Staking *StakingCaller) TotalStaked(opts *bind.CallOpts) (*big.Int, error)

TotalStaked is a free data retrieval call binding the contract method 0xaf7568dd.

Solidity: function total_staked() view returns(uint256)

type StakingCallerRaw

type StakingCallerRaw struct {
	Contract *StakingCaller // Generic read-only contract binding to access the raw methods on
}

StakingCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*StakingCallerRaw) Call

func (_Staking *StakingCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type StakingCallerSession

type StakingCallerSession struct {
	Contract *StakingCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts  // Call options to use throughout this session
}

StakingCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*StakingCallerSession) StakeBalance

func (_Staking *StakingCallerSession) StakeBalance(target common.Address, vega_public_key [32]byte) (*big.Int, error)

StakeBalance is a free data retrieval call binding the contract method 0x274abf34.

Solidity: function stake_balance(address target, bytes32 vega_public_key) view returns(uint256)

func (*StakingCallerSession) StakingToken

func (_Staking *StakingCallerSession) StakingToken() (common.Address, error)

StakingToken is a free data retrieval call binding the contract method 0x2dc7d74c.

Solidity: function staking_token() view returns(address)

func (*StakingCallerSession) TotalStaked

func (_Staking *StakingCallerSession) TotalStaked() (*big.Int, error)

TotalStaked is a free data retrieval call binding the contract method 0xaf7568dd.

Solidity: function total_staked() view returns(uint256)

type StakingFilterer

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

StakingFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

func NewStakingFilterer

func NewStakingFilterer(address common.Address, filterer bind.ContractFilterer) (*StakingFilterer, error)

NewStakingFilterer creates a new log filterer instance of Staking, bound to a specific deployed contract.

func (*StakingFilterer) FilterStakeDeposited

func (_Staking *StakingFilterer) FilterStakeDeposited(opts *bind.FilterOpts, user []common.Address, vega_public_key [][32]byte) (*StakingStakeDepositedIterator, error)

FilterStakeDeposited is a free log retrieval operation binding the contract event 0x9e3e33edf5dcded4adabc51b1266225d00fa41516bfcad69513fa4eca69519da.

Solidity: event Stake_Deposited(address indexed user, uint256 amount, bytes32 indexed vega_public_key)

func (*StakingFilterer) FilterStakeRemoved

func (_Staking *StakingFilterer) FilterStakeRemoved(opts *bind.FilterOpts, user []common.Address, vega_public_key [][32]byte) (*StakingStakeRemovedIterator, error)

FilterStakeRemoved is a free log retrieval operation binding the contract event 0xa131d16963736e4c641f27a7f82f2e350b5971e555ae06ae906892bbba0a0939.

Solidity: event Stake_Removed(address indexed user, uint256 amount, bytes32 indexed vega_public_key)

func (*StakingFilterer) FilterStakeTransferred

func (_Staking *StakingFilterer) FilterStakeTransferred(opts *bind.FilterOpts, from []common.Address, to []common.Address, vega_public_key [][32]byte) (*StakingStakeTransferredIterator, error)

FilterStakeTransferred is a free log retrieval operation binding the contract event 0x296aca09e6f616abedcd9cd45ac378207310452b7a713289374fd1b35e2c2fbe.

Solidity: event Stake_Transferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vega_public_key)

func (*StakingFilterer) ParseStakeDeposited

func (_Staking *StakingFilterer) ParseStakeDeposited(log types.Log) (*StakingStakeDeposited, error)

ParseStakeDeposited is a log parse operation binding the contract event 0x9e3e33edf5dcded4adabc51b1266225d00fa41516bfcad69513fa4eca69519da.

Solidity: event Stake_Deposited(address indexed user, uint256 amount, bytes32 indexed vega_public_key)

func (*StakingFilterer) ParseStakeRemoved

func (_Staking *StakingFilterer) ParseStakeRemoved(log types.Log) (*StakingStakeRemoved, error)

ParseStakeRemoved is a log parse operation binding the contract event 0xa131d16963736e4c641f27a7f82f2e350b5971e555ae06ae906892bbba0a0939.

Solidity: event Stake_Removed(address indexed user, uint256 amount, bytes32 indexed vega_public_key)

func (*StakingFilterer) ParseStakeTransferred

func (_Staking *StakingFilterer) ParseStakeTransferred(log types.Log) (*StakingStakeTransferred, error)

ParseStakeTransferred is a log parse operation binding the contract event 0x296aca09e6f616abedcd9cd45ac378207310452b7a713289374fd1b35e2c2fbe.

Solidity: event Stake_Transferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vega_public_key)

func (*StakingFilterer) WatchStakeDeposited

func (_Staking *StakingFilterer) WatchStakeDeposited(opts *bind.WatchOpts, sink chan<- *StakingStakeDeposited, user []common.Address, vega_public_key [][32]byte) (event.Subscription, error)

WatchStakeDeposited is a free log subscription operation binding the contract event 0x9e3e33edf5dcded4adabc51b1266225d00fa41516bfcad69513fa4eca69519da.

Solidity: event Stake_Deposited(address indexed user, uint256 amount, bytes32 indexed vega_public_key)

func (*StakingFilterer) WatchStakeRemoved

func (_Staking *StakingFilterer) WatchStakeRemoved(opts *bind.WatchOpts, sink chan<- *StakingStakeRemoved, user []common.Address, vega_public_key [][32]byte) (event.Subscription, error)

WatchStakeRemoved is a free log subscription operation binding the contract event 0xa131d16963736e4c641f27a7f82f2e350b5971e555ae06ae906892bbba0a0939.

Solidity: event Stake_Removed(address indexed user, uint256 amount, bytes32 indexed vega_public_key)

func (*StakingFilterer) WatchStakeTransferred

func (_Staking *StakingFilterer) WatchStakeTransferred(opts *bind.WatchOpts, sink chan<- *StakingStakeTransferred, from []common.Address, to []common.Address, vega_public_key [][32]byte) (event.Subscription, error)

WatchStakeTransferred is a free log subscription operation binding the contract event 0x296aca09e6f616abedcd9cd45ac378207310452b7a713289374fd1b35e2c2fbe.

Solidity: event Stake_Transferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vega_public_key)

type StakingRaw

type StakingRaw struct {
	Contract *Staking // Generic contract binding to access the raw methods on
}

StakingRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*StakingRaw) Call

func (_Staking *StakingRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*StakingRaw) Transact

func (_Staking *StakingRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*StakingRaw) Transfer

func (_Staking *StakingRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type StakingSession

type StakingSession struct {
	Contract     *Staking          // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

StakingSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*StakingSession) StakeBalance

func (_Staking *StakingSession) StakeBalance(target common.Address, vega_public_key [32]byte) (*big.Int, error)

StakeBalance is a free data retrieval call binding the contract method 0x274abf34.

Solidity: function stake_balance(address target, bytes32 vega_public_key) view returns(uint256)

func (*StakingSession) StakingToken

func (_Staking *StakingSession) StakingToken() (common.Address, error)

StakingToken is a free data retrieval call binding the contract method 0x2dc7d74c.

Solidity: function staking_token() view returns(address)

func (*StakingSession) TotalStaked

func (_Staking *StakingSession) TotalStaked() (*big.Int, error)

TotalStaked is a free data retrieval call binding the contract method 0xaf7568dd.

Solidity: function total_staked() view returns(uint256)

type StakingStakeDeposited

type StakingStakeDeposited struct {
	User          common.Address
	Amount        *big.Int
	VegaPublicKey [32]byte
	Raw           types.Log // Blockchain specific contextual infos
}

StakingStakeDeposited represents a StakeDeposited event raised by the Staking contract.

type StakingStakeDepositedIterator

type StakingStakeDepositedIterator struct {
	Event *StakingStakeDeposited // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

StakingStakeDepositedIterator is returned from FilterStakeDeposited and is used to iterate over the raw logs and unpacked data for StakeDeposited events raised by the Staking contract.

func (*StakingStakeDepositedIterator) Close

Close terminates the iteration process, releasing any pending underlying resources.

func (*StakingStakeDepositedIterator) Error

Error returns any retrieval or parsing error occurred during filtering.

func (*StakingStakeDepositedIterator) Next

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type StakingStakeRemoved

type StakingStakeRemoved struct {
	User          common.Address
	Amount        *big.Int
	VegaPublicKey [32]byte
	Raw           types.Log // Blockchain specific contextual infos
}

StakingStakeRemoved represents a StakeRemoved event raised by the Staking contract.

type StakingStakeRemovedIterator

type StakingStakeRemovedIterator struct {
	Event *StakingStakeRemoved // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

StakingStakeRemovedIterator is returned from FilterStakeRemoved and is used to iterate over the raw logs and unpacked data for StakeRemoved events raised by the Staking contract.

func (*StakingStakeRemovedIterator) Close

func (it *StakingStakeRemovedIterator) Close() error

Close terminates the iteration process, releasing any pending underlying resources.

func (*StakingStakeRemovedIterator) Error

func (it *StakingStakeRemovedIterator) Error() error

Error returns any retrieval or parsing error occurred during filtering.

func (*StakingStakeRemovedIterator) Next

func (it *StakingStakeRemovedIterator) Next() bool

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type StakingStakeTransferred

type StakingStakeTransferred struct {
	From          common.Address
	Amount        *big.Int
	To            common.Address
	VegaPublicKey [32]byte
	Raw           types.Log // Blockchain specific contextual infos
}

StakingStakeTransferred represents a StakeTransferred event raised by the Staking contract.

type StakingStakeTransferredIterator

type StakingStakeTransferredIterator struct {
	Event *StakingStakeTransferred // Event containing the contract specifics and raw log
	// contains filtered or unexported fields
}

StakingStakeTransferredIterator is returned from FilterStakeTransferred and is used to iterate over the raw logs and unpacked data for StakeTransferred events raised by the Staking contract.

func (*StakingStakeTransferredIterator) Close

Close terminates the iteration process, releasing any pending underlying resources.

func (*StakingStakeTransferredIterator) Error

Error returns any retrieval or parsing error occurred during filtering.

func (*StakingStakeTransferredIterator) Next

Next advances the iterator to the subsequent event, returning whether there are any more events found. In case of a retrieval or parsing error, false is returned and Error() can be queried for the exact failure.

type StakingTransactor

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

StakingTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewStakingTransactor

func NewStakingTransactor(address common.Address, transactor bind.ContractTransactor) (*StakingTransactor, error)

NewStakingTransactor creates a new write-only instance of Staking, bound to a specific deployed contract.

type StakingTransactorRaw

type StakingTransactorRaw struct {
	Contract *StakingTransactor // Generic write-only contract binding to access the raw methods on
}

StakingTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*StakingTransactorRaw) Transact

func (_Staking *StakingTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*StakingTransactorRaw) Transfer

func (_Staking *StakingTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type StakingTransactorSession

type StakingTransactorSession struct {
	Contract     *StakingTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts  // Transaction auth options to use throughout this session
}

StakingTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

type TimeService

type TimeService interface {
	GetTimeNow() time.Time
}

type Witness

type Witness interface {
	StartCheck(validators.Resource, func(interface{}, bool), time.Time) error
	RestoreResource(validators.Resource, func(interface{}, bool)) error
}

Witness provide foreign chain resources validations.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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