state

package
v1.22.40 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: BSD-3-Clause Imports: 57 Imported by: 7

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

View Source
const (
	CodecVersion0Tag        = "v0"
	CodecVersion0    uint16 = 0

	CodecVersion1Tag        = "v1"
	CodecVersion1    uint16 = 1
)

Variables

View Source
var (
	ErrMutatedL1Validator     = errors.New("L1 validator contains mutated constant fields")
	ErrConflictingL1Validator = errors.New("L1 validator contains conflicting subnetID + nodeID pair")
	ErrDuplicateL1Validator   = errors.New("L1 validator contains duplicate subnetID + nodeID pair")
)
View Source
var (
	BlockIDPrefix                 = []byte("blockID")
	BlockPrefix                   = []byte("block")
	ValidatorsPrefix              = []byte("validators")
	CurrentPrefix                 = []byte("current")
	PendingPrefix                 = []byte("pending")
	ValidatorPrefix               = []byte("validator")
	DelegatorPrefix               = []byte("delegator")
	NetValidatorPrefix            = []byte("subnetValidator")
	NetDelegatorPrefix            = []byte("subnetDelegator")
	ValidatorWeightDiffsPrefix    = []byte("flatValidatorDiffs")
	ValidatorPublicKeyDiffsPrefix = []byte("flatPublicKeyDiffs")
	TxPrefix                      = []byte("tx")
	RewardUTXOsPrefix             = []byte("rewardUTXOs")
	UTXOPrefix                    = []byte("utxo")
	NetPrefix                     = []byte("subnet")
	NetOwnerPrefix                = []byte("subnetOwner")
	NetToL1ConversionPrefix       = []byte("subnetToL1Conversion")
	TransformedNetPrefix          = []byte("transformedNet")
	SupplyPrefix                  = []byte("supply")
	ChainPrefix                   = []byte("chain")
	ChainNamePrefix               = []byte("chainName") // maps lowercase chain name -> chainID
	ExpiryReplayProtectionPrefix  = []byte("expiryReplayProtection")
	L1Prefix                      = []byte("l1")
	WeightsPrefix                 = []byte("weights")
	ChainIDNodeIDPrefix           = []byte("subnetIDNodeID")
	ActivePrefix                  = []byte("active")
	InactivePrefix                = []byte("inactive")
	SingletonPrefix               = []byte("singleton")

	TimestampKey         = []byte("timestamp")
	FeeStateKey          = []byte("fee state")
	L1ValidatorExcessKey = []byte("l1Validator excess")
	AccruedFeesKey       = []byte("accrued fees")
	CurrentSupplyKey     = []byte("current supply")
	LastAcceptedKey      = []byte("last accepted")
	HeightsIndexedKey    = []byte("heights indexed")
	InitializedKey       = []byte("initialized")
	BlocksReindexedKey   = []byte("blocks reindexed.3")
)
View Source
var ErrAddingStakerAfterDeletion = errors.New("attempted to add a staker after deleting it")
View Source
var (
	ErrMissingParentState = errors.New("missing parent state")
)
View Source
var MetadataCodec codec.Manager

Functions

func GetNextStakerChangeTime

func GetNextStakerChangeTime(
	config validatorfee.Config,
	state Chain,
	nextTime time.Time,
) (time.Time, error)

GetNextStakerChangeTime returns the next time a staker will be either added to or removed from the validator set. If the next staker change time is further in the future than [nextTime], then [nextTime] is returned.

func NextBlockTime

func NextBlockTime(
	config validatorfee.Config,
	state Chain,
	clk *mockable.Clock,
) (time.Time, bool, error)

func PickFeeCalculator

func PickFeeCalculator(config *config.Internal, state Chain) txfee.Calculator

PickFeeCalculator creates either a simple or a dynamic fee calculator, depending on the active upgrade.

PickFeeCalculator does not modify state.

func RegisterStateBlockType added in v1.11.14

func RegisterStateBlockType(targetCodec codec.Registry) error

RegisterStateBlockType registers the stateBlk type with the given codec. This is needed for backward compatibility with old block storage format.

Types

type Chain

type Chain interface {
	Expiry
	L1Validators
	Stakers
	L1Validators
	lux.UTXOAdder
	lux.UTXOGetter
	lux.UTXODeleter

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

	GetFeeState() gas.State
	SetFeeState(f gas.State)

	GetL1ValidatorExcess() gas.Gas
	SetL1ValidatorExcess(e gas.Gas)

	GetAccruedFees() uint64
	SetAccruedFees(f uint64)

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

	AddRewardUTXO(txID ids.ID, utxo *lux.UTXO)

	AddNet(netID ids.ID)

	GetNetOwner(netID ids.ID) (fx.Owner, error)
	SetNetOwner(netID ids.ID, owner fx.Owner)

	GetNetToL1Conversion(subnetID ids.ID) (NetToL1Conversion, error)
	SetNetToL1Conversion(subnetID ids.ID, c NetToL1Conversion)

	GetNetTransformation(subnetID ids.ID) (*txs.Tx, error)
	AddNetTransformation(transformNetTx *txs.Tx)

	AddChain(createChainTx *txs.Tx)

	// Chain name uniqueness - for network-wide chain name resolution
	GetChainIDByName(name string) (ids.ID, error)
	IsChainNameTaken(name string) bool

	GetTx(txID ids.ID) (*txs.Tx, status.Status, error)
	AddTx(tx *txs.Tx, status status.Status)

	// L1 Validator support - most methods inherited from L1Validators interface
	// Only PutL1Validator is Chain-specific
	PutL1Validator(validator L1Validator) error
}

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
	// [netID] with [nodeID]. If the validator does not exist,
	// [database.ErrNotFound] is returned.
	GetCurrentValidator(netID 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) error

	// DeleteCurrentValidator removes the [staker] describing a validator from
	// the staker set.
	//
	// Invariant: [staker] is currently a CurrentValidator
	DeleteCurrentValidator(staker *Staker)

	// SetDelegateeReward sets the accrued delegation rewards for [nodeID] on
	// [netID] to [amount].
	SetDelegateeReward(netID ids.ID, nodeID ids.NodeID, amount uint64) error

	// GetDelegateeReward returns the accrued delegation rewards for [nodeID] on
	// [netID].
	GetDelegateeReward(netID ids.ID, nodeID ids.NodeID) (uint64, error)

	// GetCurrentDelegatorIterator returns the delegators associated with the
	// validator on [netID] with [nodeID]. Delegators are sorted by their
	// removal from current staker set.
	GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (iterator.Iterator[*Staker], 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() (iterator.Iterator[*Staker], error)
}

type Diff

type Diff interface {
	Chain

	Apply(Chain) error
}

func NewDiff

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

func NewDiffOn

func NewDiffOn(parentState Chain) (Diff, error)

type Expiry

type Expiry interface {
	// GetExpiryIterator returns an iterator of all the expiry entries in order
	// of lowest to highest timestamp.
	GetExpiryIterator() (iterator.Iterator[ExpiryEntry], error)

	// HasExpiry returns true if the database has the specified entry.
	HasExpiry(ExpiryEntry) (bool, error)

	// PutExpiry adds the entry to the database. If the entry already exists, it
	// is a noop.
	PutExpiry(ExpiryEntry)

	// DeleteExpiry removes the entry from the database. If the entry doesn't
	// exist, it is a noop.
	DeleteExpiry(ExpiryEntry)
}

type ExpiryEntry

type ExpiryEntry struct {
	Timestamp    uint64
	ValidationID ids.ID
}

func (ExpiryEntry) Compare

func (e ExpiryEntry) Compare(o ExpiryEntry) int

Invariant: Compare produces the same ordering as the marshalled bytes.

func (ExpiryEntry) Less

func (e ExpiryEntry) Less(o ExpiryEntry) bool

func (*ExpiryEntry) Marshal

func (e *ExpiryEntry) Marshal() []byte

func (*ExpiryEntry) Unmarshal

func (e *ExpiryEntry) Unmarshal(data []byte) error

type L1Validator

type L1Validator struct {
	// ValidationID is not serialized because it is used as the key in the
	// database, so it doesn't need to be stored in the value.
	ValidationID ids.ID

	ChainID ids.ID     `serialize:"true"`
	NodeID  ids.NodeID `serialize:"true"`

	// PublicKey is the uncompressed BLS public key of the validator. It is
	// guaranteed to be populated.
	PublicKey []byte `serialize:"true"`

	// RemainingBalanceOwner is the owner that will be used when returning the
	// balance of the validator after removing accrued fees.
	RemainingBalanceOwner []byte `serialize:"true"`

	// DeactivationOwner is the owner that can manually deactivate the
	// validator.
	DeactivationOwner []byte `serialize:"true"`

	// StartTime is the unix timestamp, in seconds, when this validator was
	// added to the set.
	StartTime uint64 `serialize:"true"`

	// Weight of this validator. It can be updated when the MinNonce is
	// increased. If the weight is being set to 0, the validator is being
	// removed.
	Weight uint64 `serialize:"true"`

	// MinNonce is the smallest nonce that can be used to modify this
	// validator's weight. It is initially set to 0 and is set to one higher
	// than the last nonce used. It is not valid to use nonce MaxUint64 unless
	// the weight is being set to 0, which removes the validator from the set.
	MinNonce uint64 `serialize:"true"`

	// EndAccumulatedFee is the amount of accumulated fees per validator that
	// can accrue before this validator must be deactivated. It is equal to the
	// amount of fees this validator is willing to pay plus the total amount of
	// fees a validator would have needed to pay from the activation of the Etna
	// upgrade until this validator was registered. Note that this relies on the
	// fact that every validator is charged the same fee for each unit of time.
	//
	// If this value is 0, the validator is inactive.
	EndAccumulatedFee uint64 `serialize:"true"`
}

L1Validator defines an LP-77 validator. For a given ValidationID, it is expected for ChainID, NodeID, PublicKey, RemainingBalanceOwner, DeactivationOwner, and StartTime to be constant.

func (L1Validator) Compare

func (v L1Validator) Compare(o L1Validator) int

Compare determines a canonical ordering of L1 validators based on their EndAccumulatedFees and ValidationIDs. Lower EndAccumulatedFees result in an earlier ordering.

func (L1Validator) IsActive

func (v L1Validator) IsActive() bool

func (L1Validator) Less

func (v L1Validator) Less(o L1Validator) bool

type L1Validators

