keeper

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_halo_registry_keeper_registry_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	emitPortal ptypes.EmitPortal,
	storeService store.KVStoreService,
	ethCl ethclient.Client,
	namer types.ChainNameFunc,
) (Keeper, error)

func (Keeper) Addresses

func (k Keeper) Addresses() []common.Address

func (Keeper) ConfLevels

func (k Keeper) ConfLevels(ctx context.Context) (map[uint64][]xchain.ConfLevel, error)

func (Keeper) Deliver

func (k Keeper) Deliver(ctx context.Context, _ common.Hash, elog evmenginetypes.EVMEvent) error

Deliver processes a omni portal registry events.

func (Keeper) Name

func (Keeper) Name() string

func (Keeper) Network

func (Keeper) Prepare

func (k Keeper) Prepare(ctx context.Context, blockHash common.Hash) ([]evmenginetypes.EVMEvent, error)

Prepare returns all omni portal registry contract EVM event logs from the provided block hash.

func (Keeper) SupportedChain

func (k Keeper) SupportedChain(ctx context.Context, chainID uint64) (bool, error)

type Network

type Network struct {
	Id            uint64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`                                            // Auto-incremented ID
	CreatedHeight uint64    `protobuf:"varint,2,opt,name=created_height,json=createdHeight,proto3" json:"created_height,omitempty"` // Height this network was created at
	Portals       []*Portal `protobuf:"bytes,3,rep,name=portals,proto3" json:"portals,omitempty"`                                   // Supported portals by source chain.
	// contains filtered or unexported fields
}

Network defines an instance of the cross-chain network configuration including supported chains, portals, and shards.

func (*Network) Descriptor deprecated

func (*Network) Descriptor() ([]byte, []int)

Deprecated: Use Network.ProtoReflect.Descriptor instead.

func (*Network) GetCreatedHeight

func (x *Network) GetCreatedHeight() uint64

func (*Network) GetId

func (x *Network) GetId() uint64

func (*Network) GetPortals

func (x *Network) GetPortals() []*Portal

func (*Network) ProtoMessage

func (*Network) ProtoMessage()

func (*Network) ProtoReflect

func (x *Network) ProtoReflect() protoreflect.Message

func (*Network) Reset

func (x *Network) Reset()

func (*Network) String

func (x *Network) String() string

type NetworkIdIndexKey

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

func (NetworkIdIndexKey) WithId

func (this NetworkIdIndexKey) WithId(id uint64) NetworkIdIndexKey

type NetworkIndexKey

type NetworkIndexKey interface {
	// contains filtered or unexported methods
}

type NetworkIterator

type NetworkIterator struct {
	ormtable.Iterator
}

func (NetworkIterator) Value

func (i NetworkIterator) Value() (*Network, error)

type NetworkPrimaryKey

type NetworkPrimaryKey = NetworkIdIndexKey

primary key starting index..

type NetworkTable

type NetworkTable interface {
	Insert(ctx context.Context, network *Network) error
	InsertReturningId(ctx context.Context, network *Network) (uint64, error)
	LastInsertedSequence(ctx context.Context) (uint64, error)
	Update(ctx context.Context, network *Network) error
	Save(ctx context.Context, network *Network) error
	Delete(ctx context.Context, network *Network) error
	Has(ctx context.Context, id uint64) (found bool, err error)
	// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
	Get(ctx context.Context, id uint64) (*Network, error)
	List(ctx context.Context, prefixKey NetworkIndexKey, opts ...ormlist.Option) (NetworkIterator, error)
	ListRange(ctx context.Context, from, to NetworkIndexKey, opts ...ormlist.Option) (NetworkIterator, error)
	DeleteBy(ctx context.Context, prefixKey NetworkIndexKey) error
	DeleteRange(ctx context.Context, from, to NetworkIndexKey) error
	// contains filtered or unexported methods
}

func NewNetworkTable

func NewNetworkTable(db ormtable.Schema) (NetworkTable, error)

type Portal

type Portal struct {
	ChainId        uint64   `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`                      // Chain ID as per https://chainlist.org/
	Address        []byte   `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`                                      // Portal contract address
	DeployHeight   uint64   `protobuf:"varint,3,opt,name=deploy_height,json=deployHeight,proto3" json:"deploy_height,omitempty"`       // Height this portal contract was deployed at
	ShardIds       []uint64 `protobuf:"varint,4,rep,packed,name=shard_ids,json=shardIds,proto3" json:"shard_ids,omitempty"`            // Shard IDs supported by this portal
	AttestInterval uint64   `protobuf:"varint,5,opt,name=attest_interval,json=attestInterval,proto3" json:"attest_interval,omitempty"` // The interval, in blocks, at which validators must attest, even if empty
	BlockPeriodNs  uint64   `protobuf:"varint,6,opt,name=block_period_ns,json=blockPeriodNs,proto3" json:"block_period_ns,omitempty"`  // The block period of the chain deployed to, in nanoseconds.
	Name           string   `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"`                                            // The name of the chain deployed to (ex "omni_evm", "ethereum")
	// contains filtered or unexported fields
}

func (*Portal) Descriptor deprecated

func (*Portal) Descriptor() ([]byte, []int)

Deprecated: Use Portal.ProtoReflect.Descriptor instead.

func (*Portal) GetAddress

func (x *Portal) GetAddress() []byte

func (*Portal) GetAttestInterval

func (x *Portal) GetAttestInterval() uint64

func (*Portal) GetBlockPeriodNs

func (x *Portal) GetBlockPeriodNs() uint64

func (*Portal) GetChainId

func (x *Portal) GetChainId() uint64

func (*Portal) GetDeployHeight

func (x *Portal) GetDeployHeight() uint64

func (*Portal) GetName

func (x *Portal) GetName() string

func (*Portal) GetShardIds

func (x *Portal) GetShardIds() []uint64

func (*Portal) ProtoMessage

func (*Portal) ProtoMessage()

func (*Portal) ProtoReflect

func (x *Portal) ProtoReflect() protoreflect.Message

func (*Portal) Reset

func (x *Portal) Reset()

func (*Portal) String

func (x *Portal) String() string

func (*Portal) Verify

func (p *Portal) Verify() error

type RegistryStore

type RegistryStore interface {
	NetworkTable() NetworkTable
	// contains filtered or unexported methods
}

func NewRegistryStore

func NewRegistryStore(db ormtable.Schema) (RegistryStore, error)

Jump to

Keyboard shortcuts

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