erc20multisig

package
v0.78.8 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: AGPL-3.0 Imports: 22 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 EVMTopologies added in v0.76.0

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

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

func NewEVMTopologies added in v0.76.0

func NewEVMTopologies(
	secondBridge *Topology,
) *EVMTopologies

func (*EVMTopologies) GetState added in v0.76.0

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

func (*EVMTopologies) Keys added in v0.76.0

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

func (*EVMTopologies) LoadState added in v0.76.0

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

func (*EVMTopologies) Namespace added in v0.76.0

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

func (*EVMTopologies) OnStateLoaded added in v0.76.0

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

func (*EVMTopologies) Stopped added in v0.76.0

func (t *EVMTopologies) Stopped() bool

type EthConfirmations

type EthConfirmations interface {
	Check(uint64) error
}

type EthereumClient

type EthereumClient interface {
	bind.ContractFilterer
}

type EthereumEventSource

type EthereumEventSource interface {
	UpdateContractBlock(string, string, uint64)
}

type MultiSigOnChainVerifier

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

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) GetMultiSigAddress added in v0.77.0

func (o *OnChainVerifier) GetMultiSigAddress() string

func (*OnChainVerifier) UpdateMultiSigAddress

func (o *OnChainVerifier) UpdateMultiSigAddress(multiSigAddress ethcmn.Address, chainID string)

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,
	scope string,
) *Topology

func NewTopology

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

func (*Topology) ChainID added in v0.76.0

func (t *Topology) ChainID() string

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) 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) SetChainID added in v0.76.0

func (t *Topology) SetChainID(chainID string)

SetChainID sets the chainID of the EVM chain this multisig tracker belongs to.

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