type L1Validators interface {
	// GetActiveL1ValidatorsIterator returns an iterator of all the active L1
	// validators in increasing order of EndAccumulatedFee.
	//
	// It is the caller's responsibility to call [Release] on the iterator after
	// use.
	//
	// It is not guaranteed to be safe to modify the state while using the
	// iterator. After releasing the iterator, the state may be safely modified.
	GetActiveL1ValidatorsIterator() (iterator.Iterator[L1Validator], error)

	// NumActiveL1Validators returns the number of currently active L1
	// validators.
	NumActiveL1Validators() int

	// WeightOfL1Validators returns the total active and inactive weight of L1
	// validators on [subnetID].
	WeightOfL1Validators(subnetID ids.ID) (uint64, error)

	// GetL1Validator returns the validator with [validationID] if it exists. If
	// the validator does not exist, [err] will equal [database.ErrNotFound].
	GetL1Validator(validationID ids.ID) (L1Validator, error)

	// HasL1Validator returns the validator with [validationID] if it exists.
	HasL1Validator(subnetID ids.ID, nodeID ids.NodeID) (bool, error)

	// PutL1Validator inserts [l1Validator] as a validator. If the weight of the
	// validator is 0, the validator is removed.
	//
	// If inserting this validator attempts to modify any of the constant fields
	// of the L1 validator struct, an error will be returned.
	//
	// If inserting this validator would cause the total weight of L1 validators
	// on a subnet to overflow MaxUint64, an error will be returned.
	//
	// If inserting this validator would cause there to be multiple validators
	// with the same subnetID and nodeID pair to exist at the same time, an
	// error will be returned.
	//
	// If an L1 validator is added with the same validationID as a previously
	// removed L1 validator, the behavior is undefined.
	PutL1Validator(l1Validator L1Validator) error
}

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(createChainTx *txs.Tx)

AddChain mocks base method.

func (*MockChain) AddNet added in v1.16.56

func (m *MockChain) AddNet(netID ids.ID)

AddNet mocks base method.

func (*MockChain) AddNetTransformation added in v1.16.56

func (m *MockChain) AddNetTransformation(transformNetTx *txs.Tx)

AddNetTransformation mocks base method.

func (*MockChain) AddRewardUTXO

func (m *MockChain) AddRewardUTXO(txID ids.ID, utxo *lux.UTXO)

AddRewardUTXO mocks base method.

func (*MockChain) AddTx

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

AddTx mocks base method.

func (*MockChain) AddUTXO

func (m *MockChain) AddUTXO(utxo *lux.UTXO)

AddUTXO mocks base method.

func (*MockChain) DeleteCurrentDelegator

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

DeleteCurrentDelegator mocks base method.

func (*MockChain) DeleteCurrentValidator

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

DeleteCurrentValidator mocks base method.

func (*MockChain) DeleteExpiry

func (m *MockChain) DeleteExpiry(arg0 ExpiryEntry)

DeleteExpiry mocks base method.

func (*MockChain) DeletePendingDelegator

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

DeletePendingDelegator mocks base method.

func (*MockChain) DeletePendingValidator

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

DeletePendingValidator mocks base method.

func (*MockChain) DeleteUTXO

func (m *MockChain) DeleteUTXO(utxoID 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) GetAccruedFees

func (m *MockChain) GetAccruedFees() uint64

GetAccruedFees mocks base method.

func (*MockChain) GetActiveL1ValidatorsIterator

func (m *MockChain) GetActiveL1ValidatorsIterator() (iterator.Iterator[L1Validator], error)

GetActiveL1ValidatorsIterator mocks base method.

func (*MockChain) GetChainIDByName added in v1.16.56

func (m *MockChain) GetChainIDByName(name string) (ids.ID, error)

GetChainIDByName mocks base method.

func (*MockChain) GetCurrentDelegatorIterator

func (m *MockChain) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (iterator.Iterator[*Staker], error)

GetCurrentDelegatorIterator mocks base method.

func (*MockChain) GetCurrentStakerIterator

func (m *MockChain) GetCurrentStakerIterator() (iterator.Iterator[*Staker], error)

GetCurrentStakerIterator mocks base method.

func (*MockChain) GetCurrentSupply

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

GetCurrentSupply mocks base method.

func (*MockChain) GetCurrentValidator

func (m *MockChain) GetCurrentValidator(netID ids.ID, nodeID ids.NodeID) (*Staker, error)

GetCurrentValidator mocks base method.

func (*MockChain) GetDelegateeReward

func (m *MockChain) GetDelegateeReward(netID ids.ID, nodeID ids.NodeID) (uint64, error)

GetDelegateeReward mocks base method.

func (*MockChain) GetExpiryIterator

func (m *MockChain) GetExpiryIterator() (iterator.Iterator[ExpiryEntry], error)

GetExpiryIterator mocks base method.

func (*MockChain) GetFeeState

func (m *MockChain) GetFeeState() gas.State

GetFeeState mocks base method.

func (*MockChain) GetL1Validator

func (m *MockChain) GetL1Validator(validationID ids.ID) (L1Validator, error)

GetL1Validator mocks base method.

func (*MockChain) GetL1ValidatorExcess

func (m *MockChain) GetL1ValidatorExcess() gas.Gas

GetL1ValidatorExcess mocks base method.

func (*MockChain) GetNetOwner added in v1.16.56

func (m *MockChain) GetNetOwner(netID ids.ID) (fx.Owner, error)

GetNetOwner mocks base method.

func (*MockChain) GetNetToL1Conversion added in v1.16.56

func (m *MockChain) GetNetToL1Conversion(subnetID ids.ID) (NetToL1Conversion, error)

GetNetToL1Conversion mocks base method.

func (*MockChain) GetNetTransformation added in v1.16.56

func (m *MockChain) GetNetTransformation(subnetID ids.ID) (*txs.Tx, error)

GetNetTransformation mocks base method.

func (*MockChain) GetPendingDelegatorIterator

func (m *MockChain) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (iterator.Iterator[*Staker], error)

GetPendingDelegatorIterator mocks base method.

func (*MockChain) GetPendingStakerIterator

func (m *MockChain) GetPendingStakerIterator() (iterator.Iterator[*Staker], error)

GetPendingStakerIterator mocks base method.

func (*MockChain) GetPendingValidator

func (m *MockChain) GetPendingValidator(netID ids.ID, nodeID ids.NodeID) (*Staker, error)

GetPendingValidator mocks base method.

func (*MockChain) GetTimestamp

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

GetTimestamp mocks base method.

func (*MockChain) GetTx

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

GetTx mocks base method.

func (*MockChain) GetUTXO

func (m *MockChain) GetUTXO(utxoID ids.ID) (*lux.UTXO, error)

GetUTXO mocks base method.

func (*MockChain) HasExpiry

func (m *MockChain) HasExpiry(arg0 ExpiryEntry) (bool, error)

HasExpiry mocks base method.

func (*MockChain) HasL1Validator

func (m *MockChain) HasL1Validator(subnetID ids.ID, nodeID ids.NodeID) (bool, error)

HasL1Validator mocks base method.

func (*MockChain) IsChainNameTaken added in v1.16.56

func (m *MockChain) IsChainNameTaken(name string) bool

IsChainNameTaken mocks base method.

func (*MockChain) NumActiveL1Validators

func (m *MockChain) NumActiveL1Validators() int

NumActiveL1Validators mocks base method.

func (*MockChain) PutCurrentDelegator

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

PutCurrentDelegator mocks base method.

func (*MockChain) PutCurrentValidator

func (m *MockChain) PutCurrentValidator(staker *Staker) error

PutCurrentValidator mocks base method.

func (*MockChain) PutExpiry

func (m *MockChain) PutExpiry(arg0 ExpiryEntry)

PutExpiry mocks base method.

func (*MockChain) PutL1Validator

func (m *MockChain) PutL1Validator(validator L1Validator) error

PutL1Validator mocks base method.

func (*MockChain) PutPendingDelegator

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

PutPendingDelegator mocks base method.

func (*MockChain) PutPendingValidator

func (m *MockChain) PutPendingValidator(staker *Staker) error

PutPendingValidator mocks base method.

func (*MockChain) SetAccruedFees

func (m *MockChain) SetAccruedFees(f uint64)

SetAccruedFees mocks base method.

func (*MockChain) SetCurrentSupply

func (m *MockChain) SetCurrentSupply(subnetID ids.ID, cs uint64)

SetCurrentSupply mocks base method.

func (*MockChain) SetDelegateeReward

func (m *MockChain) SetDelegateeReward(netID ids.ID, nodeID ids.NodeID, amount uint64) error

SetDelegateeReward mocks base method.

func (*MockChain) SetFeeState

func (m *MockChain) SetFeeState(f gas.State)

SetFeeState mocks base method.

func (*MockChain) SetL1ValidatorExcess

func (m *MockChain) SetL1ValidatorExcess(e gas.Gas)

SetL1ValidatorExcess mocks base method.

func (*MockChain) SetNetOwner added in v1.16.56

func (m *MockChain) SetNetOwner(netID ids.ID, owner fx.Owner)

SetNetOwner mocks base method.

func (*MockChain) SetNetToL1Conversion added in v1.16.56

func (m *MockChain) SetNetToL1Conversion(subnetID ids.ID, c NetToL1Conversion)

SetNetToL1Conversion mocks base method.

func (*MockChain) SetTimestamp

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

SetTimestamp mocks base method.

func (*MockChain) WeightOfL1Validators

func (m *MockChain) WeightOfL1Validators(subnetID ids.ID) (uint64, error)

WeightOfL1Validators 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 any) *gomock.Call

AddChain indicates an expected call of AddChain.

func (*MockChainMockRecorder) AddNet added in v1.16.56

func (mr *MockChainMockRecorder) AddNet(netID any) *gomock.Call

AddNet indicates an expected call of AddNet.

func (*MockChainMockRecorder) AddNetTransformation added in v1.16.56

func (mr *MockChainMockRecorder) AddNetTransformation(transformNetTx any) *gomock.Call

AddNetTransformation indicates an expected call of AddNetTransformation.

func (*MockChainMockRecorder) AddRewardUTXO

func (mr *MockChainMockRecorder) AddRewardUTXO(txID, utxo any) *gomock.Call

AddRewardUTXO indicates an expected call of AddRewardUTXO.

func (*MockChainMockRecorder) AddTx

func (mr *MockChainMockRecorder) AddTx(tx, arg1 any) *gomock.Call

