Documentation
¶
Overview ¶
Package txs is a generated GoMock package.
Index ¶
- Constants
- Variables
- func BoundedBy(stakerStart, stakerEnd, lowerBound, upperBound time.Time) bool
- func Marshal(u UnsignedTx) ([]byte, error)
- func MarshalOwner(o any) ([]byte, error)
- func SortByCompare[T interface{ ... }](s []T)
- func UnmarshalOwner(b []byte) (*secp256k1fx.OutputOwners, error)
- type AddChainValidatorTx
- func (*AddChainValidatorTx) CurrentPriority() Priority
- func (tx *AddChainValidatorTx) InitializeWithContext(ctx context.Context) error
- func (tx *AddChainValidatorTx) NodeID() ids.NodeID
- func (*AddChainValidatorTx) PendingPriority() Priority
- func (*AddChainValidatorTx) PublicKey() (*bls.PublicKey, bool, error)
- func (tx *AddChainValidatorTx) SyntacticVerify(rt *runtime.Runtime) error
- func (tx *AddChainValidatorTx) Visit(visitor Visitor) error
- type AddDelegatorTx
- func (*AddDelegatorTx) ChainID() ids.ID
- func (*AddDelegatorTx) CurrentPriority() Priority
- func (tx *AddDelegatorTx) InitRuntime(rt *runtime.Runtime)
- func (tx *AddDelegatorTx) InitializeWithContext(ctx context.Context) error
- 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(rt *runtime.Runtime) error
- func (tx *AddDelegatorTx) Visit(visitor Visitor) error
- type AddPermissionlessDelegatorTx
- func (tx *AddPermissionlessDelegatorTx) ChainID() ids.ID
- func (tx *AddPermissionlessDelegatorTx) CurrentPriority() Priority
- func (tx *AddPermissionlessDelegatorTx) InitRuntime(rt *runtime.Runtime)
- func (tx *AddPermissionlessDelegatorTx) InitializeWithContext(ctx context.Context) error
- 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(rt *runtime.Runtime) error
- func (tx *AddPermissionlessDelegatorTx) Visit(visitor Visitor) error
- type AddPermissionlessValidatorTx
- func (tx *AddPermissionlessValidatorTx) ChainID() ids.ID
- func (tx *AddPermissionlessValidatorTx) CurrentPriority() Priority
- func (tx *AddPermissionlessValidatorTx) DelegationRewardsOwner() fx.Owner
- func (tx *AddPermissionlessValidatorTx) InitRuntime(rt *runtime.Runtime)
- func (tx *AddPermissionlessValidatorTx) InitializeWithContext(ctx context.Context) error
- 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(rt *runtime.Runtime) error
- func (tx *AddPermissionlessValidatorTx) ValidationRewardsOwner() fx.Owner
- func (tx *AddPermissionlessValidatorTx) Visit(visitor Visitor) error
- type AddValidatorTx
- func (*AddValidatorTx) ChainID() ids.ID
- func (*AddValidatorTx) CurrentPriority() Priority
- func (tx *AddValidatorTx) DelegationRewardsOwner() fx.Owner
- func (tx *AddValidatorTx) InitRuntime(rt *runtime.Runtime)
- func (tx *AddValidatorTx) InitializeWithContext(ctx context.Context) error
- 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(rt *runtime.Runtime) error
- func (tx *AddValidatorTx) ValidationRewardsOwner() fx.Owner
- func (tx *AddValidatorTx) Visit(visitor Visitor) error
- type AdvanceTimeTx
- func (tx *AdvanceTimeTx) Bytes() []byte
- func (*AdvanceTimeTx) InitRuntime(*runtime.Runtime)
- 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(*runtime.Runtime) error
- func (tx *AdvanceTimeTx) Timestamp() time.Time
- func (tx *AdvanceTimeTx) Visit(visitor Visitor) error
- type BaseTx
- func (tx *BaseTx) Bytes() []byte
- func (tx *BaseTx) InitRuntime(rt *runtime.Runtime)
- 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(rt *runtime.Runtime) error
- func (tx *BaseTx) Visit(visitor Visitor) error
- type ChainValidator
- type ContextInitializable
- type ConvertNetworkToL1Tx
- type ConvertNetworkToL1Validator
- type CreateChainTx
- type CreateNetworkTx
- type DelegatorTx
- type DisableL1ValidatorTx
- type ExportTx
- type ImportTx
- func (tx *ImportTx) InitRuntime(rt *runtime.Runtime)
- 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(rt *runtime.Runtime) error
- func (tx *ImportTx) Visit(visitor Visitor) error
- type IncreaseL1ValidatorBalanceTx
- type MockScheduledStaker
- func (m *MockScheduledStaker) ChainID() ids.ID
- func (m *MockScheduledStaker) CurrentPriority() Priority
- func (m *MockScheduledStaker) EXPECT() *MockScheduledStakerMockRecorder
- func (m *MockScheduledStaker) EndTime() time.Time
- 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) ChainID() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) CurrentPriority() *gomock.Call
- func (mr *MockScheduledStakerMockRecorder) EndTime() *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 NFTStaker
- type NetworkValidator
- 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 RemoveChainValidatorTx
- type RewardValidatorTx
- func (tx *RewardValidatorTx) Bytes() []byte
- func (*RewardValidatorTx) InitRuntime(*runtime.Runtime)
- 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(*runtime.Runtime) error
- func (tx *RewardValidatorTx) Visit(visitor Visitor) error
- type ScheduledStaker
- type SetL1ValidatorWeightTx
- type Staker
- type StakerTx
- type TransferChainOwnershipTx
- type TransformChainTx
- type Tx
- func (tx *Tx) Bind(unsignedBytes []byte) error
- func (tx *Tx) Bytes() []byte
- func (tx *Tx) GossipID() ids.ID
- func (tx *Tx) ID() ids.ID
- func (tx *Tx) Initialize() error
- func (tx *Tx) InputIDs() set.Set[ids.ID]
- func (tx *Tx) SetBytes(signedBytes []byte)
- func (tx *Tx) Sign(signers [][]*secp256k1.PrivateKey) error
- func (tx *Tx) Size() int
- func (tx *Tx) SyntacticVerify(rt *runtime.Runtime) error
- func (tx *Tx) UTXOs() []*lux.UTXO
- type UnsignedTx
- type Validator
- type ValidatorNFTInfo
- type ValidatorTx
- type Visitor
Constants ¶
const ( MaxNameLen = 128 MaxGenesisLen = constants.MiB )
const ( NetPermissionlessValidatorPendingPriority = ChainPermissionlessValidatorPendingPriority NetPermissionlessDelegatorPendingPriority = ChainPermissionlessDelegatorPendingPriority NetPermissionedValidatorPendingPriority = ChainPermissionedValidatorPendingPriority NetPermissionedValidatorCurrentPriority = ChainPermissionedValidatorCurrentPriority NetPermissionlessDelegatorCurrentPriority = ChainPermissionlessDelegatorCurrentPriority NetPermissionlessValidatorCurrentPriority = ChainPermissionlessValidatorCurrentPriority )
Deprecated: Use Chain* priority constants instead
const MaxChainAddressLength = 4096
MaxChainAddressLength bounds the manager address a network may name.
Variables ¶
var ( ErrConvertPermissionlessChain = errors.New("cannot convert a permissionless chain") ErrConvertMustIncludeValidators = errors.New("conversion must include at least one validator") ErrConvertValidatorsNotSortedAndUnique = errors.New("conversion validators must be sorted and unique") )
var ( ErrZeroWeight = errors.New("validator weight must be non-zero") ErrAddressTooLong = errors.New("address is too long") ErrValidatorsNotSortedAndUnique = errors.New("validators must be sorted and unique") ErrOwnSetMustIncludeValidator = errors.New("sovereign (non-restaking) network must include at least one genesis validator") ErrNoOwnSetButHasValidators = errors.New("network with no own set must not carry validators") ErrContractManagerNeedsAddress = errors.New("contract-governed own set requires a manager address") )
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 RemoveChainValidatorTx")
)
var (
ErrTransferPermissionlessChain = errors.New("cannot transfer ownership of a permissionless chain")
)
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, ChainPermissionlessValidatorPendingPriority: ChainPermissionlessValidatorCurrentPriority, ChainPermissionlessDelegatorPendingPriority: ChainPermissionlessDelegatorCurrentPriority, ChainPermissionedValidatorPendingPriority: ChainPermissionedValidatorCurrentPriority, }
Functions ¶
func BoundedBy ¶
BoundedBy returns true iff staker start and end are a (non-strict) subset of the provided time bound
func Marshal ¶ added in v1.4.4
func Marshal(u UnsignedTx) ([]byte, error)
Marshal encodes an unsigned tx as the chain's wire bytes.
func MarshalOwner ¶ added in v1.4.7
MarshalOwner is the ONE canonical byte encoding of an owner — same layout as the owner embedded in every tx, lifted to a standalone buffer. Used wherever a stable owner identity is needed off the tx wire (e.g. lock-owner hash keys in utxo verification, the L1-validator balance/deactivation owner blobs stored in P-Chain state). Takes `any` to match the fx.Owned.Owners() surface it serves. One encoding everywhere; no codec.
func SortByCompare ¶ added in v1.2.0
func SortByCompare[T interface{ Compare(T) int }](s []T)
SortByCompare is the exported entry point for sortByCompare. Tests in external test packages (proto/p/txs_test, etc.) reach for this when they need to assemble the canonical input/output ordering that matches what the production txs.Tx serialiser produces.
func UnmarshalOwner ¶ added in v1.4.7
func UnmarshalOwner(b []byte) (*secp256k1fx.OutputOwners, error)
UnmarshalOwner is the exact inverse of MarshalOwner — it parses the canonical standalone owner buffer back into *secp256k1fx.OutputOwners. Same layout, no codec; the marshal/unmarshal pair is the one owner byte codec every consumer (executor, service, state-owner blobs) shares.
Types ¶
type AddChainValidatorTx ¶
type AddChainValidatorTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// The validator
ChainValidator `serialize:"true" json:"validator"`
// Auth that will be allowing this validator into the network
ChainAuth verify.Verifiable `serialize:"true" json:"chainAuthorization"`
}
AddChainValidatorTx is an unsigned addChainValidatorTx
func (*AddChainValidatorTx) CurrentPriority ¶
func (*AddChainValidatorTx) CurrentPriority() Priority
func (*AddChainValidatorTx) InitializeWithContext ¶
func (tx *AddChainValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*AddChainValidatorTx) NodeID ¶
func (tx *AddChainValidatorTx) NodeID() ids.NodeID
func (*AddChainValidatorTx) PendingPriority ¶
func (*AddChainValidatorTx) PendingPriority() Priority
func (*AddChainValidatorTx) PublicKey ¶
func (*AddChainValidatorTx) PublicKey() (*bls.PublicKey, bool, error)
func (*AddChainValidatorTx) SyntacticVerify ¶
func (tx *AddChainValidatorTx) SyntacticVerify(rt *runtime.Runtime) error
SyntacticVerify returns nil iff [tx] is valid
func (*AddChainValidatorTx) Visit ¶
func (tx *AddChainValidatorTx) Visit(visitor Visitor) error
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) ChainID ¶
func (*AddDelegatorTx) ChainID() ids.ID
func (*AddDelegatorTx) CurrentPriority ¶
func (*AddDelegatorTx) CurrentPriority() Priority
func (*AddDelegatorTx) InitRuntime ¶
func (tx *AddDelegatorTx) InitRuntime(rt *runtime.Runtime)
InitRuntime 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 ¶
func (tx *AddDelegatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
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(rt *runtime.Runtime) error
SyntacticVerify returns nil iff [tx] is valid
func (*AddDelegatorTx) Visit ¶
func (tx *AddDelegatorTx) 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 chain this validator is validating
Chain ids.ID `serialize:"true" json:"chainID"`
// 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) ChainID ¶
func (tx *AddPermissionlessDelegatorTx) ChainID() ids.ID
func (*AddPermissionlessDelegatorTx) CurrentPriority ¶
func (tx *AddPermissionlessDelegatorTx) CurrentPriority() Priority
func (*AddPermissionlessDelegatorTx) InitRuntime ¶
func (tx *AddPermissionlessDelegatorTx) InitRuntime(rt *runtime.Runtime)
InitRuntime 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 ¶
func (tx *AddPermissionlessDelegatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
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(rt *runtime.Runtime) 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 chain this validator is validating
Chain ids.ID `serialize:"true" json:"chainID"`
// If the [Chain] is the primary network, [Signer] is the BLS key for this
// validator. If the [Chain] 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) ChainID ¶
func (tx *AddPermissionlessValidatorTx) ChainID() ids.ID
func (*AddPermissionlessValidatorTx) CurrentPriority ¶
func (tx *AddPermissionlessValidatorTx) CurrentPriority() Priority
func (*AddPermissionlessValidatorTx) DelegationRewardsOwner ¶
func (tx *AddPermissionlessValidatorTx) DelegationRewardsOwner() fx.Owner
func (*AddPermissionlessValidatorTx) InitRuntime ¶
func (tx *AddPermissionlessValidatorTx) InitRuntime(rt *runtime.Runtime)
InitRuntime 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 ¶
func (tx *AddPermissionlessValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
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(rt *runtime.Runtime) 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) ChainID ¶
func (*AddValidatorTx) ChainID() ids.ID
func (*AddValidatorTx) CurrentPriority ¶
func (*AddValidatorTx) CurrentPriority() Priority
func (*AddValidatorTx) DelegationRewardsOwner ¶
func (tx *AddValidatorTx) DelegationRewardsOwner() fx.Owner
func (*AddValidatorTx) InitRuntime ¶
func (tx *AddValidatorTx) InitRuntime(rt *runtime.Runtime)
InitRuntime 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 ¶
func (tx *AddValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
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(rt *runtime.Runtime) 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) InitRuntime ¶
func (*AdvanceTimeTx) InitRuntime(*runtime.Runtime)
func (*AdvanceTimeTx) InitializeWithContext ¶
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(*runtime.Runtime) 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 `serialize:"-" json:"-"`
// contains filtered or unexported fields
}
BaseTx contains fields common to many transaction types. It should be embedded in transaction implementations.
func (*BaseTx) InitRuntime ¶
InitRuntime 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 ¶
InitializeContext is a no-op. Runtime is passed explicitly.
func (*BaseTx) InitializeWithContext ¶
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 ChainValidator ¶
type ChainValidator struct {
Validator `serialize:"true"`
// ID of the chain this validator is validating
Chain ids.ID `serialize:"true" json:"chainID"`
}
ChainValidator validates a chain on the Lux network.
func (*ChainValidator) ChainID ¶
func (v *ChainValidator) ChainID() ids.ID
ChainID is the ID of the chain this validator is validating
func (*ChainValidator) Verify ¶
func (v *ChainValidator) Verify() error
Verify this validator is valid
type ContextInitializable ¶
ContextInitializable defines the interface for initializing context
type ConvertNetworkToL1Tx ¶
type ConvertNetworkToL1Tx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID of the network being promoted
Chain ids.ID `serialize:"true" json:"chainID"`
// New parent network
Parent ids.ID `json:"parent"`
// Blockchain where the network manager lives
ManagerChainID ids.ID `serialize:"true" json:"managerChainID"`
// Address of the network manager
Address types.JSONByteSlice `serialize:"true" json:"address"`
// Initial pay-as-you-go validators for the network
Validators []*ConvertNetworkToL1Validator `serialize:"true" json:"validators"`
// Authorizes this conversion
ChainAuth verify.Verifiable `serialize:"true" json:"chainAuthorization"`
// How the promoted network is secured
Security security.Mode `json:"security"`
}
ConvertNetworkToL1Tx promotes an existing network: inherited security to sovereign, re-anchored on a new parent.
func (*ConvertNetworkToL1Tx) SyntacticVerify ¶
func (tx *ConvertNetworkToL1Tx) SyntacticVerify(rt *runtime.Runtime) error
func (*ConvertNetworkToL1Tx) Visit ¶
func (tx *ConvertNetworkToL1Tx) Visit(visitor Visitor) error
type ConvertNetworkToL1Validator ¶
type ConvertNetworkToL1Validator = NetworkValidator
ConvertNetworkToL1Validator is a genesis validator of the promoted network's own set. Same value as a network's birth validator — one definition.
type CreateChainTx ¶
type CreateChainTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID of the Network that validates this chain
ValidateNetworkID ids.ID `serialize:"true" json:"networkID"`
// A human readable name for the blockchain; need not be unique
BlockchainName string `serialize:"true" json:"blockchainName"`
// ID of the VM running on the new blockchain
VMID ids.ID `serialize:"true" json:"vmID"`
// IDs of the feature extensions running on the new blockchain
FxIDs []ids.ID `serialize:"true" json:"fxIDs"`
// Byte representation of genesis state of the new blockchain
GenesisData []byte `serialize:"true" json:"genesisData"`
// Authorizes this blockchain to be added to this chain
ChainAuth verify.Verifiable `serialize:"true" json:"chainAuthorization"`
}
CreateChainTx is an unsigned createChainTx
func (*CreateChainTx) InitializeWithContext ¶
func (tx *CreateChainTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*CreateChainTx) SyntacticVerify ¶
func (tx *CreateChainTx) SyntacticVerify(rt *runtime.Runtime) error
func (*CreateChainTx) Visit ¶
func (tx *CreateChainTx) Visit(visitor Visitor) error
type CreateNetworkTx ¶
type CreateNetworkTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// Parent network; ids.Empty for a network anchored at the primary network
Parent ids.ID `json:"parent"`
// Who is authorized to manage this network
Owner fx.Owner `serialize:"true" json:"owner"`
// How this network is secured
Security security.Mode `json:"security"`
// Genesis validators of the network's own set
Validators []*NetworkValidator `json:"validators"`
// Chain hosting the staking contract of a Contract-governed own set
ManagerChainID ids.ID `json:"managerChainID"`
// Address of that staking contract
ManagerAddress types.JSONByteSlice `json:"managerAddress"`
}
CreateNetworkTx is the sole network constructor — the ∅→Network birth. It creates a network at any level of the hierarchy in one tx:
- Parent is the parent network. Primary ⇒ an L1; an L1 ⇒ an L2; recurse. The tx is byte-identical at every level — only Parent differs.
- Owner authorises future admin against the network record.
- Security is the two-axis model: restake the parent and/or run an own set (Admission + Manager).
- ManagerChainID (+ ManagerAddress) names the chain hosting a Contract-governed own set's staking contract; ids.Empty ⇒ P-Chain governed, where the owner is the authority.
Chains are not created here — CreateChainTx is the sole chain constructor.
func (*CreateNetworkTx) InitRuntime ¶
func (tx *CreateNetworkTx) InitRuntime(rt *runtime.Runtime)
InitRuntime sets the FxID fields in the inputs and outputs of this CreateNetworkTx.
func (*CreateNetworkTx) InitializeWithContext ¶
func (tx *CreateNetworkTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*CreateNetworkTx) SyntacticVerify ¶
func (tx *CreateNetworkTx) SyntacticVerify(rt *runtime.Runtime) error
SyntacticVerify verifies that this transaction is well-formed
func (*CreateNetworkTx) Visit ¶
func (tx *CreateNetworkTx) 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(rt *runtime.Runtime) 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) InitRuntime ¶
InitRuntime 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 ¶
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) InitRuntime ¶
InitRuntime 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 ¶
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(rt *runtime.Runtime) error
func (*IncreaseL1ValidatorBalanceTx) Visit ¶
func (tx *IncreaseL1ValidatorBalanceTx) Visit(visitor Visitor) error
type MockScheduledStaker ¶
type MockScheduledStaker struct {
// contains filtered or unexported fields
}
MockScheduledStaker is a mock of ScheduledStaker interface.
func NewMockScheduledStaker ¶
func NewMockScheduledStaker(ctrl *gomock.Controller) *MockScheduledStaker
NewMockScheduledStaker creates a new mock instance.
func (*MockScheduledStaker) ChainID ¶
func (m *MockScheduledStaker) ChainID() ids.ID
ChainID mocks base method.
func (*MockScheduledStaker) CurrentPriority ¶
func (m *MockScheduledStaker) CurrentPriority() Priority
CurrentPriority mocks base method.
func (*MockScheduledStaker) EXPECT ¶
func (m *MockScheduledStaker) EXPECT() *MockScheduledStakerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockScheduledStaker) EndTime ¶
func (m *MockScheduledStaker) EndTime() time.Time
EndTime mocks base method.
func (*MockScheduledStaker) NodeID ¶
func (m *MockScheduledStaker) NodeID() ids.NodeID
NodeID mocks base method.
func (*MockScheduledStaker) PendingPriority ¶
func (m *MockScheduledStaker) PendingPriority() Priority
PendingPriority mocks base method.
func (*MockScheduledStaker) PublicKey ¶
func (m *MockScheduledStaker) PublicKey() (*bls.PublicKey, bool, error)
PublicKey mocks base method.
func (*MockScheduledStaker) StartTime ¶
func (m *MockScheduledStaker) StartTime() time.Time
StartTime mocks base method.
func (*MockScheduledStaker) Weight ¶
func (m *MockScheduledStaker) Weight() uint64
Weight mocks base method.
type MockScheduledStakerMockRecorder ¶
type MockScheduledStakerMockRecorder struct {
// contains filtered or unexported fields
}
MockScheduledStakerMockRecorder is the mock recorder for MockScheduledStaker.
func (*MockScheduledStakerMockRecorder) ChainID ¶
func (mr *MockScheduledStakerMockRecorder) ChainID() *gomock.Call
ChainID indicates an expected call of ChainID.
func (*MockScheduledStakerMockRecorder) CurrentPriority ¶
func (mr *MockScheduledStakerMockRecorder) CurrentPriority() *gomock.Call
CurrentPriority indicates an expected call of CurrentPriority.
func (*MockScheduledStakerMockRecorder) EndTime ¶
func (mr *MockScheduledStakerMockRecorder) EndTime() *gomock.Call
EndTime indicates an expected call of EndTime.
func (*MockScheduledStakerMockRecorder) NodeID ¶
func (mr *MockScheduledStakerMockRecorder) NodeID() *gomock.Call
NodeID indicates an expected call of NodeID.
func (*MockScheduledStakerMockRecorder) PendingPriority ¶
func (mr *MockScheduledStakerMockRecorder) PendingPriority() *gomock.Call
PendingPriority indicates an expected call of PendingPriority.
func (*MockScheduledStakerMockRecorder) PublicKey ¶
func (mr *MockScheduledStakerMockRecorder) PublicKey() *gomock.Call
PublicKey indicates an expected call of PublicKey.
func (*MockScheduledStakerMockRecorder) StartTime ¶
func (mr *MockScheduledStakerMockRecorder) StartTime() *gomock.Call
StartTime indicates an expected call of StartTime.
func (*MockScheduledStakerMockRecorder) Weight ¶
func (mr *MockScheduledStakerMockRecorder) Weight() *gomock.Call
Weight indicates an expected call of Weight.
type NFTStaker ¶
type NFTStaker interface {
Staker
GetValidatorNFT() *ValidatorNFTInfo
}
NFTStaker is an interface for stakers that use NFTs for validation
type NetworkValidator ¶ added in v1.4.4
type NetworkValidator struct {
NodeID types.JSONByteSlice `serialize:"true" json:"nodeID"`
Weight uint64 `serialize:"true" json:"weight"`
Balance uint64 `serialize:"true" json:"balance"`
Signer signer.ProofOfPossession `serialize:"true" json:"signer"`
RemainingBalanceOwner message.PChainOwner `serialize:"true" json:"remainingBalanceOwner"`
DeactivationOwner message.PChainOwner `serialize:"true" json:"deactivationOwner"`
}
NetworkValidator is a genesis validator of a network's own validator set.
func (*NetworkValidator) Compare ¶ added in v1.4.4
func (v *NetworkValidator) Compare(o *NetworkValidator) int
func (*NetworkValidator) Verify ¶ added in v1.4.4
func (v *NetworkValidator) Verify() error
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 chain validators, ChainPermissionlessValidatorPendingPriority // then permissionless chain delegators. ChainPermissionlessDelegatorPendingPriority // then permissioned chain validators, ChainPermissionedValidatorPendingPriority // First permissioned chain 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. ChainPermissionedValidatorCurrentPriority // then permissionless chain delegators, ChainPermissionlessDelegatorCurrentPriority // then permissionless chain validators, ChainPermissionlessValidatorCurrentPriority // 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(rt *runtime.Runtime) error
func (*RegisterL1ValidatorTx) Visit ¶
func (tx *RegisterL1ValidatorTx) Visit(visitor Visitor) error
type RemoveChainValidatorTx ¶
type RemoveChainValidatorTx struct {
BaseTx `serialize:"true"`
// The node to remove from the chain.
NodeID ids.NodeID `serialize:"true" json:"nodeID"`
// The chain to remove the node from.
Chain ids.ID `serialize:"true" json:"chainID"`
// Proves that the issuer has the right to remove the node from the chain.
ChainAuth verify.Verifiable `serialize:"true" json:"chainAuthorization"`
}
RemoveChainValidatorTx removes a validator from a chain.
func (*RemoveChainValidatorTx) InitializeWithContext ¶
func (tx *RemoveChainValidatorTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*RemoveChainValidatorTx) SyntacticVerify ¶
func (tx *RemoveChainValidatorTx) SyntacticVerify(rt *runtime.Runtime) error
func (*RemoveChainValidatorTx) Visit ¶
func (tx *RemoveChainValidatorTx) 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) InitRuntime ¶
func (*RewardValidatorTx) InitRuntime(*runtime.Runtime)
func (*RewardValidatorTx) InitializeWithContext ¶
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(*runtime.Runtime) 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(rt *runtime.Runtime) error
func (*SetL1ValidatorWeightTx) Visit ¶
func (tx *SetL1ValidatorWeightTx) Visit(visitor Visitor) error
type Staker ¶
type Staker interface {
ChainID() 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 TransferChainOwnershipTx ¶
type TransferChainOwnershipTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID of the chain this tx is modifying
Chain ids.ID `serialize:"true" json:"chainID"`
// Proves that the issuer has the right to modify the chain.
ChainAuth verify.Verifiable `serialize:"true" json:"chainAuthorization"`
// Who is now authorized to manage this chain
Owner fx.Owner `serialize:"true" json:"newOwner"`
}
func (*TransferChainOwnershipTx) InitRuntime ¶
func (tx *TransferChainOwnershipTx) InitRuntime(rt *runtime.Runtime)
InitRuntime sets the FxID fields in the inputs and outputs of this TransferChainOwnershipTx. Also sets the [ctx] to the given [vm.ctx] so that the addresses can be json marshalled into human readable format
func (*TransferChainOwnershipTx) InitializeWithContext ¶
func (tx *TransferChainOwnershipTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*TransferChainOwnershipTx) SyntacticVerify ¶
func (tx *TransferChainOwnershipTx) SyntacticVerify(rt *runtime.Runtime) error
func (*TransferChainOwnershipTx) Visit ¶
func (tx *TransferChainOwnershipTx) Visit(visitor Visitor) error
type TransformChainTx ¶
type TransformChainTx struct {
// Metadata, inputs and outputs
BaseTx `serialize:"true"`
// ID of the Chain to transform
// Restrictions:
// - Must not be the Primary Network ID
Chain ids.ID `serialize:"true" json:"chainID"`
// Asset to use when staking on the Net
// 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
ChainAuth verify.Verifiable `serialize:"true" json:"chainAuthorization"`
}
TransformChainTx is an unsigned transformChainTx
func (*TransformChainTx) InitializeWithContext ¶
func (tx *TransformChainTx) InitializeWithContext(ctx context.Context) error
InitializeWithContext initializes the transaction with consensus context
func (*TransformChainTx) SyntacticVerify ¶
func (tx *TransformChainTx) SyntacticVerify(rt *runtime.Runtime) error
func (*TransformChainTx) Visit ¶
func (tx *TransformChainTx) 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: an unsigned tx plus its credentials. The signed bytes are the unsigned zap buffer followed by the credential buffer — nothing wraps the pair, and the unsigned buffer's own size field is where a reader splits them.
func NewSigned ¶
func NewSigned(unsigned UnsignedTx, signers [][]*secp256k1.PrivateKey) (*Tx, error)
NewSigned builds a signed tx from an unsigned body and signs it.
func Parse ¶
Parse reads a signed tx from its wire bytes: the leading self-delimiting zap buffer is the unsigned body, any remainder is the credential buffer.
func (*Tx) Bind ¶ added in v1.4.4
Bind sets the signed bytes to the given unsigned buffer followed by the credentials currently attached. It is the one place the pair is joined.
func (*Tx) Initialize ¶
Initialize binds the signed bytes and TxID from the unsigned body and the credentials already attached — for txs assembled without signing here (a multisig collection, a genesis tx).
type UnsignedTx ¶
type UnsignedTx interface {
// TODO: Remove this initialization pattern from both the platformvm and the
// xvm.
ContextInitializable
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(rt *runtime.Runtime) error
// Visit calls [visitor] with this transaction's concrete type
Visit(visitor Visitor) error
}
UnsignedTx is an unsigned transaction
func Unmarshal ¶ added in v1.4.4
func Unmarshal(buf []byte) (UnsignedTx, error)
Unmarshal decodes an unsigned tx from the chain's wire bytes.
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 ValidatorNFTInfo ¶
type ValidatorNFTInfo struct {
ContractAddress string `json:"contractAddress"`
TokenID uint64 `json:"tokenId"`
CollectionName string `json:"collectionName"`
}
ValidatorNFTInfo contains NFT information for validator staking
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 {
// Apricot Transactions:
AddValidatorTx(*AddValidatorTx) error
AddChainValidatorTx(*AddChainValidatorTx) error
AddDelegatorTx(*AddDelegatorTx) error
CreateNetworkTx(*CreateNetworkTx) error
CreateChainTx(*CreateChainTx) error
ImportTx(*ImportTx) error
ExportTx(*ExportTx) error
AdvanceTimeTx(*AdvanceTimeTx) error
RewardValidatorTx(*RewardValidatorTx) error
// Banff Transactions:
RemoveChainValidatorTx(*RemoveChainValidatorTx) error
TransformChainTx(*TransformChainTx) error
AddPermissionlessValidatorTx(*AddPermissionlessValidatorTx) error
AddPermissionlessDelegatorTx(*AddPermissionlessDelegatorTx) error
// Durango Transactions:
TransferChainOwnershipTx(*TransferChainOwnershipTx) error
BaseTx(*BaseTx) error
// Quasar Transactions:
ConvertNetworkToL1Tx(*ConvertNetworkToL1Tx) error
RegisterL1ValidatorTx(*RegisterL1ValidatorTx) error
SetL1ValidatorWeightTx(*SetL1ValidatorWeightTx) error
IncreaseL1ValidatorBalanceTx(*IncreaseL1ValidatorBalanceTx) error
DisableL1ValidatorTx(*DisableL1ValidatorTx) error
}
Allow vm to execute custom logic against the underlying transaction types.
Source Files
¶
- add_chain_validator_tx.go
- add_delegator_tx.go
- add_permissionless_delegator_tx.go
- add_permissionless_validator_tx.go
- add_validator_tx.go
- advance_time_tx.go
- base_tx.go
- cgo_enabled.go
- chain_validator.go
- convert_network_to_l1_tx.go
- create_chain_tx.go
- create_network_tx.go
- creds.go
- delta.go
- disable_l1_validator_tx.go
- export_tx.go
- import_tx.go
- increase_l1_validator_balance_tx.go
- kind.go
- marshal.go
- mock_scheduled_staker.go
- nft_staker.go
- priorities.go
- register_l1_validator_tx.go
- remove_chain_validator_tx.go
- reward_validator_tx.go
- set_l1_validator_weight_tx.go
- sort_helpers.go
- spending.go
- staker_tx.go
- transfer_chain_ownership_tx.go
- transform_chain_tx.go
- tx.go
- unmarshal.go
- unsigned_tx.go
- validator.go
- visitor.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package builder is a generated GoMock package.
|
Package builder is a generated GoMock package. |
|
TODO: Before Quasar Edition, address all TODOs in this package and ensure LP-103 compliance.
|
TODO: Before Quasar Edition, address all TODOs in this package and ensure LP-103 compliance. |
|
Package txsmock is a generated GoMock package.
|
Package txsmock is a generated GoMock package. |