chain

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainHandler

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

type ChainManager

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

func InitChainManager

func InitChainManager(cfg *conf.MysGateConfig, db *xorm.Engine) *ChainManager

func (*ChainManager) CloseChainManager

func (cm *ChainManager) CloseChainManager()

func (*ChainManager) PayForDest

func (cm *ChainManager) PayForDest(order *model.Order) error

func (*ChainManager) SendMessage

func (cm *ChainManager) SendMessage(msg msgType, order *model.Order) error

type Connection

type Connection struct {
	HttpClient *ethclient.Client
}

type DestChainHandler

type DestChainHandler struct {
	HttpClient      *ethclient.Client
	ContractAddress common.Address
	PrivKey         *ecdsa.PrivateKey
	Caller          common.Address
}

func NewDestChainHandler

func NewDestChainHandler(client *ethclient.Client, addr common.Address, key *ecdsa.PrivateKey) *DestChainHandler

type IDispatcher

type IDispatcher interface {
	PayForDest(*model.Order) error
}

type SrcChainHandler

type SrcChainHandler struct {
	Db              *xorm.Engine
	PrivKey         *ecdsa.PrivateKey
	HttpClient      *ethclient.Client
	QuitListen      chan bool
	ContractAddress common.Address
	Caller          common.Address

	Rpc string
	// contains filtered or unexported fields
}

func NewSrcChainHandler

func NewSrcChainHandler(httpClient *ethclient.Client, addr common.Address, key *ecdsa.PrivateKey, db *xorm.Engine, disp IDispatcher, keys []string, rpc string) *SrcChainHandler

func (*SrcChainHandler) AddCommitment

func (sch *SrcChainHandler) AddCommitment(order *model.Order) (bool, error)

addcommitment

func (*SrcChainHandler) DispatchEvent

func (sch *SrcChainHandler) DispatchEvent(v interface{})

Jump to

Keyboard shortcuts

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