state

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: BSD-3-Clause Imports: 35 Imported by: 0

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.

Package state is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDelegatorSubset = errors.New("delegator's time range must be a subset of the validator's time range")
)
View Source
var (
	ErrMissingParentState = errors.New("missing parent state")
)

Functions

This section is empty.

Types

type BlockState

type BlockState interface {
	GetStatelessBlock(blockID ids.ID) (blocks.Block, choices.Status, error)
	AddStatelessBlock(block blocks.Block, status choices.Status)
}

type Chain

type Chain interface {
	Stakers
	UTXOAdder
	UTXOGetter
	UTXODeleter

	GetTimestamp() time.Time
	SetTimestamp(tm time.Time)

	GetCurrentSupply(subnetID ids.ID) (uint64, error)
	SetCurrentSupply(subnetID ids.ID, cs uint64)

	GetRewardUTXOs(txID ids.ID) ([]*djtx.UTXO, error)
	AddRewardUTXO(txID ids.ID, utxo *djtx.UTXO)

	GetSubnets() ([]*txs.Tx, error)
	AddSubnet(createSubnetTx *txs.Tx)

	GetSubnetTransformation(subnetID ids.ID) (*txs.Tx, error)
	AddSubnetTransformation(transformSubnetTx *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.
	//
	// Invariant: [staker] is not currently a CurrentValidator
	PutCurrentValidator(staker *Staker)

	// DeleteCurrentValidator removes the [staker] describing a validator from
	// the staker set.
	//
	// Invariant: [staker] is currently a CurrentValidator
	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.
	//
	// Invariant: [staker] is not currently a CurrentDelegator
	PutCurrentDelegator(staker *Staker)

	// DeleteCurrentDelegator removes the [staker] describing a delegator from
	// the staker set.
	//
	// Invariant: [staker] is currently a CurrentDelegator
	DeleteCurrentDelegator(staker *Staker)

	// GetCurrentStakerIterator returns stakers in order of their removal from
	// the current staker set.
	GetCurrentStakerIterator() (StakerIterator, error)
}

type Diff

type Diff interface {
	Chain

	Apply(State)
}

func NewDiff

func NewDiff(
	parentID ids.ID,
	stateVersions Versions,
) (Diff, error)

type LastAccepteder

type LastAccepteder interface {
	GetLastAccepted() ids.ID
	SetLastAccepted(blkID ids.ID)
}

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

func (m *MockChain) AddChain(arg0 *txs.Tx)

AddChain mocks base method.

func (*MockChain) AddRewardUTXO

func (m *MockChain) AddRewardUTXO(arg0 ids.ID, arg1 *djtx.UTXO)

AddRewardUTXO mocks base method.

func (*MockChain) AddSubnet

func (m *MockChain) AddSubnet(arg0 *txs.Tx)

AddSubnet mocks base method.

func (*MockChain) AddSubnetTransformation

func (m *MockChain) AddSubnetTransformation(arg0 *txs.Tx)

AddSubnetTransformation mocks base method.

func (*MockChain) AddTx

func (m *MockChain) AddTx(arg0 *txs.Tx, arg1 status.Status)

AddTx mocks base method.

func (*MockChain) AddUTXO

func (m *MockChain) AddUTXO(arg0 *djtx.UTXO)

AddUTXO mocks base method.

func (*MockChain) DeleteCurrentDelegator

func (m *MockChain) DeleteCurrentDelegator(arg0 *Staker)

DeleteCurrentDelegator mocks base method.

func (*MockChain) DeleteCurrentValidator

func (m *MockChain) DeleteCurrentValidator(arg0 *Staker)

DeleteCurrentValidator mocks base method.

func (*MockChain) DeletePendingDelegator

func (m *MockChain) DeletePendingDelegator(arg0 *Staker)

DeletePendingDelegator mocks base method.

func (*MockChain) DeletePendingValidator

func (m *MockChain) DeletePendingValidator(arg0 *Staker)

DeletePendingValidator mocks base method.

func (*MockChain) DeleteUTXO

func (m *MockChain) DeleteUTXO(arg0 ids.ID)

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

func (m *MockChain) GetChains(arg0 ids.ID) ([]*txs.Tx, error)

GetChains mocks base method.

func (*MockChain) GetCurrentDelegatorIterator

func (m *MockChain) GetCurrentDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (StakerIterator, error)

GetCurrentDelegatorIterator mocks base method.

func (*MockChain) GetCurrentStakerIterator

func (m *MockChain) GetCurrentStakerIterator() (StakerIterator, error)

GetCurrentStakerIterator mocks base method.

func (*MockChain) GetCurrentSupply

func (m *MockChain) GetCurrentSupply(arg0 ids.ID) (uint64, error)

GetCurrentSupply mocks base method.

func (*MockChain) GetCurrentValidator

func (m *MockChain) GetCurrentValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, error)

GetCurrentValidator mocks base method.

func (*MockChain) GetPendingDelegatorIterator

func (m *MockChain) GetPendingDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (StakerIterator, error)

GetPendingDelegatorIterator mocks base method.

