proposal

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FunctionVote    = "Vote"
	FunctionExecute = "Execute"
)

function vote's params

Variables

View Source
var (
	ErrPropsalInvalidInitData     = errors.New("err_proposal_invalid_init_data")
	ErrPropsalInvalidTxAction     = errors.New("err_proposal_invalid_tx_action")
	ErrPropsalInvalidTxCallParams = errors.New("err_proposal_invalid_tx_call_params")
	ErrPropsalInvalidVoteTime     = errors.New("err_proposal_invalid_vote_time")
	ErrPropsalInvalidVoteParams   = errors.New("err_proposal_invalid_vote_params")
	ErrPropsalNoStakes            = errors.New("err_proposal_no_stakes")
	ErrPropsalInvalidExectueTime  = errors.New("err_proposal_invalid_execute_time")
	ErrPropsalExectued            = errors.New("err_proposal_executed")
	ErrPropsalInvalidGrantAmount  = errors.New("err_proposal_invalid_grant_amount")
	ErrPropsalInvalidFunction     = errors.New("err_proposal_invalid_function")
)

Functions

func Execute

func Execute(tx *schema.Transaction, state *schema.StateForProposal, oracle *schema.Oracle, localState, initData string) (*schema.StateForProposal, string, string, error)

Types

type InitData

type InitData struct {
	VoteDeadLine int64  `json:"voteDeadline"`
	GrantFrom    string `json:"grantFrom"`
	GrantTo      string `json:"grantTo"`
	GrantAmount  string `json:"grantAmount"`
}

type LocalState

type LocalState struct {
	Voteds   map[string]Voted `json:"voteds"`
	Infavor  int64            `json:"infavor"`
	Against  int64            `json:"against"`
	Approved bool             `json:"approved"`
	Executed bool             `json:"executed"`
}

func (*LocalState) Hash

func (l *LocalState) Hash() string

func (*LocalState) String

func (l *LocalState) String() string

type VoteParams

type VoteParams struct {
	Infavor bool `json:"infavor"`
}

type Voted

type Voted struct {
	Infavor bool  `json:"infavor"`
	Weight  int64 `json:"weight"`
}

Jump to

Keyboard shortcuts

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