agency

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TxsExecutorConstructorM = make(map[string]TxsExecutorConstructor)
	ContractConstructorM    = make(map[string]*ContractInfo)
	RegisterConstructorM    = make(map[string]RegistryConstructor)

	PierHAConstructorM = make(map[string]PierHAConstructor)
)

Functions

func GetRegisteredContractInfo

func GetRegisteredContractInfo() map[string]*ContractInfo

func RegisterContractConstructor

func RegisterContractConstructor(name string, addr *types.Address, f ContractConstructor)

func RegisterExecutorConstructor

func RegisterExecutorConstructor(typ string, f TxsExecutorConstructor)

func RegisterPierHAConstructor

func RegisterPierHAConstructor(typ string, f PierHAConstructor)

func RegisterRegistryConstructor

func RegisterRegistryConstructor(typ string, f RegistryConstructor)

Types

type ApplyTxFunc

type ApplyTxFunc func(int, pb.Transaction, InvalidReason, *TxOpt) *pb.Receipt

type Contract

type Contract interface{}

type ContractConstructor

type ContractConstructor func() Contract

type ContractInfo

type ContractInfo struct {
	Name        string
	Constructor ContractConstructor
}

func GetContractInfo

func GetContractInfo(addr *types.Address) (*ContractInfo, error)

type HAClient

type HAClient interface {
	//Check whethe there is a master pier connect to the BitXHub.
	CheckMasterPier(address string) (*pb.Response, error)

	//Set the master pier connect to the BitXHub.
	SetMasterPier(address string, index string, timeout int64) (*pb.Response, error)

	//Update the master pier status
	HeartBeat(address string, index string) (*pb.Response, error)
}

type InvalidReason

type InvalidReason string

type PierHA

type PierHA interface {
	Start() error

	Stop() error

	IsMain() <-chan bool
}

type PierHAConstructor

type PierHAConstructor func(client HAClient, pierID string) PierHA

func GetPierHAConstructor

func GetPierHAConstructor(typ string) (PierHAConstructor, error)

type RegisterContractFunc

type RegisterContractFunc func() map[string]Contract

type Registry

type Registry interface{}

type RegistryConstructor

type RegistryConstructor func(storage.Storage, logrus.FieldLogger) Registry

func GetRegistryConstructor

func GetRegistryConstructor(typ string) (RegistryConstructor, error)

type TxOpt

type TxOpt struct {
	Contracts map[string]Contract
}

type TxsExecutor

type TxsExecutor interface {
	ApplyTransactions(txs []pb.Transaction, invalidTxs map[int]InvalidReason) []*pb.Receipt

	GetBoltContracts() map[string]Contract

	AddNormalTx(hash *types.Hash)

	GetNormalTxs() []*types.Hash

	AddInterchainCounter(to string, index uint64)

	GetInterchainCounter() map[string][]uint64

	GetDescription() string
}

type TxsExecutorConstructor

type TxsExecutorConstructor func(ApplyTxFunc, RegisterContractFunc, logrus.FieldLogger) TxsExecutor

func GetExecutorConstructor

func GetExecutorConstructor(typ string) (TxsExecutorConstructor, error)

Jump to

Keyboard shortcuts

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