withdraw

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONSENSUS_VERSION = 2

	WITHRAW_ORACLE_CONTRACT_VERSION     = 2
	LARGE_STAKE_ORACLE_CONTRACT_VERSION = 1

	WITHRAW_ORACLE_MODULE_ID = 1
	LARGE_STAKE_MODULE_ID    = 2

	SLOTS_PER_EPOCH   = 32
	SECONDS_PER_SLOT  = 12
	SECONDS_PER_EPOCH = SLOTS_PER_EPOCH * SECONDS_PER_SLOT
)

version

Variables

This section is empty.

Functions

func DefaultRandomSleep

func DefaultRandomSleep()

func EncodeReportData

func EncodeReportData(reportData *withdrawOracle.WithdrawOracleReportData) ([32]byte, error)

func RandomSleepTime added in v0.0.6

func RandomSleepTime() time.Duration

Types

type EffectiveOperator

type EffectiveOperator struct {
	VnftCountOfStakingPool uint64
	OperatorReward         withdrawOracle.WithdrawInfo
}

type Oracle

type Oracle struct {
}

func (*Oracle) CheckContractVersions

func (v *Oracle) CheckContractVersions(ctx context.Context) error

func (*Oracle) GetConsensusContract

func (v *Oracle) GetConsensusContract(ctx context.Context) (*hashConsensus.HashConsensus, error)

func (*Oracle) GetConsensusContractAddress

func (v *Oracle) GetConsensusContractAddress(ctx context.Context) (common.Address, error)

func (*Oracle) GetLastProcessingRefSlot added in v0.0.6

func (v *Oracle) GetLastProcessingRefSlot(ctx context.Context) (*big.Int, error)

func (*Oracle) GetProcessingState

func (*Oracle) GetReportAsyncProcessorAddress added in v0.0.6

func (v *Oracle) GetReportAsyncProcessorAddress() (common.Address, error)

func (*Oracle) IsContractReportable

func (v *Oracle) IsContractReportable(ctx context.Context) (bool, error)

func (*Oracle) IsMainDataSubmitted

func (v *Oracle) IsMainDataSubmitted(ctx context.Context) (bool, error)

func (*Oracle) Paused

func (v *Oracle) Paused(ctx context.Context) (bool, error)

type ValidatorExa

type ValidatorExa struct {
	Validator *consensusApi.Validator

	VnftOwner VnftOwner

	IsExited          bool
	ExitedSlot        *big.Int
	ExitedBlockHeight *big.Int

	TokenId    *big.Int
	OperatorId *big.Int
	// Whether oracle needs to make a report
	IsNeedOracleReportExit bool
	// IsNeedOracleReportExit = true And then to calculate
	// ClCapital used to calculate WithdrawInfo
	ExitedAmountForClCapital *big.Int

	// 1.slashed 2.exited 3.Not OracleReportExit
	SlashAmount *big.Int
}

type VnftOwner added in v0.1.0

type VnftOwner uint32
const (
	USER VnftOwner = iota
	LiquidStaking
)

type WithdrawHelper

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

func (*WithdrawHelper) IsOwnerLiqPool

func (v *WithdrawHelper) IsOwnerLiqPool(ctx context.Context, exa *ValidatorExa) (bool, error)

func (*WithdrawHelper) ProcessReport

func (v *WithdrawHelper) ProcessReport(ctx context.Context) error

Jump to

Keyboard shortcuts

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