sero

package
v0.0.0-...-e30b66f Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const BlockRetryLimit = 5
View Source
const DefaultBlockConfirmations = 12
View Source
const DefaultGasLimit = 6721975
View Source
const DefaultGasPrice = 10000000000
View Source
const ExecuteBlockWatchLimit = 100

Number of blocks to wait for an finalization event

Variables

View Source
var (
	AccountEndpointOpt = "accountEndpoint"
	BridgeOpt          = "bridge"

	NFTBridgeOpt = "nftBridge"

	MaxGasPriceOpt        = "maxGasPrice"
	GasLimitOpt           = "gasLimit"
	HttpOpt               = "http"
	StartBlockOpt         = "startBlock"
	BlockConfirmationsOpt = "blockConfirmations"

	SignMsgStartSeqOpt         = "signMsgStartSeq"
	VoteProposalStartSeqOpt    = "voteProposalStartSeq"
	ExecuteProposalStartSeqOpt = "executeProposalStartSeqOpt"
)

Chain specific options

View Source
var BlockRetryInterval = time.Second * 10
View Source
var CancelledStatus uint8 = 4
View Source
var ErrFatalQuery = errors.New("query of chain state failed")
View Source
var ErrFatalTx = errors.New("submission of transaction failed")
View Source
var ErrNonceTooLow = errors.New("nonce too low")
View Source
var ErrTxUnderpriced = errors.New("replacement transaction underpriced")
View Source
var PassedStatus uint8 = 2
View Source
var TransferredStatus uint8 = 3
View Source
var WatchDuration = 60 * 30 // 30 Minute

Functions

func ConstructSRC20ProposalDataHash

func ConstructSRC20ProposalDataHash(handler seroCommon.Address, recipient seroCommon.Address, amount *big.Int) [32]byte

func ConstructSRC721ProposalDataHash

func ConstructSRC721ProposalDataHash(handler seroCommon.Address, recipient seroCommon.Address, tokenId *big.Int, metadata []byte) [32]byte

func NewListener

func NewListener(conn Connection, chainDB *chains.ChainDB, cfg *Config, log log.Logger, stop <-chan int, sysErr chan<- error, m *metrics.ChainMetrics) *listener

NewListener creates and returns a listener

func NewWriter

func NewWriter(conn Connection, cfg *Config, log log.Logger, stop <-chan int, sysErr chan<- error, m *metrics.ChainMetrics) *writer

NewWriter creates and returns writer

Types

type Chain

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

func InitializeChain

func InitializeChain(chainCfg *core.ChainConfig, chainDB *chains.ChainDB, logger log.Logger, sysErr chan<- error, m *metrics.ChainMetrics) (*Chain, core.ProposalState, error)

func (*Chain) Id

func (c *Chain) Id() types.ChainId

func (*Chain) LatestBlock

func (c *Chain) LatestBlock() metrics.LatestBlock

func (*Chain) Name

func (c *Chain) Name() string

func (*Chain) SetState

func (c *Chain) SetState(state map[types.ChainId]core.ProposalState)

func (*Chain) Start

func (c *Chain) Start() error

func (*Chain) Stop

func (c *Chain) Stop()

Stop signals to any running routines to exit

type Config

type Config struct {
	SignMsgStartSeq         *big.Int
	VoteProposalStartSeq    *big.Int
	ExecuteProposalStartSeq *big.Int
	// contains filtered or unexported fields
}

Config encapsulates all necessary parameters in ethereum compatible forms

type Connection

type Connection interface {
	Connect() error
	Keypair() *secp256k1.Keypair
	Opts() *bind.TransactOpts
	CallOpts() *bind.CallOpts
	LockAndUpdateOpts() error
	UnlockOpts()
	Client() *sero.WrappedClient
	EnsureHasBytecode(address seroCommon.Address) error
	LatestBlock() (*big.Int, error)
	WaitForBlock(block *big.Int) error
	Close()
}

Jump to

Keyboard shortcuts

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