types

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownTranscoderStatus = fmt.Errorf("unknown transcoder status")
	ErrUnknownDelegatorStatus  = fmt.Errorf("unknown delegator status")
)
View Source
var (
	ErrDuplicatedHash = fmt.Errorf("MerkleTree: duplicated hash provided")
)
View Source
var VoteChoices = []VoteChoice{Yes, No}

Functions

func NewMerkleTree

func NewMerkleTree(hashes []common.Hash) (*MerkleTreeNode, []*MerkleProof, error)

func ParseDelegatorStatus added in v0.5.0

func ParseDelegatorStatus(s uint8) (string, error)

func ParseTranscoderStatus added in v0.5.0

func ParseTranscoderStatus(s uint8) (string, error)

func VerifyProof

func VerifyProof(rootHash common.Hash, hash common.Hash, proof *MerkleProof) bool

Types

type Delegator added in v0.5.0

type Delegator struct {
	Address             common.Address
	BondedAmount        *big.Int
	Fees                *big.Int
	DelegateAddress     common.Address
	DelegatedAmount     *big.Int
	StartRound          *big.Int
	LastClaimRound      *big.Int
	NextUnbondingLockId *big.Int
	PendingStake        *big.Int
	PendingFees         *big.Int
	Status              string
}

type MerkleProof

type MerkleProof struct {
	Hashes []common.Hash
}

func NewMerkleProof

func NewMerkleProof(node *MerkleTreeNode) *MerkleProof

func (*MerkleProof) Bytes

func (p *MerkleProof) Bytes() []byte

type MerkleTreeNode

type MerkleTreeNode struct {
	Hash     common.Hash
	Parent   *MerkleTreeNode
	LeftSib  *MerkleTreeNode
	RightSib *MerkleTreeNode
}

func (*MerkleTreeNode) String

func (n *MerkleTreeNode) String() string

type ProtocolParameters added in v0.5.0

type ProtocolParameters struct {
	NumActiveTranscoders          *big.Int
	RoundLength                   *big.Int
	RoundLockAmount               *big.Int
	UnbondingPeriod               uint64
	VerificationRate              uint64
	VerificationPeriod            *big.Int
	SlashingPeriod                *big.Int
	FailedVerificationSlashAmount *big.Int
	MissedVerificationSlashAmount *big.Int
	DoubleClaimSegmentSlashAmount *big.Int
	FinderFee                     *big.Int
	Inflation                     *big.Int
	InflationChange               *big.Int
	TargetBondingRate             *big.Int
	VerificationCodeHash          string
	TotalBonded                   *big.Int
	TotalSupply                   *big.Int
	Paused                        bool
}

type TokenPools added in v0.5.0

type TokenPools struct {
	TotalStake             *big.Int
	TranscoderRewardCut    *big.Int
	TranscoderFeeShare     *big.Int
	CumulativeRewardFactor *big.Int
	CumulativeFeeFactor    *big.Int
}

type Transcoder added in v0.5.0

type Transcoder struct {
	Address                    common.Address
	ServiceURI                 string
	LastRewardRound            *big.Int
	RewardCut                  *big.Int
	FeeShare                   *big.Int
	DelegatedStake             *big.Int
	ActivationRound            *big.Int
	DeactivationRound          *big.Int
	LastActiveStakeUpdateRound *big.Int
	Active                     bool
	Status                     string
	PricePerPixel              *big.Rat
}

type TranscoderPoolHints added in v0.5.10

type TranscoderPoolHints struct {
	PosNext common.Address
	PosPrev common.Address
}

type UnbondingLock added in v0.5.0

type UnbondingLock struct {
	ID               *big.Int
	DelegatorAddress common.Address
	Amount           *big.Int
	WithdrawRound    *big.Int
}

type VoteChoice added in v0.5.8

type VoteChoice int
const (
	Yes VoteChoice = iota
	No
)

func (VoteChoice) IsValid added in v0.5.8

func (v VoteChoice) IsValid() bool

func (VoteChoice) String added in v0.5.8

func (v VoteChoice) String() string

Jump to

Keyboard shortcuts

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