contractmanager

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractManager

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

func NewContractManager

func NewContractManager(clonefactoryAddr, ownerAddr common.Address, createContractFn CreateContractFn, store *contracts.HashrateEthereum, log interfaces.ILogger) *ContractManager

func (*ContractManager) AddContract

func (cm *ContractManager) AddContract(ctx context.Context, data *hashrate.EncryptedTerms)

func (*ContractManager) GetContract

func (cm *ContractManager) GetContract(id string) (resources.Contract, bool)

func (*ContractManager) GetContracts

func (cm *ContractManager) GetContracts() *lib.Collection[resources.Contract]

func (*ContractManager) Run

func (cm *ContractManager) Run(ctx context.Context) error

type CreateContractFn

type CreateContractFn func(terms *hashrate.EncryptedTerms) (resources.Contract, error)

type TermsCommon

type TermsCommon interface {
	ID() string
	BlockchainState() hashrate.BlockchainState
	Seller() string
	Buyer() string
	Validator() string
	StartTime() time.Time
	Duration() time.Duration
	HashrateGHS() float64
}

Jump to

Keyboard shortcuts

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