AddTx indicates an expected call of AddTx.

func (*MockChainMockRecorder) AddUTXO

func (mr *MockChainMockRecorder) AddUTXO(utxo any) *gomock.Call

AddUTXO indicates an expected call of AddUTXO.

func (*MockChainMockRecorder) DeleteCurrentDelegator

func (mr *MockChainMockRecorder) DeleteCurrentDelegator(staker any) *gomock.Call

DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.

func (*MockChainMockRecorder) DeleteCurrentValidator

func (mr *MockChainMockRecorder) DeleteCurrentValidator(staker any) *gomock.Call

DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.

func (*MockChainMockRecorder) DeleteExpiry

func (mr *MockChainMockRecorder) DeleteExpiry(arg0 any) *gomock.Call

DeleteExpiry indicates an expected call of DeleteExpiry.

func (*MockChainMockRecorder) DeletePendingDelegator

func (mr *MockChainMockRecorder) DeletePendingDelegator(staker any) *gomock.Call

DeletePendingDelegator indicates an expected call of DeletePendingDelegator.

func (*MockChainMockRecorder) DeletePendingValidator

func (mr *MockChainMockRecorder) DeletePendingValidator(staker any) *gomock.Call

DeletePendingValidator indicates an expected call of DeletePendingValidator.

func (*MockChainMockRecorder) DeleteUTXO

func (mr *MockChainMockRecorder) DeleteUTXO(utxoID any) *gomock.Call

DeleteUTXO indicates an expected call of DeleteUTXO.

func (*MockChainMockRecorder) GetAccruedFees

func (mr *MockChainMockRecorder) GetAccruedFees() *gomock.Call

GetAccruedFees indicates an expected call of GetAccruedFees.

func (*MockChainMockRecorder) GetActiveL1ValidatorsIterator

func (mr *MockChainMockRecorder) GetActiveL1ValidatorsIterator() *gomock.Call

GetActiveL1ValidatorsIterator indicates an expected call of GetActiveL1ValidatorsIterator.

func (*MockChainMockRecorder) GetChainIDByName added in v1.16.56

func (mr *MockChainMockRecorder) GetChainIDByName(name any) *gomock.Call

GetChainIDByName indicates an expected call of GetChainIDByName.

func (*MockChainMockRecorder) GetCurrentDelegatorIterator

func (mr *MockChainMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID any) *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(subnetID any) *gomock.Call

GetCurrentSupply indicates an expected call of GetCurrentSupply.

func (*MockChainMockRecorder) GetCurrentValidator

func (mr *MockChainMockRecorder) GetCurrentValidator(netID, nodeID any) *gomock.Call

GetCurrentValidator indicates an expected call of GetCurrentValidator.

func (*MockChainMockRecorder) GetDelegateeReward

func (mr *MockChainMockRecorder) GetDelegateeReward(netID, nodeID any) *gomock.Call

GetDelegateeReward indicates an expected call of GetDelegateeReward.

func (*MockChainMockRecorder) GetExpiryIterator

func (mr *MockChainMockRecorder) GetExpiryIterator() *gomock.Call

GetExpiryIterator indicates an expected call of GetExpiryIterator.

func (*MockChainMockRecorder) GetFeeState

func (mr *MockChainMockRecorder) GetFeeState() *gomock.Call

GetFeeState indicates an expected call of GetFeeState.

func (*MockChainMockRecorder) GetL1Validator

func (mr *MockChainMockRecorder) GetL1Validator(validationID any) *gomock.Call

GetL1Validator indicates an expected call of GetL1Validator.

func (*MockChainMockRecorder) GetL1ValidatorExcess

func (mr *MockChainMockRecorder) GetL1ValidatorExcess() *gomock.Call

GetL1ValidatorExcess indicates an expected call of GetL1ValidatorExcess.

func (*MockChainMockRecorder) GetNetOwner added in v1.16.56

func (mr *MockChainMockRecorder) GetNetOwner(netID any) *gomock.Call

GetNetOwner indicates an expected call of GetNetOwner.

func (*MockChainMockRecorder) GetNetToL1Conversion added in v1.16.56

func (mr *MockChainMockRecorder) GetNetToL1Conversion(subnetID any) *gomock.Call

GetNetToL1Conversion indicates an expected call of GetNetToL1Conversion.

func (*MockChainMockRecorder) GetNetTransformation added in v1.16.56

func (mr *MockChainMockRecorder) GetNetTransformation(subnetID any) *gomock.Call

GetNetTransformation indicates an expected call of GetNetTransformation.

func (*MockChainMockRecorder) GetPendingDelegatorIterator

func (mr *MockChainMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID any) *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(netID, nodeID any) *gomock.Call

GetPendingValidator indicates an expected call of GetPendingValidator.

func (*MockChainMockRecorder) GetTimestamp

func (mr *MockChainMockRecorder) GetTimestamp() *gomock.Call

GetTimestamp indicates an expected call of GetTimestamp.

func (*MockChainMockRecorder) GetTx

func (mr *MockChainMockRecorder) GetTx(txID any) *gomock.Call

GetTx indicates an expected call of GetTx.

func (*MockChainMockRecorder) GetUTXO

func (mr *MockChainMockRecorder) GetUTXO(utxoID any) *gomock.Call

GetUTXO indicates an expected call of GetUTXO.

func (*MockChainMockRecorder) HasExpiry

func (mr *MockChainMockRecorder) HasExpiry(arg0 any) *gomock.Call

HasExpiry indicates an expected call of HasExpiry.

func (*MockChainMockRecorder) HasL1Validator

func (mr *MockChainMockRecorder) HasL1Validator(subnetID, nodeID any) *gomock.Call

HasL1Validator indicates an expected call of HasL1Validator.

func (*MockChainMockRecorder) IsChainNameTaken added in v1.16.56

func (mr *MockChainMockRecorder) IsChainNameTaken(name any) *gomock.Call

IsChainNameTaken indicates an expected call of IsChainNameTaken.

func (*MockChainMockRecorder) NumActiveL1Validators

func (mr *MockChainMockRecorder) NumActiveL1Validators() *gomock.Call

NumActiveL1Validators indicates an expected call of NumActiveL1Validators.

func (*MockChainMockRecorder) PutCurrentDelegator

func (mr *MockChainMockRecorder) PutCurrentDelegator(staker any) *gomock.Call

PutCurrentDelegator indicates an expected call of PutCurrentDelegator.

func (*MockChainMockRecorder) PutCurrentValidator

func (mr *MockChainMockRecorder) PutCurrentValidator(staker any) *gomock.Call

PutCurrentValidator indicates an expected call of PutCurrentValidator.

func (*MockChainMockRecorder) PutExpiry

func (mr *MockChainMockRecorder) PutExpiry(arg0 any) *gomock.Call

PutExpiry indicates an expected call of PutExpiry.

func (*MockChainMockRecorder) PutL1Validator

func (mr *MockChainMockRecorder) PutL1Validator(validator any) *gomock.Call

PutL1Validator indicates an expected call of PutL1Validator.

func (*MockChainMockRecorder) PutPendingDelegator

func (mr *MockChainMockRecorder) PutPendingDelegator(staker any) *gomock.Call

PutPendingDelegator indicates an expected call of PutPendingDelegator.

func (*MockChainMockRecorder) PutPendingValidator

func (mr *MockChainMockRecorder) PutPendingValidator(staker any) *gomock.Call

PutPendingValidator indicates an expected call of PutPendingValidator.

func (*MockChainMockRecorder) SetAccruedFees

func (mr *MockChainMockRecorder) SetAccruedFees(f any) *gomock.Call

SetAccruedFees indicates an expected call of SetAccruedFees.

func (*MockChainMockRecorder) SetCurrentSupply

func (mr *MockChainMockRecorder) SetCurrentSupply(subnetID, cs any) *gomock.Call

SetCurrentSupply indicates an expected call of SetCurrentSupply.

func (*MockChainMockRecorder) SetDelegateeReward

func (mr *MockChainMockRecorder) SetDelegateeReward(netID, nodeID, amount any) *gomock.Call

SetDelegateeReward indicates an expected call of SetDelegateeReward.

func (*MockChainMockRecorder) SetFeeState

func (mr *MockChainMockRecorder) SetFeeState(f any) *gomock.Call

SetFeeState indicates an expected call of SetFeeState.

func (*MockChainMockRecorder) SetL1ValidatorExcess

func (mr *MockChainMockRecorder) SetL1ValidatorExcess(e any) *gomock.Call

SetL1ValidatorExcess indicates an expected call of SetL1ValidatorExcess.

func (*MockChainMockRecorder) SetNetOwner added in v1.16.56

func (mr *MockChainMockRecorder) SetNetOwner(netID, owner any) *gomock.Call

SetNetOwner indicates an expected call of SetNetOwner.

func (*MockChainMockRecorder) SetNetToL1Conversion added in v1.16.56

func (mr *MockChainMockRecorder) SetNetToL1Conversion(subnetID, c any) *gomock.Call

SetNetToL1Conversion indicates an expected call of SetNetToL1Conversion.

func (*MockChainMockRecorder) SetTimestamp

func (mr *MockChainMockRecorder) SetTimestamp(tm any) *gomock.Call

SetTimestamp indicates an expected call of SetTimestamp.

func (*MockChainMockRecorder) WeightOfL1Validators

func (mr *MockChainMockRecorder) WeightOfL1Validators(subnetID any) *gomock.Call

WeightOfL1Validators indicates an expected call of WeightOfL1Validators.

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(createChainTx *txs.Tx)

AddChain mocks base method.

func (*MockDiff) AddNet added in v1.16.56

func (m *MockDiff) AddNet(netID ids.ID)

AddNet mocks base method.

func (*MockDiff) AddNetTransformation added in v1.16.56

func (m *MockDiff) AddNetTransformation(transformNetTx *txs.Tx)

AddNetTransformation mocks base method.

func (*MockDiff) AddRewardUTXO

func (m *MockDiff) AddRewardUTXO(txID ids.ID, utxo *lux.UTXO)

AddRewardUTXO mocks base method.

func (*MockDiff) AddTx

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

AddTx mocks base method.

func (*MockDiff) AddUTXO

func (m *MockDiff) AddUTXO(utxo *lux.UTXO)

AddUTXO mocks base method.

func (*MockDiff) Apply

func (m *MockDiff) Apply(arg0 Chain) error

Apply mocks base method.

func (*MockDiff) DeleteCurrentDelegator

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

