supplychecker

package
v0.0.0-...-2da98db Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package supplychecker provides functionalities to check the total supply of Zeta tokens Currently not used in the codebase

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateZetaSupply

func ValidateZetaSupply(
	logger zerolog.Logger,
	abortedTxAmounts, zetaInTransit, genesisAmounts, externalChainTotalSupply, zetaTokenSupplyOnNode, ethLockedAmount sdkmath.Int,
) bool

ValidateZetaSupply validates the zeta supply from the checked values

Types

type ZetaSupplyCheckLogs

type ZetaSupplyCheckLogs struct {
	Logger                   zerolog.Logger
	AbortedTxAmounts         sdkmath.Int `json:"aborted_tx_amounts"`
	ZetaInTransit            sdkmath.Int `json:"zeta_in_transit"`
	ExternalChainTotalSupply sdkmath.Int `json:"external_chain_total_supply"`
	ZetaTokenSupplyOnNode    sdkmath.Int `json:"zeta_token_supply_on_node"`
	EthLockedAmount          sdkmath.Int `json:"eth_locked_amount"`
	NodeAmounts              sdkmath.Int `json:"node_amounts"`
	LHS                      sdkmath.Int `json:"LHS"`
	RHS                      sdkmath.Int `json:"RHS"`
	SupplyCheckSuccess       bool        `json:"supply_check_success"`
}

ZetaSupplyCheckLogs is a struct to log the output of the ZetaSupplyChecker

func (ZetaSupplyCheckLogs) LogOutput

func (z ZetaSupplyCheckLogs) LogOutput()

LogOutput logs the output of the ZetaSupplyChecker

type ZetaSupplyChecker

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

ZetaSupplyChecker is a utility to check the total supply of Zeta tokens

func NewZetaSupplyChecker

func NewZetaSupplyChecker(
	ctx context.Context,
	zetaClient *zetacore.Client,
	logger zerolog.Logger,
) (*ZetaSupplyChecker, error)

NewZetaSupplyChecker creates a new ZetaSupplyChecker

func (*ZetaSupplyChecker) AbortedTxAmount

func (zs *ZetaSupplyChecker) AbortedTxAmount(ctx context.Context) (sdkmath.Int, error)

AbortedTxAmount returns the amount of Zeta tokens in aborted transactions

func (*ZetaSupplyChecker) CheckZetaTokenSupply

func (zs *ZetaSupplyChecker) CheckZetaTokenSupply(ctx context.Context) error

CheckZetaTokenSupply checks the total supply of Zeta tokens

func (*ZetaSupplyChecker) GetAmountOfZetaInTransit

func (zs *ZetaSupplyChecker) GetAmountOfZetaInTransit(ctx context.Context) (sdkmath.Int, error)

GetAmountOfZetaInTransit returns the amount of Zeta tokens in transit

func (*ZetaSupplyChecker) GetPendingCCTXInTransit

func (zs *ZetaSupplyChecker) GetPendingCCTXInTransit(
	ctx context.Context,
	receivingChains []chains.Chain,
) []*types.CrossChainTx

GetPendingCCTXInTransit returns the pending CCTX in transit

func (*ZetaSupplyChecker) Start

func (zs *ZetaSupplyChecker) Start(ctx context.Context)

Start starts the ZetaSupplyChecker

func (*ZetaSupplyChecker) Stop

func (zs *ZetaSupplyChecker) Stop()

Stop stops the ZetaSupplyChecker

Jump to

Keyboard shortcuts

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