governance

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableGovernance

func EnableGovernance(r action.Router) error

func EnableInternalGovernance

func EnableInternalGovernance(r action.Router) error

Types

type CancelProposal

type CancelProposal struct {
	ProposalId gov.ProposalID `json:"proposalId"`
	Proposer   keys.Address   `json:"proposerAddress"`
	Reason     string         `json:"cancelReason"`
}

func (*CancelProposal) Marshal

func (cp *CancelProposal) Marshal() ([]byte, error)

func (CancelProposal) Signers

func (cp CancelProposal) Signers() []action.Address

func (CancelProposal) Tags

func (cp CancelProposal) Tags() kv.Pairs

func (CancelProposal) Type

func (cp CancelProposal) Type() action.Type

func (*CancelProposal) Unmarshal

func (cp *CancelProposal) Unmarshal(data []byte) error

type CreateProposal

type CreateProposal struct {
	ProposalID      governance.ProposalID   `json:"proposalId"`
	ProposalType    governance.ProposalType `json:"proposalType"`
	Headline        string                  `json:"proposalHeadline"`
	Description     string                  `json:"proposalDescription"`
	Proposer        keys.Address            `json:"proposerAddress"`
	InitialFunding  action.Amount           `json:"initialFunding"`
	FundingDeadline int64                   `json:"fundingDeadline"`
	FundingGoal     *balance.Amount         `json:"fundingGoal"`
	VotingDeadline  int64                   `json:"votingDeadline"`
	PassPercentage  int                     `json:"passPercentage"`
	ConfigUpdate    string                  `json:"configUpdate"`
}

func (CreateProposal) Marshal

func (c CreateProposal) Marshal() ([]byte, error)

func (CreateProposal) ProcessCheck