DeleteCurrentDelegator mocks base method.

func (*MockDiff) DeleteCurrentValidator

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

DeleteCurrentValidator mocks base method.

func (*MockDiff) DeleteExpiry

func (m *MockDiff) DeleteExpiry(arg0 ExpiryEntry)

DeleteExpiry mocks base method.

func (*MockDiff) DeletePendingDelegator

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

DeletePendingDelegator mocks base method.

func (*MockDiff) DeletePendingValidator

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

DeletePendingValidator mocks base method.

func (*MockDiff) DeleteUTXO

func (m *MockDiff) DeleteUTXO(utxoID 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) GetAccruedFees

func (m *MockDiff) GetAccruedFees() uint64

GetAccruedFees mocks base method.

func (*MockDiff) GetActiveL1ValidatorsIterator

func (m *MockDiff) GetActiveL1ValidatorsIterator() (iterator.Iterator[L1Validator], error)

GetActiveL1ValidatorsIterator mocks base method.

func (*MockDiff) GetChainIDByName added in v1.16.56

func (m *MockDiff) GetChainIDByName(name string) (ids.ID, error)

GetChainIDByName mocks base method.

func (*MockDiff) GetCurrentDelegatorIterator

func (m *MockDiff) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (iterator.Iterator[*Staker], error)

GetCurrentDelegatorIterator mocks base method.

func (*MockDiff) GetCurrentStakerIterator

func (m *MockDiff) GetCurrentStakerIterator() (iterator.Iterator[*Staker], error)

GetCurrentStakerIterator mocks base method.

func (*MockDiff) GetCurrentSupply

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

GetCurrentSupply mocks base method.

func (*MockDiff) GetCurrentValidator

func (m *MockDiff) GetCurrentValidator(netID ids.ID, nodeID ids.NodeID) (*Staker, error)

GetCurrentValidator mocks base method.

func (*MockDiff) GetDelegateeReward

func (m *MockDiff) GetDelegateeReward(netID ids.ID, nodeID ids.NodeID) (uint64, error)

GetDelegateeReward mocks base method.

func (*MockDiff) GetExpiryIterator

func (m *MockDiff) GetExpiryIterator() (iterator.Iterator[ExpiryEntry], error)

GetExpiryIterator mocks base method.

func (*MockDiff) GetFeeState

func (m *MockDiff) GetFeeState() gas.State

GetFeeState mocks base method.

func (*MockDiff) GetL1Validator

func (m *MockDiff) GetL1Validator(validationID ids.ID) (L1Validator, error)

GetL1Validator mocks base method.

func (*MockDiff) GetL1ValidatorExcess

func (m *MockDiff) GetL1ValidatorExcess() gas.Gas

GetL1ValidatorExcess mocks base method.

func (*MockDiff) GetNetOwner added in v1.16.56

func (m *MockDiff) GetNetOwner(netID ids.ID) (fx.Owner, error)

GetNetOwner mocks base method.

func (*MockDiff) GetNetToL1Conversion added in v1.16.56

func (m *MockDiff) GetNetToL1Conversion(subnetID ids.ID) (NetToL1Conversion, error)

GetNetToL1Conversion mocks base method.

func (*MockDiff) GetNetTransformation added in v1.16.56

func (m *MockDiff) GetNetTransformation(subnetID ids.ID) (*txs.Tx, error)

GetNetTransformation mocks base method.

func (*MockDiff) GetPendingDelegatorIterator

func (m *MockDiff) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (iterator.Iterator[*Staker], error)

GetPendingDelegatorIterator mocks base method.

func (*MockDiff) GetPendingStakerIterator

func (m *MockDiff) GetPendingStakerIterator() (iterator.Iterator[*Staker], error)

GetPendingStakerIterator mocks base method.

func (*MockDiff) GetPendingValidator

func (m *MockDiff) GetPendingValidator(netID ids.ID, nodeID ids.NodeID) (*Staker, error)

GetPendingValidator mocks base method.

func (*MockDiff) GetTimestamp

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

GetTimestamp mocks base method.

func (*MockDiff) GetTx

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

GetTx mocks base method.

func (*MockDiff) GetUTXO

func (m *MockDiff) GetUTXO(utxoID ids.ID) (*lux.UTXO, error)

GetUTXO mocks base method.

func (*MockDiff) HasExpiry

func (m *MockDiff) HasExpiry(arg0 ExpiryEntry) (bool, error)

HasExpiry mocks base method.

func (*MockDiff) HasL1Validator

func (m *MockDiff) HasL1Validator(subnetID ids.ID, nodeID ids.NodeID) (bool, error)

HasL1Validator mocks base method.

func (*MockDiff) IsChainNameTaken added in v1.16.56

func (m *MockDiff) IsChainNameTaken(name string) bool

IsChainNameTaken mocks base method.

func (*MockDiff) NumActiveL1Validators

func (m *MockDiff) NumActiveL1Validators() int

NumActiveL1Validators mocks base method.

func (*MockDiff) PutCurrentDelegator

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

PutCurrentDelegator mocks base method.

func (*MockDiff) PutCurrentValidator

func (m *MockDiff) PutCurrentValidator(staker *Staker) error

PutCurrentValidator mocks base method.

func (*MockDiff) PutExpiry

func (m *MockDiff) PutExpiry(arg0 ExpiryEntry)

PutExpiry mocks base method.

func (*MockDiff) PutL1Validator

func (m *MockDiff) PutL1Validator(validator L1Validator) error

PutL1Validator mocks base method.

func (*MockDiff) PutPendingDelegator

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

PutPendingDelegator mocks base method.

func (*MockDiff) PutPendingValidator

func (m *MockDiff) PutPendingValidator(staker *Staker) error

PutPendingValidator mocks base method.

func (*MockDiff) SetAccruedFees

func (m *MockDiff) SetAccruedFees(f uint64)

SetAccruedFees mocks base method.

func (*MockDiff) SetCurrentSupply

func (m *MockDiff) SetCurrentSupply(subnetID ids.ID, cs uint64)

SetCurrentSupply mocks base method.

func (*MockDiff) SetDelegateeReward

func (m *MockDiff) SetDelegateeReward(netID ids.ID, nodeID ids.NodeID, amount uint64) error

SetDelegateeReward mocks base method.

func (*MockDiff) SetFeeState

func (m *MockDiff) SetFeeState(f gas.State)

SetFeeState mocks base method.

func (*MockDiff) SetL1ValidatorExcess

func (m *MockDiff) SetL1ValidatorExcess(e gas.Gas)

SetL1ValidatorExcess mocks base method.

func (*MockDiff) SetNetOwner added in v1.16.56

func (m *MockDiff) SetNetOwner(netID ids.ID, owner fx.Owner)

SetNetOwner mocks base method.

func (*MockDiff) SetNetToL1Conversion added in v1.16.56

func (m *MockDiff) SetNetToL1Conversion(subnetID ids.ID, c NetToL1Conversion)

SetNetToL1Conversion mocks base method.

func (*MockDiff) SetTimestamp

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

SetTimestamp mocks base method.

func (*MockDiff) WeightOfL1Validators

func (m *MockDiff) WeightOfL1Validators(subnetID ids.ID) (uint64, error)

WeightOfL1Validators 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 any) *gomock.Call

AddChain indicates an expected call of AddChain.

func (*MockDiffMockRecorder) AddNet added in v1.16.56

func (mr *MockDiffMockRecorder) AddNet(netID any) *gomock.Call

AddNet indicates an expected call of AddNet.

func (*MockDiffMockRecorder) AddNetTransformation added in v1.16.56

func (mr *MockDiffMockRecorder) AddNetTransformation(transformNetTx any) *gomock.Call

AddNetTransformation indicates an expected call of AddNetTransformation.

func (*MockDiffMockRecorder) AddRewardUTXO

func (mr *MockDiffMockRecorder) AddRewardUTXO(txID, utxo any) *gomock.Call

AddRewardUTXO indicates an expected call of AddRewardUTXO.

func (*MockDiffMockRecorder) AddTx

func (mr *MockDiffMockRecorder) AddTx(tx, arg1 any) *gomock.Call

AddTx indicates an expected call of AddTx.

func (*MockDiffMockRecorder) AddUTXO

func (mr *MockDiffMockRecorder) AddUTXO(utxo any) *gomock.Call

AddUTXO indicates an expected call of AddUTXO.

func (*MockDiffMockRecorder) Apply

func (mr *MockDiffMockRecorder) Apply(arg0 any) *gomock.Call

Apply indicates an expected call of Apply.

func (*MockDiffMockRecorder) DeleteCurrentDelegator

func (mr *MockDiffMockRecorder) DeleteCurrentDelegator(staker any) *gomock.Call

DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.

func (*MockDiffMockRecorder) DeleteCurrentValidator

func (mr *MockDiffMockRecorder) DeleteCurrentValidator(staker any) *gomock.Call

DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.

func (*MockDiffMockRecorder) DeleteExpiry

func (mr *MockDiffMockRecorder) DeleteExpiry(arg0 any) *gomock.Call

DeleteExpiry indicates an expected call of DeleteExpiry.

func (*MockDiffMockRecorder) DeletePendingDelegator

func (mr *MockDiffMockRecorder) DeletePendingDelegator(staker any) *gomock.Call

DeletePendingDelegator indicates an expected call of DeletePendingDelegator.

func (*MockDiffMockRecorder) DeletePendingValidator

func (mr *MockDiffMockRecorder) DeletePendingValidator(staker any) *gomock.Call

DeletePendingValidator indicates an expected call of DeletePendingValidator.

func (*MockDiffMockRecorder) DeleteUTXO

func (mr *MockDiffMockRecorder) DeleteUTXO(utxoID any) *gomock.Call

DeleteUTXO indicates an expected call of DeleteUTXO.

func (*MockDiffMockRecorder) GetAccruedFees

func (mr *MockDiffMockRecorder) GetAccruedFees() *gomock.Call

GetAccruedFees indicates an expected call of GetAccruedFees.

func (*MockDiffMockRecorder) GetActiveL1ValidatorsIterator

func (mr *MockDiffMockRecorder) GetActiveL1ValidatorsIterator() *gomock.Call

GetActiveL1ValidatorsIterator indicates an expected call of GetActiveL1ValidatorsIterator.

func (*MockDiffMockRecorder) GetChainIDByName added in v1.16.56

func (mr *MockDiffMockRecorder) GetChainIDByName(name any) *gomock.Call

