erc20multisig

package
v0.73.0-preview.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSignerEventFound       = errors.New("no signer event found")
	ErrNoThresholdSetEventFound = errors.New("no threshold set event found")
	ErrUnsupportedSignerEvent   = errors.New("unsupported signer event")
)
View Source
var (
	ErrDuplicatedSignerEvent    = errors.New("duplicated signer event")
	ErrDuplicatedThresholdEvent = errors.New("duplicated threshold event")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// logging level
	Level encoding.LogLevel `long:"log-level"`
}

Config represents governance specific configuration.

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig creates an instance of the package specific configuration.

type EthConfirmations

type EthConfirmations interface {
	Check(uint64) error
}

type EthereumClient

type EthereumClient interface {
	bind.ContractFilterer
}

type EthereumEventSource

type EthereumEventSource interface {
	UpdateMultisigControlStartingBlock(uint64)
}

type MultiSigOnChainVerifier

type MultiSigOnChainVerifier interface {
	CheckSignerEvent(*types.SignerEvent) error
	CheckThresholdSetEvent(*types.SignerThresholdSetEvent) error
}

type OnChainVerifier

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

func NewOnChainVerifier

func NewOnChainVerifier(
	config Config,
	log *logging.Logger,
	ethClient EthereumClient,
	ethConfirmations EthConfirmations,
) *OnChainVerifier

func (*OnChainVerifier) CheckSignerEvent

func (o *OnChainVerifier) CheckSignerEvent(event *types.SignerEvent) error

func (*OnChainVerifier) CheckThresholdSetEvent

func (o *OnChainVerifier) CheckThresholdSetEvent(
	event *types.SignerThresholdSetEvent,
) error

func (*OnChainVerifier) UpdateMultiSigAddress

func (o *OnChainVerifier) UpdateMultiSigAddress(multiSigAddress ethcmn.Address)

type Topology

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

Topology keeps track of all the validators registered in the erc20 bridge.

func NewERC20MultisigTopology

func NewERC20MultisigTopology(
	config Config,
	log *logging.Logger,
	witness Witness,
	broker broker.Interface,
	ethClient EthereumClient,
	ethConfirmation EthConfirmations,
	netp *netparams.Store,
) *Topology

func NewTopology

func NewTopology(
	config Config,
	log *logging.Logger,
	witness Witness,
	ocv MultiSigOnChainVerifier,
	broker broker.Interface,
) *Topology

func (*Topology) Checkpoint

func (t *Topology) Checkpoint() ([]byte, error)

func (*Topology) ExcessSigners

func (t *Topology) ExcessSigners(addresses []string) bool

func (*Topology) GetSigners

func (t *Topology) GetSigners() []string

func (*Topology) GetState

func (t *Topology) GetState(k string) ([]byte, []types.StateProvider, error)

func (*Topology) GetThreshold

func (t *Topology) GetThreshold() uint32

func (*Topology) IsSigner

func (t *Topology) IsSigner(address string) bool

func (*Topology) Keys

func (t *Topology) Keys() []string

func (*Topology) Load

func (t *Topology) Load(ctx context.Context, data []byte) error

func (*Topology) LoadState

func (t *Topology) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)

func (*Topology) Name

func (t *Topology) Name() types.CheckpointName

func (*Topology) Namespace

func (t *Topology) Namespace() types.SnapshotNamespace

func (*Topology) OnStateLoaded

func (t *Topology) OnStateLoaded(ctx context.Context) error

func (*Topology) OnTick

func (t *Topology) OnTick(ctx context.Context, ct time.Time)

func (*Topology) ProcessSignerEvent

func (t *Topology) ProcessSignerEvent(event *types.SignerEvent) error

func (*Topology) ProcessThresholdEvent

func (t *Topology) ProcessThresholdEvent(event *types.SignerThresholdSetEvent) error

func (*Topology) SetEthereumEventSource

func (t *Topology) SetEthereumEventSource(e EthereumEventSource)

func (*Topology) SetWitness

func (t *Topology) SetWitness(w Witness)

func (*Topology) Stopped

func (t *Topology) Stopped() bool

type Witness

type Witness interface {
	StartCheck(validators.Resource, func(interface{}, bool), time.Time) error
	RestoreResource(validators.Resource, func(interface{}, bool)) error
}

Witness provide foreign chain resources validations.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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