func (*MockChain) GetPendingStakerIterator

func (m *MockChain) GetPendingStakerIterator() (StakerIterator, error)

GetPendingStakerIterator mocks base method.

func (*MockChain) GetPendingValidator

func (m *MockChain) GetPendingValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, error)

GetPendingValidator mocks base method.

func (*MockChain) GetRewardUTXOs

func (m *MockChain) GetRewardUTXOs(arg0 ids.ID) ([]*djtx.UTXO, error)

GetRewardUTXOs mocks base method.

func (*MockChain) GetSubnetTransformation

func (m *MockChain) GetSubnetTransformation(arg0 ids.ID) (*txs.Tx, error)

GetSubnetTransformation mocks base method.

func (*MockChain) GetSubnets

func (m *MockChain) GetSubnets() ([]*txs.Tx, error)

GetSubnets mocks base method.

func (*MockChain) GetTimestamp

func (m *MockChain) GetTimestamp() time.Time

GetTimestamp mocks base method.

func (*MockChain) GetTx

func (m *MockChain) GetTx(arg0 ids.ID) (*txs.Tx, status.Status, error)

GetTx mocks base method.

func (*MockChain) GetUTXO

func (m *MockChain) GetUTXO(arg0 ids.ID) (*djtx.UTXO, error)

GetUTXO mocks base method.

func (*MockChain) PutCurrentDelegator

func (m *MockChain) PutCurrentDelegator(arg0 *Staker)

PutCurrentDelegator mocks base method.

func (*MockChain) PutCurrentValidator

func (m *MockChain) PutCurrentValidator(arg0 *Staker)

PutCurrentValidator mocks base method.

func (*MockChain) PutPendingDelegator

func (m *MockChain) PutPendingDelegator(arg0 *Staker)

PutPendingDelegator mocks base method.

func (*MockChain) PutPendingValidator

func (m *MockChain) PutPendingValidator(arg0 *Staker)

PutPendingValidator mocks base method.

func (*MockChain) SetCurrentSupply

func (m *MockChain) SetCurrentSupply(arg0 ids.ID, arg1 uint64)

SetCurrentSupply mocks base method.

func (*MockChain) SetTimestamp

func (m *MockChain) SetTimestamp(arg0 time.Time)

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(arg0 interface{}) *gomock.Call

AddChain indicates an expected call of AddChain.

func (*MockChainMockRecorder) AddRewardUTXO

func (mr *MockChainMockRecorder) AddRewardUTXO(arg0, arg1 interface{}) *gomock.Call

AddRewardUTXO indicates an expected call of AddRewardUTXO.

func (*MockChainMockRecorder) AddSubnet

func (mr *MockChainMockRecorder) AddSubnet(arg0 interface{}) *gomock.Call

AddSubnet indicates an expected call of AddSubnet.

func (*MockChainMockRecorder) AddSubnetTransformation

func (mr *MockChainMockRecorder) AddSubnetTransformation(arg0 interface{}) *gomock.Call

AddSubnetTransformation indicates an expected call of AddSubnetTransformation.

func (*MockChainMockRecorder) AddTx

func (mr *MockChainMockRecorder) AddTx(arg0, arg1 interface{}) *gomock.Call

AddTx indicates an expected call of AddTx.

func (*MockChainMockRecorder) AddUTXO

func (mr *MockChainMockRecorder) AddUTXO(arg0 interface{}) *gomock.Call

AddUTXO indicates an expected call of AddUTXO.

func (*MockChainMockRecorder) DeleteCurrentDelegator

func (mr *MockChainMockRecorder) DeleteCurrentDelegator(arg0 interface{}) *gomock.Call

DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.

func (*MockChainMockRecorder) DeleteCurrentValidator

func (mr *MockChainMockRecorder) DeleteCurrentValidator(arg0 interface{}) *gomock.Call

DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.

func (*MockChainMockRecorder) DeletePendingDelegator

func (mr *MockChainMockRecorder) DeletePendingDelegator(arg0 interface{}) *gomock.Call

DeletePendingDelegator indicates an expected call of DeletePendingDelegator.

func (*MockChainMockRecorder) DeletePendingValidator

func (mr *MockChainMockRecorder) DeletePendingValidator(arg0 interface{}) *gomock.Call

DeletePendingValidator indicates an expected call of DeletePendingValidator.

func (*MockChainMockRecorder) DeleteUTXO