GetChainIDByName indicates an expected call of GetChainIDByName.

func (*MockDiffMockRecorder) GetCurrentDelegatorIterator

func (mr *MockDiffMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID any) *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(subnetID any) *gomock.Call

GetCurrentSupply indicates an expected call of GetCurrentSupply.

func (*MockDiffMockRecorder) GetCurrentValidator

func (mr *MockDiffMockRecorder) GetCurrentValidator(netID, nodeID any) *gomock.Call

GetCurrentValidator indicates an expected call of GetCurrentValidator.

func (*MockDiffMockRecorder) GetDelegateeReward

func (mr *MockDiffMockRecorder) GetDelegateeReward(netID, nodeID any) *gomock.Call

GetDelegateeReward indicates an expected call of GetDelegateeReward.

func (*MockDiffMockRecorder) GetExpiryIterator

func (mr *MockDiffMockRecorder) GetExpiryIterator() *gomock.Call

GetExpiryIterator indicates an expected call of GetExpiryIterator.

func (*MockDiffMockRecorder) GetFeeState

func (mr *MockDiffMockRecorder) GetFeeState() *gomock.Call

GetFeeState indicates an expected call of GetFeeState.

func (*MockDiffMockRecorder) GetL1Validator

func (mr *MockDiffMockRecorder) GetL1Validator(validationID any) *gomock.Call

GetL1Validator indicates an expected call of GetL1Validator.

func (*MockDiffMockRecorder) GetL1ValidatorExcess

func (mr *MockDiffMockRecorder) GetL1ValidatorExcess() *gomock.Call

GetL1ValidatorExcess indicates an expected call of GetL1ValidatorExcess.

func (*MockDiffMockRecorder) GetNetOwner added in v1.16.56

func (mr *MockDiffMockRecorder) GetNetOwner(netID any) *gomock.Call

GetNetOwner indicates an expected call of GetNetOwner.

func (*MockDiffMockRecorder) GetNetToL1Conversion added in v1.16.56

func (mr *MockDiffMockRecorder) GetNetToL1Conversion(subnetID any) *gomock.Call

GetNetToL1Conversion indicates an expected call of GetNetToL1Conversion.

func (*MockDiffMockRecorder) GetNetTransformation added in v1.16.56

func (mr *MockDiffMockRecorder) GetNetTransformation(subnetID any) *gomock.Call

GetNetTransformation indicates an expected call of GetNetTransformation.

func (*MockDiffMockRecorder) GetPendingDelegatorIterator

func (mr *MockDiffMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID any) *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(netID, nodeID any) *gomock.Call

GetPendingValidator indicates an expected call of GetPendingValidator.

func (*MockDiffMockRecorder) GetTimestamp

func (mr *MockDiffMockRecorder) GetTimestamp() *gomock.Call

GetTimestamp indicates an expected call of GetTimestamp.

func (*MockDiffMockRecorder) GetTx

func (mr *MockDiffMockRecorder) GetTx(txID any) *gomock.Call

GetTx indicates an expected call of GetTx.

func (*MockDiffMockRecorder) GetUTXO

func (mr *MockDiffMockRecorder) GetUTXO(utxoID any) *gomock.Call

GetUTXO indicates an expected call of GetUTXO.

func (*MockDiffMockRecorder) HasExpiry

func (mr *MockDiffMockRecorder) HasExpiry(arg0 any) *gomock.Call

HasExpiry indicates an expected call of HasExpiry.

func (*MockDiffMockRecorder) HasL1Validator

func (mr *MockDiffMockRecorder) HasL1Validator(subnetID, nodeID any) *gomock.Call

HasL1Validator indicates an expected call of HasL1Validator.

func (*MockDiffMockRecorder) IsChainNameTaken added in v1.16.56

func (mr *MockDiffMockRecorder) IsChainNameTaken(name any) *gomock.Call

IsChainNameTaken indicates an expected call of IsChainNameTaken.

func (*MockDiffMockRecorder) NumActiveL1Validators

func (mr *MockDiffMockRecorder) NumActiveL1Validators() *gomock.Call

NumActiveL1Validators indicates an expected call of NumActiveL1Validators.

func (*MockDiffMockRecorder) PutCurrentDelegator

func (mr *MockDiffMockRecorder) PutCurrentDelegator(staker any) *gomock.Call

PutCurrentDelegator indicates an expected call of PutCurrentDelegator.

func (*MockDiffMockRecorder) PutCurrentValidator

func (mr *MockDiffMockRecorder) PutCurrentValidator(staker any) *gomock.Call

PutCurrentValidator indicates an expected call of PutCurrentValidator.

func (*MockDiffMockRecorder) PutExpiry

func (mr *MockDiffMockRecorder) PutExpiry(arg0 any) *gomock.Call

PutExpiry indicates an expected call of PutExpiry.

func (*MockDiffMockRecorder) PutL1Validator

func (mr *MockDiffMockRecorder) PutL1Validator(validator any) *gomock.Call

PutL1Validator indicates an expected call of PutL1Validator.

func (*MockDiffMockRecorder) PutPendingDelegator

func (mr *MockDiffMockRecorder) PutPendingDelegator(staker any) *gomock.Call

PutPendingDelegator indicates an expected call of PutPendingDelegator.

func (*MockDiffMockRecorder) PutPendingValidator

func (mr *MockDiffMockRecorder) PutPendingValidator(staker any) *gomock.Call

PutPendingValidator indicates an expected call of PutPendingValidator.

func (*MockDiffMockRecorder) SetAccruedFees

func (mr *MockDiffMockRecorder) SetAccruedFees(f any) *gomock.Call

SetAccruedFees indicates an expected call of SetAccruedFees.

func (*MockDiffMockRecorder) SetCurrentSupply

func (mr *MockDiffMockRecorder) SetCurrentSupply(subnetID, cs any) *gomock.Call

SetCurrentSupply indicates an expected call of SetCurrentSupply.

func (*MockDiffMockRecorder) SetDelegateeReward

func (mr *MockDiffMockRecorder) SetDelegateeReward(netID, nodeID, amount any) *gomock.Call

SetDelegateeReward indicates an expected call of SetDelegateeReward.

func (*MockDiffMockRecorder) SetFeeState

func (mr *MockDiffMockRecorder) SetFeeState(f any) *gomock.Call

SetFeeState indicates an expected call of SetFeeState.

func (*MockDiffMockRecorder) SetL1ValidatorExcess

func (mr *MockDiffMockRecorder) SetL1ValidatorExcess(e any) *gomock.Call

SetL1ValidatorExcess indicates an expected call of SetL1ValidatorExcess.

func (*MockDiffMockRecorder) SetNetOwner added in v1.16.56

func (mr *MockDiffMockRecorder) SetNetOwner(netID, owner any) *gomock.Call

SetNetOwner indicates an expected call of SetNetOwner.

func (*MockDiffMockRecorder) SetNetToL1Conversion added in v1.16.56

func (mr *MockDiffMockRecorder) SetNetToL1Conversion(subnetID, c any) *gomock.Call

SetNetToL1Conversion indicates an expected call of SetNetToL1Conversion.

func (*MockDiffMockRecorder) SetTimestamp

func (mr *MockDiffMockRecorder) SetTimestamp(tm any) *gomock.Call

SetTimestamp indicates an expected call of SetTimestamp.

func (*MockDiffMockRecorder) WeightOfL1Validators

func (mr *MockDiffMockRecorder) WeightOfL1Validators(subnetID any) *gomock.Call

WeightOfL1Validators indicates an expected call of WeightOfL1Validators.

type MockStakerIterator added in v1.1.11

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

MockStakerIterator is a mock of StakerIterator interface.

func NewMockStakerIterator added in v1.1.11

func NewMockStakerIterator(ctrl *gomock.Controller) *MockStakerIterator

NewMockStakerIterator creates a new mock instance.

func (*MockStakerIterator) EXPECT added in v1.1.11

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

func (*MockStakerIterator) Next added in v1.1.11

func (m *MockStakerIterator) Next() bool

Next mocks base method.

func (*MockStakerIterator) Release added in v1.1.11

func (m *MockStakerIterator) Release()

Release mocks base method.

func (*MockStakerIterator) Value added in v1.1.11

func (m *MockStakerIterator) Value() *Staker

Value mocks base method.

type MockStakerIteratorMockRecorder added in v1.1.11

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

MockStakerIteratorMockRecorder is the mock recorder for MockStakerIterator.

func (*MockStakerIteratorMockRecorder) Next added in v1.1.11

Next indicates an expected call of Next.

func (*MockStakerIteratorMockRecorder) Release added in v1.1.11

Release indicates an expected call of Release.

func (*MockStakerIteratorMockRecorder) Value added in v1.1.11

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(createChainTx *txs.Tx)

AddChain mocks base method.

func (*MockState) AddNet added in v1.16.56

func (m *MockState) AddNet(netID ids.ID)

AddNet mocks base method.

func (*MockState) AddNetTransformation added in v1.16.56

func (m *MockState) AddNetTransformation(transformNetTx *txs.Tx)

AddNetTransformation mocks base method.

func (*MockState) AddRewardUTXO

func (m *MockState) AddRewardUTXO(txID ids.ID, utxo *lux.UTXO)

AddRewardUTXO mocks base method.

func (*MockState) AddStatelessBlock

func (m *MockState) AddStatelessBlock(arg0 block.Block)

AddStatelessBlock mocks base method.

func (*MockState) AddTx

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

AddTx mocks base method.

func (*MockState) AddUTXO

func (m *MockState) AddUTXO(utxo *lux.UTXO)

AddUTXO mocks base method.

func (*MockState) ApplyValidatorPublicKeyDiffs

func (m *MockState) ApplyValidatorPublicKeyDiffs(ctx context.Context, arg1 map[ids.NodeID]*validators.GetValidatorOutput, startHeight, endHeight uint64, subnetID ids.ID) error

ApplyValidatorPublicKeyDiffs mocks base method.

func (*MockState) ApplyValidatorWeightDiffs

func (m *MockState) ApplyValidatorWeightDiffs(ctx context.Context, arg1 map[ids.NodeID]*validators.GetValidatorOutput, startHeight, endHeight uint64, netID ids.ID) error

ApplyValidatorWeightDiffs mocks base method.

func (*MockState) Checksum

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

Checksum 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(staker *Staker)

DeleteCurrentDelegator mocks base method.

func (*MockState) DeleteCurrentValidator

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

