vote

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ProgramName = "Vote"

Variables

View Source
var InstructionImplDef = bin.NewVariantDefinition(
	bin.Uint32TypeIDEncoding,
	[]bin.VariantType{
		{
			"InitializeAccount", (*InitializeAccount)(nil),
		},
		{
			"Authorize", (*Authorize)(nil),
		},
		{
			"Vote", (*Vote)(nil),
		},
	},
)
View Source
var ProgramID solana.PublicKey = solana.VoteProgramID

Functions

func SetProgramID

func SetProgramID(pubkey solana.PublicKey)

Types

type Authorize

type Authorize struct {

	// [0] = [WRITE] VoteAccount
	// ··········· Unitialized vote account
	//
	// [1] = [] SysVarClock
	// ··········· Clock sysvar
	//
	// [2] = [SIGNER] Authority
	// ··········· Vote or withdraw authority
	solana.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

type InitializeAccount

type InitializeAccount struct {

	// [0] = [WRITE] VoteAccount
	// ··········· Vote account to vote with
	//
	// [1] = [] SysVarSlotHashes
	// ··········· Slot hashes sysvar
	//
	// [2] = [] SysVarClock
	// ··········· Clock sysvar
	//
	// [3] = [SIGNER] VoteAuthority
	// ··········· New validator identity (node_pubkey)
	solana.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

type Instruction

type Instruction struct {
	bin.BaseVariant
}

func DecodeInstruction

func DecodeInstruction(accounts []*solana.AccountMeta, data []byte) (*Instruction, error)

func (*Instruction) Accounts

func (inst *Instruction) Accounts() (out []*solana.AccountMeta)

func (*Instruction) Data

func (inst *Instruction) Data() ([]byte, error)

func (*Instruction) EncodeToTree

func (inst *Instruction) EncodeToTree(parent treeout.Branches)

func (Instruction) MarshalWithEncoder

func (inst Instruction) MarshalWithEncoder(encoder *bin.Encoder) error

func (*Instruction) ProgramID

func (inst *Instruction) ProgramID() solana.PublicKey

func (*Instruction) TextEncode

func (inst *Instruction) TextEncode(encoder *text.Encoder, option *text.Option) error

func (*Instruction) UnmarshalWithDecoder

func (inst *Instruction) UnmarshalWithDecoder(decoder *bin.Decoder) error

type Vote

type Vote struct {
	Slots     []uint64
	Hash      solana.Hash
	Timestamp *int64

	// [0] = [WRITE] VoteAccount
	// ··········· Vote account to vote with
	//
	// [1] = [] SysVarSlotHashes
	// ··········· Slot hashes sysvar
	//
	// [2] = [] SysVarClock
	// ··········· Clock sysvar
	//
	// [3] = [SIGNER] VoteAuthority
	// ··········· Vote authority
	solana.AccountMetaSlice `bin:"-" borsh_skip:"true"`
}

func (*Vote) EncodeToTree

func (inst *Vote) EncodeToTree(parent treeout.Branches)

func (*Vote) UnmarshalWithDecoder

func (v *Vote) UnmarshalWithDecoder(dec *bin.Decoder) error

func (*Vote) Validate

func (inst *Vote) Validate() error

Jump to

Keyboard shortcuts

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