Documentation
¶
Index ¶
- type ActionVote
- type AddedCommitteeMember
- type GovAction
- type GovActionId
- type HardForkInitiation
- type InfoAction
- type NewConstitution
- type NoConfidence
- type ParameterChange
- type ProposalProcedure
- type ProposalProcedures
- type ProtocolVersion
- type TreasuryWithdrawals
- type UpdateCommittee
- type Vote
- type Voter
- type VoterRole
- type VoterVotes
- type VotingProcedure
- type VotingProcedures
- type Withdrawal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionVote ¶
type ActionVote struct {
ActionId GovActionId
Procedure VotingProcedure
}
ActionVote pairs an action with its voting procedure.
type AddedCommitteeMember ¶
type AddedCommitteeMember struct {
Credential Certificate.Credential
Epoch uint64
}
AddedCommitteeMember pairs a credential with an epoch.
type GovAction ¶
GovAction is the interface all governance action types satisfy.
func UnmarshalGovAction ¶
UnmarshalGovAction decodes CBOR and dispatches to the correct concrete type based on the type tag (element 0).
type GovActionId ¶
type GovActionId struct {
TransactionHash []byte
GovActionIndex uint32
// contains filtered or unexported fields
}
GovActionId references a specific governance action.
type HardForkInitiation ¶
type HardForkInitiation struct {
PrevActionId *GovActionId
ProtocolVersion ProtocolVersion
}
HardForkInitiation proposes a hard fork to a new protocol version.
func (HardForkInitiation) GovActionType ¶
func (a HardForkInitiation) GovActionType() int
func (HardForkInitiation) MarshalCBOR ¶
func (a HardForkInitiation) MarshalCBOR() ([]byte, error)
type InfoAction ¶
type InfoAction struct{}
InfoAction is the simplest governance action with no fields.
func (InfoAction) GovActionType ¶
func (a InfoAction) GovActionType() int
func (InfoAction) MarshalCBOR ¶
func (a InfoAction) MarshalCBOR() ([]byte, error)
type NewConstitution ¶
type NewConstitution struct {
PrevActionId *GovActionId
Anchor Certificate.Anchor
ScriptHash []byte // nil means null
}
NewConstitution proposes a new constitution.
func (NewConstitution) GovActionType ¶
func (a NewConstitution) GovActionType() int
func (NewConstitution) MarshalCBOR ¶
func (a NewConstitution) MarshalCBOR() ([]byte, error)
type NoConfidence ¶
type NoConfidence struct {
PrevActionId *GovActionId
}
NoConfidence expresses lack of confidence in the current constitutional committee.
func (NoConfidence) GovActionType ¶
func (a NoConfidence) GovActionType() int
func (NoConfidence) MarshalCBOR ¶
func (a NoConfidence) MarshalCBOR() ([]byte, error)
type ParameterChange ¶
type ParameterChange struct {
PrevActionId *GovActionId
ParamUpdate map[int]any
}
ParameterChange proposes changes to protocol parameters.
func (ParameterChange) GovActionType ¶
func (a ParameterChange) GovActionType() int
func (ParameterChange) MarshalCBOR ¶
func (a ParameterChange) MarshalCBOR() ([]byte, error)
type ProposalProcedure ¶
type ProposalProcedure struct {
Deposit int64
RewardAccount []byte
Action GovAction
Anchor Certificate.Anchor
}
ProposalProcedure encodes a single governance proposal.
func UnmarshalProposalProcedure ¶
func UnmarshalProposalProcedure( data []byte, ) (ProposalProcedure, error)
UnmarshalProposalProcedure decodes a single proposal.
func (ProposalProcedure) MarshalCBOR ¶
func (pp ProposalProcedure) MarshalCBOR() ([]byte, error)
MarshalCBOR encodes as [deposit, reward_account, gov_action, anchor].
type ProposalProcedures ¶
type ProposalProcedures []ProposalProcedure
ProposalProcedures is a collection of proposals.
func (ProposalProcedures) MarshalCBOR ¶
func (ps ProposalProcedures) MarshalCBOR() ( []byte, error, )
MarshalCBOR encodes as a CBOR array.
func (*ProposalProcedures) UnmarshalCBOR ¶
func (ps *ProposalProcedures) UnmarshalCBOR( data []byte, ) error
UnmarshalCBOR decodes a CBOR array of proposal procedures.
type ProtocolVersion ¶
ProtocolVersion pairs a major and minor version.
type TreasuryWithdrawals ¶
type TreasuryWithdrawals struct {
Withdrawals []Withdrawal
PrevActionId *GovActionId
}
TreasuryWithdrawals proposes withdrawals from the treasury.
func (TreasuryWithdrawals) GovActionType ¶
func (a TreasuryWithdrawals) GovActionType() int
func (TreasuryWithdrawals) MarshalCBOR ¶
func (a TreasuryWithdrawals) MarshalCBOR() ( []byte, error, )
type UpdateCommittee ¶
type UpdateCommittee struct {
PrevActionId *GovActionId
Removed []Certificate.Credential
Added []AddedCommitteeMember
Quorum Certificate.UnitInterval
}
UpdateCommittee proposes changes to the constitutional committee.
func (UpdateCommittee) GovActionType ¶
func (a UpdateCommittee) GovActionType() int
func (UpdateCommittee) MarshalCBOR ¶
func (a UpdateCommittee) MarshalCBOR() ([]byte, error)
type Voter ¶
type Voter struct {
Role VoterRole
Hash serialization.ConstrainedBytes
// contains filtered or unexported fields
}
Voter identifies who is casting a vote.
type VoterVotes ¶
type VoterVotes struct {
Voter Voter
Votes []ActionVote
}
VoterVotes groups all votes cast by a single voter.
type VotingProcedure ¶
type VotingProcedure struct {
Vote Vote
Anchor *Certificate.Anchor
// contains filtered or unexported fields
}
VotingProcedure captures a single vote plus optional anchor.
type VotingProcedures ¶
type VotingProcedures []VoterVotes
VotingProcedures is the top-level collection.
func (*VotingProcedures) Add ¶
func (vp *VotingProcedures) Add( voter Voter, actionId GovActionId, procedure VotingProcedure, )
Add appends a vote for the given voter and action. If the same voter already has a vote for the same action, the existing procedure is replaced.
func (VotingProcedures) MarshalCBOR ¶
func (vp VotingProcedures) MarshalCBOR() ([]byte, error)
MarshalCBOR encodes as { voter => { action_id => proc } }.
func (*VotingProcedures) UnmarshalCBOR ¶
func (vp *VotingProcedures) UnmarshalCBOR( data []byte, ) error
UnmarshalCBOR decodes { voter => { action_id => procedure } }.
type Withdrawal ¶
Withdrawal pairs a reward account with an amount.