DeleteCurrentValidator mocks base method.

func (*MockState) DeleteExpiry

func (m *MockState) DeleteExpiry(arg0 ExpiryEntry)

DeleteExpiry mocks base method.

func (*MockState) DeletePendingDelegator

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

DeletePendingDelegator mocks base method.

func (*MockState) DeletePendingValidator

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

DeletePendingValidator mocks base method.

func (*MockState) DeleteUTXO

func (m *MockState) DeleteUTXO(utxoID 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) GetAccruedFees

func (m *MockState) GetAccruedFees() uint64

GetAccruedFees mocks base method.

func (*MockState) GetActiveL1ValidatorsIterator

func (m *MockState) GetActiveL1ValidatorsIterator() (iterator.Iterator[L1Validator], error)

GetActiveL1ValidatorsIterator mocks base method.

func (*MockState) GetBlockIDAtHeight

func (m *MockState) GetBlockIDAtHeight(height uint64) (ids.ID, error)

GetBlockIDAtHeight mocks base method.

func (*MockState) GetChainIDByName added in v1.16.56

func (m *MockState) GetChainIDByName(name string) (ids.ID, error)

GetChainIDByName mocks base method.

func (*MockState) GetChainIDs added in v1.22.23

func (m *MockState) GetChainIDs() ([]ids.ID, error)

GetChainIDs mocks base method.

func (*MockState) GetChains

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

GetChains mocks base method.

func (*MockState) GetCurrentDelegatorIterator

func (m *MockState) GetCurrentDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (iterator.Iterator[*Staker], error)

GetCurrentDelegatorIterator mocks base method.

func (*MockState) GetCurrentStakerIterator

func (m *MockState) GetCurrentStakerIterator() (iterator.Iterator[*Staker], error)

GetCurrentStakerIterator mocks base method.

func (*MockState) GetCurrentSupply

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

GetCurrentSupply mocks base method.

func (*MockState) GetCurrentValidator

func (m *MockState) GetCurrentValidator(netID ids.ID, nodeID ids.NodeID) (*Staker, error)

GetCurrentValidator mocks base method.

func (*MockState) GetCurrentValidators

func (m *MockState) GetCurrentValidators(ctx context.Context, subnetID ids.ID) ([]*Staker, []L1Validator, uint64, error)

GetCurrentValidators mocks base method.

func (*MockState) GetDelegateeReward

func (m *MockState) GetDelegateeReward(netID ids.ID, nodeID ids.NodeID) (uint64, error)

GetDelegateeReward mocks base method.

func (*MockState) GetExpiryIterator

func (m *MockState) GetExpiryIterator() (iterator.Iterator[ExpiryEntry], error)

GetExpiryIterator mocks base method.

func (*MockState) GetFeeState

func (m *MockState) GetFeeState() gas.State

GetFeeState mocks base method.

func (*MockState) GetL1Validator

func (m *MockState) GetL1Validator(validationID ids.ID) (L1Validator, error)

GetL1Validator mocks base method.

func (*MockState) GetL1ValidatorExcess

func (m *MockState) GetL1ValidatorExcess() gas.Gas

GetL1ValidatorExcess mocks base method.

func (*MockState) GetLastAccepted

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

GetLastAccepted mocks base method.

func (*MockState) GetNetIDs added in v1.16.56

func (m *MockState) GetNetIDs() ([]ids.ID, error)

GetNetIDs mocks base method.

func (*MockState) GetNetOwner added in v1.16.56

func (m *MockState) GetNetOwner(netID ids.ID) (fx.Owner, error)

GetNetOwner mocks base method.

func (*MockState) GetNetToL1Conversion added in v1.16.56

func (m *MockState) GetNetToL1Conversion(subnetID ids.ID) (NetToL1Conversion, error)

GetNetToL1Conversion mocks base method.

func (*MockState) GetNetTransformation added in v1.16.56

func (m *MockState) GetNetTransformation(subnetID ids.ID) (*txs.Tx, error)

GetNetTransformation mocks base method.

func (*MockState) GetPendingDelegatorIterator

func (m *MockState) GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (iterator.Iterator[*Staker], error)

GetPendingDelegatorIterator mocks base method.

func (*MockState) GetPendingStakerIterator

func (m *MockState) GetPendingStakerIterator() (iterator.Iterator[*Staker], error)

GetPendingStakerIterator mocks base method.

func (*MockState) GetPendingValidator

func (m *MockState) GetPendingValidator(netID ids.ID, nodeID ids.NodeID) (*Staker, error)

GetPendingValidator mocks base method.

func (*MockState) GetRewardUTXOs

func (m *MockState) GetRewardUTXOs(txID ids.ID) ([]*lux.UTXO, error)

GetRewardUTXOs mocks base method.

func (*MockState) GetStartTime

func (m *MockState) GetStartTime(nodeID ids.NodeID, netID ids.ID) (time.Time, error)

GetStartTime mocks base method.

func (*MockState) GetStatelessBlock

func (m *MockState) GetStatelessBlock(blockID ids.ID) (block.Block, error)

GetStatelessBlock mocks base method.

func (*MockState) GetTimestamp

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

GetTimestamp mocks base method.

func (*MockState) GetTx

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

GetTx mocks base method.

func (*MockState) GetUTXO

func (m *MockState) GetUTXO(utxoID ids.ID) (*lux.UTXO, error)

GetUTXO mocks base method.

func (*MockState) GetUptime

func (m *MockState) GetUptime(nodeID ids.NodeID, netID ids.ID) (time.Duration, time.Duration, error)

GetUptime mocks base method.

func (*MockState) HasExpiry

func (m *MockState) HasExpiry(arg0 ExpiryEntry) (bool, error)

HasExpiry mocks base method.

func (*MockState) HasL1Validator

func (m *MockState) HasL1Validator(subnetID ids.ID, nodeID ids.NodeID) (bool, error)

HasL1Validator mocks base method.

func (*MockState) IsChainNameTaken added in v1.16.56

func (m *MockState) IsChainNameTaken(name string) bool

IsChainNameTaken mocks base method.

func (*MockState) NumActiveL1Validators

func (m *MockState) NumActiveL1Validators() int

NumActiveL1Validators mocks base method.

func (*MockState) PutCurrentDelegator

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

PutCurrentDelegator mocks base method.

func (*MockState) PutCurrentValidator

func (m *MockState) PutCurrentValidator(staker *Staker) error

PutCurrentValidator mocks base method.

func (*MockState) PutExpiry

func (m *MockState) PutExpiry(arg0 ExpiryEntry)

PutExpiry mocks base method.

func (*MockState) PutL1Validator

func (m *MockState) PutL1Validator(validator L1Validator) error

PutL1Validator mocks base method.

func (*MockState) PutPendingDelegator

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

PutPendingDelegator mocks base method.

func (*MockState) PutPendingValidator

func (m *MockState) PutPendingValidator(staker *Staker) error

PutPendingValidator mocks base method.

func (*MockState) ReindexBlocks

func (m *MockState) ReindexBlocks(lock sync.Locker, arg1 log.Logger) error

ReindexBlocks mocks base method.

func (*MockState) SetAccruedFees

func (m *MockState) SetAccruedFees(f uint64)

SetAccruedFees mocks base method.

func (*MockState) SetCurrentSupply

func (m *MockState) SetCurrentSupply(subnetID ids.ID, cs uint64)

SetCurrentSupply mocks base method.

func (*MockState) SetDelegateeReward

func (m *MockState) SetDelegateeReward(netID ids.ID, nodeID ids.NodeID, amount uint64) error

SetDelegateeReward mocks base method.

func (*MockState) SetFeeState

func (m *MockState) SetFeeState(f gas.State)

SetFeeState mocks base method.

func (*MockState) SetHeight

func (m *MockState) SetHeight(height uint64)

SetHeight mocks base method.

func (*MockState) SetL1ValidatorExcess

func (m *MockState) SetL1ValidatorExcess(e gas.Gas)

SetL1ValidatorExcess mocks base method.

func (*MockState) SetLastAccepted

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

SetLastAccepted mocks base method.

func (*MockState) SetNetOwner added in v1.16.56

func (m *MockState) SetNetOwner(netID ids.ID, owner fx.Owner)

SetNetOwner mocks base method.

func (*MockState) SetNetToL1Conversion added in v1.16.56

func (m *MockState) SetNetToL1Conversion(subnetID ids.ID, c NetToL1Conversion)

SetNetToL1Conversion mocks base method.

func (*MockState) SetTimestamp

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

SetTimestamp mocks base method.

func (*MockState) SetUptime

func (m *MockState) SetUptime(nodeID ids.NodeID, netID ids.ID, uptime time.Duration, lastUpdated time.Time) error

SetUptime mocks base method.

func (*MockState) UTXOIDs

func (m *MockState) UTXOIDs(addr []byte, previous ids.ID, limit int) ([]ids.ID, error)

UTXOIDs mocks base method.

func (*MockState) WeightOfL1Validators

func (m *MockState) WeightOfL1Validators(subnetID ids.ID) (uint64, error)

WeightOfL1Validators 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 any) *gomock.Call

AddChain indicates an expected call of AddChain.

func (*MockStateMockRecorder) AddNet added in v1.16.56

func (mr *MockStateMockRecorder) AddNet(netID any) *gomock.Call

AddNet indicates an expected call of AddNet.

func (*MockStateMockRecorder) AddNetTransformation added in v1.16.56

func (mr *MockStateMockRecorder) AddNetTransformation(transformNetTx any) *gomock.Call

AddNetTransformation indicates an expected call of AddNetTransformation.

func (*MockStateMockRecorder) AddRewardUTXO

func (mr *MockStateMockRecorder) AddRewardUTXO(txID, utxo any) *gomock.Call

AddRewardUTXO indicates an expected call of AddRewardUTXO.

func (*MockStateMockRecorder) AddStatelessBlock

func (mr *MockStateMockRecorder) AddStatelessBlock(arg0 any) *gomock.Call

AddStatelessBlock indicates an expected call of AddStatelessBlock.

func (*MockStateMockRecorder) AddTx

func (mr *MockStateMockRecorder) AddTx(tx, arg1 any) *gomock.Call

AddTx indicates an expected call of AddTx.

func (*MockStateMockRecorder) AddUTXO

func (mr *MockStateMockRecorder) AddUTXO(utxo any) *gomock.Call

AddUTXO indicates an expected call of AddUTXO.