func (c CreateProposal) ProcessCheck(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (CreateProposal) ProcessDeliver

func (c CreateProposal) ProcessDeliver(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (CreateProposal) ProcessFee

func (c CreateProposal) ProcessFee(ctx *action.Context, signedTx action.SignedTx, start action.Gas, size action.Gas, gasUsed action.Gas) (bool, action.Response)

func (CreateProposal) Signers

func (c CreateProposal) Signers() []action.Address

func (CreateProposal) Tags

func (c CreateProposal) Tags() kv.Pairs

func (CreateProposal) Type

func (c CreateProposal) Type() action.Type

func (*CreateProposal) Unmarshal

func (c *CreateProposal) Unmarshal(bytes []byte) error

func (CreateProposal) Validate

func (c CreateProposal) Validate(ctx *action.Context, signedTx action.SignedTx) (bool, error)

type ExpireVotes

type ExpireVotes struct {
	ProposalID       governance.ProposalID `json:"proposalId"`
	ValidatorAddress action.Address        `json:"validatorAddress"`
}

func (ExpireVotes) Marshal

func (e ExpireVotes) Marshal() ([]byte, error)

func (ExpireVotes) ProcessCheck

func (e ExpireVotes) ProcessCheck(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (ExpireVotes) ProcessDeliver

func (e ExpireVotes) ProcessDeliver(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (ExpireVotes) ProcessFee

func (e ExpireVotes) ProcessFee(ctx *action.Context, signedTx action.SignedTx, start action.Gas, size action.Gas, gasUsed action.Gas) (bool, action.Response)

func (ExpireVotes) Signers

func (e ExpireVotes) Signers() []action.Address

func (ExpireVotes) Tags

func (e ExpireVotes) Tags() kv.Pairs

func (ExpireVotes) Type

func (e ExpireVotes) Type() action.Type

func (*ExpireVotes) Unmarshal

func (e *ExpireVotes) Unmarshal(bytes []byte) error

func (ExpireVotes) Validate

func (e ExpireVotes) Validate(ctx *action.Context, signedTx action.SignedTx) (bool, error)

type FinalizeProposal

type FinalizeProposal struct {
	ProposalID       governance.ProposalID `json:"proposalId"`
	ValidatorAddress action.Address        `json:"validatorAddress"`
}

func (FinalizeProposal) Marshal

func (p FinalizeProposal) Marshal() ([]byte, error)

func (FinalizeProposal) ProcessCheck

func (FinalizeProposal) ProcessCheck(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (FinalizeProposal) ProcessDeliver

func (FinalizeProposal) ProcessDeliver(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (FinalizeProposal) ProcessFee

func (FinalizeProposal) ProcessFee(ctx *action.Context, signedTx action.SignedTx, start action.Gas, size action.Gas, gasUsed action.Gas) (bool, action.Response)

func (FinalizeProposal) Signers

func (p FinalizeProposal) Signers() []action.Address

func (FinalizeProposal) Tags

func (p FinalizeProposal) Tags() kv.Pairs

func (FinalizeProposal) Type

func (p FinalizeProposal) Type() action.Type

func (*FinalizeProposal) Unmarshal

func (p *FinalizeProposal) Unmarshal(bytes []byte) error

func (FinalizeProposal) Validate

func (FinalizeProposal) Validate(ctx *action.Context, signedTx action.SignedTx) (bool, error)

type FundProposal

type FundProposal struct {
	ProposalId    governance.ProposalID `json:"proposalId"`
	FunderAddress keys.Address          `json:"funderAddress"`
	FundValue     action.Amount         `json:"fundValue"`
}

func (FundProposal) Marshal

func (fp FundProposal) Marshal() ([]byte, error)

func (FundProposal) Signers

func (fp FundProposal) Signers() []action.Address

func (FundProposal) Tags

func (fp FundProposal) Tags() kv.Pairs

func (FundProposal) Type

func (fp FundProposal) Type() action.Type

func (*FundProposal) Unmarshal

func (fp *FundProposal) Unmarshal(bytes []byte) error

type VoteProposal

type VoteProposal struct {
	ProposalID       gov.ProposalID  `json:"proposalId"`
	Address          action.Address  `json:"address"`
	ValidatorAddress action.Address  `json:"validatorAddress"`
	Opinion          gov.VoteOpinion `json:"voteOpinion"`
}

func (*VoteProposal) Marshal

func (vote *VoteProposal) Marshal() ([]byte, error)

func (VoteProposal) Signers

func (vote VoteProposal) Signers() []action.Address

func (VoteProposal) Tags

func (vote VoteProposal) Tags() kv.Pairs

func (VoteProposal) Type

func (vote VoteProposal) Type() action.Type

func (*VoteProposal) Unmarshal

func (vote *VoteProposal) Unmarshal(data []byte) error

type WithdrawFunds

type WithdrawFunds struct {
	ProposalID    governance.ProposalID `json:"proposalId"`
	Funder        keys.Address          `json:"funderAddress"`
	WithdrawValue action.Amount         `json:"withdrawValue"`
	Beneficiary   keys.Address          `json:"beneficiaryAddress"`
}

func (WithdrawFunds) Marshal

func (wp WithdrawFunds) Marshal() ([]byte, error)

func (WithdrawFunds) ProcessCheck

func (wp WithdrawFunds) ProcessCheck(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (WithdrawFunds) ProcessDeliver

func (wp WithdrawFunds) ProcessDeliver(ctx *action.Context, tx action.RawTx) (bool, action.Response)

func (WithdrawFunds) ProcessFee

func (wp WithdrawFunds) ProcessFee(ctx *action.Context, signedTx action.SignedTx, start action.Gas, size action.Gas, gasUsed action.Gas) (bool, action.Response)

func (WithdrawFunds) Signers

func (wp WithdrawFunds) Signers() []action.Address

func (WithdrawFunds) Tags

func (wp WithdrawFunds) Tags() kv.Pairs

func (WithdrawFunds) Type

func (wp WithdrawFunds) Type() action.Type

func (*WithdrawFunds) Unmarshal

func (wp *WithdrawFunds) Unmarshal(bytes []byte) error

func (WithdrawFunds) Validate

func (wp WithdrawFunds) Validate(ctx *action.Context, signedTx action.SignedTx) (bool, error)

Jump to

Keyboard shortcuts

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