Documentation
¶
Overview ¶
Package txs is a generated GoMock package.
Package txs is a generated GoMock package.
Package txs is a generated GoMock package.
Index ¶
- Constants
- Variables
- func BoundedBy(stakerStart, stakerEnd, lowerBound, upperBound time.Time) bool
- func RegisterDUnsignedTxsTypes(targetCodec linearcodec.Codec) error
- func RegisterUnsignedTxsTypes(targetCodec linearcodec.Codec) error
- type AddDelegatorTx
- func (*AddDelegatorTx) CurrentPriority() Priority
- func (tx *AddDelegatorTx) InitCtx(ctx context.Context)
- func (tx *AddDelegatorTx) InitializeWithContext(ctx context.Context) error
- func (*AddDelegatorTx) NetID() ids.ID
- func (tx *AddDelegatorTx) NodeID() ids.NodeID
- func (*AddDelegatorTx) PendingPriority() Priority
- func (*AddDelegatorTx) PublicKey() (*bls.PublicKey, bool, error)
- func (tx *AddDelegatorTx) RewardsOwner() fx.Owner
- func (tx *AddDelegatorTx) Stake() []*lux.TransferableOutput
- func (tx *AddDelegatorTx) SyntacticVerify(ctx context.Context) error
- func (tx *AddDelegatorTx) Visit(visitor Visitor) error
- type AddNetValidatorTx
- func (*AddNetValidatorTx) CurrentPriority() Priority
- func (tx *AddNetValidatorTx) InitializeWithContext(ctx context.Context) error
- func (tx *AddNetValidatorTx) NodeID() ids.NodeID
- func (*AddNetValidatorTx) PendingPriority() Priority
- func (*AddNetValidatorTx) PublicKey() (*bls.PublicKey, bool, error)
- func (tx *AddNetValidatorTx) SyntacticVerify(ctx context.Context) error
- func (tx *AddNetValidatorTx) Visit(visitor Visitor) error
- type AddPermissionlessDelegatorTx
- func (tx *AddPermissionlessDelegatorTx) CurrentPriority() Priority
- func (tx *AddPermissionlessDelegatorTx) InitCtx(ctx context.Context)
- func (tx *AddPermissionlessDelegatorTx) InitializeWithContext(ctx context.Context) error
- func (tx *AddPermissionlessDelegatorTx) NetID() ids.ID
- func (tx *AddPermissionlessDelegatorTx) NodeID() ids.NodeID
- func (tx *AddPermissionlessDelegatorTx) PendingPriority() Priority
- func (*AddPermissionlessDelegatorTx) PublicKey() (*bls.PublicKey, bool, error)
- func (tx *AddPermissionlessDelegatorTx) RewardsOwner() fx.Owner
- func (tx *AddPermissionlessDelegatorTx) Stake() []*lux.TransferableOutput
- func (tx *AddPermissionlessDelegatorTx) SyntacticVerify(ctx context.Context) error
- func (tx *AddPermissionlessDelegatorTx) Visit(visitor Visitor) error
- type AddPermissionlessValidatorTx
- func (tx *AddPermissionlessValidatorTx) CurrentPriority() Priority
- func (tx *AddPermissionlessValidatorTx) DelegationRewardsOwner() fx.Owner
- func (tx *AddPermissionlessValidatorTx) InitCtx(ctx context.Context)
- func (tx *AddPermissionlessValidatorTx) InitializeWithContext(ctx context.Context) error
- func (tx *AddPermissionlessValidatorTx) NetID() ids.ID
- func (tx *AddPermissionlessValidatorTx) NodeID() ids.NodeID
- func (tx *AddPermissionlessValidatorTx) PendingPriority() Priority
- func (tx *AddPermissionlessValidatorTx) PublicKey() (*bls.PublicKey, bool, error)
- func (tx *AddPermissionlessValidatorTx) Shares() uint32
- func (tx *AddPermissionlessValidatorTx) Stake() []*lux.TransferableOutput
- func (tx *AddPermissionlessValidatorTx) SyntacticVerify(ctx context.Context) error
- func (tx *AddPermissionlessValidatorTx) ValidationRewardsOwner() fx.Owner
- func (tx *AddPermissionlessValidatorTx) Visit(visitor Visitor) error
- type AddValidatorTx
- func (*AddValidatorTx) CurrentPriority() Priority
- func (tx *AddValidatorTx) DelegationRewardsOwner() fx.Owner
- func (tx *AddValidatorTx) InitCtx(ctx context.Context)
- func (tx *AddValidatorTx) InitializeWithContext(ctx context.Context) error
- func (*AddValidatorTx) NetID() ids.ID
- func (tx *AddValidatorTx) NodeID() ids.NodeID
- func (*AddValidatorTx) PendingPriority() Priority
- func (*AddValidatorTx) PublicKey() (*bls.PublicKey, bool, error)
- func (tx *AddValidatorTx) Shares() uint32
- func (tx *AddValidatorTx) Stake() []*lux.TransferableOutput
- func (tx *AddValidatorTx) SyntacticVerify(ctx context.Context) error
- func (tx *AddValidatorTx) ValidationRewardsOwner() fx.Owner
- func (tx *AddValidatorTx) Visit(visitor Visitor) error
- type AdvanceTimeTx
- func (tx *AdvanceTimeTx) Bytes() []byte
- func (*AdvanceTimeTx) InitCtx(context.Context)
- func (*AdvanceTimeTx) InitializeContext(context.Context) error
- func (tx *AdvanceTimeTx) InitializeWithContext(ctx context.Context) error
- func (*AdvanceTimeTx) InputIDs() set.Set[ids.ID]
- func (*AdvanceTimeTx) Outputs() []*lux.TransferableOutput
- func (tx *AdvanceTimeTx) SetBytes(unsignedBytes []byte)
- func (*AdvanceTimeTx) SyntacticVerify(context.Context) error
- func (tx *AdvanceTimeTx) Timestamp() time.Time
- func (tx *AdvanceTimeTx) Visit(visitor Visitor) error
- type BaseTx
- func (tx *BaseTx) Bytes() []byte
- func (tx *BaseTx) InitCtx(ctx context.Context)
- func (tx *BaseTx) InitializeContext(ctx context.Context) error
- func (tx *BaseTx) InitializeWithContext(ctx context.Context) error
- func (tx *BaseTx) InputIDs() set.Set[ids.ID]
- func (tx *BaseTx) Outputs() []*lux.TransferableOutput
- func (tx *BaseTx) SetBytes(unsignedBytes []byte)
- func (tx *BaseTx) SyntacticVerify(ctx context.Context) error
- func (tx *BaseTx) Visit(visitor Visitor) error
- type ConvertNetToL1Tx
- type ConvertNetToL1Validator
- type CreateChainTx
- type CreateNetTx
- type DelegatorTx
- type DisableL1ValidatorTx
- type ExportTx
- type ImportTx
- func (tx *ImportTx) InitCtx(ctx context.Context)
- func (tx *ImportTx) InitializeWithContext(ctx context.Context) error
- func (tx *ImportTx) InputIDs() set.Set[ids.ID]
- func (tx *ImportTx) InputUTXOs() set.Set[ids.ID]
- func (tx *ImportTx) SyntacticVerify(ctx context.Context) error
- func (tx *ImportTx) Visit(visitor Visitor) error
- type IncreaseL1ValidatorBalanceTx
- type MockScheduledStaker
- func (m *MockScheduledStaker) CurrentPriority() Priority
- func (m *MockScheduledStaker) EXPECT() *MockScheduledStakerMockRecorder
- func (m *MockScheduledStaker) EndTime() time.Time
- func (m *MockScheduledStaker) NetID() ids.ID
- func (m *MockScheduledStaker) NodeID() ids.NodeID
- func (m *MockScheduledStaker) PendingPriority() Priority
- func (m *MockScheduledStaker) PublicKey() (*bls.PublicKey, bool, error)
- func (m *MockScheduledStaker) StartTime() time.Time
- func (m *MockScheduledStaker) Weight() uint64
- type MockScheduledStakerMockRecorder
- func (mr *MockScheduledStakerMockRecorder) CurrentPriority() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) EndTime() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) NetID() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) NodeID() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) PendingPriority() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) PublicKey() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) StartTime() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) Weight() *gomock.Call
- type MockStaker
- func (m *MockStaker) CurrentPriority() Priority
- func (m *MockStaker) EXPECT() *MockStakerMockRecorder
- func (m *MockStaker) EndTime() time.Time
- func (m *MockStaker) NetID() ids.ID
- func (m *MockStaker) NodeID() ids.NodeID
- func (m *MockStaker) PendingPriority() Priority
- func (m *MockStaker) PublicKey() (*bls.PublicKey, bool, error)
- func (m *MockStaker) StartTime() time.Time
- func (m *MockStaker) Weight() uint64
- type MockStakerMockRecorder
- func (mr *MockStakerMockRecorder) CurrentPriority() *gomock.Call
- func (mr *MockStakerMockRecorder) EndTime() *gomock.Call
- func (mr *MockStakerMockRecorder) NetID() *gomock.Call
- func (mr *MockStakerMockRecorder) NodeID() *gomock.Call
- func (mr *MockStakerMockRecorder) PendingPriority() *gomock.Call
- func (mr *MockStakerMockRecorder) PublicKey() *gomock.Call
- func (mr *MockStakerMockRecorder) StartTime() *gomock.Call
- func (mr *MockStakerMockRecorder) Weight() *gomock.Call
- type MockUnsignedTx
- func (m *MockUnsignedTx) Bytes() []byte
- func (m *MockUnsignedTx) EXPECT() *MockUnsignedTxMockRecorder
- func (m *MockUnsignedTx) InitCtx(ctx context.Context)
- func (m *MockUnsignedTx) InitializeContext(ctx context.Context) error
- func (tx *MockUnsignedTx) InitializeWithContext(ctx context.Context) error
- func (m *MockUnsignedTx) InputIDs() set.Set[ids.ID]
- func (m *MockUnsignedTx) Outputs() []*lux.TransferableOutput
- func (m *MockUnsignedTx) SetBytes(unsignedBytes []byte)
- func (m *MockUnsignedTx) SyntacticVerify(ctx context.Context) error
- func (m *MockUnsignedTx) Visit(visitor Visitor) error
- type MockUnsignedTxMockRecorder
- func (mr *MockUnsignedTxMockRecorder) Bytes() *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) InitCtx(ctx any) *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) InitializeContext(ctx any) *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) InputIDs() *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) Outputs() *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) SetBytes(unsignedBytes any) *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) SyntacticVerify(ctx any) *gomock.Call
- func (mr *MockUnsignedTxMockRecorder) Visit(visitor any) *gomock.Call
- type NetValidator
- type PermissionlessStaker
- type Priority
- func (p Priority) IsCurrent() bool
- func (p Priority) IsCurrentDelegator() bool
- func (p Priority) IsCurrentValidator() bool
- func (p Priority) IsDelegator() bool
- func (p Priority) IsPending() bool
- func (p Priority) IsPendingDelegator() bool
- func (p Priority) IsPendingValidator() bool
- func (p Priority) IsPermissionedValidator() bool
- func (p Priority) IsValidator() bool
- type RegisterL1ValidatorTx
- type RemoveNetValidatorTx
- type RewardValidatorTx
- func (tx *RewardValidatorTx) Bytes() []byte
- func (*RewardValidatorTx) InitCtx(context.Context)
- func (*RewardValidatorTx) InitializeContext(context.Context) error
- func (tx *RewardValidatorTx) InitializeWithContext(ctx context.Context) error
- func (*RewardValidatorTx) InputIDs() set.Set[ids.ID]
- func (*RewardValidatorTx) Outputs() []*lux.TransferableOutput
- func (tx *RewardValidatorTx) SetBytes(unsignedBytes []byte)
- func (*RewardValidatorTx) SyntacticVerify(context.Context) error
- func (tx *RewardValidatorTx) Visit(visitor Visitor) error
- type ScheduledStaker
- type SetL1ValidatorWeightTx
- type Staker
- type StakerTx
- type TransferNetOwnershipTx
- type TransformNetTx
- type Tx
- func (tx *Tx) Bytes() []byte
- func (tx *Tx) GossipID() ids.ID
- func (tx *Tx) ID() ids.ID
- func (tx *Tx) Initialize(c codec.Manager) error
- func (tx *Tx) InputIDs() set.Set[ids.ID]
- func (tx *Tx) SetBytes(unsignedBytes, signedBytes []byte)
- func (tx *Tx) Sign(c codec.Manager, signers [][]*secp256k1.PrivateKey) error
- func (tx *Tx) Size() int
- func (tx *Tx) SyntacticVerify(ctx context.Context) error
- func (tx *Tx) UTXOs() []*lux.UTXO
- type UnsignedTx
- type Validator
- type ValidatorTx
- type Visitor
Constants ¶
const ( CodecVersion = 0 Version = CodecVersion )
const ( MaxNameLen = 128 MaxGenesisLen = units.MiB )
const MaxSubnetAddressLength = 4096
Variables ¶
var ( Codec codec.Manager // GenesisCodec allows txs of larger than usual size to be parsed. // While this gives flexibility in accommodating large genesis txs // it must not be used to parse new, unverified txs which instead // must be processed by Codec GenesisCodec codec.Manager )
var ( ErrConvertPermissionlessNet = errors.New("cannot convert a permissionless subnet") ErrAddressTooLong = errors.New("address is too long") ErrConvertMustIncludeValidators = errors.New("conversion must include at least one validator") ErrConvertValidatorsNotSortedAndUnique = errors.New("conversion validators must be sorted and unique") ErrZeroWeight = errors.New("validator weight must be non-zero") )
var (
ErrCantValidatePrimaryNetwork = errors.New("new blockchain can't be validated by primary network")
)
var (
ErrNilSignedTx = errors.New("nil signed tx is not valid")
)
var (
ErrNilTx = errors.New("tx is nil")
)
var (
ErrRemovePrimaryNetworkValidator = errors.New("can't remove primary network validator with RemoveNetValidatorTx")
)
var (
ErrTransferPermissionlessNet = errors.New("cannot transfer ownership of a permissionless subnet")
)
var (
ErrWeightTooSmall = errors.New("weight of this validator is too low")
)
var (
ErrWrongLocktime = errors.New("wrong locktime reported")
)
var (
ErrZeroBalance = errors.New("balance must be greater than 0")
)
var PendingToCurrentPriorities = []Priority{ PrimaryNetworkDelegatorApricotPendingPriority: PrimaryNetworkDelegatorCurrentPriority, PrimaryNetworkValidatorPendingPriority: PrimaryNetworkValidatorCurrentPriority, PrimaryNetworkDelegatorBanffPendingPriority: PrimaryNetworkDelegatorCurrentPriority, SubnetPermissionlessValidatorPendingPriority: SubnetPermissionlessValidatorCurrentPriority, SubnetPermissionlessDelegatorPendingPriority: SubnetPermissionlessDelegatorCurrentPriority, SubnetPermissionedValidatorPendingPriority: SubnetPermissionedValidatorCurrentPriority, }
Functions ¶
func BoundedBy ¶
BoundedBy returns true iff staker start and end are a (non-strict) subset of the provided time bound
func RegisterDUnsignedTxsTypes ¶ added in v1.1.11
func RegisterDUnsignedTxsTypes(targetCodec linearcodec.Codec) error
func RegisterUnsignedTxsTypes ¶ added in v1.1.11
func RegisterUnsignedTxsTypes(targetCodec linearcodec.Codec) error
RegisterUnsignedTxsTypes allows registering relevant type of unsigned package in the right sequence. Following repackaging of platformvm package, a few subpackage-level codecs were introduced, each handling serialization of specific types.
RegisterUnsignedTxsTypes is made exportable so to guarantee that other codecs are coherent with components one.
Types ¶
type AddDelegatorTx ¶
type AddDelegatorTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Describes the delegatee
Validator `serialize:"true" json:"validator"`
// Where to send staked tokens when done validating
StakeOuts []*lux.TransferableOutput `serialize:"true" json:"stake"`
// Where to send staking rewards when done validating
DelegationRewardsOwner fx.Owner `serialize:"true" json:"rewardsOwner"`
}
AddDelegatorTx is an unsigned addDelegatorTx
func (*AddDelegatorTx) CurrentPriority ¶
func (*AddDelegatorTx) CurrentPriority() Priority
func (*AddDelegatorTx) InitCtx ¶
func (tx *AddDelegatorTx) InitCtx(ctx context.Context)
InitCtx sets the FxID fields in the inputs and outputs of this [UnsignedAddDelegatorTx]. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*AddDelegatorTx) InitializeWithContext ¶ added in v1.11.14
func (tx *AddDelegatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*AddDelegatorTx) NetID ¶ added in v1.16.56
func (*AddDelegatorTx) NetID() ids.ID
func (*AddDelegatorTx) NodeID ¶
func (tx *AddDelegatorTx) NodeID() ids.NodeID
func (*AddDelegatorTx) PendingPriority ¶
func (*AddDelegatorTx) PendingPriority() Priority
func (*AddDelegatorTx) RewardsOwner ¶
func (tx *AddDelegatorTx) RewardsOwner() fx.Owner
func (*AddDelegatorTx) Stake ¶
func (tx *AddDelegatorTx) Stake() []*lux.TransferableOutput
func (*AddDelegatorTx) SyntacticVerify ¶
func (tx *AddDelegatorTx) SyntacticVerify(ctx context.Context) error
SyntacticVerify returns nil iff [tx] is valid
func (*AddDelegatorTx) Visit ¶
func (tx *AddDelegatorTx) Visit(visitor Visitor) error
type AddNetValidatorTx ¶ added in v1.16.56
type AddNetValidatorTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// The validator
NetValidator `serialize:"true" json:"validator"`
// Auth that will be allowing this validator into the network
SubnetAuth verify.Verifiable `serialize:"true" json:"subnetAuthorization"`
}
AddNetValidatorTx is an unsigned addNetValidatorTx
func (*AddNetValidatorTx) CurrentPriority ¶ added in v1.16.56
func (*AddNetValidatorTx) CurrentPriority() Priority
func (*AddNetValidatorTx) InitializeWithContext ¶ added in v1.16.56
func (tx *AddNetValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*AddNetValidatorTx) NodeID ¶ added in v1.16.56
func (tx *AddNetValidatorTx) NodeID() ids.NodeID
func (*AddNetValidatorTx) PendingPriority ¶ added in v1.16.56
func (*AddNetValidatorTx) PendingPriority() Priority
func (*AddNetValidatorTx) PublicKey ¶ added in v1.16.56
func (*AddNetValidatorTx) PublicKey() (*bls.PublicKey, bool, error)
func (*AddNetValidatorTx) SyntacticVerify ¶ added in v1.16.56
func (tx *AddNetValidatorTx) SyntacticVerify(ctx context.Context) error
SyntacticVerify returns nil iff [tx] is valid
func (*AddNetValidatorTx) Visit ¶ added in v1.16.56
func (tx *AddNetValidatorTx) Visit(visitor Visitor) error
type AddPermissionlessDelegatorTx ¶
type AddPermissionlessDelegatorTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Describes the validator
Validator `serialize:"true" json:"validator"`
// ID of the net this validator is validating
Net ids.ID `serialize:"true" json:"netID"`
// Where to send staked tokens when done validating
StakeOuts []*lux.TransferableOutput `serialize:"true" json:"stake"`
// Where to send staking rewards when done validating
DelegationRewardsOwner fx.Owner `serialize:"true" json:"rewardsOwner"`
}
AddPermissionlessDelegatorTx is an unsigned addPermissionlessDelegatorTx
func (*AddPermissionlessDelegatorTx) CurrentPriority ¶
func (tx *AddPermissionlessDelegatorTx) CurrentPriority() Priority
func (*AddPermissionlessDelegatorTx) InitCtx ¶
func (tx *AddPermissionlessDelegatorTx) InitCtx(ctx context.Context)
InitCtx sets the FxID fields in the inputs and outputs of this AddPermissionlessDelegatorTx. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*AddPermissionlessDelegatorTx) InitializeWithContext ¶ added in v1.11.14
func (tx *AddPermissionlessDelegatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*AddPermissionlessDelegatorTx) NetID ¶ added in v1.16.56
func (tx *AddPermissionlessDelegatorTx) NetID() ids.ID
func (*AddPermissionlessDelegatorTx) NodeID ¶
func (tx *AddPermissionlessDelegatorTx) NodeID() ids.NodeID
func (*AddPermissionlessDelegatorTx) PendingPriority ¶
func (tx *AddPermissionlessDelegatorTx) PendingPriority() Priority
func (*AddPermissionlessDelegatorTx) PublicKey ¶
func (*AddPermissionlessDelegatorTx) PublicKey() (*bls.PublicKey, bool, error)
func (*AddPermissionlessDelegatorTx) RewardsOwner ¶
func (tx *AddPermissionlessDelegatorTx) RewardsOwner() fx.Owner
func (*AddPermissionlessDelegatorTx) Stake ¶
func (tx *AddPermissionlessDelegatorTx) Stake() []*lux.TransferableOutput
func (*AddPermissionlessDelegatorTx) SyntacticVerify ¶
func (tx *AddPermissionlessDelegatorTx) SyntacticVerify(ctx context.Context) error
SyntacticVerify returns nil iff [tx] is valid
func (*AddPermissionlessDelegatorTx) Visit ¶
func (tx *AddPermissionlessDelegatorTx) Visit(visitor Visitor) error
type AddPermissionlessValidatorTx ¶
type AddPermissionlessValidatorTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Describes the validator
Validator `serialize:"true" json:"validator"`
// ID of the net this validator is validating
Net ids.ID `serialize:"true" json:"netID"`
// If the [Subnet] is the primary network, [Signer] is the BLS key for this
// validator. If the [Subnet] is not the primary network, this value is the
// empty signer
// Note: We do not enforce that the BLS key is unique across all validators.
// This means that validators can share a key if they so choose.
// However, a NodeID does uniquely map to a BLS key
Signer signer.Signer `serialize:"true" json:"signer"`
// Where to send staked tokens when done validating
StakeOuts []*lux.TransferableOutput `serialize:"true" json:"stake"`
// Where to send validation rewards when done validating
ValidatorRewardsOwner fx.Owner `serialize:"true" json:"validationRewardsOwner"`
// Where to send delegation rewards when done validating
DelegatorRewardsOwner fx.Owner `serialize:"true" json:"delegationRewardsOwner"`
// For example, if this validator has DelegationShares=300,000 then they
// take 30% of rewards from delegators
DelegationShares uint32 `serialize:"true" json:"shares"`
}
AddPermissionlessValidatorTx is an unsigned addPermissionlessValidatorTx
func (*AddPermissionlessValidatorTx) CurrentPriority ¶
func (tx *AddPermissionlessValidatorTx) CurrentPriority() Priority
func (*AddPermissionlessValidatorTx) DelegationRewardsOwner ¶
func (tx *AddPermissionlessValidatorTx) DelegationRewardsOwner() fx.Owner
func (*AddPermissionlessValidatorTx) InitCtx ¶
func (tx *AddPermissionlessValidatorTx) InitCtx(ctx context.Context)
InitCtx sets the FxID fields in the inputs and outputs of this AddPermissionlessValidatorTx. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*AddPermissionlessValidatorTx) InitializeWithContext ¶ added in v1.11.14
func (tx *AddPermissionlessValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*AddPermissionlessValidatorTx) NetID ¶ added in v1.16.56
func (tx *AddPermissionlessValidatorTx) NetID() ids.ID
func (*AddPermissionlessValidatorTx) NodeID ¶
func (tx *AddPermissionlessValidatorTx) NodeID() ids.NodeID
func (*AddPermissionlessValidatorTx) PendingPriority ¶
func (tx *AddPermissionlessValidatorTx) PendingPriority() Priority
func (*AddPermissionlessValidatorTx) PublicKey ¶
func (tx *AddPermissionlessValidatorTx) PublicKey() (*bls.PublicKey, bool, error)
func (*AddPermissionlessValidatorTx) Shares ¶
func (tx *AddPermissionlessValidatorTx) Shares() uint32
func (*AddPermissionlessValidatorTx) Stake ¶
func (tx *AddPermissionlessValidatorTx) Stake() []*lux.TransferableOutput
func (*AddPermissionlessValidatorTx) SyntacticVerify ¶
func (tx *AddPermissionlessValidatorTx) SyntacticVerify(ctx context.Context) error
SyntacticVerify returns nil iff [tx] is valid
func (*AddPermissionlessValidatorTx) ValidationRewardsOwner ¶
func (tx *AddPermissionlessValidatorTx) ValidationRewardsOwner() fx.Owner
func (*AddPermissionlessValidatorTx) Visit ¶
func (tx *AddPermissionlessValidatorTx) Visit(visitor Visitor) error
type AddValidatorTx ¶
type AddValidatorTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Describes the delegatee
Validator `serialize:"true" json:"validator"`
// Where to send staked tokens when done validating
StakeOuts []*lux.TransferableOutput `serialize:"true" json:"stake"`
// Where to send staking rewards when done validating
RewardsOwner fx.Owner `serialize:"true" json:"rewardsOwner"`
// For example, if this validator has DelegationShares=300,000 then they
// take 30% of rewards from delegators
DelegationShares uint32 `serialize:"true" json:"shares"`
}
AddValidatorTx is an unsigned addValidatorTx
func (*AddValidatorTx) CurrentPriority ¶
func (*AddValidatorTx) CurrentPriority() Priority
func (*AddValidatorTx) DelegationRewardsOwner ¶
func (tx *AddValidatorTx) DelegationRewardsOwner() fx.Owner
func (*AddValidatorTx) InitCtx ¶
func (tx *AddValidatorTx) InitCtx(ctx context.Context)
InitCtx sets the FxID fields in the inputs and outputs of this AddValidatorTx. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*AddValidatorTx) InitializeWithContext ¶ added in v1.11.14
func (tx *AddValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*AddValidatorTx) NetID ¶ added in v1.16.56
func (*AddValidatorTx) NetID() ids.ID
func (*AddValidatorTx) NodeID ¶
func (tx *AddValidatorTx) NodeID() ids.NodeID
func (*AddValidatorTx) PendingPriority ¶
func (*AddValidatorTx) PendingPriority() Priority
func (*AddValidatorTx) Shares ¶
func (tx *AddValidatorTx) Shares() uint32
func (*AddValidatorTx) Stake ¶
func (tx *AddValidatorTx) Stake() []*lux.TransferableOutput
func (*AddValidatorTx) SyntacticVerify ¶
func (tx *AddValidatorTx) SyntacticVerify(ctx context.Context) error
SyntacticVerify returns nil iff [tx] is valid
func (*AddValidatorTx) ValidationRewardsOwner ¶
func (tx *AddValidatorTx) ValidationRewardsOwner() fx.Owner
func (*AddValidatorTx) Visit ¶
func (tx *AddValidatorTx) Visit(visitor Visitor) error
type AdvanceTimeTx ¶
type AdvanceTimeTx struct {
// Unix time this block proposes increasing the timestamp to
Time uint64 `serialize:"true" json:"time"`
// contains filtered or unexported fields
}
AdvanceTimeTx is a transaction to increase the chain's timestamp. When the chain's timestamp is updated (a AdvanceTimeTx is accepted and followed by a commit block) the staker set is also updated accordingly. It must be that: - proposed timestamp > [current chain time] - proposed timestamp <= [time for next staker set change]
func (*AdvanceTimeTx) Bytes ¶
func (tx *AdvanceTimeTx) Bytes() []byte
func (*AdvanceTimeTx) InitCtx ¶
func (*AdvanceTimeTx) InitCtx(context.Context)
func (*AdvanceTimeTx) InitializeContext ¶ added in v1.17.2
func (*AdvanceTimeTx) InitializeContext(context.Context) error
InitializeContext initializes the context for this transaction
func (*AdvanceTimeTx) InitializeWithContext ¶ added in v1.11.14
func (tx *AdvanceTimeTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*AdvanceTimeTx) Outputs ¶
func (*AdvanceTimeTx) Outputs() []*lux.TransferableOutput
func (*AdvanceTimeTx) SetBytes ¶
func (tx *AdvanceTimeTx) SetBytes(unsignedBytes []byte)
func (*AdvanceTimeTx) SyntacticVerify ¶
func (*AdvanceTimeTx) SyntacticVerify(context.Context) error
func (*AdvanceTimeTx) Timestamp ¶
func (tx *AdvanceTimeTx) Timestamp() time.Time
Timestamp returns the time this block is proposing the chain should be set to
func (*AdvanceTimeTx) Visit ¶
func (tx *AdvanceTimeTx) Visit(visitor Visitor) error
type BaseTx ¶
type BaseTx struct {
lux.BaseTx `serialize:"true"`
// true iff this transaction has already passed syntactic verification
SyntacticallyVerified bool `json:"-"`
// contains filtered or unexported fields
}
BaseTx contains fields common to many transaction types. It should be embedded in transaction implementations.
func (*BaseTx) InitCtx ¶
InitCtx sets the FxID fields in the inputs and outputs of this BaseTx. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*BaseTx) InitializeContext ¶ added in v1.16.56
InitializeContext initializes the context for this transaction
func (*BaseTx) InitializeWithContext ¶ added in v1.11.14
InitializeWithContext initializes the transaction with consensus context
func (*BaseTx) Outputs ¶
func (tx *BaseTx) Outputs() []*lux.TransferableOutput
func (*BaseTx) SyntacticVerify ¶
SyntacticVerify returns nil iff this tx is well formed
type ConvertNetToL1Tx ¶ added in v1.16.56
type ConvertNetToL1Tx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID of the Net to transform
Net ids.ID `serialize:"true" json:"netID"`
// Chain where the Net manager lives
ChainID ids.ID `serialize:"true" json:"chainID"`
// Address of the Net manager
Address types.JSONByteSlice `serialize:"true" json:"address"`
// Initial pay-as-you-go validators for the Subnet
Validators []*ConvertNetToL1Validator `serialize:"true" json:"validators"`
// Authorizes this conversion
SubnetAuth verify.Verifiable `serialize:"true" json:"subnetAuthorization"`
}
ConvertNetToL1Tx converts a net to an L1
func (*ConvertNetToL1Tx) InitCtx ¶ added in v1.17.2
func (tx *ConvertNetToL1Tx) InitCtx(ctx context.Context)
InitCtx sets the FxID fields in the inputs and outputs of this tx. Also sets the context for json marshalling.
func (*ConvertNetToL1Tx) MarshalJSON ¶ added in v1.17.2
func (tx *ConvertNetToL1Tx) MarshalJSON() ([]byte, error)
MarshalJSON marshals the ConvertNetToL1Tx to JSON with backward compatibility
func (*ConvertNetToL1Tx) SyntacticVerify ¶ added in v1.16.56
func (tx *ConvertNetToL1Tx) SyntacticVerify(ctx context.Context) error
SyntacticVerify performs syntactic verification of the transaction
func (*ConvertNetToL1Tx) Visit ¶ added in v1.16.56
func (tx *ConvertNetToL1Tx) Visit(visitor Visitor) error
Visit calls visitor.ConvertNetToL1Tx
type ConvertNetToL1Validator ¶ added in v1.16.56
type ConvertNetToL1Validator struct {
// NodeID of this validator
NodeID types.JSONByteSlice `serialize:"true" json:"nodeID"`
// Weight of this validator used when sampling
Weight uint64 `serialize:"true" json:"weight"`
// Initial balance for this validator
Balance uint64 `serialize:"true" json:"balance"`
// Signer is the BLS key and proof of possession for this validator
Signer signer.ProofOfPossession `serialize:"true" json:"signer"`
// Leftover LUX from the Balance will be issued to this owner once it is
// removed from the validator set
RemainingBalanceOwner message.PChainOwner `serialize:"true" json:"remainingBalanceOwner"`
// This owner has the authority to manually deactivate this validator
DeactivationOwner message.PChainOwner `serialize:"true" json:"deactivationOwner"`
}
ConvertNetToL1Validator represents a validator for subnet-to-L1 conversion
func (*ConvertNetToL1Validator) Compare ¶ added in v1.16.56
func (v *ConvertNetToL1Validator) Compare(o *ConvertNetToL1Validator) int
Compare implements utils.Sortable
func (*ConvertNetToL1Validator) Verify ¶ added in v1.16.56
func (v *ConvertNetToL1Validator) Verify() error
Verify performs verification for this validator
type CreateChainTx ¶
type CreateChainTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID of the Net that validates this blockchain
NetID ids.ID `serialize:"true" json:"netID"`
// A human readable name for the chain; need not be unique
ChainName string `serialize:"true" json:"chainName"`
// ID of the VM running on the new chain
VMID ids.ID `serialize:"true" json:"vmID"`
// IDs of the feature extensions running on the new chain
FxIDs []ids.ID `serialize:"true" json:"fxIDs"`
// Byte representation of genesis state of the new chain
GenesisData []byte `serialize:"true" json:"genesisData"`
// Authorizes this blockchain to be added to this subnet
SubnetAuth verify.Verifiable `serialize:"true" json:"subnetAuthorization"`
}
CreateChainTx is an unsigned createChainTx
func (*CreateChainTx) InitializeWithContext ¶ added in v1.11.14
func (tx *CreateChainTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*CreateChainTx) SyntacticVerify ¶
func (tx *CreateChainTx) SyntacticVerify(ctx context.Context) error
func (*CreateChainTx) Visit ¶
func (tx *CreateChainTx) Visit(visitor Visitor) error
type CreateNetTx ¶ added in v1.16.56
type CreateNetTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Who is authorized to manage this subnet
Owner fx.Owner `serialize:"true" json:"owner"`
}
CreateNetTx is an unsigned proposal to create a new subnet
func (*CreateNetTx) InitCtx ¶ added in v1.16.56
func (tx *CreateNetTx) InitCtx(ctx context.Context)
InitCtx sets the FxID fields in the inputs and outputs of this CreateNetTx. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*CreateNetTx) InitializeWithContext ¶ added in v1.16.56
func (tx *CreateNetTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*CreateNetTx) SyntacticVerify ¶ added in v1.16.56
func (tx *CreateNetTx) SyntacticVerify(ctx context.Context) error
SyntacticVerify verifies that this transaction is well-formed
func (*CreateNetTx) Visit ¶ added in v1.16.56
func (tx *CreateNetTx) Visit(visitor Visitor) error
type DelegatorTx ¶
type DelegatorTx interface {
UnsignedTx
PermissionlessStaker
RewardsOwner() fx.Owner
}
type DisableL1ValidatorTx ¶
type DisableL1ValidatorTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID corresponding to the validator
ValidationID ids.ID `serialize:"true" json:"validationID"`
// Authorizes this validator to be disabled
DisableAuth verify.Verifiable `serialize:"true" json:"disableAuthorization"`
}
func (*DisableL1ValidatorTx) SyntacticVerify ¶
func (tx *DisableL1ValidatorTx) SyntacticVerify(ctx context.Context) error
func (*DisableL1ValidatorTx) Visit ¶
func (tx *DisableL1ValidatorTx) Visit(visitor Visitor) error
type ExportTx ¶
type ExportTx struct {
BaseTx `serialize:"true"`
// Which chain to send the funds to
DestinationChain ids.ID `serialize:"true" json:"destinationChain"`
// Outputs that are exported to the chain
ExportedOutputs []*lux.TransferableOutput `serialize:"true" json:"exportedOutputs"`
}
ExportTx is an unsigned exportTx
func (*ExportTx) InitCtx ¶
InitCtx sets the FxID fields in the inputs and outputs of this [UnsignedExportTx]. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*ExportTx) InitializeWithContext ¶ added in v1.11.14
InitializeWithContext initializes the transaction with consensus context
func (*ExportTx) SyntacticVerify ¶
SyntacticVerify this transaction is well-formed
type ImportTx ¶
type ImportTx struct {
BaseTx `serialize:"true"`
// Which chain to consume the funds from
SourceChain ids.ID `serialize:"true" json:"sourceChain"`
// Inputs that consume UTXOs produced on the chain
ImportedInputs []*lux.TransferableInput `serialize:"true" json:"importedInputs"`
}
ImportTx is an unsigned importTx
func (*ImportTx) InitCtx ¶
InitCtx sets the FxID fields in the inputs and outputs of this ImportTx. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*ImportTx) InitializeWithContext ¶ added in v1.11.14
InitializeWithContext initializes the transaction with consensus context
func (*ImportTx) InputUTXOs ¶
InputUTXOs returns the UTXOIDs of the imported funds
func (*ImportTx) SyntacticVerify ¶
SyntacticVerify this transaction is well-formed
type IncreaseL1ValidatorBalanceTx ¶
type IncreaseL1ValidatorBalanceTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID corresponding to the validator
ValidationID ids.ID `serialize:"true" json:"validationID"`
// Balance <= sum($LUX inputs) - sum($LUX outputs) - TxFee
Balance uint64 `serialize:"true" json:"balance"`
}
func (*IncreaseL1ValidatorBalanceTx) SyntacticVerify ¶
func (tx *IncreaseL1ValidatorBalanceTx) SyntacticVerify(ctx context.Context) error
func (*IncreaseL1ValidatorBalanceTx) Visit ¶
func (tx *IncreaseL1ValidatorBalanceTx) Visit(visitor Visitor) error
type MockScheduledStaker ¶ added in v1.1.11
type MockScheduledStaker struct {
// contains filtered or unexported fields
}
MockScheduledStaker is a mock of ScheduledStaker interface.
func NewMockScheduledStaker ¶ added in v1.1.11
func NewMockScheduledStaker(ctrl *gomock.Controller) *MockScheduledStaker
NewMockScheduledStaker creates a new mock instance.
func (*MockScheduledStaker) CurrentPriority ¶ added in v1.1.11
func (m *MockScheduledStaker) CurrentPriority() Priority
CurrentPriority mocks base method.
func (*MockScheduledStaker) EXPECT ¶ added in v1.1.11
func (m *MockScheduledStaker) EXPECT() *MockScheduledStakerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockScheduledStaker) EndTime ¶ added in v1.1.11
func (m *MockScheduledStaker) EndTime() time.Time
EndTime mocks base method.
func (*MockScheduledStaker) NetID ¶ added in v1.16.56
func (m *MockScheduledStaker) NetID() ids.ID
NetID mocks base method.
func (*MockScheduledStaker) NodeID ¶ added in v1.1.11
func (m *MockScheduledStaker) NodeID() ids.NodeID
NodeID mocks base method.
func (*MockScheduledStaker) PendingPriority ¶ added in v1.1.11
func (m *MockScheduledStaker) PendingPriority() Priority
PendingPriority mocks base method.
func (*MockScheduledStaker) PublicKey ¶ added in v1.1.11
func (m *MockScheduledStaker) PublicKey() (*bls.PublicKey, bool, error)
PublicKey mocks base method.
func (*MockScheduledStaker) StartTime ¶ added in v1.1.11
func (m *MockScheduledStaker) StartTime() time.Time
StartTime mocks base method.
func (*MockScheduledStaker) Weight ¶ added in v1.1.11
func (m *MockScheduledStaker) Weight() uint64
Weight mocks base method.
type MockScheduledStakerMockRecorder ¶ added in v1.1.11
type MockScheduledStakerMockRecorder struct {
// contains filtered or unexported fields
}
MockScheduledStakerMockRecorder is the mock recorder for MockScheduledStaker.
func (*MockScheduledStakerMockRecorder) CurrentPriority ¶ added in v1.1.11
func (mr *MockScheduledStakerMockRecorder) CurrentPriority() *gomock.Call
CurrentPriority indicates an expected call of CurrentPriority.
func (*MockScheduledStakerMockRecorder) EndTime ¶ added in v1.1.11
func (mr *MockScheduledStakerMockRecorder) EndTime() *gomock.Call
EndTime indicates an expected call of EndTime.
func (*MockScheduledStakerMockRecorder) NetID ¶ added in v1.16.56
func (mr *MockScheduledStakerMockRecorder) NetID() *gomock.Call
NetID indicates an expected call of NetID.
func (*MockScheduledStakerMockRecorder) NodeID ¶ added in v1.1.11
func (mr *MockScheduledStakerMockRecorder) NodeID() *gomock.Call
NodeID indicates an expected call of NodeID.
func (*MockScheduledStakerMockRecorder) PendingPriority ¶ added in v1.1.11
func (mr *MockScheduledStakerMockRecorder) PendingPriority() *gomock.Call
PendingPriority indicates an expected call of PendingPriority.
func (*MockScheduledStakerMockRecorder) PublicKey ¶ added in v1.1.11
func (mr *MockScheduledStakerMockRecorder) PublicKey() *gomock.Call
PublicKey indicates an expected call of PublicKey.
func (*MockScheduledStakerMockRecorder) StartTime ¶ added in v1.1.11
func (mr *MockScheduledStakerMockRecorder) StartTime() *gomock.Call
StartTime indicates an expected call of StartTime.
func (*MockScheduledStakerMockRecorder) Weight ¶ added in v1.1.11
func (mr *MockScheduledStakerMockRecorder) Weight() *gomock.Call
Weight indicates an expected call of Weight.
type MockStaker ¶ added in v1.1.11
type MockStaker struct {
// contains filtered or unexported fields
}
MockStaker is a mock of Staker interface.
func NewMockStaker ¶ added in v1.1.11
func NewMockStaker(ctrl *gomock.Controller) *MockStaker
NewMockStaker creates a new mock instance.
func (*MockStaker) CurrentPriority ¶ added in v1.1.11
func (m *MockStaker) CurrentPriority() Priority
CurrentPriority mocks base method.
func (*MockStaker) EXPECT ¶ added in v1.1.11
func (m *MockStaker) EXPECT() *MockStakerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStaker) EndTime ¶ added in v1.1.11
func (m *MockStaker) EndTime() time.Time
EndTime mocks base method.
func (*MockStaker) NetID ¶ added in v1.17.2
func (m *MockStaker) NetID() ids.ID
NetID mocks base method.
func (*MockStaker) NodeID ¶ added in v1.1.11
func (m *MockStaker) NodeID() ids.NodeID
NodeID mocks base method.
func (*MockStaker) PendingPriority ¶ added in v1.1.11
func (m *MockStaker) PendingPriority() Priority
PendingPriority mocks base method.
func (*MockStaker) PublicKey ¶ added in v1.1.11
func (m *MockStaker) PublicKey() (*bls.PublicKey, bool, error)
PublicKey mocks base method.
func (*MockStaker) StartTime ¶ added in v1.1.11
func (m *MockStaker) StartTime() time.Time
StartTime mocks base method.
func (*MockStaker) Weight ¶ added in v1.1.11
func (m *MockStaker) Weight() uint64
Weight mocks base method.
type MockStakerMockRecorder ¶ added in v1.1.11
type MockStakerMockRecorder struct {
// contains filtered or unexported fields
}
MockStakerMockRecorder is the mock recorder for MockStaker.
func (*MockStakerMockRecorder) CurrentPriority ¶ added in v1.1.11
func (mr *MockStakerMockRecorder) CurrentPriority() *gomock.Call
CurrentPriority indicates an expected call of CurrentPriority.
func (*MockStakerMockRecorder) EndTime ¶ added in v1.1.11
func (mr *MockStakerMockRecorder) EndTime() *gomock.Call
EndTime indicates an expected call of EndTime.
func (*MockStakerMockRecorder) NetID ¶ added in v1.17.2
func (mr *MockStakerMockRecorder) NetID() *gomock.Call
NetID indicates an expected call of NetID.
func (*MockStakerMockRecorder) NodeID ¶ added in v1.1.11
func (mr *MockStakerMockRecorder) NodeID() *gomock.Call
NodeID indicates an expected call of NodeID.
func (*MockStakerMockRecorder) PendingPriority ¶ added in v1.1.11
func (mr *MockStakerMockRecorder) PendingPriority() *gomock.Call
PendingPriority indicates an expected call of PendingPriority.
func (*MockStakerMockRecorder) PublicKey ¶ added in v1.1.11
func (mr *MockStakerMockRecorder) PublicKey() *gomock.Call
PublicKey indicates an expected call of PublicKey.
func (*MockStakerMockRecorder) StartTime ¶ added in v1.1.11
func (mr *MockStakerMockRecorder) StartTime() *gomock.Call
StartTime indicates an expected call of StartTime.
func (*MockStakerMockRecorder) Weight ¶ added in v1.1.11
func (mr *MockStakerMockRecorder) Weight() *gomock.Call
Weight indicates an expected call of Weight.
type MockUnsignedTx ¶ added in v1.1.11
type MockUnsignedTx struct {
// contains filtered or unexported fields
}
MockUnsignedTx is a mock of UnsignedTx interface.
func NewMockUnsignedTx ¶ added in v1.1.11
func NewMockUnsignedTx(ctrl *gomock.Controller) *MockUnsignedTx
NewMockUnsignedTx creates a new mock instance.
func (*MockUnsignedTx) Bytes ¶ added in v1.1.11
func (m *MockUnsignedTx) Bytes() []byte
Bytes mocks base method.
func (*MockUnsignedTx) EXPECT ¶ added in v1.1.11
func (m *MockUnsignedTx) EXPECT() *MockUnsignedTxMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockUnsignedTx) InitCtx ¶ added in v1.1.11
func (m *MockUnsignedTx) InitCtx(ctx context.Context)
InitCtx mocks base method.
func (*MockUnsignedTx) InitializeContext ¶ added in v1.17.2
func (m *MockUnsignedTx) InitializeContext(ctx context.Context) error
InitializeContext mocks base method (alias for InitCtx).
func (*MockUnsignedTx) InitializeWithContext ¶ added in v1.11.14
func (tx *MockUnsignedTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*MockUnsignedTx) InputIDs ¶ added in v1.1.11
func (m *MockUnsignedTx) InputIDs() set.Set[ids.ID]
InputIDs mocks base method.
func (*MockUnsignedTx) Outputs ¶ added in v1.1.11
func (m *MockUnsignedTx) Outputs() []*lux.TransferableOutput
Outputs mocks base method.
func (*MockUnsignedTx) SetBytes ¶ added in v1.1.11
func (m *MockUnsignedTx) SetBytes(unsignedBytes []byte)
SetBytes mocks base method.
func (*MockUnsignedTx) SyntacticVerify ¶ added in v1.1.11
func (m *MockUnsignedTx) SyntacticVerify(ctx context.Context) error
SyntacticVerify mocks base method.
func (*MockUnsignedTx) Visit ¶ added in v1.1.11
func (m *MockUnsignedTx) Visit(visitor Visitor) error
Visit mocks base method.
type MockUnsignedTxMockRecorder ¶ added in v1.1.11
type MockUnsignedTxMockRecorder struct {
// contains filtered or unexported fields
}
MockUnsignedTxMockRecorder is the mock recorder for MockUnsignedTx.
func (*MockUnsignedTxMockRecorder) Bytes ¶ added in v1.1.11
func (mr *MockUnsignedTxMockRecorder) Bytes() *gomock.Call
Bytes indicates an expected call of Bytes.
func (*MockUnsignedTxMockRecorder) InitCtx ¶ added in v1.1.11
func (mr *MockUnsignedTxMockRecorder) InitCtx(ctx any) *gomock.Call
InitCtx indicates an expected call of InitCtx.
func (*MockUnsignedTxMockRecorder) InitializeContext ¶ added in v1.17.2
func (mr *MockUnsignedTxMockRecorder) InitializeContext(ctx any) *gomock.Call
InitializeContext indicates an expected call of InitializeContext.
func (*MockUnsignedTxMockRecorder) InputIDs ¶ added in v1.1.11
func (mr *MockUnsignedTxMockRecorder) InputIDs() *gomock.Call
InputIDs indicates an expected call of InputIDs.
func (*MockUnsignedTxMockRecorder) Outputs ¶ added in v1.1.11
func (mr *MockUnsignedTxMockRecorder) Outputs() *gomock.Call
Outputs indicates an expected call of Outputs.
func (*MockUnsignedTxMockRecorder) SetBytes ¶ added in v1.1.11
func (mr *MockUnsignedTxMockRecorder) SetBytes(unsignedBytes any) *gomock.Call
SetBytes indicates an expected call of SetBytes.
func (*MockUnsignedTxMockRecorder) SyntacticVerify ¶ added in v1.1.11
func (mr *MockUnsignedTxMockRecorder) SyntacticVerify(ctx any) *gomock.Call
SyntacticVerify indicates an expected call of SyntacticVerify.
type NetValidator ¶ added in v1.16.56
type NetValidator struct {
Validator `serialize:"true"`
// ID of the net this validator is validating
Net ids.ID `serialize:"true" json:"netID"`
}
NetValidator validates a net on the Lux network.
func (*NetValidator) NetID ¶ added in v1.16.56
func (v *NetValidator) NetID() ids.ID
NetID is the ID of the net this validator is validating
func (*NetValidator) Verify ¶ added in v1.16.56
func (v *NetValidator) Verify() error
Verify this validator is valid
type PermissionlessStaker ¶
type PermissionlessStaker interface {
Staker
Outputs() []*lux.TransferableOutput
Stake() []*lux.TransferableOutput
}
type Priority ¶
type Priority byte
const ( // First primary network apricot delegators are moved from the pending to // the current validator set, PrimaryNetworkDelegatorApricotPendingPriority Priority = iota + 1 // then primary network validators, PrimaryNetworkValidatorPendingPriority // then primary network banff delegators, PrimaryNetworkDelegatorBanffPendingPriority // then permissionless net validators, SubnetPermissionlessValidatorPendingPriority // then permissionless net delegators. SubnetPermissionlessDelegatorPendingPriority // then permissioned net validators, SubnetPermissionedValidatorPendingPriority // First permissioned net validators are removed from the current // validator set, // Invariant: All permissioned stakers must be removed first because they // are removed by the advancement of time. Permissionless stakers // are removed with a RewardValidatorTx after time has advanced. SubnetPermissionedValidatorCurrentPriority // then permissionless net delegators, SubnetPermissionlessDelegatorCurrentPriority // then permissionless net validators, SubnetPermissionlessValidatorCurrentPriority // then primary network delegators, PrimaryNetworkDelegatorCurrentPriority // then primary network validators. PrimaryNetworkValidatorCurrentPriority )
func (Priority) IsCurrentDelegator ¶
func (Priority) IsCurrentValidator ¶
func (Priority) IsDelegator ¶
func (Priority) IsPendingDelegator ¶
func (Priority) IsPendingValidator ¶
func (Priority) IsPermissionedValidator ¶
func (Priority) IsValidator ¶
type RegisterL1ValidatorTx ¶
type RegisterL1ValidatorTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Balance <= sum($LUX inputs) - sum($LUX outputs) - TxFee.
Balance uint64 `serialize:"true" json:"balance"`
// ProofOfPossession of the BLS key that is included in the Message.
ProofOfPossession [bls.SignatureLen]byte `serialize:"true" json:"proofOfPossession"`
// Message is expected to be a signed Warp message containing an
// AddressedCall payload with the RegisterL1Validator message.
Message types.JSONByteSlice `serialize:"true" json:"message"`
}
func (*RegisterL1ValidatorTx) SyntacticVerify ¶
func (tx *RegisterL1ValidatorTx) SyntacticVerify(ctx context.Context) error
func (*RegisterL1ValidatorTx) Visit ¶
func (tx *RegisterL1ValidatorTx) Visit(visitor Visitor) error
type RemoveNetValidatorTx ¶ added in v1.16.56
type RemoveNetValidatorTx struct {
BaseTx `serialize:"true"`
// The node to remove from the subnet.
NodeID ids.NodeID `serialize:"true" json:"nodeID"`
// The net to remove the node from.
Net ids.ID `serialize:"true" json:"netID"`
// Proves that the issuer has the right to remove the node from the subnet.
SubnetAuth verify.Verifiable `serialize:"true" json:"subnetAuthorization"`
}
Removes a validator from a subnet.
func (*RemoveNetValidatorTx) InitializeWithContext ¶ added in v1.16.56
func (tx *RemoveNetValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*RemoveNetValidatorTx) SyntacticVerify ¶ added in v1.16.56
func (tx *RemoveNetValidatorTx) SyntacticVerify(ctx context.Context) error
func (*RemoveNetValidatorTx) Visit ¶ added in v1.16.56
func (tx *RemoveNetValidatorTx) Visit(visitor Visitor) error
type RewardValidatorTx ¶
type RewardValidatorTx struct {
// ID of the tx that created the delegator/validator being removed/rewarded
TxID ids.ID `serialize:"true" json:"txID"`
// contains filtered or unexported fields
}
RewardValidatorTx is a transaction that represents a proposal to remove a validator that is currently validating from the validator set.
If this transaction is accepted and the next block accepted is a Commit block, the validator is removed and the address that the validator specified receives the staked LUX as well as a validating reward.
If this transaction is accepted and the next block accepted is an Abort block, the validator is removed and the address that the validator specified receives the staked LUX but no reward.
func (*RewardValidatorTx) Bytes ¶
func (tx *RewardValidatorTx) Bytes() []byte
func (*RewardValidatorTx) InitCtx ¶
func (*RewardValidatorTx) InitCtx(context.Context)
func (*RewardValidatorTx) InitializeContext ¶ added in v1.17.2
func (*RewardValidatorTx) InitializeContext(context.Context) error
InitializeContext initializes the context for this transaction
func (*RewardValidatorTx) InitializeWithContext ¶ added in v1.11.14
func (tx *RewardValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*RewardValidatorTx) Outputs ¶
func (*RewardValidatorTx) Outputs() []*lux.TransferableOutput
func (*RewardValidatorTx) SetBytes ¶
func (tx *RewardValidatorTx) SetBytes(unsignedBytes []byte)
func (*RewardValidatorTx) SyntacticVerify ¶
func (*RewardValidatorTx) SyntacticVerify(context.Context) error
func (*RewardValidatorTx) Visit ¶
func (tx *RewardValidatorTx) Visit(visitor Visitor) error
type ScheduledStaker ¶
type SetL1ValidatorWeightTx ¶
type SetL1ValidatorWeightTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Message is expected to be a signed Warp message containing an
// AddressedCall payload with the SetL1ValidatorWeight message.
Message types.JSONByteSlice `serialize:"true" json:"message"`
}
func (*SetL1ValidatorWeightTx) SyntacticVerify ¶
func (tx *SetL1ValidatorWeightTx) SyntacticVerify(ctx context.Context) error
func (*SetL1ValidatorWeightTx) Visit ¶
func (tx *SetL1ValidatorWeightTx) Visit(visitor Visitor) error
type Staker ¶
type Staker interface {
NetID() ids.ID
NodeID() ids.NodeID
// PublicKey returns the BLS public key registered by this transaction. If
// there was no key registered by this transaction, it will return false.
PublicKey() (*bls.PublicKey, bool, error)
EndTime() time.Time
Weight() uint64
CurrentPriority() Priority
}
type StakerTx ¶
type StakerTx interface {
UnsignedTx
Staker
}
type TransferNetOwnershipTx ¶ added in v1.16.56
type TransferNetOwnershipTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID of the net this tx is modifying
Net ids.ID `serialize:"true" json:"netID"`
// Proves that the issuer has the right to remove the node from the subnet.
SubnetAuth verify.Verifiable `serialize:"true" json:"subnetAuthorization"`
// Who is now authorized to manage this subnet
Owner fx.Owner `serialize:"true" json:"newOwner"`
}
func (*TransferNetOwnershipTx) InitCtx ¶ added in v1.16.56
func (tx *TransferNetOwnershipTx) InitCtx(ctx context.Context)
InitCtx sets the FxID fields in the inputs and outputs of this TransferNetOwnershipTx. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*TransferNetOwnershipTx) InitializeWithContext ¶ added in v1.16.56
func (tx *TransferNetOwnershipTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*TransferNetOwnershipTx) SyntacticVerify ¶ added in v1.16.56
func (tx *TransferNetOwnershipTx) SyntacticVerify(ctx context.Context) error
func (*TransferNetOwnershipTx) Visit ¶ added in v1.16.56
func (tx *TransferNetOwnershipTx) Visit(visitor Visitor) error
type TransformNetTx ¶ added in v1.16.56
type TransformNetTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID of the Net to transform
// Restrictions:
// - Must not be the Primary Network ID
Net ids.ID `serialize:"true" json:"netID"`
// Asset to use when staking on the Subnet
// Restrictions:
// - Must not be the Empty ID
// - Must not be the LUX ID
AssetID ids.ID `serialize:"true" json:"assetID"`
// Amount to initially specify as the current supply
// Restrictions:
// - Must be > 0
InitialSupply uint64 `serialize:"true" json:"initialSupply"`
// Amount to specify as the maximum token supply
// Restrictions:
// - Must be >= [InitialSupply]
MaximumSupply uint64 `serialize:"true" json:"maximumSupply"`
// MinConsumptionRate is the rate to allocate funds if the validator's stake
// duration is 0
MinConsumptionRate uint64 `serialize:"true" json:"minConsumptionRate"`
// MaxConsumptionRate is the rate to allocate funds if the validator's stake
// duration is equal to the minting period
// Restrictions:
// - Must be >= [MinConsumptionRate]
// - Must be <= [reward.PercentDenominator]
MaxConsumptionRate uint64 `serialize:"true" json:"maxConsumptionRate"`
// MinValidatorStake is the minimum amount of funds required to become a
// validator.
// Restrictions:
// - Must be > 0
// - Must be <= [InitialSupply]
MinValidatorStake uint64 `serialize:"true" json:"minValidatorStake"`
// MaxValidatorStake is the maximum amount of funds a single validator can
// be allocated, including delegated funds.
// Restrictions:
// - Must be >= [MinValidatorStake]
// - Must be <= [MaximumSupply]
MaxValidatorStake uint64 `serialize:"true" json:"maxValidatorStake"`
// MinStakeDuration is the minimum number of seconds a staker can stake for.
// Restrictions:
// - Must be > 0
MinStakeDuration uint32 `serialize:"true" json:"minStakeDuration"`
// MaxStakeDuration is the maximum number of seconds a staker can stake for.
// Restrictions:
// - Must be >= [MinStakeDuration]
// - Must be <= [GlobalMaxStakeDuration]
MaxStakeDuration uint32 `serialize:"true" json:"maxStakeDuration"`
// MinDelegationFee is the minimum percentage a validator must charge a
// delegator for delegating.
// Restrictions:
// - Must be <= [reward.PercentDenominator]
MinDelegationFee uint32 `serialize:"true" json:"minDelegationFee"`
// MinDelegatorStake is the minimum amount of funds required to become a
// delegator.
// Restrictions:
// - Must be > 0
MinDelegatorStake uint64 `serialize:"true" json:"minDelegatorStake"`
// MaxValidatorWeightFactor is the factor which calculates the maximum
// amount of delegation a validator can receive.
// Note: a value of 1 effectively disables delegation.
// Restrictions:
// - Must be > 0
MaxValidatorWeightFactor byte `serialize:"true" json:"maxValidatorWeightFactor"`
// UptimeRequirement is the minimum percentage a validator must be online
// and responsive to receive a reward.
// Restrictions:
// - Must be <= [reward.PercentDenominator]
UptimeRequirement uint32 `serialize:"true" json:"uptimeRequirement"`
// Authorizes this transformation
SubnetAuth verify.Verifiable `serialize:"true" json:"subnetAuthorization"`
}
TransformNetTx is an unsigned transformSubnetTx
func (*TransformNetTx) InitializeWithContext ¶ added in v1.16.56
func (tx *TransformNetTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*TransformNetTx) Subnet ¶ added in v1.17.2
func (tx *TransformNetTx) Subnet() ids.ID
Subnet returns the Net field for backward compatibility
func (*TransformNetTx) SyntacticVerify ¶ added in v1.16.56
func (tx *TransformNetTx) SyntacticVerify(ctx context.Context) error
func (*TransformNetTx) Visit ¶ added in v1.16.56
func (tx *TransformNetTx) Visit(visitor Visitor) error
type Tx ¶
type Tx struct {
// The body of this transaction
Unsigned UnsignedTx `serialize:"true" json:"unsignedTx"`
// The credentials of this transaction
Creds []verify.Verifiable `serialize:"true" json:"credentials"`
TxID ids.ID `json:"id"`
// contains filtered or unexported fields
}
Tx is a signed transaction
func NewSigned ¶
func NewSigned( unsigned UnsignedTx, c codec.Manager, signers [][]*secp256k1.PrivateKey, ) (*Tx, error)
func Parse ¶
Parse signed tx starting from its byte representation. Note: We explicitly pass the codec in Parse since we may need to parse P-Chain genesis txs whose length exceed the max length of txs.Codec.
type UnsignedTx ¶
type UnsignedTx interface {
// xvm.
consensus.ContextInitializable
consensus.Contextualizable
secp256k1fx.UnsignedTx
SetBytes(unsignedBytes []byte)
// InputIDs returns the set of inputs this transaction consumes
InputIDs() set.Set[ids.ID]
Outputs() []*lux.TransferableOutput
// Attempts to verify this transaction without any provided state.
SyntacticVerify(ctx context.Context) error
// Visit calls [visitor] with this transaction's concrete type
Visit(visitor Visitor) error
}
UnsignedTx is an unsigned transaction
type Validator ¶
type Validator struct {
// Node ID of the validator
NodeID ids.NodeID `serialize:"true" json:"nodeID"`
// Unix time this validator starts validating
Start uint64 `serialize:"true" json:"start"`
// Unix time this validator stops validating
End uint64 `serialize:"true" json:"end"`
// Weight of this validator used when sampling
Wght uint64 `serialize:"true" json:"weight"`
}
Validator is a validator.
func (*Validator) StartTime ¶
StartTime is the time that this validator will enter the validator set
type ValidatorTx ¶
type ValidatorTx interface {
UnsignedTx
PermissionlessStaker
ValidationRewardsOwner() fx.Owner
DelegationRewardsOwner() fx.Owner
}
ValidatorTx defines the interface for a validator transaction that supports delegation.
type Visitor ¶
type Visitor interface {
AddValidatorTx(*AddValidatorTx) error
AddNetValidatorTx(*AddNetValidatorTx) error
AddDelegatorTx(*AddDelegatorTx) error
CreateChainTx(*CreateChainTx) error
CreateNetTx(*CreateNetTx) error
ImportTx(*ImportTx) error
ExportTx(*ExportTx) error
AdvanceTimeTx(*AdvanceTimeTx) error
RewardValidatorTx(*RewardValidatorTx) error
RemoveNetValidatorTx(*RemoveNetValidatorTx) error
TransformNetTx(*TransformNetTx) error
AddPermissionlessValidatorTx(*AddPermissionlessValidatorTx) error
AddPermissionlessDelegatorTx(*AddPermissionlessDelegatorTx) error
TransferNetOwnershipTx(*TransferNetOwnershipTx) error
BaseTx(*BaseTx) error
ConvertNetToL1Tx(*ConvertNetToL1Tx) error
DisableL1ValidatorTx(*DisableL1ValidatorTx) error
IncreaseL1ValidatorBalanceTx(*IncreaseL1ValidatorBalanceTx) error
RegisterL1ValidatorTx(*RegisterL1ValidatorTx) error
SetL1ValidatorWeightTx(*SetL1ValidatorWeightTx) error
}
Allow vm to execute custom logic against the underlying transaction types.
Source Files
¶
- add_delegator_tx.go
- add_permissionless_delegator_tx.go
- add_permissionless_validator_tx.go
- add_subnet_validator_tx.go
- add_validator_tx.go
- advance_time_tx.go
- base_tx.go
- codec.go
- convert_subnet_to_l1_tx.go
- create_chain_tx.go
- create_subnet_tx.go
- disable_l1_validator_tx.go
- export_tx.go
- import_tx.go
- increase_l1_validator_balance_tx.go
- mock_scheduled_staker.go
- mock_staker.go
- mock_unsigned_tx.go
- priorities.go
- register_l1_validator_tx.go
- remove_subnet_validator_tx.go
- reward_validator_tx.go
- set_l1_validator_weight_tx.go
- staker_tx.go
- subnet_validator.go
- transfer_subnet_ownership_tx.go
- transform_subnet_tx.go
- tx.go
- unsigned_tx.go
- validator.go
- visitor.go