func (*MockStateMockRecorder) ApplyValidatorPublicKeyDiffs

func (mr *MockStateMockRecorder) ApplyValidatorPublicKeyDiffs(ctx, arg1, startHeight, endHeight, subnetID any) *gomock.Call

ApplyValidatorPublicKeyDiffs indicates an expected call of ApplyValidatorPublicKeyDiffs.

func (*MockStateMockRecorder) ApplyValidatorWeightDiffs

func (mr *MockStateMockRecorder) ApplyValidatorWeightDiffs(ctx, arg1, startHeight, endHeight, netID any) *gomock.Call

ApplyValidatorWeightDiffs indicates an expected call of ApplyValidatorWeightDiffs.

func (*MockStateMockRecorder) Checksum

func (mr *MockStateMockRecorder) Checksum() *gomock.Call

Checksum indicates an expected call of Checksum.

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 any) *gomock.Call

DeleteCurrentDelegator indicates an expected call of DeleteCurrentDelegator.

func (*MockStateMockRecorder) DeleteCurrentValidator

func (mr *MockStateMockRecorder) DeleteCurrentValidator(staker any) *gomock.Call

DeleteCurrentValidator indicates an expected call of DeleteCurrentValidator.

func (*MockStateMockRecorder) DeleteExpiry

func (mr *MockStateMockRecorder) DeleteExpiry(arg0 any) *gomock.Call

DeleteExpiry indicates an expected call of DeleteExpiry.

func (*MockStateMockRecorder) DeletePendingDelegator

func (mr *MockStateMockRecorder) DeletePendingDelegator(staker any) *gomock.Call

DeletePendingDelegator indicates an expected call of DeletePendingDelegator.

func (*MockStateMockRecorder) DeletePendingValidator

func (mr *MockStateMockRecorder) DeletePendingValidator(staker any) *gomock.Call

DeletePendingValidator indicates an expected call of DeletePendingValidator.

func (*MockStateMockRecorder) DeleteUTXO

func (mr *MockStateMockRecorder) DeleteUTXO(utxoID any) *gomock.Call

DeleteUTXO indicates an expected call of DeleteUTXO.

func (*MockStateMockRecorder) GetAccruedFees

func (mr *MockStateMockRecorder) GetAccruedFees() *gomock.Call

GetAccruedFees indicates an expected call of GetAccruedFees.

func (*MockStateMockRecorder) GetActiveL1ValidatorsIterator

func (mr *MockStateMockRecorder) GetActiveL1ValidatorsIterator() *gomock.Call

GetActiveL1ValidatorsIterator indicates an expected call of GetActiveL1ValidatorsIterator.

func (*MockStateMockRecorder) GetBlockIDAtHeight

func (mr *MockStateMockRecorder) GetBlockIDAtHeight(height any) *gomock.Call

GetBlockIDAtHeight indicates an expected call of GetBlockIDAtHeight.

func (*MockStateMockRecorder) GetChainIDByName added in v1.16.56

func (mr *MockStateMockRecorder) GetChainIDByName(name any) *gomock.Call

GetChainIDByName indicates an expected call of GetChainIDByName.

func (*MockStateMockRecorder) GetChainIDs added in v1.22.23

func (mr *MockStateMockRecorder) GetChainIDs() *gomock.Call

GetChainIDs indicates an expected call of GetChainIDs.

func (*MockStateMockRecorder) GetChains

func (mr *MockStateMockRecorder) GetChains(netID any) *gomock.Call

GetChains indicates an expected call of GetChains.

func (*MockStateMockRecorder) GetCurrentDelegatorIterator

func (mr *MockStateMockRecorder) GetCurrentDelegatorIterator(subnetID, nodeID any) *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(subnetID any) *gomock.Call

GetCurrentSupply indicates an expected call of GetCurrentSupply.

func (*MockStateMockRecorder) GetCurrentValidator

func (mr *MockStateMockRecorder) GetCurrentValidator(netID, nodeID any) *gomock.Call

GetCurrentValidator indicates an expected call of GetCurrentValidator.

func (*MockStateMockRecorder) GetCurrentValidators

func (mr *MockStateMockRecorder) GetCurrentValidators(ctx, subnetID any) *gomock.Call

GetCurrentValidators indicates an expected call of GetCurrentValidators.

func (*MockStateMockRecorder) GetDelegateeReward

func (mr *MockStateMockRecorder) GetDelegateeReward(netID, nodeID any) *gomock.Call

GetDelegateeReward indicates an expected call of GetDelegateeReward.

func (*MockStateMockRecorder) GetExpiryIterator

func (mr *MockStateMockRecorder) GetExpiryIterator() *gomock.Call

GetExpiryIterator indicates an expected call of GetExpiryIterator.

func (*MockStateMockRecorder) GetFeeState

func (mr *MockStateMockRecorder) GetFeeState() *gomock.Call

GetFeeState indicates an expected call of GetFeeState.

func (*MockStateMockRecorder) GetL1Validator

func (mr *MockStateMockRecorder) GetL1Validator(validationID any) *gomock.Call

GetL1Validator indicates an expected call of GetL1Validator.

func (*MockStateMockRecorder) GetL1ValidatorExcess

func (mr *MockStateMockRecorder) GetL1ValidatorExcess() *gomock.Call

GetL1ValidatorExcess indicates an expected call of GetL1ValidatorExcess.

func (*MockStateMockRecorder) GetLastAccepted

func (mr *MockStateMockRecorder) GetLastAccepted() *gomock.Call

GetLastAccepted indicates an expected call of GetLastAccepted.

func (*MockStateMockRecorder) GetNetIDs added in v1.16.56

func (mr *MockStateMockRecorder) GetNetIDs() *gomock.Call

GetNetIDs indicates an expected call of GetNetIDs.

func (*MockStateMockRecorder) GetNetOwner added in v1.16.56

func (mr *MockStateMockRecorder) GetNetOwner(netID any) *gomock.Call

GetNetOwner indicates an expected call of GetNetOwner.

func (*MockStateMockRecorder) GetNetToL1Conversion added in v1.16.56

func (mr *MockStateMockRecorder) GetNetToL1Conversion(subnetID any) *gomock.Call

GetNetToL1Conversion indicates an expected call of GetNetToL1Conversion.

func (*MockStateMockRecorder) GetNetTransformation added in v1.16.56

func (mr *MockStateMockRecorder) GetNetTransformation(subnetID any) *gomock.Call

GetNetTransformation indicates an expected call of GetNetTransformation.

func (*MockStateMockRecorder) GetPendingDelegatorIterator

func (mr *MockStateMockRecorder) GetPendingDelegatorIterator(subnetID, nodeID any) *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(netID, nodeID any) *gomock.Call

GetPendingValidator indicates an expected call of GetPendingValidator.

func (*MockStateMockRecorder) GetRewardUTXOs

func (mr *MockStateMockRecorder) GetRewardUTXOs(txID any) *gomock.Call

GetRewardUTXOs indicates an expected call of GetRewardUTXOs.

func (*MockStateMockRecorder) GetStartTime

func (mr *MockStateMockRecorder) GetStartTime(nodeID, netID any) *gomock.Call

GetStartTime indicates an expected call of GetStartTime.

func (*MockStateMockRecorder) GetStatelessBlock

func (mr *MockStateMockRecorder) GetStatelessBlock(blockID any) *gomock.Call

GetStatelessBlock indicates an expected call of GetStatelessBlock.

func (*MockStateMockRecorder) GetTimestamp

func (mr *MockStateMockRecorder) GetTimestamp() *gomock.Call

GetTimestamp indicates an expected call of GetTimestamp.

func (*MockStateMockRecorder) GetTx

func (mr *MockStateMockRecorder) GetTx(txID any) *gomock.Call

GetTx indicates an expected call of GetTx.

func (*MockStateMockRecorder) GetUTXO

func (mr *MockStateMockRecorder) GetUTXO(utxoID any) *gomock.Call

GetUTXO indicates an expected call of GetUTXO.

func (*MockStateMockRecorder) GetUptime

func (mr *MockStateMockRecorder) GetUptime(nodeID, netID any) *gomock.Call

GetUptime indicates an expected call of GetUptime.

func (*MockStateMockRecorder) HasExpiry

func (mr *MockStateMockRecorder) HasExpiry(arg0 any) *gomock.Call

HasExpiry indicates an expected call of HasExpiry.

func (*MockStateMockRecorder) HasL1Validator

func (mr *MockStateMockRecorder) HasL1Validator(subnetID, nodeID any) *gomock.Call

HasL1Validator indicates an expected call of HasL1Validator.

func (*MockStateMockRecorder) IsChainNameTaken added in v1.16.56

func (mr *MockStateMockRecorder) IsChainNameTaken(name any) *gomock.Call

IsChainNameTaken indicates an expected call of IsChainNameTaken.

func (*MockStateMockRecorder) NumActiveL1Validators

func (mr *MockStateMockRecorder) NumActiveL1Validators() *gomock.Call

NumActiveL1Validators indicates an expected call of NumActiveL1Validators.

func (*MockStateMockRecorder) PutCurrentDelegator

func (mr *MockStateMockRecorder) PutCurrentDelegator(staker any) *gomock.Call

PutCurrentDelegator indicates an expected call of PutCurrentDelegator.

func (*MockStateMockRecorder) PutCurrentValidator

func (mr *MockStateMockRecorder) PutCurrentValidator(staker any) *gomock.Call

PutCurrentValidator indicates an expected call of PutCurrentValidator.

func (*MockStateMockRecorder) PutExpiry

func (mr *MockStateMockRecorder) PutExpiry(arg0 any) *gomock.Call

PutExpiry indicates an expected call of PutExpiry.

func (*MockStateMockRecorder) PutL1Validator

func (mr *MockStateMockRecorder) PutL1Validator(validator any) *gomock.Call

PutL1Validator indicates an expected call of PutL1Validator.

func (*MockStateMockRecorder) PutPendingDelegator

func (mr *MockStateMockRecorder) PutPendingDelegator(staker any) *gomock.Call

PutPendingDelegator indicates an expected call of PutPendingDelegator.

func (*MockStateMockRecorder) PutPendingValidator

func (mr *MockStateMockRecorder) PutPendingValidator(staker any) *gomock.Call

PutPendingValidator indicates an expected call of PutPendingValidator.

func (*MockStateMockRecorder) ReindexBlocks

func (mr *MockStateMockRecorder) ReindexBlocks(lock, arg1 any) *gomock.Call

