Documentation ¶
Overview ¶
Package state is a generated GoMock package.
Package state is a generated GoMock package.
Package state is a generated GoMock package.
Package state is a generated GoMock package.
Index ¶
- Variables
- type BlockState
- type Chain
- type CurrentStakers
- type Diff
- type LastAccepteder
- type MockBlockState
- type MockBlockStateMockRecorder
- type MockChain
- func (m *MockChain) AddChain(createChainTx *txs.Tx)
- func (m *MockChain) AddRewardUTXO(txID ids.ID, utxo *avax.UTXO)
- func (m *MockChain) AddSubnet(createSubnetTx *txs.Tx)
- func (m *MockChain) AddTx(tx *txs.Tx, status status.Status)
- func (m *MockChain) AddUTXO(utxo *avax.UTXO)
- func (m *MockChain) DeleteCurrentDelegator(staker *Staker)
- func (m *MockChain) DeleteCurrentValidator(staker *Staker)
- func (m *MockChain) DeletePendingDelegator(staker *Staker)
- func (m *MockChain) DeletePendingValidator(staker *Staker)
- func (m *MockChain) DeleteUTXO(utxoID ids.ID)
- func (m *MockChain) EXPECT() *MockChainMockRecorder
- func (m *MockChain) GetChains(subnetID ids.ID) ([]*txs.Tx, error)
- func (m *MockChain) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
- func (m *MockChain) GetCurrentStakerIterator() (StakerIterator, error)
- func (m *MockChain) GetCurrentSupply() uint64
- func (m *MockChain) GetCurrentValidator(subnetID ids.ID, nodeID ids.NodeID) (*Staker, error)
- func (m *MockChain) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
- func (m *MockChain) GetPendingStakerIterator() (StakerIterator, error)
- func (m *MockChain) GetPendingValidator(subnetID ids.ID, nodeID ids.NodeID) (*Staker, error)
- func (m *MockChain) GetRewardUTXOs(txID ids.ID) ([]*avax.UTXO, error)
- func (m *MockChain) GetSubnets() ([]*txs.Tx, error)
- func (m *MockChain) GetTimestamp() time.Time
- func (m *MockChain) GetTx(txID ids.ID) (*txs.Tx, status.Status, error)
- func (m *MockChain) GetUTXO(utxoID ids.ID) (*avax.UTXO, error)
- func (m *MockChain) PutCurrentDelegator(staker *Staker)
- func (m *MockChain) PutCurrentValidator(staker *Staker)
- func (m *MockChain) PutPendingDelegator(staker *Staker)
- func (m *MockChain) PutPendingValidator(staker *Staker)
- func (m *MockChain) SetCurrentSupply(cs uint64)
- func (m *MockChain) SetTimestamp(tm time.Time)
- type MockChainMockRecorder
- func (mr *MockChainMockRecorder) AddChain(createChainTx interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) AddRewardUTXO(txID, utxo interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) AddSubnet(createSubnetTx interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) AddTx(tx, status interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) AddUTXO(utxo interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) DeleteCurrentDelegator(staker interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) DeleteCurrentValidator(staker interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) DeletePendingDelegator(staker interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) DeletePendingValidator(staker interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) DeleteUTXO(utxoID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetChains(subnetID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetCurrentStakerIterator() *gomock.Call
- func (mr *MockChainMockRecorder) GetCurrentSupply() *gomock.Call
- func (mr *MockChainMockRecorder) GetCurrentValidator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetPendingStakerIterator() *gomock.Call
- func (mr *MockChainMockRecorder) GetPendingValidator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetRewardUTXOs(txID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetSubnets() *gomock.Call
- func (mr *MockChainMockRecorder) GetTimestamp() *gomock.Call
- func (mr *MockChainMockRecorder) GetTx(txID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) GetUTXO(utxoID interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) PutCurrentDelegator(staker interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) PutCurrentValidator(staker interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) PutPendingDelegator(staker interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) PutPendingValidator(staker interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) SetCurrentSupply(cs interface{}) *gomock.Call
- func (mr *MockChainMockRecorder) SetTimestamp(tm interface{}) *gomock.Call
- type MockDiff
- func (m *MockDiff) AddChain(createChainTx *txs.Tx)
- func (m *MockDiff) AddRewardUTXO(txID ids.ID, utxo *avax.UTXO)
- func (m *MockDiff) AddSubnet(createSubnetTx *txs.Tx)
- func (m *MockDiff) AddTx(tx *txs.Tx, status status.Status)
- func (m *MockDiff) AddUTXO(utxo *avax.UTXO)
- func (m *MockDiff) Apply(arg0 State)
- func (m *MockDiff) DeleteCurrentDelegator(staker *Staker)
- func (m *MockDiff) DeleteCurrentValidator(staker *Staker)
- func (m *MockDiff) DeletePendingDelegator(staker *Staker)
- func (m *MockDiff) DeletePendingValidator(staker *Staker)
- func (m *MockDiff) DeleteUTXO(utxoID ids.ID)
- func (m *MockDiff) EXPECT() *MockDiffMockRecorder
- func (m *MockDiff) GetChains(subnetID ids.ID) ([]*txs.Tx, error)
- func (m *MockDiff) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
- func (m *MockDiff) GetCurrentStakerIterator() (StakerIterator, error)
- func (m *MockDiff) GetCurrentSupply() uint64
- func (m *MockDiff) GetCurrentValidator(subnetID ids.ID, nodeID ids.NodeID) (*Staker, error)
- func (m *MockDiff) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
- func (m *MockDiff) GetPendingStakerIterator() (StakerIterator, error)
- func (m *MockDiff) GetPendingValidator(subnetID ids.ID, nodeID ids.NodeID) (*Staker, error)
- func (m *MockDiff) GetRewardUTXOs(txID ids.ID) ([]*avax.UTXO, error)
- func (m *MockDiff) GetSubnets() ([]*txs.Tx, error)
- func (m *MockDiff) GetTimestamp() time.Time
- func (m *MockDiff) GetTx(txID ids.ID) (*txs.Tx, status.Status, error)
- func (m *MockDiff) GetUTXO(utxoID ids.ID) (*avax.UTXO, error)
- func (m *MockDiff) PutCurrentDelegator(staker *Staker)
- func (m *MockDiff) PutCurrentValidator(staker *Staker)
- func (m *MockDiff) PutPendingDelegator(staker *Staker)
- func (m *MockDiff) PutPendingValidator(staker *Staker)
- func (m *MockDiff) SetCurrentSupply(cs uint64)
- func (m *MockDiff) SetTimestamp(tm time.Time)
- type MockDiffMockRecorder
- func (mr *MockDiffMockRecorder) AddChain(createChainTx interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) AddRewardUTXO(txID, utxo interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) AddSubnet(createSubnetTx interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) AddTx(tx, status interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) AddUTXO(utxo interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) Apply(arg0 interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) DeleteCurrentDelegator(staker interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) DeleteCurrentValidator(staker interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) DeletePendingDelegator(staker interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) DeletePendingValidator(staker interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) DeleteUTXO(utxoID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) GetChains(subnetID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) GetCurrentStakerIterator() *gomock.Call
- func (mr *MockDiffMockRecorder) GetCurrentSupply() *gomock.Call
- func (mr *MockDiffMockRecorder) GetCurrentValidator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) GetPendingStakerIterator() *gomock.Call
- func (mr *MockDiffMockRecorder) GetPendingValidator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) GetRewardUTXOs(txID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) GetSubnets() *gomock.Call
- func (mr *MockDiffMockRecorder) GetTimestamp() *gomock.Call
- func (mr *MockDiffMockRecorder) GetTx(txID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) GetUTXO(utxoID interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) PutCurrentDelegator(staker interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) PutCurrentValidator(staker interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) PutPendingDelegator(staker interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) PutPendingValidator(staker interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) SetCurrentSupply(cs interface{}) *gomock.Call
- func (mr *MockDiffMockRecorder) SetTimestamp(tm interface{}) *gomock.Call
- type MockLastAccepteder
- type MockLastAcceptederMockRecorder
- type MockStakerIterator
- type MockStakerIteratorMockRecorder
- type MockState
- func (m *MockState) Abort()
- func (m *MockState) AddChain(createChainTx *txs.Tx)
- func (m *MockState) AddRewardUTXO(txID ids.ID, utxo *avax.UTXO)
- func (m *MockState) AddStatelessBlock(block blocks.Block, status choices.Status)
- func (m *MockState) AddSubnet(createSubnetTx *txs.Tx)
- func (m *MockState) AddTx(tx *txs.Tx, status status.Status)
- func (m *MockState) AddUTXO(utxo *avax.UTXO)
- func (m *MockState) Close() error
- func (m *MockState) Commit() error
- func (m *MockState) CommitBatch() (database.Batch, error)
- func (m *MockState) DeleteCurrentDelegator(staker *Staker)
- func (m *MockState) DeleteCurrentValidator(staker *Staker)
- func (m *MockState) DeletePendingDelegator(staker *Staker)
- func (m *MockState) DeletePendingValidator(staker *Staker)
- func (m *MockState) DeleteUTXO(utxoID ids.ID)
- func (m *MockState) EXPECT() *MockStateMockRecorder
- func (m *MockState) GetChains(subnetID ids.ID) ([]*txs.Tx, error)
- func (m *MockState) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
- func (m *MockState) GetCurrentStakerIterator() (StakerIterator, error)
- func (m *MockState) GetCurrentSupply() uint64
- func (m *MockState) GetCurrentValidator(subnetID ids.ID, nodeID ids.NodeID) (*Staker, error)
- func (m *MockState) GetLastAccepted() ids.ID
- func (m *MockState) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
- func (m *MockState) GetPendingStakerIterator() (StakerIterator, error)
- func (m *MockState) GetPendingValidator(subnetID ids.ID, nodeID ids.NodeID) (*Staker, error)
- func (m *MockState) GetRewardUTXOs(txID ids.ID) ([]*avax.UTXO, error)
- func (m *MockState) GetStartTime(nodeID ids.NodeID) (time.Time, error)
- func (m *MockState) GetStatelessBlock(blockID ids.ID) (blocks.Block, choices.Status, error)
- func (m *MockState) GetSubnets() ([]*txs.Tx, error)
- func (m *MockState) GetTimestamp() time.Time
- func (m *MockState) GetTx(txID ids.ID) (*txs.Tx, status.Status, error)
- func (m *MockState) GetUTXO(utxoID ids.ID) (*avax.UTXO, error)
- func (m *MockState) GetUptime(nodeID ids.NodeID) (time.Duration, time.Time, error)
- func (m *MockState) GetValidatorWeightDiffs(height uint64, subnetID ids.ID) (map[ids.NodeID]*ValidatorWeightDiff, error)
- func (m *MockState) PutCurrentDelegator(staker *Staker)
- func (m *MockState) PutCurrentValidator(staker *Staker)
- func (m *MockState) PutPendingDelegator(staker *Staker)
- func (m *MockState) PutPendingValidator(staker *Staker)
- func (m *MockState) SetCurrentSupply(cs uint64)
- func (m *MockState) SetHeight(height uint64)
- func (m *MockState) SetLastAccepted(blkID ids.ID)
- func (m *MockState) SetTimestamp(tm time.Time)
- func (m *MockState) SetUptime(nodeID ids.NodeID, upDuration time.Duration, lastUpdated time.Time) error
- func (m *MockState) UTXOIDs(addr []byte, previous ids.ID, limit int) ([]ids.ID, error)
- func (m *MockState) ValidatorSet(subnetID ids.ID) (validators.Set, error)
- type MockStateMockRecorder
- func (mr *MockStateMockRecorder) Abort() *gomock.Call
- func (mr *MockStateMockRecorder) AddChain(createChainTx interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) AddRewardUTXO(txID, utxo interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) AddStatelessBlock(block, status interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) AddSubnet(createSubnetTx interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) AddTx(tx, status interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) AddUTXO(utxo interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) Close() *gomock.Call
- func (mr *MockStateMockRecorder) Commit() *gomock.Call
- func (mr *MockStateMockRecorder) CommitBatch() *gomock.Call
- func (mr *MockStateMockRecorder) DeleteCurrentDelegator(staker interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) DeleteCurrentValidator(staker interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) DeletePendingDelegator(staker interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) DeletePendingValidator(staker interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) DeleteUTXO(utxoID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetChains(subnetID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetCurrentStakerIterator() *gomock.Call
- func (mr *MockStateMockRecorder) GetCurrentSupply() *gomock.Call
- func (mr *MockStateMockRecorder) GetCurrentValidator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetLastAccepted() *gomock.Call
- func (mr *MockStateMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetPendingStakerIterator() *gomock.Call
- func (mr *MockStateMockRecorder) GetPendingValidator(subnetID, nodeID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetRewardUTXOs(txID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetStartTime(nodeID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetStatelessBlock(blockID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetSubnets() *gomock.Call
- func (mr *MockStateMockRecorder) GetTimestamp() *gomock.Call
- func (mr *MockStateMockRecorder) GetTx(txID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetUTXO(utxoID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetUptime(nodeID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) GetValidatorWeightDiffs(height, subnetID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) PutCurrentDelegator(staker interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) PutCurrentValidator(staker interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) PutPendingDelegator(staker interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) PutPendingValidator(staker interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetCurrentSupply(cs interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetHeight(height interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetLastAccepted(blkID interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetTimestamp(tm interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) SetUptime(nodeID, upDuration, lastUpdated interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) UTXOIDs(addr, previous, limit interface{}) *gomock.Call
- func (mr *MockStateMockRecorder) ValidatorSet(subnetID interface{}) *gomock.Call
- type MockVersions
- type MockVersionsMockRecorder
- type PendingStakers
- type Priority
- type Staker
- type StakerDiffIterator
- type StakerIterator
- type Stakers
- type State
- type UTXOAdder
- type UTXODeleter
- type UTXOGetter
- type ValidatorWeightDiff
- type Versions
Constants ¶
This section is empty.
Variables ¶
var (
ErrDelegatorSubset = errors.New("delegator's time range must be a subset of the validator's time range")
)
var PendingToCurrentPriorities = []Priority{ PrimaryNetworkValidatorPendingPriority: PrimaryNetworkValidatorCurrentPriority, PrimaryNetworkDelegatorPendingPriority: PrimaryNetworkDelegatorCurrentPriority, SubnetValidatorPendingPriority: SubnetValidatorCurrentPriority, SubnetDelegatorPendingPriority: SubnetDelegatorCurrentPriority, }
Functions ¶
This section is empty.
Types ¶
type BlockState ¶
type Chain ¶
type Chain interface { Stakers UTXOAdder UTXOGetter UTXODeleter GetTimestamp() time.Time SetTimestamp(tm time.Time) GetCurrentSupply() uint64 SetCurrentSupply(cs uint64) GetRewardUTXOs(txID ids.ID) ([]*avax.UTXO, error) AddRewardUTXO(txID ids.ID, utxo *avax.UTXO) GetSubnets() ([]*txs.Tx, error) AddSubnet(createSubnetTx *txs.Tx) GetChains(subnetID ids.ID) ([]*txs.Tx, error) AddChain(createChainTx *txs.Tx) GetTx(txID ids.ID) (*txs.Tx, status.Status, error) AddTx(tx *txs.Tx, status status.Status) }
Chain collects all methods to manage the state of the chain for block execution.
type CurrentStakers ¶
type CurrentStakers interface { // GetCurrentValidator returns the [staker] describing the validator on // [subnetID] with [nodeID]. If the validator does not exist, // [database.ErrNotFound] is returned. GetCurrentValidator(subnetID ids.ID, nodeID ids.NodeID) (*Staker, error) // PutCurrentValidator adds the [staker] describing a validator to the // staker set. PutCurrentValidator(staker *Staker) // DeleteCurrentValidator removes the [staker] describing a validator from // the staker set. DeleteCurrentValidator(staker *Staker) // GetCurrentDelegatorIterator returns the delegators associated with the // validator on [subnetID] with [nodeID]. Delegators are sorted by their // removal from current staker set. GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error) // PutCurrentDelegator adds the [staker] describing a delegator to the // staker set. PutCurrentDelegator(staker *Staker) // DeleteCurrentDelegator removes the [staker] describing a delegator from // the staker set. DeleteCurrentDelegator(staker *Staker) // GetCurrentStakerIterator returns stakers in order of their removal from // the current staker set. GetCurrentStakerIterator() (StakerIterator, error) }
type LastAccepteder ¶
type MockBlockState ¶
type MockBlockState struct {
// contains filtered or unexported fields
}
MockBlockState is a mock of BlockState interface.
func NewMockBlockState ¶
func NewMockBlockState(ctrl *gomock.Controller) *MockBlockState
NewMockBlockState creates a new mock instance.
func (*MockBlockState) AddStatelessBlock ¶
func (m *MockBlockState) AddStatelessBlock(block blocks.Block, status choices.Status)
AddStatelessBlock mocks base method.
func (*MockBlockState) EXPECT ¶
func (m *MockBlockState) EXPECT() *MockBlockStateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBlockState) GetStatelessBlock ¶
GetStatelessBlock mocks base method.
type MockBlockStateMockRecorder ¶
type MockBlockStateMockRecorder struct {
// contains filtered or unexported fields
}
MockBlockStateMockRecorder is the mock recorder for MockBlockState.
func (*MockBlockStateMockRecorder) AddStatelessBlock ¶
func (mr *MockBlockStateMockRecorder) AddStatelessBlock(block, status interface{}) *gomock.Call
AddStatelessBlock indicates an expected call of AddStatelessBlock.
func (*MockBlockStateMockRecorder) GetStatelessBlock ¶
func (mr *MockBlockStateMockRecorder) GetStatelessBlock(blockID interface{}) *gomock.Call
GetStatelessBlock indicates an expected call of GetStatelessBlock.
type MockChain ¶
type MockChain struct {
// contains filtered or unexported fields
}
MockChain is a mock of Chain interface.
func NewMockChain ¶
func NewMockChain(ctrl *gomock.Controller) *MockChain
NewMockChain creates a new mock instance.
func (*MockChain) AddRewardUTXO ¶
AddRewardUTXO mocks base method.
func (*MockChain) DeleteCurrentDelegator ¶
DeleteCurrentDelegator mocks base method.
func (*MockChain) DeleteCurrentValidator ¶
DeleteCurrentValidator mocks base method.
func (*MockChain) DeletePendingDelegator ¶
DeletePendingDelegator mocks base method.
func (*MockChain) DeletePendingValidator ¶
DeletePendingValidator mocks base method.
func (*MockChain) DeleteUTXO ¶
DeleteUTXO mocks base method.
func (*MockChain) EXPECT ¶
func (m *MockChain) EXPECT() *MockChainMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockChain) GetCurrentDelegatorIterator ¶
func (m *MockChain) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
GetCurrentDelegatorIterator mocks base method.
func (*MockChain) GetCurrentStakerIterator ¶
func (m *MockChain) GetCurrentStakerIterator() (StakerIterator, error)
GetCurrentStakerIterator mocks base method.
func (*MockChain) GetCurrentSupply ¶
GetCurrentSupply mocks base method.
func (*MockChain) GetCurrentValidator ¶
GetCurrentValidator mocks base method.
func (*MockChain) GetPendingDelegatorIterator ¶
func (m *MockChain) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
GetPendingDelegatorIterator mocks base method.
func (*MockChain) GetPendingStakerIterator ¶
func (m *MockChain) GetPendingStakerIterator() (StakerIterator, error)
GetPendingStakerIterator mocks base method.
func (*MockChain) GetPendingValidator ¶
GetPendingValidator mocks base method.
func (*MockChain) GetRewardUTXOs ¶
GetRewardUTXOs mocks base method.
func (*MockChain) GetSubnets ¶
GetSubnets mocks base method.
func (*MockChain) GetTimestamp ¶
GetTimestamp mocks base method.
func (*MockChain) PutCurrentDelegator ¶
PutCurrentDelegator mocks base method.
func (*MockChain) PutCurrentValidator ¶
PutCurrentValidator mocks base method.
func (*MockChain) PutPendingDelegator ¶
PutPendingDelegator mocks base method.
func (*MockChain) PutPendingValidator ¶
PutPendingValidator mocks base method.
func (*MockChain) SetCurrentSupply ¶
SetCurrentSupply mocks base method.
func (*MockChain) SetTimestamp ¶
SetTimestamp mocks base method.
type MockChainMockRecorder ¶
type MockChainMockRecorder struct {
// contains filtered or unexported fields
}
MockChainMockRecorder is the mock recorder for MockChain.
func (*MockChainMockRecorder) AddChain ¶
func (mr *MockChainMockRecorder) AddChain(createChainTx interface{}) *gomock.Call
AddChain indicates an expected call of AddChain.
func (*MockChainMockRecorder) AddRewardUTXO ¶
func (mr *MockChainMockRecorder) AddRewardUTXO(txID, utxo interface{}) *gomock.Call
AddRewardUTXO indicates an expected call of AddRewardUTXO.
func (*MockChainMockRecorder) AddSubnet ¶
func (mr *MockChainMockRecorder) AddSubnet(createSubnetTx interface{}) *gomock.Call
AddSubnet indicates an expected call of AddSubnet.
func (*MockChainMockRecorder) AddTx ¶
func (mr *MockChainMockRecorder) AddTx(tx, status interface{}) *gomock.Call
AddTx indicates an expected call of AddTx.
func (*MockChainMockRecorder) AddUTXO ¶
func (mr *MockChainMockRecorder) AddUTXO(utxo interface{}) *gomock.Call
AddUTXO indicates an expected call of AddUTXO.
func (*MockChainMockRecorder) DeleteCurrentDelegator ¶
func (mr *MockChainMockRecorder) DeleteCurrentDelegator(staker interface{}) *gomock.Call
DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.
func (*MockChainMockRecorder) DeleteCurrentValidator ¶
func (mr *MockChainMockRecorder) DeleteCurrentValidator(staker interface{}) *gomock.Call
DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.
func (*MockChainMockRecorder) DeletePendingDelegator ¶
func (mr *MockChainMockRecorder) DeletePendingDelegator(staker interface{}) *gomock.Call
DeletePendingDelegator indicates an expected call of DeletePendingDelegator.
func (*MockChainMockRecorder) DeletePendingValidator ¶
func (mr *MockChainMockRecorder) DeletePendingValidator(staker interface{}) *gomock.Call
DeletePendingValidator indicates an expected call of DeletePendingValidator.
func (*MockChainMockRecorder) DeleteUTXO ¶
func (mr *MockChainMockRecorder) DeleteUTXO(utxoID interface{}) *gomock.Call
DeleteUTXO indicates an expected call of DeleteUTXO.
func (*MockChainMockRecorder) GetChains ¶
func (mr *MockChainMockRecorder) GetChains(subnetID interface{}) *gomock.Call
GetChains indicates an expected call of GetChains.
func (*MockChainMockRecorder) GetCurrentDelegatorIterator ¶
func (mr *MockChainMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
GetCurrentDelegatorIterator indicates an expected call of GetCurrentDelegatorIterator.
func (*MockChainMockRecorder) GetCurrentStakerIterator ¶
func (mr *MockChainMockRecorder) GetCurrentStakerIterator() *gomock.Call
GetCurrentStakerIterator indicates an expected call of GetCurrentStakerIterator.
func (*MockChainMockRecorder) GetCurrentSupply ¶
func (mr *MockChainMockRecorder) GetCurrentSupply() *gomock.Call
GetCurrentSupply indicates an expected call of GetCurrentSupply.
func (*MockChainMockRecorder) GetCurrentValidator ¶
func (mr *MockChainMockRecorder) GetCurrentValidator(subnetID, nodeID interface{}) *gomock.Call
GetCurrentValidator indicates an expected call of GetCurrentValidator.
func (*MockChainMockRecorder) GetPendingDelegatorIterator ¶
func (mr *MockChainMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
GetPendingDelegatorIterator indicates an expected call of GetPendingDelegatorIterator.
func (*MockChainMockRecorder) GetPendingStakerIterator ¶
func (mr *MockChainMockRecorder) GetPendingStakerIterator() *gomock.Call
GetPendingStakerIterator indicates an expected call of GetPendingStakerIterator.
func (*MockChainMockRecorder) GetPendingValidator ¶
func (mr *MockChainMockRecorder) GetPendingValidator(subnetID, nodeID interface{}) *gomock.Call
GetPendingValidator indicates an expected call of GetPendingValidator.
func (*MockChainMockRecorder) GetRewardUTXOs ¶
func (mr *MockChainMockRecorder) GetRewardUTXOs(txID interface{}) *gomock.Call
GetRewardUTXOs indicates an expected call of GetRewardUTXOs.
func (*MockChainMockRecorder) GetSubnets ¶
func (mr *MockChainMockRecorder) GetSubnets() *gomock.Call
GetSubnets indicates an expected call of GetSubnets.
func (*MockChainMockRecorder) GetTimestamp ¶
func (mr *MockChainMockRecorder) GetTimestamp() *gomock.Call
GetTimestamp indicates an expected call of GetTimestamp.
func (*MockChainMockRecorder) GetTx ¶
func (mr *MockChainMockRecorder) GetTx(txID interface{}) *gomock.Call
GetTx indicates an expected call of GetTx.
func (*MockChainMockRecorder) GetUTXO ¶
func (mr *MockChainMockRecorder) GetUTXO(utxoID interface{}) *gomock.Call
GetUTXO indicates an expected call of GetUTXO.
func (*MockChainMockRecorder) PutCurrentDelegator ¶
func (mr *MockChainMockRecorder) PutCurrentDelegator(staker interface{}) *gomock.Call
PutCurrentDelegator indicates an expected call of PutCurrentDelegator.
func (*MockChainMockRecorder) PutCurrentValidator ¶
func (mr *MockChainMockRecorder) PutCurrentValidator(staker interface{}) *gomock.Call
PutCurrentValidator indicates an expected call of PutCurrentValidator.
func (*MockChainMockRecorder) PutPendingDelegator ¶
func (mr *MockChainMockRecorder) PutPendingDelegator(staker interface{}) *gomock.Call
PutPendingDelegator indicates an expected call of PutPendingDelegator.
func (*MockChainMockRecorder) PutPendingValidator ¶
func (mr *MockChainMockRecorder) PutPendingValidator(staker interface{}) *gomock.Call
PutPendingValidator indicates an expected call of PutPendingValidator.
func (*MockChainMockRecorder) SetCurrentSupply ¶
func (mr *MockChainMockRecorder) SetCurrentSupply(cs interface{}) *gomock.Call
SetCurrentSupply indicates an expected call of SetCurrentSupply.
func (*MockChainMockRecorder) SetTimestamp ¶
func (mr *MockChainMockRecorder) SetTimestamp(tm interface{}) *gomock.Call
SetTimestamp indicates an expected call of SetTimestamp.
type MockDiff ¶
type MockDiff struct {
// contains filtered or unexported fields
}
MockDiff is a mock of Diff interface.
func NewMockDiff ¶
func NewMockDiff(ctrl *gomock.Controller) *MockDiff
NewMockDiff creates a new mock instance.
func (*MockDiff) AddRewardUTXO ¶
AddRewardUTXO mocks base method.
func (*MockDiff) DeleteCurrentDelegator ¶
DeleteCurrentDelegator mocks base method.
func (*MockDiff) DeleteCurrentValidator ¶
DeleteCurrentValidator mocks base method.
func (*MockDiff) DeletePendingDelegator ¶
DeletePendingDelegator mocks base method.
func (*MockDiff) DeletePendingValidator ¶
DeletePendingValidator mocks base method.
func (*MockDiff) DeleteUTXO ¶
DeleteUTXO mocks base method.
func (*MockDiff) EXPECT ¶
func (m *MockDiff) EXPECT() *MockDiffMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDiff) GetCurrentDelegatorIterator ¶
func (m *MockDiff) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
GetCurrentDelegatorIterator mocks base method.
func (*MockDiff) GetCurrentStakerIterator ¶
func (m *MockDiff) GetCurrentStakerIterator() (StakerIterator, error)
GetCurrentStakerIterator mocks base method.
func (*MockDiff) GetCurrentSupply ¶
GetCurrentSupply mocks base method.
func (*MockDiff) GetCurrentValidator ¶
GetCurrentValidator mocks base method.
func (*MockDiff) GetPendingDelegatorIterator ¶
func (m *MockDiff) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
GetPendingDelegatorIterator mocks base method.
func (*MockDiff) GetPendingStakerIterator ¶
func (m *MockDiff) GetPendingStakerIterator() (StakerIterator, error)
GetPendingStakerIterator mocks base method.
func (*MockDiff) GetPendingValidator ¶
GetPendingValidator mocks base method.
func (*MockDiff) GetRewardUTXOs ¶
GetRewardUTXOs mocks base method.
func (*MockDiff) GetSubnets ¶
GetSubnets mocks base method.
func (*MockDiff) GetTimestamp ¶
GetTimestamp mocks base method.
func (*MockDiff) PutCurrentDelegator ¶
PutCurrentDelegator mocks base method.
func (*MockDiff) PutCurrentValidator ¶
PutCurrentValidator mocks base method.
func (*MockDiff) PutPendingDelegator ¶
PutPendingDelegator mocks base method.
func (*MockDiff) PutPendingValidator ¶
PutPendingValidator mocks base method.
func (*MockDiff) SetCurrentSupply ¶
SetCurrentSupply mocks base method.
func (*MockDiff) SetTimestamp ¶
SetTimestamp mocks base method.
type MockDiffMockRecorder ¶
type MockDiffMockRecorder struct {
// contains filtered or unexported fields
}
MockDiffMockRecorder is the mock recorder for MockDiff.
func (*MockDiffMockRecorder) AddChain ¶
func (mr *MockDiffMockRecorder) AddChain(createChainTx interface{}) *gomock.Call
AddChain indicates an expected call of AddChain.
func (*MockDiffMockRecorder) AddRewardUTXO ¶
func (mr *MockDiffMockRecorder) AddRewardUTXO(txID, utxo interface{}) *gomock.Call
AddRewardUTXO indicates an expected call of AddRewardUTXO.
func (*MockDiffMockRecorder) AddSubnet ¶
func (mr *MockDiffMockRecorder) AddSubnet(createSubnetTx interface{}) *gomock.Call
AddSubnet indicates an expected call of AddSubnet.
func (*MockDiffMockRecorder) AddTx ¶
func (mr *MockDiffMockRecorder) AddTx(tx, status interface{}) *gomock.Call
AddTx indicates an expected call of AddTx.
func (*MockDiffMockRecorder) AddUTXO ¶
func (mr *MockDiffMockRecorder) AddUTXO(utxo interface{}) *gomock.Call
AddUTXO indicates an expected call of AddUTXO.
func (*MockDiffMockRecorder) Apply ¶
func (mr *MockDiffMockRecorder) Apply(arg0 interface{}) *gomock.Call
Apply indicates an expected call of Apply.
func (*MockDiffMockRecorder) DeleteCurrentDelegator ¶
func (mr *MockDiffMockRecorder) DeleteCurrentDelegator(staker interface{}) *gomock.Call
DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.
func (*MockDiffMockRecorder) DeleteCurrentValidator ¶
func (mr *MockDiffMockRecorder) DeleteCurrentValidator(staker interface{}) *gomock.Call
DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.
func (*MockDiffMockRecorder) DeletePendingDelegator ¶
func (mr *MockDiffMockRecorder) DeletePendingDelegator(staker interface{}) *gomock.Call
DeletePendingDelegator indicates an expected call of DeletePendingDelegator.
func (*MockDiffMockRecorder) DeletePendingValidator ¶
func (mr *MockDiffMockRecorder) DeletePendingValidator(staker interface{}) *gomock.Call
DeletePendingValidator indicates an expected call of DeletePendingValidator.
func (*MockDiffMockRecorder) DeleteUTXO ¶
func (mr *MockDiffMockRecorder) DeleteUTXO(utxoID interface{}) *gomock.Call
DeleteUTXO indicates an expected call of DeleteUTXO.
func (*MockDiffMockRecorder) GetChains ¶
func (mr *MockDiffMockRecorder) GetChains(subnetID interface{}) *gomock.Call
GetChains indicates an expected call of GetChains.
func (*MockDiffMockRecorder) GetCurrentDelegatorIterator ¶
func (mr *MockDiffMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
GetCurrentDelegatorIterator indicates an expected call of GetCurrentDelegatorIterator.
func (*MockDiffMockRecorder) GetCurrentStakerIterator ¶
func (mr *MockDiffMockRecorder) GetCurrentStakerIterator() *gomock.Call
GetCurrentStakerIterator indicates an expected call of GetCurrentStakerIterator.
func (*MockDiffMockRecorder) GetCurrentSupply ¶
func (mr *MockDiffMockRecorder) GetCurrentSupply() *gomock.Call
GetCurrentSupply indicates an expected call of GetCurrentSupply.
func (*MockDiffMockRecorder) GetCurrentValidator ¶
func (mr *MockDiffMockRecorder) GetCurrentValidator(subnetID, nodeID interface{}) *gomock.Call
GetCurrentValidator indicates an expected call of GetCurrentValidator.
func (*MockDiffMockRecorder) GetPendingDelegatorIterator ¶
func (mr *MockDiffMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
GetPendingDelegatorIterator indicates an expected call of GetPendingDelegatorIterator.
func (*MockDiffMockRecorder) GetPendingStakerIterator ¶
func (mr *MockDiffMockRecorder) GetPendingStakerIterator() *gomock.Call
GetPendingStakerIterator indicates an expected call of GetPendingStakerIterator.
func (*MockDiffMockRecorder) GetPendingValidator ¶
func (mr *MockDiffMockRecorder) GetPendingValidator(subnetID, nodeID interface{}) *gomock.Call
GetPendingValidator indicates an expected call of GetPendingValidator.
func (*MockDiffMockRecorder) GetRewardUTXOs ¶
func (mr *MockDiffMockRecorder) GetRewardUTXOs(txID interface{}) *gomock.Call
GetRewardUTXOs indicates an expected call of GetRewardUTXOs.
func (*MockDiffMockRecorder) GetSubnets ¶
func (mr *MockDiffMockRecorder) GetSubnets() *gomock.Call
GetSubnets indicates an expected call of GetSubnets.
func (*MockDiffMockRecorder) GetTimestamp ¶
func (mr *MockDiffMockRecorder) GetTimestamp() *gomock.Call
GetTimestamp indicates an expected call of GetTimestamp.
func (*MockDiffMockRecorder) GetTx ¶
func (mr *MockDiffMockRecorder) GetTx(txID interface{}) *gomock.Call
GetTx indicates an expected call of GetTx.
func (*MockDiffMockRecorder) GetUTXO ¶
func (mr *MockDiffMockRecorder) GetUTXO(utxoID interface{}) *gomock.Call
GetUTXO indicates an expected call of GetUTXO.
func (*MockDiffMockRecorder) PutCurrentDelegator ¶
func (mr *MockDiffMockRecorder) PutCurrentDelegator(staker interface{}) *gomock.Call
PutCurrentDelegator indicates an expected call of PutCurrentDelegator.
func (*MockDiffMockRecorder) PutCurrentValidator ¶
func (mr *MockDiffMockRecorder) PutCurrentValidator(staker interface{}) *gomock.Call
PutCurrentValidator indicates an expected call of PutCurrentValidator.
func (*MockDiffMockRecorder) PutPendingDelegator ¶
func (mr *MockDiffMockRecorder) PutPendingDelegator(staker interface{}) *gomock.Call
PutPendingDelegator indicates an expected call of PutPendingDelegator.
func (*MockDiffMockRecorder) PutPendingValidator ¶
func (mr *MockDiffMockRecorder) PutPendingValidator(staker interface{}) *gomock.Call
PutPendingValidator indicates an expected call of PutPendingValidator.
func (*MockDiffMockRecorder) SetCurrentSupply ¶
func (mr *MockDiffMockRecorder) SetCurrentSupply(cs interface{}) *gomock.Call
SetCurrentSupply indicates an expected call of SetCurrentSupply.
func (*MockDiffMockRecorder) SetTimestamp ¶
func (mr *MockDiffMockRecorder) SetTimestamp(tm interface{}) *gomock.Call
SetTimestamp indicates an expected call of SetTimestamp.
type MockLastAccepteder ¶
type MockLastAccepteder struct {
// contains filtered or unexported fields
}
MockLastAccepteder is a mock of LastAccepteder interface.
func NewMockLastAccepteder ¶
func NewMockLastAccepteder(ctrl *gomock.Controller) *MockLastAccepteder
NewMockLastAccepteder creates a new mock instance.
func (*MockLastAccepteder) EXPECT ¶
func (m *MockLastAccepteder) EXPECT() *MockLastAcceptederMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLastAccepteder) GetLastAccepted ¶
func (m *MockLastAccepteder) GetLastAccepted() ids.ID
GetLastAccepted mocks base method.
func (*MockLastAccepteder) SetLastAccepted ¶
func (m *MockLastAccepteder) SetLastAccepted(blkID ids.ID)
SetLastAccepted mocks base method.
type MockLastAcceptederMockRecorder ¶
type MockLastAcceptederMockRecorder struct {
// contains filtered or unexported fields
}
MockLastAcceptederMockRecorder is the mock recorder for MockLastAccepteder.
func (*MockLastAcceptederMockRecorder) GetLastAccepted ¶
func (mr *MockLastAcceptederMockRecorder) GetLastAccepted() *gomock.Call
GetLastAccepted indicates an expected call of GetLastAccepted.
func (*MockLastAcceptederMockRecorder) SetLastAccepted ¶
func (mr *MockLastAcceptederMockRecorder) SetLastAccepted(blkID interface{}) *gomock.Call
SetLastAccepted indicates an expected call of SetLastAccepted.
type MockStakerIterator ¶
type MockStakerIterator struct {
// contains filtered or unexported fields
}
MockStakerIterator is a mock of StakerIterator interface
func NewMockStakerIterator ¶
func NewMockStakerIterator(ctrl *gomock.Controller) *MockStakerIterator
NewMockStakerIterator creates a new mock instance
func (*MockStakerIterator) EXPECT ¶
func (m *MockStakerIterator) EXPECT() *MockStakerIteratorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockStakerIterator) Release ¶
func (m *MockStakerIterator) Release()
Release mocks base method
func (*MockStakerIterator) Value ¶
func (m *MockStakerIterator) Value() *Staker
Value mocks base method
type MockStakerIteratorMockRecorder ¶
type MockStakerIteratorMockRecorder struct {
// contains filtered or unexported fields
}
MockStakerIteratorMockRecorder is the mock recorder for MockStakerIterator
func (*MockStakerIteratorMockRecorder) Next ¶
func (mr *MockStakerIteratorMockRecorder) Next() *gomock.Call
Next indicates an expected call of Next
func (*MockStakerIteratorMockRecorder) Release ¶
func (mr *MockStakerIteratorMockRecorder) Release() *gomock.Call
Release indicates an expected call of Release
func (*MockStakerIteratorMockRecorder) Value ¶
func (mr *MockStakerIteratorMockRecorder) Value() *gomock.Call
Value indicates an expected call of Value
type MockState ¶
type MockState struct {
// contains filtered or unexported fields
}
MockState is a mock of State interface.
func NewMockState ¶
func NewMockState(ctrl *gomock.Controller) *MockState
NewMockState creates a new mock instance.
func (*MockState) AddRewardUTXO ¶
AddRewardUTXO mocks base method.
func (*MockState) AddStatelessBlock ¶
AddStatelessBlock mocks base method.
func (*MockState) CommitBatch ¶
CommitBatch mocks base method.
func (*MockState) DeleteCurrentDelegator ¶
DeleteCurrentDelegator mocks base method.
func (*MockState) DeleteCurrentValidator ¶
DeleteCurrentValidator mocks base method.
func (*MockState) DeletePendingDelegator ¶
DeletePendingDelegator mocks base method.
func (*MockState) DeletePendingValidator ¶
DeletePendingValidator mocks base method.
func (*MockState) DeleteUTXO ¶
DeleteUTXO mocks base method.
func (*MockState) EXPECT ¶
func (m *MockState) EXPECT() *MockStateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockState) GetCurrentDelegatorIterator ¶
func (m *MockState) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
GetCurrentDelegatorIterator mocks base method.
func (*MockState) GetCurrentStakerIterator ¶
func (m *MockState) GetCurrentStakerIterator() (StakerIterator, error)
GetCurrentStakerIterator mocks base method.
func (*MockState) GetCurrentSupply ¶
GetCurrentSupply mocks base method.
func (*MockState) GetCurrentValidator ¶
GetCurrentValidator mocks base method.
func (*MockState) GetLastAccepted ¶
GetLastAccepted mocks base method.
func (*MockState) GetPendingDelegatorIterator ¶
func (m *MockState) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error)
GetPendingDelegatorIterator mocks base method.
func (*MockState) GetPendingStakerIterator ¶
func (m *MockState) GetPendingStakerIterator() (StakerIterator, error)
GetPendingStakerIterator mocks base method.
func (*MockState) GetPendingValidator ¶
GetPendingValidator mocks base method.
func (*MockState) GetRewardUTXOs ¶
GetRewardUTXOs mocks base method.
func (*MockState) GetStartTime ¶
GetStartTime mocks base method.
func (*MockState) GetStatelessBlock ¶
GetStatelessBlock mocks base method.
func (*MockState) GetSubnets ¶
GetSubnets mocks base method.
func (*MockState) GetTimestamp ¶
GetTimestamp mocks base method.
func (*MockState) GetValidatorWeightDiffs ¶
func (m *MockState) GetValidatorWeightDiffs(height uint64, subnetID ids.ID) (map[ids.NodeID]*ValidatorWeightDiff, error)
GetValidatorWeightDiffs mocks base method.
func (*MockState) PutCurrentDelegator ¶
PutCurrentDelegator mocks base method.
func (*MockState) PutCurrentValidator ¶
PutCurrentValidator mocks base method.
func (*MockState) PutPendingDelegator ¶
PutPendingDelegator mocks base method.
func (*MockState) PutPendingValidator ¶
PutPendingValidator mocks base method.
func (*MockState) SetCurrentSupply ¶
SetCurrentSupply mocks base method.
func (*MockState) SetLastAccepted ¶
SetLastAccepted mocks base method.
func (*MockState) SetTimestamp ¶
SetTimestamp mocks base method.
func (*MockState) SetUptime ¶
func (m *MockState) SetUptime(nodeID ids.NodeID, upDuration time.Duration, lastUpdated time.Time) error
SetUptime mocks base method.
func (*MockState) ValidatorSet ¶
ValidatorSet mocks base method.
type MockStateMockRecorder ¶
type MockStateMockRecorder struct {
// contains filtered or unexported fields
}
MockStateMockRecorder is the mock recorder for MockState.
func (*MockStateMockRecorder) Abort ¶
func (mr *MockStateMockRecorder) Abort() *gomock.Call
Abort indicates an expected call of Abort.
func (*MockStateMockRecorder) AddChain ¶
func (mr *MockStateMockRecorder) AddChain(createChainTx interface{}) *gomock.Call
AddChain indicates an expected call of AddChain.
func (*MockStateMockRecorder) AddRewardUTXO ¶
func (mr *MockStateMockRecorder) AddRewardUTXO(txID, utxo interface{}) *gomock.Call
AddRewardUTXO indicates an expected call of AddRewardUTXO.
func (*MockStateMockRecorder) AddStatelessBlock ¶
func (mr *MockStateMockRecorder) AddStatelessBlock(block, status interface{}) *gomock.Call
AddStatelessBlock indicates an expected call of AddStatelessBlock.
func (*MockStateMockRecorder) AddSubnet ¶
func (mr *MockStateMockRecorder) AddSubnet(createSubnetTx interface{}) *gomock.Call
AddSubnet indicates an expected call of AddSubnet.
func (*MockStateMockRecorder) AddTx ¶
func (mr *MockStateMockRecorder) AddTx(tx, status interface{}) *gomock.Call
AddTx indicates an expected call of AddTx.
func (*MockStateMockRecorder) AddUTXO ¶
func (mr *MockStateMockRecorder) AddUTXO(utxo interface{}) *gomock.Call
AddUTXO indicates an expected call of AddUTXO.
func (*MockStateMockRecorder) Close ¶
func (mr *MockStateMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockStateMockRecorder) Commit ¶
func (mr *MockStateMockRecorder) Commit() *gomock.Call
Commit indicates an expected call of Commit.
func (*MockStateMockRecorder) CommitBatch ¶
func (mr *MockStateMockRecorder) CommitBatch() *gomock.Call
CommitBatch indicates an expected call of CommitBatch.
func (*MockStateMockRecorder) DeleteCurrentDelegator ¶
func (mr *MockStateMockRecorder) DeleteCurrentDelegator(staker interface{}) *gomock.Call
DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.
func (*MockStateMockRecorder) DeleteCurrentValidator ¶
func (mr *MockStateMockRecorder) DeleteCurrentValidator(staker interface{}) *gomock.Call
DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.
func (*MockStateMockRecorder) DeletePendingDelegator ¶
func (mr *MockStateMockRecorder) DeletePendingDelegator(staker interface{}) *gomock.Call
DeletePendingDelegator indicates an expected call of DeletePendingDelegator.
func (*MockStateMockRecorder) DeletePendingValidator ¶
func (mr *MockStateMockRecorder) DeletePendingValidator(staker interface{}) *gomock.Call
DeletePendingValidator indicates an expected call of DeletePendingValidator.
func (*MockStateMockRecorder) DeleteUTXO ¶
func (mr *MockStateMockRecorder) DeleteUTXO(utxoID interface{}) *gomock.Call
DeleteUTXO indicates an expected call of DeleteUTXO.
func (*MockStateMockRecorder) GetChains ¶
func (mr *MockStateMockRecorder) GetChains(subnetID interface{}) *gomock.Call
GetChains indicates an expected call of GetChains.
func (*MockStateMockRecorder) GetCurrentDelegatorIterator ¶
func (mr *MockStateMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
GetCurrentDelegatorIterator indicates an expected call of GetCurrentDelegatorIterator.
func (*MockStateMockRecorder) GetCurrentStakerIterator ¶
func (mr *MockStateMockRecorder) GetCurrentStakerIterator() *gomock.Call
GetCurrentStakerIterator indicates an expected call of GetCurrentStakerIterator.
func (*MockStateMockRecorder) GetCurrentSupply ¶
func (mr *MockStateMockRecorder) GetCurrentSupply() *gomock.Call
GetCurrentSupply indicates an expected call of GetCurrentSupply.
func (*MockStateMockRecorder) GetCurrentValidator ¶
func (mr *MockStateMockRecorder) GetCurrentValidator(subnetID, nodeID interface{}) *gomock.Call
GetCurrentValidator indicates an expected call of GetCurrentValidator.
func (*MockStateMockRecorder) GetLastAccepted ¶
func (mr *MockStateMockRecorder) GetLastAccepted() *gomock.Call
GetLastAccepted indicates an expected call of GetLastAccepted.
func (*MockStateMockRecorder) GetPendingDelegatorIterator ¶
func (mr *MockStateMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID interface{}) *gomock.Call
GetPendingDelegatorIterator indicates an expected call of GetPendingDelegatorIterator.
func (*MockStateMockRecorder) GetPendingStakerIterator ¶
func (mr *MockStateMockRecorder) GetPendingStakerIterator() *gomock.Call
GetPendingStakerIterator indicates an expected call of GetPendingStakerIterator.
func (*MockStateMockRecorder) GetPendingValidator ¶
func (mr *MockStateMockRecorder) GetPendingValidator(subnetID, nodeID interface{}) *gomock.Call
GetPendingValidator indicates an expected call of GetPendingValidator.
func (*MockStateMockRecorder) GetRewardUTXOs ¶
func (mr *MockStateMockRecorder) GetRewardUTXOs(txID interface{}) *gomock.Call
GetRewardUTXOs indicates an expected call of GetRewardUTXOs.
func (*MockStateMockRecorder) GetStartTime ¶
func (mr *MockStateMockRecorder) GetStartTime(nodeID interface{}) *gomock.Call
GetStartTime indicates an expected call of GetStartTime.
func (*MockStateMockRecorder) GetStatelessBlock ¶
func (mr *MockStateMockRecorder) GetStatelessBlock(blockID interface{}) *gomock.Call
GetStatelessBlock indicates an expected call of GetStatelessBlock.
func (*MockStateMockRecorder) GetSubnets ¶
func (mr *MockStateMockRecorder) GetSubnets() *gomock.Call
GetSubnets indicates an expected call of GetSubnets.
func (*MockStateMockRecorder) GetTimestamp ¶
func (mr *MockStateMockRecorder) GetTimestamp() *gomock.Call
GetTimestamp indicates an expected call of GetTimestamp.
func (*MockStateMockRecorder) GetTx ¶
func (mr *MockStateMockRecorder) GetTx(txID interface{}) *gomock.Call
GetTx indicates an expected call of GetTx.
func (*MockStateMockRecorder) GetUTXO ¶
func (mr *MockStateMockRecorder) GetUTXO(utxoID interface{}) *gomock.Call
GetUTXO indicates an expected call of GetUTXO.
func (*MockStateMockRecorder) GetUptime ¶
func (mr *MockStateMockRecorder) GetUptime(nodeID interface{}) *gomock.Call
GetUptime indicates an expected call of GetUptime.
func (*MockStateMockRecorder) GetValidatorWeightDiffs ¶
func (mr *MockStateMockRecorder) GetValidatorWeightDiffs(height, subnetID interface{}) *gomock.Call
GetValidatorWeightDiffs indicates an expected call of GetValidatorWeightDiffs.
func (*MockStateMockRecorder) PutCurrentDelegator ¶
func (mr *MockStateMockRecorder) PutCurrentDelegator(staker interface{}) *gomock.Call
PutCurrentDelegator indicates an expected call of PutCurrentDelegator.
func (*MockStateMockRecorder) PutCurrentValidator ¶
func (mr *MockStateMockRecorder) PutCurrentValidator(staker interface{}) *gomock.Call
PutCurrentValidator indicates an expected call of PutCurrentValidator.
func (*MockStateMockRecorder) PutPendingDelegator ¶
func (mr *MockStateMockRecorder) PutPendingDelegator(staker interface{}) *gomock.Call
PutPendingDelegator indicates an expected call of PutPendingDelegator.
func (*MockStateMockRecorder) PutPendingValidator ¶
func (mr *MockStateMockRecorder) PutPendingValidator(staker interface{}) *gomock.Call
PutPendingValidator indicates an expected call of PutPendingValidator.
func (*MockStateMockRecorder) SetCurrentSupply ¶
func (mr *MockStateMockRecorder) SetCurrentSupply(cs interface{}) *gomock.Call
SetCurrentSupply indicates an expected call of SetCurrentSupply.
func (*MockStateMockRecorder) SetHeight ¶
func (mr *MockStateMockRecorder) SetHeight(height interface{}) *gomock.Call
SetHeight indicates an expected call of SetHeight.
func (*MockStateMockRecorder) SetLastAccepted ¶
func (mr *MockStateMockRecorder) SetLastAccepted(blkID interface{}) *gomock.Call
SetLastAccepted indicates an expected call of SetLastAccepted.
func (*MockStateMockRecorder) SetTimestamp ¶
func (mr *MockStateMockRecorder) SetTimestamp(tm interface{}) *gomock.Call
SetTimestamp indicates an expected call of SetTimestamp.
func (*MockStateMockRecorder) SetUptime ¶
func (mr *MockStateMockRecorder) SetUptime(nodeID, upDuration, lastUpdated interface{}) *gomock.Call
SetUptime indicates an expected call of SetUptime.
func (*MockStateMockRecorder) UTXOIDs ¶
func (mr *MockStateMockRecorder) UTXOIDs(addr, previous, limit interface{}) *gomock.Call
UTXOIDs indicates an expected call of UTXOIDs.
func (*MockStateMockRecorder) ValidatorSet ¶
func (mr *MockStateMockRecorder) ValidatorSet(subnetID interface{}) *gomock.Call
ValidatorSet indicates an expected call of ValidatorSet.
type MockVersions ¶
type MockVersions struct {
// contains filtered or unexported fields
}
MockVersions is a mock of Versions interface.
func NewMockVersions ¶
func NewMockVersions(ctrl *gomock.Controller) *MockVersions
NewMockVersions creates a new mock instance.
func (*MockVersions) EXPECT ¶
func (m *MockVersions) EXPECT() *MockVersionsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockVersionsMockRecorder ¶
type MockVersionsMockRecorder struct {
// contains filtered or unexported fields
}
MockVersionsMockRecorder is the mock recorder for MockVersions.
func (*MockVersionsMockRecorder) GetState ¶
func (mr *MockVersionsMockRecorder) GetState(arg0 interface{}) *gomock.Call
GetState indicates an expected call of GetState.
type PendingStakers ¶
type PendingStakers interface { // GetPendingValidator returns the Staker describing the validator on // [subnetID] with [nodeID]. If the validator does not exist, // [database.ErrNotFound] is returned. GetPendingValidator(subnetID ids.ID, nodeID ids.NodeID) (*Staker, error) // PutPendingValidator adds the [staker] describing a validator to the // staker set. PutPendingValidator(staker *Staker) // DeletePendingValidator removes the [staker] describing a validator from // the staker set. DeletePendingValidator(staker *Staker) // GetPendingDelegatorIterator returns the delegators associated with the // validator on [subnetID] with [nodeID]. Delegators are sorted by their // removal from pending staker set. GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (StakerIterator, error) // PutPendingDelegator adds the [staker] describing a delegator to the // staker set. PutPendingDelegator(staker *Staker) // DeletePendingDelegator removes the [staker] describing a delegator from // the staker set. DeletePendingDelegator(staker *Staker) // GetPendingStakerIterator returns stakers in order of their removal from // the pending staker set. GetPendingStakerIterator() (StakerIterator, error) }
type Priority ¶
type Priority byte
const ( // First subnet delegators are removed from the current validator set, SubnetDelegatorCurrentPriority Priority = iota + 1 // then subnet validators, SubnetValidatorCurrentPriority // then primary network delegators, PrimaryNetworkDelegatorCurrentPriority // then primary network validators. PrimaryNetworkValidatorCurrentPriority )
const ( // First primary network delegators are moved from the pending to the // current validator set, PrimaryNetworkDelegatorPendingPriority Priority = iota + 1 // then primary network validators, PrimaryNetworkValidatorPendingPriority // then subnet validators, SubnetValidatorPendingPriority // then subnet delegators. SubnetDelegatorPendingPriority )
type Staker ¶
type Staker struct { TxID ids.ID NodeID ids.NodeID SubnetID ids.ID Weight uint64 StartTime time.Time EndTime time.Time PotentialReward uint64 // NextTime is the next time this staker will be moved from a validator set. // If the staker is in the pending validator set, NextTime will equal // StartTime. If the staker is in the current validator set, NextTime will // equal EndTime. NextTime time.Time // Priority specifies how to break ties between stakers with the same // NextTime. This ensures that stakers created by the same transaction type // are grouped together. The ordering of these groups is documented in // [priorities.go] and depends on if the stakers are in the pending or // current validator set. Priority Priority }
Staker contains all information required to represent a validator or delegator in the current and pending validator sets.
func NewPrimaryNetworkStaker ¶
func NewSubnetStaker ¶
func NewSubnetStaker(txID ids.ID, vdr *validator.SubnetValidator) *Staker
func (*Staker) Less ¶
A *Staker is considered to be less than another *Staker when:
- If its NextTime is before the other's.
- If the NextTimes are the same, the *Staker with the lesser priority is the lesser one.
- If the priorities are also the same, the one with the lesser txID is lesser.
Invariant: [thanIntf] is a *Staker.
type StakerDiffIterator ¶
type StakerDiffIterator interface { Next() bool // Returns: // - The staker that is changing // - True if the staker is being added to the current staker set, false if // the staker is being removed from the current staker set Value() (*Staker, bool) Release() }
StakerDiffIterator is an iterator that iterates over the events that will be performed on the current staker set.
There are two event types affecting current staker set, removal of an existing staker and addition of a new staker from the pending set.
The ordering of operations is:
- Staker operations are performed in order of their [NextTime].
- If operations have the same [NextTime], stakers are first added to the current staker set, then removed.
- Further ties are broken by *Staker.Less(), returning the lesser staker first.
func NewStakerDiffIterator ¶
func NewStakerDiffIterator(currentIterator, pendingIterator StakerIterator) StakerDiffIterator
type StakerIterator ¶
type StakerIterator interface { // Next attempts to move the iterator to the next staker. It returns false // once there are no more stakers to return. Next() bool // Value returns the current staker. Value should only be called after a // call to Next which returned true. Value() *Staker // Release any resources associated with the iterator. This must be called // after the interator is no longer needed. Release() }
StakerIterator defines an interface for iterating over a set of stakers.
var EmptyIterator StakerIterator = emptyIterator{}
EmptyIterator contains no stakers.
func NewMaskedIterator ¶
func NewMaskedIterator(parentIterator StakerIterator, maskedStakers map[ids.ID]*Staker) StakerIterator
NewMaskedIterator returns a new iterator that skips the stakers in [parentIterator] that are present in [maskedStakers].
func NewMergedIterator ¶
func NewMergedIterator(stakers ...StakerIterator) StakerIterator
Returns an iterator that returns all of the elements of [stakers] in order.
func NewTreeIterator ¶
func NewTreeIterator(tree *btree.BTree) StakerIterator
NewTreeIterator returns a new iterator of the stakers in [tree] in ascending order.
type Stakers ¶
type Stakers interface { CurrentStakers PendingStakers }
type State ¶
type State interface { LastAccepteder Chain BlockState uptime.State avax.UTXOReader GetValidatorWeightDiffs(height uint64, subnetID ids.ID) (map[ids.NodeID]*ValidatorWeightDiff, error) // Return the current validator set of [subnetID]. ValidatorSet(subnetID ids.ID) (validators.Set, error) SetHeight(height uint64) // Discard uncommitted changes to the database. Abort() // Commit changes to the base database. Commit() error // Returns a batch of unwritten changes that, when written, will be commit // all pending changes to the base database. CommitBatch() (database.Batch, error) Close() error }
func New ¶
func New( db database.Database, genesisBytes []byte, metrics prometheus.Registerer, cfg *config.Config, ctx *snow.Context, localStake prometheus.Gauge, totalStake prometheus.Gauge, rewards reward.Calculator, ) (State, error)