func (mr *MockChainMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call

DeleteUTXO indicates an expected call of DeleteUTXO.

func (*MockChainMockRecorder) GetChains

func (mr *MockChainMockRecorder) GetChains(arg0 interface{}) *gomock.Call

GetChains indicates an expected call of GetChains.

func (*MockChainMockRecorder) GetCurrentDelegatorIterator

func (mr *MockChainMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 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(arg0 interface{}) *gomock.Call

GetCurrentSupply indicates an expected call of GetCurrentSupply.

func (*MockChainMockRecorder) GetCurrentValidator

func (mr *MockChainMockRecorder) GetCurrentValidator(arg0, arg1 interface{}) *gomock.Call

GetCurrentValidator indicates an expected call of GetCurrentValidator.

func (*MockChainMockRecorder) GetPendingDelegatorIterator

func (mr *MockChainMockRecorder) GetPendingDelegatorIterator(arg0, arg1 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(arg0, arg1 interface{}) *gomock.Call

GetPendingValidator indicates an expected call of GetPendingValidator.

func (*MockChainMockRecorder) GetRewardUTXOs

func (mr *MockChainMockRecorder) GetRewardUTXOs(arg0 interface{}) *gomock.Call

GetRewardUTXOs indicates an expected call of GetRewardUTXOs.

func (*MockChainMockRecorder) GetSubnetTransformation

func (mr *MockChainMockRecorder) GetSubnetTransformation(arg0 interface{}) *gomock.Call

GetSubnetTransformation indicates an expected call of GetSubnetTransformation.

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(arg0 interface{}) *gomock.Call

GetTx indicates an expected call of GetTx.

func (*MockChainMockRecorder) GetUTXO

func (mr *MockChainMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call

GetUTXO indicates an expected call of GetUTXO.

func (*MockChainMockRecorder) PutCurrentDelegator

func (mr *MockChainMockRecorder) PutCurrentDelegator(arg0 interface{}) *gomock.Call

PutCurrentDelegator indicates an expected call of PutCurrentDelegator.

func (*MockChainMockRecorder) PutCurrentValidator

func (mr *MockChainMockRecorder) PutCurrentValidator(arg0 interface{}) *gomock.Call

PutCurrentValidator indicates an expected call of PutCurrentValidator.

func (*MockChainMockRecorder) PutPendingDelegator

func (mr *MockChainMockRecorder) PutPendingDelegator(arg0 interface{}) *gomock.Call

PutPendingDelegator indicates an expected call of PutPendingDelegator.

func (*MockChainMockRecorder) PutPendingValidator

func (mr *MockChainMockRecorder) PutPendingValidator(arg0 interface{}) *gomock.Call

PutPendingValidator indicates an expected call of PutPendingValidator.

func (*MockChainMockRecorder) SetCurrentSupply

func (mr *MockChainMockRecorder) SetCurrentSupply(arg0, arg1 interface{}) *gomock.Call

SetCurrentSupply indicates an expected call of SetCurrentSupply.

func (*MockChainMockRecorder) SetTimestamp

func (mr *MockChainMockRecorder) SetTimestamp(arg0 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) AddChain

func (m *MockDiff) AddChain(arg0 *txs.Tx)

AddChain mocks base method.

func (*MockDiff) AddRewardUTXO

func (m *MockDiff) AddRewardUTXO(arg0 ids.ID, arg1 *djtx.UTXO)

AddRewardUTXO mocks base method.

func (*MockDiff) AddSubnet

func (m *MockDiff) AddSubnet(arg0 *txs.Tx)

AddSubnet mocks base method.

func (*MockDiff) AddSubnetTransformation

func (m *MockDiff) AddSubnetTransformation(arg0 *txs.Tx)

AddSubnetTransformation mocks base method.

func (*MockDiff) AddTx

func (m *MockDiff) AddTx(arg0 *txs.Tx, arg1 status.Status)

AddTx mocks base method.

func (*MockDiff) AddUTXO

func (m *MockDiff) AddUTXO(arg0 *djtx.UTXO)

AddUTXO mocks base method.

func (*MockDiff) Apply

func (m *MockDiff) Apply(arg0 State)

Apply mocks base method.

func (*MockDiff) DeleteCurrentDelegator

func (m *MockDiff) DeleteCurrentDelegator(arg0 *Staker)

DeleteCurrentDelegator mocks base method.

func (*MockDiff) DeleteCurrentValidator

func (m *MockDiff) DeleteCurrentValidator(arg0 *Staker)

DeleteCurrentValidator mocks base method.

func (*MockDiff) DeletePendingDelegator

func (m *MockDiff) DeletePendingDelegator(arg0 *Staker)

DeletePendingDelegator mocks base method.

func (*MockDiff) DeletePendingValidator

func (m *MockDiff) DeletePendingValidator(arg0 *Staker)

DeletePendingValidator mocks base method.

func (*MockDiff) DeleteUTXO

func (m *MockDiff) DeleteUTXO(arg0 ids.ID)

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

func (m *MockDiff) GetChains(arg0 ids.ID) ([]*txs.Tx, error)

GetChains mocks base method.

func (*MockDiff) GetCurrentDelegatorIterator

func (m *MockDiff) GetCurrentDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (StakerIterator, error)

GetCurrentDelegatorIterator mocks base method.

func (*MockDiff) GetCurrentStakerIterator

func (m *MockDiff) GetCurrentStakerIterator() (StakerIterator, error)

GetCurrentStakerIterator mocks base method.

func (*MockDiff) GetCurrentSupply

func (m *MockDiff) GetCurrentSupply(arg0 ids.ID) (uint64, error)

GetCurrentSupply mocks base method.

func (*MockDiff) GetCurrentValidator

func (m *MockDiff) GetCurrentValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, error)

GetCurrentValidator mocks base method.

func (*MockDiff) GetPendingDelegatorIterator

func (m *MockDiff) GetPendingDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (StakerIterator, error)

GetPendingDelegatorIterator mocks base method.

func (*MockDiff) GetPendingStakerIterator

func (m *MockDiff) GetPendingStakerIterator() (StakerIterator, error)

GetPendingStakerIterator mocks base method.

func (*MockDiff) GetPendingValidator

func (m *MockDiff) GetPendingValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, error)

GetPendingValidator mocks base method.

func (*MockDiff) GetRewardUTXOs

func (m *MockDiff) GetRewardUTXOs(arg0 ids.ID) ([]*djtx.UTXO, error)

GetRewardUTXOs mocks base method.

func (*MockDiff) GetSubnetTransformation

func (m *MockDiff) GetSubnetTransformation(arg0 ids.ID) (*txs.Tx, error)

GetSubnetTransformation mocks base method.

func (*MockDiff) GetSubnets

func (m *MockDiff) GetSubnets() ([]*txs.Tx, error)

GetSubnets mocks base method.

func (*MockDiff) GetTimestamp

func (m *MockDiff) GetTimestamp() time.Time

GetTimestamp mocks base method.

func (*MockDiff) GetTx

func (m *MockDiff) GetTx(arg0 ids.ID) (*txs.Tx, status.Status, error)

GetTx mocks base method.

func (*MockDiff) GetUTXO

func (m *MockDiff) GetUTXO(arg0 ids.ID) (*djtx.UTXO, error)

GetUTXO mocks base method.

func (*MockDiff) PutCurrentDelegator

func (m *MockDiff) PutCurrentDelegator(arg0 *Staker)

PutCurrentDelegator mocks base method.

func (*MockDiff) PutCurrentValidator

func (m *MockDiff) PutCurrentValidator(arg0 *Staker)

PutCurrentValidator mocks base method.

func (*MockDiff) PutPendingDelegator

func (m *MockDiff) PutPendingDelegator(arg0 *Staker)

PutPendingDelegator mocks base method.

func (*MockDiff) PutPendingValidator

func (m *MockDiff) PutPendingValidator(arg0 *Staker)

PutPendingValidator mocks base method.

func (*MockDiff) SetCurrentSupply

func (m *MockDiff) SetCurrentSupply(arg0 ids.ID, arg1 uint64)

SetCurrentSupply mocks base method.

func (*MockDiff) SetTimestamp

func (m *MockDiff) SetTimestamp(arg0 time.Time)

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(arg0 interface{}) *gomock.Call

AddChain indicates an expected call of AddChain.

func (*MockDiffMockRecorder) AddRewardUTXO

func (mr *MockDiffMockRecorder) AddRewardUTXO(arg0, arg1 interface{}) *gomock.Call

AddRewardUTXO indicates an expected call of AddRewardUTXO.

func (*MockDiffMockRecorder) AddSubnet

func (mr *MockDiffMockRecorder) AddSubnet(arg0 interface{}) *gomock.Call

AddSubnet indicates an expected call of AddSubnet.

func (*MockDiffMockRecorder) AddSubnetTransformation

func (mr *MockDiffMockRecorder) AddSubnetTransformation(arg0 interface{}) *gomock.Call

AddSubnetTransformation indicates an expected call of AddSubnetTransformation.

func (*MockDiffMockRecorder) AddTx

func (mr *MockDiffMockRecorder) AddTx(arg0, arg1 interface{}) *gomock.Call

AddTx indicates an expected call of AddTx.

func (*MockDiffMockRecorder) AddUTXO

func (mr *MockDiffMockRecorder) AddUTXO(arg0 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(arg0 interface{}) *gomock.Call

DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.

func (*MockDiffMockRecorder) DeleteCurrentValidator

func (mr *MockDiffMockRecorder) DeleteCurrentValidator(arg0 interface{}) *gomock.Call

DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.

func (*MockDiffMockRecorder) DeletePendingDelegator

func (mr *MockDiffMockRecorder) DeletePendingDelegator(arg0 interface{}) *gomock.Call

DeletePendingDelegator indicates an expected call of DeletePendingDelegator.

func (*MockDiffMockRecorder) DeletePendingValidator

func (mr *MockDiffMockRecorder) DeletePendingValidator(arg0 interface{}) *gomock.Call

DeletePendingValidator indicates an expected call of DeletePendingValidator.

func (*MockDiffMockRecorder) DeleteUTXO

func (mr *MockDiffMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call

DeleteUTXO indicates an expected call of DeleteUTXO.

func (*MockDiffMockRecorder) GetChains

func (mr *MockDiffMockRecorder) GetChains(arg0 interface{}) *gomock.Call

GetChains indicates an expected call of GetChains.

func (*MockDiffMockRecorder) GetCurrentDelegatorIterator

func (mr *MockDiffMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 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(arg0 interface{}) *gomock.Call

GetCurrentSupply indicates an expected call of GetCurrentSupply.

func (*MockDiffMockRecorder) GetCurrentValidator

func (mr *MockDiffMockRecorder) GetCurrentValidator(arg0, arg1 interface{}) *gomock.Call

GetCurrentValidator indicates an expected call of GetCurrentValidator.

func (*MockDiffMockRecorder) GetPendingDelegatorIterator

func (mr *MockDiffMockRecorder) GetPendingDelegatorIterator(arg0, arg1 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(arg0, arg1 interface{}) *gomock.Call

GetPendingValidator indicates an expected call of GetPendingValidator.

func (*MockDiffMockRecorder) GetRewardUTXOs

func (mr *MockDiffMockRecorder) GetRewardUTXOs(arg0 interface{}) *gomock.Call

GetRewardUTXOs indicates an expected call of GetRewardUTXOs.

func (*MockDiffMockRecorder) GetSubnetTransformation

func (mr *MockDiffMockRecorder) GetSubnetTransformation(arg0 interface{}) *gomock.Call

GetSubnetTransformation indicates an expected call of GetSubnetTransformation.

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(arg0 interface{}) *gomock.Call

GetTx indicates an expected call of GetTx.

func (*MockDiffMockRecorder) GetUTXO

func (mr *MockDiffMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call

GetUTXO indicates an expected call of GetUTXO.

func (*MockDiffMockRecorder) PutCurrentDelegator

func (mr *MockDiffMockRecorder) PutCurrentDelegator(arg0 interface{}) *gomock.Call

PutCurrentDelegator indicates an expected call of PutCurrentDelegator.

func (*MockDiffMockRecorder) PutCurrentValidator

func (mr *MockDiffMockRecorder) PutCurrentValidator(arg0 interface{}) *gomock.Call

PutCurrentValidator indicates an expected call of PutCurrentValidator.

func (*MockDiffMockRecorder) PutPendingDelegator

func (mr *MockDiffMockRecorder) PutPendingDelegator(arg0 interface{}) *gomock.Call

PutPendingDelegator indicates an expected call of PutPendingDelegator.

func (*MockDiffMockRecorder) PutPendingValidator

func (mr *MockDiffMockRecorder) PutPendingValidator(arg0 interface{}) *gomock.Call

PutPendingValidator indicates an expected call of PutPendingValidator.

func (*MockDiffMockRecorder) SetCurrentSupply

func (mr *MockDiffMockRecorder) SetCurrentSupply(arg0, arg1 interface{}) *gomock.Call

SetCurrentSupply indicates an expected call of SetCurrentSupply.

func (*MockDiffMockRecorder) SetTimestamp

func (mr *MockDiffMockRecorder) SetTimestamp(arg0 interface{}) *gomock.Call

SetTimestamp indicates an expected call of SetTimestamp.

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

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStakerIterator) Next

func (m *MockStakerIterator) Next() bool

Next mocks base method.

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

Next indicates an expected call of Next.

func (*MockStakerIteratorMockRecorder) Release

Release indicates an expected call of Release.

func (*MockStakerIteratorMockRecorder) Value

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

func (m *MockState) Abort()

Abort mocks base method.

func (*MockState) AddChain

func (m *MockState) AddChain(arg0 *txs.Tx)

AddChain mocks base method.

func (*MockState) AddRewardUTXO

func (m *MockState) AddRewardUTXO(arg0 ids.ID, arg1 *djtx.UTXO)

AddRewardUTXO mocks base method.

func (*MockState) AddStatelessBlock

func (m *MockState) AddStatelessBlock(arg0 blocks.Block, arg1 choices.Status)

AddStatelessBlock mocks base method.

func (*MockState) AddSubnet

func (m *MockState) AddSubnet(arg0 *txs.Tx)

AddSubnet mocks base method.

func (*MockState) AddSubnetTransformation

func (m *MockState) AddSubnetTransformation(arg0 *txs.Tx)

AddSubnetTransformation mocks base method.

func (*MockState) AddTx

func (m *MockState) AddTx(arg0 *txs.Tx, arg1 status.Status)

AddTx mocks base method.

func (*MockState) AddUTXO

func (m *MockState) AddUTXO(arg0 *djtx.UTXO)

AddUTXO mocks base method.

func (*MockState) Close

func (m *MockState) Close() error

Close mocks base method.

func (*MockState) Commit

func (m *MockState) Commit() error

Commit mocks base method.

func (*MockState) CommitBatch

func (m *MockState) CommitBatch() (database.Batch, error)

CommitBatch mocks base method.

func (*MockState) DeleteCurrentDelegator

func (m *MockState) DeleteCurrentDelegator(arg0 *Staker)

DeleteCurrentDelegator mocks base method.

func (*MockState) DeleteCurrentValidator

func (m *MockState) DeleteCurrentValidator(arg0 *Staker)

DeleteCurrentValidator mocks base method.

func (*MockState) DeletePendingDelegator

func (m *MockState) DeletePendingDelegator(arg0 *Staker)

DeletePendingDelegator mocks base method.

func (*MockState) DeletePendingValidator

func (m *MockState) DeletePendingValidator(arg0 *Staker)

DeletePendingValidator mocks base method.

func (*MockState) DeleteUTXO

func (m *MockState) DeleteUTXO(arg0 ids.ID)

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

func (m *MockState) GetChains(arg0 ids.ID) ([]*txs.Tx, error)

GetChains mocks base method.

func (*MockState) GetCurrentDelegatorIterator

func (m *MockState) GetCurrentDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (StakerIterator, error)

GetCurrentDelegatorIterator mocks base method.

func (*MockState) GetCurrentStakerIterator

func (m *MockState) GetCurrentStakerIterator() (StakerIterator, error)

GetCurrentStakerIterator mocks base method.

func (*MockState) GetCurrentSupply

func (m *MockState) GetCurrentSupply(arg0 ids.ID) (uint64, error)

GetCurrentSupply mocks base method.

func (*MockState) GetCurrentValidator

func (m *MockState) GetCurrentValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, error)

GetCurrentValidator mocks base method.

func (*MockState) GetLastAccepted

func (m *MockState) GetLastAccepted() ids.ID

GetLastAccepted mocks base method.

func (*MockState) GetPendingDelegatorIterator

func (m *MockState) GetPendingDelegatorIterator(arg0 ids.ID, arg1 ids.NodeID) (StakerIterator, error)

GetPendingDelegatorIterator mocks base method.

func (*MockState) GetPendingStakerIterator

func (m *MockState) GetPendingStakerIterator() (StakerIterator, error)

GetPendingStakerIterator mocks base method.

func (*MockState) GetPendingValidator

func (m *MockState) GetPendingValidator(arg0 ids.ID, arg1 ids.NodeID) (*Staker, error)

GetPendingValidator mocks base method.

func (*MockState) GetRewardUTXOs

func (m *MockState) GetRewardUTXOs(arg0 ids.ID) ([]*djtx.UTXO, error)

GetRewardUTXOs mocks base method.

func (*MockState) GetStartTime

func (m *MockState) GetStartTime(arg0 ids.NodeID, arg1 ids.ID) (time.Time, error)

GetStartTime mocks base method.

func (*MockState) GetStatelessBlock

func (m *MockState) GetStatelessBlock(arg0 ids.ID) (blocks.Block, choices.Status, error)

GetStatelessBlock mocks base method.

func (*MockState) GetSubnetTransformation

func (m *MockState) GetSubnetTransformation(arg0 ids.ID) (*txs.Tx, error)

GetSubnetTransformation mocks base method.

func (*MockState) GetSubnets

func (m *MockState) GetSubnets() ([]*txs.Tx, error)

GetSubnets mocks base method.

func (*MockState) GetTimestamp

func (m *MockState) GetTimestamp() time.Time

GetTimestamp mocks base method.

func (*MockState) GetTx

func (m *MockState) GetTx(arg0 ids.ID) (*txs.Tx, status.Status, error)

GetTx mocks base method.

func (*MockState) GetUTXO

func (m *MockState) GetUTXO(arg0 ids.ID) (*djtx.UTXO, error)

GetUTXO mocks base method.

func (*MockState) GetUptime

func (m *MockState) GetUptime(arg0 ids.NodeID, arg1 ids.ID) (time.Duration, time.Time, error)

GetUptime mocks base method.

func (*MockState) GetValidatorPublicKeyDiffs

func (m *MockState) GetValidatorPublicKeyDiffs(arg0 uint64) (map[ids.NodeID]*bls.PublicKey, error)

GetValidatorPublicKeyDiffs mocks base method.

func (*MockState) GetValidatorWeightDiffs

func (m *MockState) GetValidatorWeightDiffs(arg0 uint64, arg1 ids.ID) (map[ids.NodeID]*ValidatorWeightDiff, error)

GetValidatorWeightDiffs mocks base method.

func (*MockState) PutCurrentDelegator

func (m *MockState) PutCurrentDelegator(arg0 *Staker)

PutCurrentDelegator mocks base method.

func (*MockState) PutCurrentValidator

func (m *MockState) PutCurrentValidator(arg0 *Staker)

PutCurrentValidator mocks base method.

func (*MockState) PutPendingDelegator

func (m *MockState) PutPendingDelegator(arg0 *Staker)

PutPendingDelegator mocks base method.

func (*MockState) PutPendingValidator

func (m *MockState) PutPendingValidator(arg0 *Staker)

PutPendingValidator mocks base method.

func (*MockState) SetCurrentSupply

func (m *MockState) SetCurrentSupply(arg0 ids.ID, arg1 uint64)

SetCurrentSupply mocks base method.

func (*MockState) SetHeight

func (m *MockState) SetHeight(arg0 uint64)

SetHeight mocks base method.

func (*MockState) SetLastAccepted

func (m *MockState) SetLastAccepted(arg0 ids.ID)

SetLastAccepted mocks base method.

func (*MockState) SetTimestamp

func (m *MockState) SetTimestamp(arg0 time.Time)

SetTimestamp mocks base method.

func (*MockState) SetUptime

func (m *MockState) SetUptime(arg0 ids.NodeID, arg1 ids.ID, arg2 time.Duration, arg3 time.Time) error

SetUptime mocks base method.

func (*MockState) UTXOIDs

func (m *MockState) UTXOIDs(arg0 []byte, arg1 ids.ID, arg2 int) ([]ids.ID, error)

UTXOIDs 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(arg0 interface{}) *gomock.Call

AddChain indicates an expected call of AddChain.

func (*MockStateMockRecorder) AddRewardUTXO

func (mr *MockStateMockRecorder) AddRewardUTXO(arg0, arg1 interface{}) *gomock.Call

AddRewardUTXO indicates an expected call of AddRewardUTXO.

func (*MockStateMockRecorder) AddStatelessBlock

func (mr *MockStateMockRecorder) AddStatelessBlock(arg0, arg1 interface{}) *gomock.Call

AddStatelessBlock indicates an expected call of AddStatelessBlock.

func (*MockStateMockRecorder) AddSubnet

func (mr *MockStateMockRecorder) AddSubnet(arg0 interface{}) *gomock.Call

AddSubnet indicates an expected call of AddSubnet.

func (*MockStateMockRecorder) AddSubnetTransformation

func (mr *MockStateMockRecorder) AddSubnetTransformation(arg0 interface{}) *gomock.Call

AddSubnetTransformation indicates an expected call of AddSubnetTransformation.

func (*MockStateMockRecorder) AddTx

func (mr *MockStateMockRecorder) AddTx(arg0, arg1 interface{}) *gomock.Call

AddTx indicates an expected call of AddTx.

func (*MockStateMockRecorder) AddUTXO

func (mr *MockStateMockRecorder) AddUTXO(arg0 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(arg0 interface{}) *gomock.Call

DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.

func (*MockStateMockRecorder) DeleteCurrentValidator

func (mr *MockStateMockRecorder) DeleteCurrentValidator(arg0 interface{}) *gomock.Call

DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.

func (*MockStateMockRecorder) DeletePendingDelegator

func (mr *MockStateMockRecorder) DeletePendingDelegator(arg0 interface{}) *gomock.Call

DeletePendingDelegator indicates an expected call of DeletePendingDelegator.

func (*MockStateMockRecorder) DeletePendingValidator

func (mr *MockStateMockRecorder) DeletePendingValidator(arg0 interface{}) *gomock.Call

DeletePendingValidator indicates an expected call of DeletePendingValidator.

func (*MockStateMockRecorder) DeleteUTXO

func (mr *MockStateMockRecorder) DeleteUTXO(arg0 interface{}) *gomock.Call

DeleteUTXO indicates an expected call of DeleteUTXO.

func (*MockStateMockRecorder) GetChains

func (mr *MockStateMockRecorder) GetChains(arg0 interface{}) *gomock.Call

GetChains indicates an expected call of GetChains.

func (*MockStateMockRecorder) GetCurrentDelegatorIterator

func (mr *MockStateMockRecorder) GetCurrentDelegatorIterator(arg0, arg1 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(arg0 interface{}) *gomock.Call

GetCurrentSupply indicates an expected call of GetCurrentSupply.

func (*MockStateMockRecorder) GetCurrentValidator

func (mr *MockStateMockRecorder) GetCurrentValidator(arg0, arg1 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(arg0, arg1 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(arg0, arg1 interface{}) *gomock.Call

GetPendingValidator indicates an expected call of GetPendingValidator.

func (*MockStateMockRecorder) GetRewardUTXOs

func (mr *MockStateMockRecorder) GetRewardUTXOs(arg0 interface{}) *gomock.Call

GetRewardUTXOs indicates an expected call of GetRewardUTXOs.

func (*MockStateMockRecorder) GetStartTime

func (mr *MockStateMockRecorder) GetStartTime(arg0, arg1 interface{}) *gomock.Call

GetStartTime indicates an expected call of GetStartTime.

func (*MockStateMockRecorder) GetStatelessBlock

func (mr *MockStateMockRecorder) GetStatelessBlock(arg0 interface{}) *gomock.Call

GetStatelessBlock indicates an expected call of GetStatelessBlock.

func (*MockStateMockRecorder) GetSubnetTransformation

func (mr *MockStateMockRecorder) GetSubnetTransformation(arg0 interface{}) *gomock.Call

GetSubnetTransformation indicates an expected call of GetSubnetTransformation.

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(arg0 interface{}) *gomock.Call

GetTx indicates an expected call of GetTx.

func (*MockStateMockRecorder) GetUTXO

func (mr *MockStateMockRecorder) GetUTXO(arg0 interface{}) *gomock.Call

GetUTXO indicates an expected call of GetUTXO.

func (*MockStateMockRecorder) GetUptime

func (mr *MockStateMockRecorder) GetUptime(arg0, arg1 interface{}) *gomock.Call

GetUptime indicates an expected call of GetUptime.

func (*MockStateMockRecorder) GetValidatorPublicKeyDiffs

func (mr *MockStateMockRecorder) GetValidatorPublicKeyDiffs(arg0 interface{}) *gomock.Call

GetValidatorPublicKeyDiffs indicates an expected call of GetValidatorPublicKeyDiffs.

func (*MockStateMockRecorder) GetValidatorWeightDiffs

func (mr *MockStateMockRecorder) GetValidatorWeightDiffs(arg0, arg1 interface{}) *gomock.Call

GetValidatorWeightDiffs indicates an expected call of GetValidatorWeightDiffs.

func (*MockStateMockRecorder) PutCurrentDelegator

func (mr *MockStateMockRecorder) PutCurrentDelegator(arg0 interface{}) *gomock.Call

PutCurrentDelegator indicates an expected call of PutCurrentDelegator.

func (*MockStateMockRecorder) PutCurrentValidator

func (mr *MockStateMockRecorder) PutCurrentValidator(arg0 interface{}) *gomock.Call

PutCurrentValidator indicates an expected call of PutCurrentValidator.

func (*MockStateMockRecorder) PutPendingDelegator

func (mr *MockStateMockRecorder) PutPendingDelegator(arg0 interface{}) *gomock.Call

PutPendingDelegator indicates an expected call of PutPendingDelegator.

func (*MockStateMockRecorder) PutPendingValidator

func (mr *MockStateMockRecorder) PutPendingValidator(arg0 interface{}) *gomock.Call

PutPendingValidator indicates an expected call of PutPendingValidator.

func (*MockStateMockRecorder) SetCurrentSupply

func (mr *MockStateMockRecorder) SetCurrentSupply(arg0, arg1 interface{}) *gomock.Call

SetCurrentSupply indicates an expected call of SetCurrentSupply.

func (*MockStateMockRecorder) SetHeight

func (mr *MockStateMockRecorder) SetHeight(arg0 interface{}) *gomock.Call

SetHeight indicates an expected call of SetHeight.

func (*MockStateMockRecorder) SetLastAccepted

func (mr *MockStateMockRecorder) SetLastAccepted(arg0 interface{}) *gomock.Call

SetLastAccepted indicates an expected call of SetLastAccepted.

func (*MockStateMockRecorder) SetTimestamp

func (mr *MockStateMockRecorder) SetTimestamp(arg0 interface{}) *gomock.Call

SetTimestamp indicates an expected call of SetTimestamp.

func (*MockStateMockRecorder) SetUptime

func (mr *MockStateMockRecorder) SetUptime(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

SetUptime indicates an expected call of SetUptime.

func (*MockStateMockRecorder) UTXOIDs

func (mr *MockStateMockRecorder) UTXOIDs(arg0, arg1, arg2 interface{}) *gomock.Call

UTXOIDs indicates an expected call of UTXOIDs.

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

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockVersions) GetState

func (m *MockVersions) GetState(arg0 ids.ID) (Chain, bool)

GetState mocks base method.

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 Staker

type Staker struct {
	TxID            ids.ID
	NodeID          ids.NodeID
	PublicKey       *bls.PublicKey
	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 txs.Priority
}

Staker contains all information required to represent a validator or delegator in the current and pending validator sets.

func NewCurrentStaker

func NewCurrentStaker(txID ids.ID, staker txs.Staker, potentialReward uint64) (*Staker, error)

func NewPendingStaker

func NewPendingStaker(txID ids.ID, staker txs.Staker) (*Staker, error)

func (*Staker) Less

func (s *Staker) Less(thanIntf btree.Item) bool

A *Staker is considered to be less than another *Staker when:

  1. If its NextTime is before the other's.
  2. If the NextTimes are the same, the *Staker with the lesser priority is the lesser one.
  3. 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. Note that it isn't safe to modify [tree] while iterating over it.

type Stakers

type Stakers interface {
	CurrentStakers
	PendingStakers
}

type State

type State interface {
	LastAccepteder
	Chain
	BlockState
	uptime.State
	djtx.UTXOReader

	GetValidatorWeightDiffs(height uint64, subnetID ids.ID) (map[ids.NodeID]*ValidatorWeightDiff, error)

	// Returns a map of node ID --> BLS Public Key for all validators
	// that left the Primary Network validator set.
	GetValidatorPublicKeyDiffs(height uint64) (map[ids.NodeID]*bls.PublicKey, 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,
	metricsReg prometheus.Registerer,
	cfg *config.Config,
	ctx *snow.Context,
	metrics metrics.Metrics,
	rewards reward.Calculator,
) (State, error)

type UTXOAdder

type UTXOAdder interface {
	AddUTXO(utxo *djtx.UTXO)
}

type UTXODeleter

type UTXODeleter interface {
	DeleteUTXO(utxoID ids.ID)
}

type UTXOGetter

type UTXOGetter interface {
	GetUTXO(utxoID ids.ID) (*djtx.UTXO, error)
}

type ValidatorWeightDiff

type ValidatorWeightDiff struct {
	Decrease bool   `serialize:"true"`
	Amount   uint64 `serialize:"true"`
}

func (*ValidatorWeightDiff) Add

func (v *ValidatorWeightDiff) Add(negative bool, amount uint64) error

type Versions

type Versions interface {
	GetState(blkID ids.ID) (Chain, bool)
}

Jump to

Keyboard shortcuts

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