ReindexBlocks indicates an expected call of ReindexBlocks.

func (*MockStateMockRecorder) SetAccruedFees

func (mr *MockStateMockRecorder) SetAccruedFees(f any) *gomock.Call

SetAccruedFees indicates an expected call of SetAccruedFees.

func (*MockStateMockRecorder) SetCurrentSupply

func (mr *MockStateMockRecorder) SetCurrentSupply(subnetID, cs any) *gomock.Call

SetCurrentSupply indicates an expected call of SetCurrentSupply.

func (*MockStateMockRecorder) SetDelegateeReward

func (mr *MockStateMockRecorder) SetDelegateeReward(netID, nodeID, amount any) *gomock.Call

SetDelegateeReward indicates an expected call of SetDelegateeReward.

func (*MockStateMockRecorder) SetFeeState

func (mr *MockStateMockRecorder) SetFeeState(f any) *gomock.Call

SetFeeState indicates an expected call of SetFeeState.

func (*MockStateMockRecorder) SetHeight

func (mr *MockStateMockRecorder) SetHeight(height any) *gomock.Call

SetHeight indicates an expected call of SetHeight.

func (*MockStateMockRecorder) SetL1ValidatorExcess

func (mr *MockStateMockRecorder) SetL1ValidatorExcess(e any) *gomock.Call

SetL1ValidatorExcess indicates an expected call of SetL1ValidatorExcess.

func (*MockStateMockRecorder) SetLastAccepted

func (mr *MockStateMockRecorder) SetLastAccepted(blkID any) *gomock.Call

SetLastAccepted indicates an expected call of SetLastAccepted.

func (*MockStateMockRecorder) SetNetOwner added in v1.16.56

func (mr *MockStateMockRecorder) SetNetOwner(netID, owner any) *gomock.Call

SetNetOwner indicates an expected call of SetNetOwner.

func (*MockStateMockRecorder) SetNetToL1Conversion added in v1.16.56

func (mr *MockStateMockRecorder) SetNetToL1Conversion(subnetID, c any) *gomock.Call

SetNetToL1Conversion indicates an expected call of SetNetToL1Conversion.

func (*MockStateMockRecorder) SetTimestamp

func (mr *MockStateMockRecorder) SetTimestamp(tm any) *gomock.Call

SetTimestamp indicates an expected call of SetTimestamp.

func (*MockStateMockRecorder) SetUptime

func (mr *MockStateMockRecorder) SetUptime(nodeID, netID, uptime, lastUpdated any) *gomock.Call

SetUptime indicates an expected call of SetUptime.

func (*MockStateMockRecorder) UTXOIDs

func (mr *MockStateMockRecorder) UTXOIDs(addr, previous, limit any) *gomock.Call

UTXOIDs indicates an expected call of UTXOIDs.

func (*MockStateMockRecorder) WeightOfL1Validators

func (mr *MockStateMockRecorder) WeightOfL1Validators(subnetID any) *gomock.Call

WeightOfL1Validators indicates an expected call of WeightOfL1Validators.

type MockVersions added in v1.1.11

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

MockVersions is a mock of Versions interface.

func NewMockVersions added in v1.1.11

func NewMockVersions(ctrl *gomock.Controller) *MockVersions

NewMockVersions creates a new mock instance.

func (*MockVersions) EXPECT added in v1.1.11

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

func (*MockVersions) GetState added in v1.1.11

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

GetState mocks base method.

type MockVersionsMockRecorder added in v1.1.11

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

MockVersionsMockRecorder is the mock recorder for MockVersions.

func (*MockVersionsMockRecorder) GetState added in v1.1.11

func (mr *MockVersionsMockRecorder) GetState(blkID any) *gomock.Call

GetState indicates an expected call of GetState.

type NetToL1Conversion added in v1.16.56

type NetToL1Conversion struct {
	ConversionID ids.ID `serialize:"true"`
	ChainID      ids.ID `serialize:"true"`
	Addr         []byte `serialize:"true"`
}

type PendingStakers

type PendingStakers interface {
	// GetPendingValidator returns the Staker describing the validator on
	// [netID] with [nodeID]. If the validator does not exist,
	// [database.ErrNotFound] is returned.
	GetPendingValidator(netID ids.ID, nodeID ids.NodeID) (*Staker, error)

	// PutPendingValidator adds the [staker] describing a validator to the
	// staker set.
	PutPendingValidator(staker *Staker) error

	// DeletePendingValidator removes the [staker] describing a validator from
	// the staker set.
	DeletePendingValidator(staker *Staker)

	// GetPendingDelegatorIterator returns the delegators associated with the
	// validator on [netID] with [nodeID]. Delegators are sorted by their
	// removal from pending staker set.
	GetPendingDelegatorIterator(subnetID ids.ID, nodeID ids.NodeID) (iterator.Iterator[*Staker], 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() (iterator.Iterator[*Staker], error)
}

type Staker

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

	// ValidatorNFT contains NFT information if this validator is using NFT staking
	ValidatorNFT *txs.ValidatorNFTInfo
}

Staker contains all information required to represent a validator or delegator in the current and pending validator sets. Invariant: Staker's size is bounded to prevent OOM DoS attacks.

func NewCurrentStaker

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

func NewPendingStaker

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

func (*Staker) Less

func (s *Staker) Less(than *Staker) 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.

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 iterator.Iterator[*Staker]) StakerDiffIterator

type StakerIterator added in v1.1.11

type StakerIterator interface {
	// Next advances the iterator to the next staker.
	// Returns false if there are no more stakers.
	Next() bool

	// Value returns the current staker.
	// Should only be called after Next() returns true.
	Value() *Staker

	// Release frees any resources associated with the iterator.
	// Must be called when the iterator is no longer needed.
	Release()
}

StakerIterator is an iterator for Staker objects. Iterators should be released when they are no longer needed.

var EmptyIterator StakerIterator = emptyIterator{}

EmptyIterator contains no stakers.

func NewMaskedIterator added in v1.1.11

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 added in v1.1.11

func NewMergedIterator(stakers ...StakerIterator) StakerIterator

Returns an iterator that returns all of the elements of [stakers] in order.

func NewTreeIterator added in v1.1.11

func NewTreeIterator(tree *btree.BTreeG[*Staker]) 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 {
	Chain
	uptime.State
	lux.UTXOReader

	GetLastAccepted() ids.ID
	SetLastAccepted(blkID ids.ID)

	GetStatelessBlock(blockID ids.ID) (block.Block, error)

	// Invariant: [block] is an accepted block.
	AddStatelessBlock(block block.Block)

	GetBlockIDAtHeight(height uint64) (ids.ID, error)

	GetRewardUTXOs(txID ids.ID) ([]*lux.UTXO, error)
	GetChainIDs() ([]ids.ID, error)
	GetNetIDs() ([]ids.ID, error)
	GetChains(netID ids.ID) ([]*txs.Tx, error)

	// ApplyValidatorWeightDiffs iterates from [startHeight] towards the genesis
	// block until it has applied all of the diffs up to and including
	// [endHeight]. Applying the diffs modifies [validators].
	//
	// Invariant: If attempting to generate the validator set for
	// [endHeight - 1], [validators] must initially contain the validator
	// weights for [startHeight].
	//
	// Note: Because this function iterates towards the genesis, [startHeight]
	// will typically be greater than or equal to [endHeight]. If [startHeight]
	// is less than [endHeight], no diffs will be applied.
	ApplyValidatorWeightDiffs(
		ctx context.Context,
		validators map[ids.NodeID]*validators.GetValidatorOutput,
		startHeight uint64,
		endHeight uint64,
		netID ids.ID,
	) error

	// ApplyValidatorPublicKeyDiffs iterates from [startHeight] towards the
	// genesis block until it has applied all of the diffs up to and including
	// [endHeight]. Applying the diffs modifies [validators].
	//
	// Invariant: If attempting to generate the validator set for
	// [endHeight - 1], [validators] must initially contain the validator
	// weights for [startHeight].
	//
	// Note: Because this function iterates towards the genesis, [startHeight]
	// will typically be greater than or equal to [endHeight]. If [startHeight]
	// is less than [endHeight], no diffs will be applied.
	ApplyValidatorPublicKeyDiffs(
		ctx context.Context,
		validators map[ids.NodeID]*validators.GetValidatorOutput,
		startHeight uint64,
		endHeight uint64,
		subnetID ids.ID,
	) error

	SetHeight(height uint64)

	// GetCurrentValidators returns subnet and L1 validators for the given
	// subnetID along with the current P-chain height.
	// This method works for both subnets and L1s. Depending of the requested
	// subnet/L1 validator schema, the return values can include only subnet
	// validator, only L1 validators or both if there are initial stakers in the
	// L1 conversion.
	GetCurrentValidators(ctx context.Context, subnetID ids.ID) ([]*Staker, []L1Validator, uint64, error)

	// Discard uncommitted changes to the database.
	Abort()

	// ReindexBlocks converts any block indices using the legacy storage format
	// to the new format. If this database has already updated the indices,
	// this function will return immediately, without iterating over the
	// database.
	//
	// TODO: Remove after v1.14.x is activated
	ReindexBlocks(lock sync.Locker, log log.Logger) error

	// Commit changes to the base database.
	Commit() error

	// Returns a batch of unwritten changes that, when written, will commit all
	// pending changes to the base database.
	CommitBatch() (database.Batch, error)

	Checksum() ids.ID

	Close() error
}

func New

func New(
	db database.Database,
	genesisBytes []byte,
	metricsReg metric.Registerer,
	validators validators.Manager,
	upgrades upgrade.Config,
	execCfg *config.Config,
	ctx *consensus.Context,
	metrics metrics.Metrics,
	rewards reward.Calculator,
) (State, error)

type ValidatorWeightDiff

type ValidatorWeightDiff struct {
	Decrease     bool   `serialize:"true"`
	Amount       uint64 `serialize:"true"`
	ValidationID ids.ID `serialize:"true"` // Added to preserve TxID during diff application
}

func (*ValidatorWeightDiff) Add

func (v *ValidatorWeightDiff) Add(amount uint64) error

func (*ValidatorWeightDiff) Sub

func (v *ValidatorWeightDiff) Sub(amount uint64) error

type Versions

type Versions interface {
	// GetState returns the state of the chain after [blkID] has been accepted.
	// If the state is not known, `false` will be returned.
	GetState(blkID ids.ID) (Chain, bool)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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