runners

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsVaultSolvent

func IsVaultSolvent(account common.Account, vault types.Vault, currentGasFee cosmos.Uint) bool

IsVaultSolvent check whether the given vault is solvent or not , if it is not solvent , then it will need to report solvency to ddnode

func SolvencyCheckRunner

func SolvencyCheckRunner(chain common.Chain,
	provider SolvencyCheckProvider,
	bridge ddclient.DdchainBridge,
	stopper <-chan struct{},
	wg *sync.WaitGroup,
	backOffDuration time.Duration,
)

SolvencyCheckRunner when a chain get marked as insolvent , and then get halt automatically , the chain client will stop scanning blocks , as a result , solvency checker will not report current solvency status to DDNode anymore, this method is to ensure that the chain client will continue to do solvency check even when the chain has been halted

Types

type SolvencyCheckProvider

type SolvencyCheckProvider interface {
	GetHeight() (int64, error)
	ShouldReportSolvency(height int64) bool
	ReportSolvency(height int64) error
}

SolvencyCheckProvider methods that a SolvencyChecker implementation should have

Jump to

Keyboard shortcuts

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