statedb

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFluxHelper

type DefaultFluxHelper struct {
	// contains filtered or unexported fields
}

func NewDefaultFluxHelper

func NewDefaultFluxHelper(client pbstatedb.StateClient) *DefaultFluxHelper

func (*DefaultFluxHelper) QueryProducers

func (f *DefaultFluxHelper) QueryProducers(ctx context.Context) ([]Producer, float64, error)

func (*DefaultFluxHelper) QueryTotalActivatedStake

func (f *DefaultFluxHelper) QueryTotalActivatedStake(ctx context.Context) (float64, error)

type Global

type Global struct {
	MaxBlockNetUsage               int       `json:"max_block_net_usage"`
	TargetBlockNetUsagePct         int       `json:"target_block_net_usage_pct"`
	MaxTransactionNetUsage         int       `json:"max_transaction_net_usage"`
	BasePerTransactionNetUsage     int       `json:"base_per_transaction_net_usage"`
	NetUsageLeeway                 int       `json:"net_usage_leeway"`
	ContextFreeDiscountNetUsageNum int       `json:"context_free_discount_net_usage_num"`
	ContextFreeDiscountNetUsageDen int       `json:"context_free_discount_net_usage_den"`
	MaxBlockCPUUsage               int       `json:"max_block_cpu_usage"`
	TargetBlockCPUUsagePct         int       `json:"target_block_cpu_usage_pct"`
	MaxTransactionCPUUsage         int       `json:"max_transaction_cpu_usage"`
	MinTransactionCPUUsage         int       `json:"min_transaction_cpu_usage"`
	MaxTransactionLifetime         int       `json:"max_transaction_lifetime"`
	DeferredTrxExpirationWindow    int       `json:"deferred_trx_expiration_window"`
	MaxTransactionDelay            int       `json:"max_transaction_delay"`
	MaxInlineActionSize            int       `json:"max_inline_action_size"`
	MaxInlineActionDepth           int       `json:"max_inline_action_depth"`
	MaxAuthorityDepth              int       `json:"max_authority_depth"`
	MaxRAMSize                     string    `json:"max_ram_size"`
	TotalRAMBytesReserved          zsw.Int64 `json:"total_ram_bytes_reserved"`
	TotalRAMStake                  zsw.Int64 `json:"total_ram_stake"`
	LastProducerScheduleUpdate     string    `json:"last_producer_schedule_update"`
	//LastPervoteBucketFill          int64     `json:"last_pervote_bucket_fill,string"`
	PervoteBucket       zsw.Int64   `json:"pervote_bucket"`
	PerblockBucket      zsw.Int64   `json:"perblock_bucket"`
	TotalUnpaidBlocks   zsw.Int64   `json:"total_unpaid_blocks"`
	TotalActivatedStake zsw.Float64 `json:"total_activated_stake"`
	//ThreshActivatedStakeTime       int64     `json:"thresh_activated_stake_time,string"`
	LastProducerScheduleSize zsw.Int64   `json:"last_producer_schedule_size"`
	TotalProducerVoteWeight  zsw.Float64 `json:"total_producer_vote_weight"`
	LastNameClose            string      `json:"last_name_close"`
}

type Producer

type Producer struct {
	Owner        string  `json:"owner"`
	TotalVotes   float64 `json:"total_votes"`
	ProducerKey  string  `json:"producer_key"`
	IsActive     bool    `json:"is_active"`
	URL          string  `json:"url"`
	UnpaidBlocks int     `json:"unpaid_blocks"`
	Location     int     `json:"location"`
}

type StateHelper

type StateHelper interface {
	QueryTotalActivatedStake(ctx context.Context) (float64, error)
	QueryProducers(ctx context.Context) ([]Producer, float64, error)
}

type TestProducersResponse

type TestProducersResponse struct {
	// contains filtered or unexported fields
}

type TestStateHelper

type TestStateHelper struct {
	// contains filtered or unexported fields
}

func NewTestStateHelper

func NewTestStateHelper() *TestStateHelper

func (*TestStateHelper) QueryProducers

func (c *TestStateHelper) QueryProducers(ctx context.Context) ([]Producer, float64, error)

func (*TestStateHelper) QueryTotalActivatedStake

func (c *TestStateHelper) QueryTotalActivatedStake(ctx context.Context) (float64, error)

func (*TestStateHelper) SetProducersResponse

func (c *TestStateHelper) SetProducersResponse(producers []Producer, totalVotes float64, err error)

func (*TestStateHelper) SetTotalActivatedStakeResponse

func (c *TestStateHelper) SetTotalActivatedStakeResponse(totalActivatedStake float64, err error)

type TestTotalActivatedStakeResponse

type TestTotalActivatedStakeResponse struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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