voting

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Receipt

type Receipt struct {
	InstructionHash               common.Hash   `json:"instructionHash"`
	Sequence                      uint64        `json:"sequence"`
	Signature                     hexutil.Bytes `json:"signature"`
	AdditionalVariableMessageHash common.Hash   `json:"additionalVariableMessageHash"`
	Timestamp                     uint64        `json:"timestamp"`
	VoteHash                      common.Hash   `json:"voteHash"`
}

func (*Receipt) Hash

func (r *Receipt) Hash() (common.Hash, error)

func (*Receipt) Sign

func (r *Receipt) Sign(sk *ecdsa.PrivateKey) (*SignedReceipt, error)

Sign signs the receipt with the private key and returns signed receipt.

type SignedReceipt

type SignedReceipt struct {
	Receipt   Receipt       `json:"receipt"`
	Signature hexutil.Bytes `json:"signature"`
}

SignedReceipt combines Receipt and its signature.

func (*SignedReceipt) RecoverPubKey

func (sr *SignedReceipt) RecoverPubKey() (*ecdsa.PublicKey, error)

RecoverPubKey recovers signer of the signed receipt.

type Status

type Status struct {
	InstructionHash    common.Hash `json:"instructionHash"`
	Finalized          bool        `json:"finalized"`
	Deleted            bool        `json:"deleted"`
	Start              uint64      `json:"start"`
	End                uint64      `json:"end"`
	Weight             uint16      `json:"weight"`
	Threshold          uint16      `json:"threshold"`
	Cosigners          uint16      `json:"cosigners"`
	CosignersThreshold uint16      `json:"cosignersThreshold"`
}

type Statuses

type Statuses struct {
	InstructionID common.Hash `json:"instructionId"`
	FinalizedHash common.Hash `json:"finalizedHash"`
	Status        []Status    `json:"status"`
}

Jump to

Keyboard shortcuts

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