keeper

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// QueryOracleSetRequest This retrieves a specific validator set by it's nonce
	// used to compare what's on Ethereum with what's in Cosmos
	// to perform slashing / validation of system consistency
	QueryOracleSetRequest = "oracleSetRequest"
	// QueryOracleSetConfirmsByNonce Gets all the confirmation signatures for a given validator
	// set, used by the relayer to package the validator set and
	// it's signatures into an Ethereum transaction
	QueryOracleSetConfirmsByNonce = "oracleSetConfirms"
	// QueryLastOracleSetRequests Gets the last N (where N is currently 5) validator sets that
	// have been produced by the chain. Useful to see if any recently
	// signed requests can be submitted.
	QueryLastOracleSetRequests = "lastOracleSetRequests"
	// QueryLastPendingOracleSetRequestByAddr Gets a list of unsigned oracleSets for a given validators delegate
	// bridger address. Up to 100 are sent at a time
	QueryLastPendingOracleSetRequestByAddr = "lastPendingOracleSetRequest"

	QueryCurrentOracleSet = "currentOracleSet"
	QueryOracleSetConfirm = "oracleSetConfirm"

	// QueryGravityID used by the contract deployer script. GravityID is set in the Genesis
	// file, then read by the contract deployer and deployed to Ethereum
	// a unique GravityID ensures that even if the same validator set with
	// the same keys is running on two chains these chains can have independent
	// bridges
	QueryGravityID = "gravityID"

	// QueryBatch This retrieves a specific batch by it's nonce and token contract
	// or in the case of a Cosmos originated address it's denom
	QueryBatch = "batch"
	// QueryLastPendingBatchRequestByAddr Get the last unsigned batch (of any denom) for the validators
	// bridger to sign
	QueryLastPendingBatchRequestByAddr = "lastPendingBatchRequest"
	// QueryOutgoingTxBatches gets the last 100 outgoing batches, regardless of denom, useful
	// for a relayed to see what is available to relay
	QueryOutgoingTxBatches = "lastBatches"
	// QueryBatchConfirms Used by the relayer to package a batch with signatures required
	// to submit to Ethereum
	QueryBatchConfirms = "batchConfirms"
	// QueryBatchFees Used to query all pending SendToEth transactions and fees available for each
	// token type, a relayer can then estimate their potential profit when requesting
	// a batch
	QueryBatchFees = "batchFees"

	// QueryTokenToDenom Token mapping
	// This retrieves the denom which is represented by a given ERC20 contract
	QueryTokenToDenom = "TokenToDenom"
	// QueryDenomToToken This retrieves the ERC20 contract which represents a given denom
	QueryDenomToToken = "DenomToToken"

	// QueryPendingSendToExternal Query pending transactions
	QueryPendingSendToExternal = "PendingSendToExternal"
)
View Source
const MaxResults = 100
View Source
const OutgoingTxBatchSize = 100

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the gov MsgServer interface for the provided Keeper.

func NewMsgServerRouterImpl

func NewMsgServerRouterImpl(routerKeeper RouterKeeper) types.MsgServer

NewMsgServerRouterImpl returns an implementation of the crosschain router MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier is the module level router for state queries

Types

type EthereumMsgServer

type EthereumMsgServer struct {
	Keeper
}

func (EthereumMsgServer) AddDelegate

func (EthereumMsgServer) BondedOracle

func (EthereumMsgServer) BridgeTokenClaim

func (EthereumMsgServer) ConfirmBatch

ConfirmBatch handles MsgConfirmBatch

func (EthereumMsgServer) EditOracle

func (EthereumMsgServer) OracleSetConfirm

OracleSetConfirm handles MsgOracleSetConfirm

func (EthereumMsgServer) OracleSetUpdateClaim

OracleSetUpdateClaim handles claims for executing a oracle set update on Ethereum

func (EthereumMsgServer) RequestBatch

RequestBatch handles MsgRequestBatch

func (EthereumMsgServer) SendToExternal

SendToExternal handles MsgSendToExternal

func (EthereumMsgServer) SendToExternalClaim

SendToExternalClaim handles MsgSendToExternalClaim executed aka 'observed' and had its slashing window expire) that will never be cleaned up in the end block. This should not be a security risk as 'old' events can never execute but it does store spam in the chain.

func (EthereumMsgServer) SendToFxClaim

SendToFxClaim handles MsgSendToFxClaim executed aka 'observed' and had it's slashing window expire) that will never be cleaned up in the endblocker. This should not be a security risk as 'old' events can never execute but it does store spam in the chain.

func (EthereumMsgServer) UnbondedOracle

func (EthereumMsgServer) WithdrawReward

type Keeper

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

Keeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, moduleName string, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace,
	stakingKeeper types.StakingKeeper, distributionKeeper types.DistributionKeeper, bankKeeper types.BankKeeper,
	ibcTransferKeeper types.IBCTransferKeeper, channelKeeper types.IBCChannelKeeper, erc20Keeper types.Erc20Keeper) Keeper

NewKeeper returns a new instance of the gravity keeper

func (Keeper) AddBridgeToken

func (k Keeper) AddBridgeToken(ctx sdk.Context, token, channelIBC string) (string, error)

func (Keeper) AddOracleSetRequest

func (k Keeper) AddOracleSetRequest(ctx sdk.Context, currentOracleSet *types.OracleSet)

AddOracleSetRequest returns a new instance of the Gravity BridgeValidatorSet

func (Keeper) AddToOutgoingPool

func (k Keeper) AddToOutgoingPool(ctx sdk.Context, sender sdk.AccAddress, receiver string, amount sdk.Coin, fee sdk.Coin) (uint64, error)

AddToOutgoingPool - checks a counterpart denominator exists for the given voucher type - burns the voucher for transfer amount and fees - persists an OutgoingTx - adds the TX to the `available` TX pool via a second index

func (Keeper) AddUnbatchedTx

func (k Keeper) AddUnbatchedTx(ctx sdk.Context, outgoingTransferTx *types.OutgoingTransferTx) error

AddUnbatchedTx creates a new transaction in the pool WARNING: Do not make this function public

func (Keeper) Attest

func (k Keeper) Attest(ctx sdk.Context, claim types.ExternalClaim, anyClaim *codectypes.Any) (*types.Attestation, error)

func (Keeper) AttestationHandler

func (k Keeper) AttestationHandler(ctx sdk.Context, externalClaim types.ExternalClaim) error

AttestationHandler Handle is the entry point for Attestation processing.

func (Keeper) BatchConfirms

BatchConfirms returns the batch confirmations by nonce and token contract

func (Keeper) BatchFees

BatchFees queries the batch fees from unbatched pool

func (Keeper) BatchRequestByNonce

BatchRequestByNonce queries the BatchRequestByNonce of the bsc module

func (Keeper) BuildOutgoingTxBatch

func (k Keeper) BuildOutgoingTxBatch(ctx sdk.Context, tokenContract, feeReceive string, maxElements uint, minimumFee, baseFee sdk.Int) (*types.OutgoingTxBatch, error)

BuildOutgoingTxBatch starts the following process chain:

  • find bridged denominator for given voucher type
  • determine if a an unExecuted batch is already waiting for this token type, if so confirm the new batch would have a higher total fees. If not exit without creating a batch
  • select available transactions from the outgoing transaction pool sorted by fee desc
  • persist an outgoing batch object with an incrementing ID = nonce
  • emit an event

func (Keeper) CancelOutgoingTxBatch

func (k Keeper) CancelOutgoingTxBatch(ctx sdk.Context, tokenContract string, nonce uint64) error

CancelOutgoingTxBatch releases all TX in the batch and deletes the batch

func (Keeper) CommonSetOracleTotalPower

func (k Keeper) CommonSetOracleTotalPower(ctx sdk.Context)

func (Keeper) ConvertDenomToMany added in v2.2.1

func (k Keeper) ConvertDenomToMany(ctx sdk.Context, sender sdk.AccAddress, coin sdk.Coin) (sdk.Coin, error)

func (Keeper) CurrentOracleSet

CurrentOracleSet queries the CurrentOracleSet of the bsc module

func (Keeper) DelLastEventNonceByOracle

func (k Keeper) DelLastEventNonceByOracle(ctx sdk.Context, oracleAddr sdk.AccAddress)

DelLastEventNonceByOracle delete the latest event nonce for a given oracle

func (Keeper) DelOracle

func (k Keeper) DelOracle(ctx sdk.Context, oracle sdk.AccAddress)

func (Keeper) DelOracleByBridger

func (k Keeper) DelOracleByBridger(ctx sdk.Context, bridgerAddr sdk.AccAddress)

DelOracleByBridger delete the bridger key for a given oracle

func (Keeper) DelOracleByExternalAddress

func (k Keeper) DelOracleByExternalAddress(ctk sdk.Context, externalAddress string)

DelOracleByExternalAddress delete the external address for a give oracle

func (Keeper) DeleteAttestation

func (k Keeper) DeleteAttestation(ctx sdk.Context, att types.Attestation)

DeleteAttestation deletes an attestation given an event nonce and claim

func (Keeper) DeleteBatch

func (k Keeper) DeleteBatch(ctx sdk.Context, batch *types.OutgoingTxBatch)

DeleteBatch deletes an outgoing transaction batch

func (Keeper) DeleteOracleSet

func (k Keeper) DeleteOracleSet(ctx sdk.Context, nonce uint64)

DeleteOracleSet deletes the oracleSet at a given nonce from state

func (Keeper) GetAllBatchFees

func (k Keeper) GetAllBatchFees(ctx sdk.Context, maxElements uint, minBatchFees []types.MinBatchFee) (batchFees []*types.BatchFees)

GetAllBatchFees creates a fee entry for every batch type currently in the store this can be used by relayers to determine what batch types are desirable to request

func (Keeper) GetAllOracles

func (k Keeper) GetAllOracles(ctx sdk.Context, isOnline bool) (oracles types.Oracles)

func (Keeper) GetAttestation

func (k Keeper) GetAttestation(ctx sdk.Context, eventNonce uint64, claimHash []byte) *types.Attestation

GetAttestation return an attestation given a nonce

func (Keeper) GetAttestationMapping

func (k Keeper) GetAttestationMapping(ctx sdk.Context) (out map[uint64][]types.Attestation)

GetAttestationMapping returns a mapping of eventNonce -> attestations at that nonce

func (Keeper) GetBatchConfirm

func (k Keeper) GetBatchConfirm(ctx sdk.Context, nonce uint64, tokenContract string, oracleAddr sdk.AccAddress) *types.MsgConfirmBatch

GetBatchConfirm returns a batch confirmation given its nonce, the token contract, and a oracle address

func (Keeper) GetBatchConfirmByNonceAndTokenContract

func (k Keeper) GetBatchConfirmByNonceAndTokenContract(ctx sdk.Context, nonce uint64, tokenContract string) (out []types.MsgConfirmBatch)

GetBatchConfirmByNonceAndTokenContract returns the batch confirms

func (Keeper) GetBatchFeesByTokenType

func (k Keeper) GetBatchFeesByTokenType(ctx sdk.Context, tokenContract string, maxElements uint, baseFee sdk.Int) *types.BatchFees

GetBatchFeesByTokenType gets the fee the next batch of a given token type would have if created right now. This info is both presented to relayers for the purpose of determining when to request batches and also used by the batch creation process to decide not to create a new batch (fees must be increasing)

func (Keeper) GetBatchTimeoutHeight

func (k Keeper) GetBatchTimeoutHeight(ctx sdk.Context) uint64

GetBatchTimeoutHeight This gets the batch timeout height in External blocks.

func (Keeper) GetBridgeTokenDenom

func (k Keeper) GetBridgeTokenDenom(ctx sdk.Context, tokenContract string) *types.BridgeToken

func (Keeper) GetCurrentOracleSet

func (k Keeper) GetCurrentOracleSet(ctx sdk.Context) *types.OracleSet

GetCurrentOracleSet gets powers from the store and normalizes them into an integer percentage with a resolution of uint32 Max meaning a given validators 'gravity power' is computed as Cosmos power / total cosmos power = x / uint32 Max where x is the voting power on the gravity contract. This allows us to only use integer division which produces a known rounding error from truncation equal to the ratio of the validators Cosmos power / total cosmos power ratio, leaving us at uint32 Max - 1 total voting power. This is an acceptable rounding error since floating point may cause consensus problems if different floating point unit implementations are involved.

func (Keeper) GetDenomByBridgeToken

func (k Keeper) GetDenomByBridgeToken(ctx sdk.Context, denom string) *types.BridgeToken

func (Keeper) GetGravityID

func (k Keeper) GetGravityID(ctx sdk.Context) string

GetGravityID returns the GravityID is essentially a salt value for bridge signatures, provided each chain running Gravity has a unique ID it won't be possible to play back signatures from one bridge onto another even if they share a oracle set.

The lifecycle of the GravityID is that it is set in the Genesis file read from the live chain for the contract deployment, once a Gravity contract is deployed the GravityID CAN NOT BE CHANGED. Meaning that it can't just be the same as the chain id since the chain id may be changed many times with each successive chain in charge of the same bridge

func (Keeper) GetIbcTransferTimeoutHeight

func (k Keeper) GetIbcTransferTimeoutHeight(ctx sdk.Context) uint64

func (Keeper) GetLastEventNonceByOracle

func (k Keeper) GetLastEventNonceByOracle(ctx sdk.Context, oracleAddr sdk.AccAddress) uint64

GetLastEventNonceByOracle returns the latest event nonce for a given oracle

func (Keeper) GetLastObservedBlockHeight

func (k Keeper) GetLastObservedBlockHeight(ctx sdk.Context) types.LastObservedBlockHeight

GetLastObservedBlockHeight height gets the block height to of the last observed attestation from the store

func (Keeper) GetLastObservedEventNonce

func (k Keeper) GetLastObservedEventNonce(ctx sdk.Context) uint64

GetLastObservedEventNonce returns the latest observed event nonce

func (Keeper) GetLastObservedOracleSet

func (k Keeper) GetLastObservedOracleSet(ctx sdk.Context) *types.OracleSet

GetLastObservedOracleSet retrieves the last observed oracle set from the store WARNING: This value is not an up to date oracle set on Ethereum, it is a oracle set that AT ONE POINT was the one in the bridge on Ethereum. If you assume that it's up to date you may break the bridge

func (Keeper) GetLastOracleSlashBlockHeight

func (k Keeper) GetLastOracleSlashBlockHeight(ctx sdk.Context) uint64

GetLastOracleSlashBlockHeight returns the last proposal block height

func (Keeper) GetLastOutgoingBatchByTokenType

func (k Keeper) GetLastOutgoingBatchByTokenType(ctx sdk.Context, token string) *types.OutgoingTxBatch

GetLastOutgoingBatchByTokenType gets the latest outgoing tx batch by token type

func (Keeper) GetLastSlashedBatchBlock

func (k Keeper) GetLastSlashedBatchBlock(ctx sdk.Context) uint64

GetLastSlashedBatchBlock returns the latest slashed Batch block

func (Keeper) GetLastSlashedOracleSetNonce

func (k Keeper) GetLastSlashedOracleSetNonce(ctx sdk.Context) uint64

GetLastSlashedOracleSetNonce returns the latest slashed oracleSet nonce

func (Keeper) GetLastTotalPower

func (k Keeper) GetLastTotalPower(ctx sdk.Context) sdk.Int

GetLastTotalPower Load the last total oracle power.

func (Keeper) GetLatestOracleSet

func (k Keeper) GetLatestOracleSet(ctx sdk.Context) *types.OracleSet

GetLatestOracleSet returns the latest oracle set in state

func (Keeper) GetLatestOracleSetNonce

func (k Keeper) GetLatestOracleSetNonce(ctx sdk.Context) uint64

GetLatestOracleSetNonce returns the latest oracleSet nonce

func (Keeper) GetOracle

func (k Keeper) GetOracle(ctx sdk.Context, addr sdk.AccAddress) (oracle types.Oracle, found bool)

GetOracle get Oracle data

func (Keeper) GetOracleAddressByBridgerKey

func (k Keeper) GetOracleAddressByBridgerKey(ctx sdk.Context, bridgerAddr sdk.AccAddress) (sdk.AccAddress, bool)

GetOracleAddressByBridgerKey returns the oracle key associated with an bridger key

func (Keeper) GetOracleByExternalAddress

func (k Keeper) GetOracleByExternalAddress(ctx sdk.Context, externalAddress string) (sdk.AccAddress, bool)

GetOracleByExternalAddress returns the external address for a given gravity oracle

func (Keeper) GetOracleDelegateMultiple

func (k Keeper) GetOracleDelegateMultiple(ctx sdk.Context) int64

func (Keeper) GetOracleDelegateThreshold

func (k Keeper) GetOracleDelegateThreshold(ctx sdk.Context) sdk.Coin

func (Keeper) GetOracleSet

func (k Keeper) GetOracleSet(ctx sdk.Context, nonce uint64) *types.OracleSet

GetOracleSet returns a oracleSet by nonce

func (Keeper) GetOracleSetConfirm

func (k Keeper) GetOracleSetConfirm(ctx sdk.Context, nonce uint64, oracleAddr sdk.AccAddress) *types.MsgOracleSetConfirm

GetOracleSetConfirm returns a oracleSet confirmation by a nonce and external address

func (Keeper) GetOracleSetConfirms

func (k Keeper) GetOracleSetConfirms(ctx sdk.Context, nonce uint64) (confirms []*types.MsgOracleSetConfirm)

GetOracleSetConfirms returns all oracle set confirmations by nonce

func (Keeper) GetOracleSetUpdatePowerChangePercent

func (k Keeper) GetOracleSetUpdatePowerChangePercent(ctx sdk.Context) sdk.Dec

func (Keeper) GetOracleSets

func (k Keeper) GetOracleSets(ctx sdk.Context) (out []*types.OracleSet)

GetOracleSets returns all the oracle sets in state

func (Keeper) GetOutgoingTxBatch

func (k Keeper) GetOutgoingTxBatch(ctx sdk.Context, tokenContract string, nonce uint64) *types.OutgoingTxBatch

GetOutgoingTxBatch loads a batch object. Returns nil when not exists.

func (Keeper) GetOutgoingTxBatches

func (k Keeper) GetOutgoingTxBatches(ctx sdk.Context) (out []*types.OutgoingTxBatch)

GetOutgoingTxBatches returns the outgoing tx batches

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the parameters from the store

func (Keeper) GetPastExternalSignatureCheckpoint

func (k Keeper) GetPastExternalSignatureCheckpoint(ctx sdk.Context, checkpoint []byte) (found bool)

GetPastExternalSignatureCheckpoint tells you whether a given checkpoint has ever existed

func (Keeper) GetProposalOracle

func (k Keeper) GetProposalOracle(ctx sdk.Context) (proposalOracle types.ProposalOracle, found bool)

func (Keeper) GetSignedWindow

func (k Keeper) GetSignedWindow(ctx sdk.Context) uint64

func (Keeper) GetSlashFraction

func (k Keeper) GetSlashFraction(ctx sdk.Context) sdk.Dec

func (Keeper) GetUnSlashedBatches

func (k Keeper) GetUnSlashedBatches(ctx sdk.Context, maxHeight uint64) (outgoingTxBatches types.OutgoingTxBatches)

GetUnSlashedBatches returns all the unSlashed batches in state

func (Keeper) GetUnSlashedOracleSets

func (k Keeper) GetUnSlashedOracleSets(ctx sdk.Context, maxHeight uint64) (oracleSets types.OracleSets)

GetUnSlashedOracleSets returns all the unSlashed oracle sets in state

func (Keeper) GetUnbatchedTransactions

func (k Keeper) GetUnbatchedTransactions(ctx sdk.Context) []*types.OutgoingTransferTx

GetUnbatchedTransactions grabs all transactions from the tx pool, useful for queries or genesis save/load

func (Keeper) GetUnbatchedTransactionsByContract

func (k Keeper) GetUnbatchedTransactionsByContract(ctx sdk.Context, tokenContract string) []*types.OutgoingTransferTx

GetUnbatchedTransactionsByContract grabs all unbatched transactions from the tx pool for the given contract unbatched transactions are sorted by fee amount in DESC order

func (Keeper) GetUnbatchedTxByFeeAndId

func (k Keeper) GetUnbatchedTxByFeeAndId(ctx sdk.Context, fee types.ERC20Token, txID uint64) (*types.OutgoingTransferTx, error)

GetUnbatchedTxByFeeAndId grabs a tx from the pool given its fee and txID

func (Keeper) GetUnbatchedTxById

func (k Keeper) GetUnbatchedTxById(ctx sdk.Context, txID uint64) (*types.OutgoingTransferTx, error)

GetUnbatchedTxById grabs a tx from the pool given only the txID note that due to the way unbatched txs are indexed, the GetUnbatchedTxByFeeAndId method is much faster

func (Keeper) HasOracle

func (k Keeper) HasOracle(ctx sdk.Context, addr sdk.AccAddress) (found bool)

func (Keeper) HasOracleSetRequest

func (k Keeper) HasOracleSetRequest(ctx sdk.Context, nonce uint64) bool

HasOracleSetRequest returns true if a oracleSet defined by a nonce exists

func (Keeper) IsProposalOracle

func (k Keeper) IsProposalOracle(ctx sdk.Context, oracleAddr string) bool

func (Keeper) IterateAttestations

func (k Keeper) IterateAttestations(ctx sdk.Context, cb func([]byte, types.Attestation) bool)

IterateAttestations iterates through all attestations

func (Keeper) IterateBatchBySlashedBatchBlock

func (k Keeper) IterateBatchBySlashedBatchBlock(ctx sdk.Context, lastSlashedBatchBlock uint64, maxHeight uint64, cb func([]byte, *types.OutgoingTxBatch) bool)

IterateBatchBySlashedBatchBlock iterates through all Batch by last slashed Batch block in ASC order

func (Keeper) IterateBatchConfirmByNonceAndTokenContract

func (k Keeper) IterateBatchConfirmByNonceAndTokenContract(ctx sdk.Context, nonce uint64, tokenContract string, cb func([]byte, types.MsgConfirmBatch) bool)

IterateBatchConfirmByNonceAndTokenContract iterates through all batch confirmations MARK finish-batches: this is where the key is iterated in the old (presumed working) code

func (Keeper) IterateBridgeTokenToDenom

func (k Keeper) IterateBridgeTokenToDenom(ctx sdk.Context, cb func([]byte, *types.BridgeToken) bool)

IterateBridgeTokenToDenom iterates over token to denom relations

func (Keeper) IterateOracle

func (k Keeper) IterateOracle(ctx sdk.Context, cb func(oracle types.Oracle) bool)

func (Keeper) IterateOracleSetBySlashedOracleSetNonce

func (k Keeper) IterateOracleSetBySlashedOracleSetNonce(ctx sdk.Context, lastSlashedOracleSetNonce uint64, maxHeight uint64, cb func([]byte, *types.OracleSet) bool)

IterateOracleSetBySlashedOracleSetNonce iterates through all oracleSet by last slashed oracleSet nonce in ASC order

func (Keeper) IterateOracleSetConfirmByNonce

func (k Keeper) IterateOracleSetConfirmByNonce(ctx sdk.Context, nonce uint64, cb func([]byte, types.MsgOracleSetConfirm) bool)

IterateOracleSetConfirmByNonce iterates through all oracleSet confirms by nonce in ASC order MARK finish-batches: this is where the key is iterated in the old (presumed working) code

func (Keeper) IterateOracleSets

func (k Keeper) IterateOracleSets(ctx sdk.Context, cb func(key []byte, val *types.OracleSet) bool)

IterateOracleSets returns all oracleSetRequests

func (Keeper) IterateOutgoingTxBatches

func (k Keeper) IterateOutgoingTxBatches(ctx sdk.Context, cb func(key []byte, batch *types.OutgoingTxBatch) bool)

IterateOutgoingTxBatches iterates through all outgoing batches in DESC order.

func (Keeper) IterateUnbatchedTransactions

func (k Keeper) IterateUnbatchedTransactions(ctx sdk.Context, prefixKey []byte, cb func(key []byte, tx *types.OutgoingTransferTx) bool)

IterateUnbatchedTransactions iterates through all unbatched transactions whose keys begin with prefixKey in DESC order

func (Keeper) IterateUnbatchedTransactionsByContract

func (k Keeper) IterateUnbatchedTransactionsByContract(ctx sdk.Context, tokenContract string, cb func(key []byte, tx *types.OutgoingTransferTx) bool)

IterateUnbatchedTransactionsByContract iterates through unbatched transactions from the tx pool for the given contract unbatched transactions are sorted by fee amount in DESC order

func (Keeper) LastEventNonceByAddr

LastEventNonceByAddr returns the last event nonce for the given validator address, this allows eth oracles to figure out where they left off

func (Keeper) LastOracleSetRequests

LastOracleSetRequests queries the LastOracleSetRequests of the bsc module

func (Keeper) LastPendingBatchRequestByAddr

LastPendingBatchRequestByAddr queries the LastPendingBatchRequestByAddr of the bsc module

func (Keeper) LastPendingOracleSetRequestByAddr

LastPendingOracleSetRequestByAddr queries the LastPendingOracleSetRequestByAddr of the bsc module

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) OracleSetConfirm

OracleSetConfirm queries the OracleSetConfirm of the bsc module

func (Keeper) OracleSetConfirmsByNonce

OracleSetConfirmsByNonce queries the OracleSetConfirmsByNonce of the bsc module

func (Keeper) OracleSetRequest

OracleSetRequest queries the OracleSetRequest of the bsc module

func (Keeper) OutgoingTxBatchExecuted

func (k Keeper) OutgoingTxBatchExecuted(ctx sdk.Context, tokenContract string, nonce uint64)

OutgoingTxBatchExecuted is run when the Cosmos chain detects that a batch has been executed on Ethereum It frees all the transactions in the batch, then cancels all earlier batches

func (Keeper) OutgoingTxBatches

OutgoingTxBatches queries the OutgoingTxBatches of the bsc module

func (Keeper) Params

Params queries the params of the bsc module

func (Keeper) RemoveFromOutgoingPoolAndRefund

func (k Keeper) RemoveFromOutgoingPoolAndRefund(ctx sdk.Context, txId uint64, sender sdk.AccAddress) error

RemoveFromOutgoingPoolAndRefund - checks that the provided tx actually exists - deletes the unbatched tx from the pool - issues the tokens back to the sender

func (Keeper) SetAttestation

func (k Keeper) SetAttestation(ctx sdk.Context, eventNonce uint64, claimHash []byte, att *types.Attestation)

SetAttestation sets the attestation in the store

func (Keeper) SetBatchConfirm

func (k Keeper) SetBatchConfirm(ctx sdk.Context, oracleAddr sdk.AccAddress, batch *types.MsgConfirmBatch)

SetBatchConfirm sets a batch confirmation by a oracle

func (Keeper) SetLastEventNonceByOracle

func (k Keeper) SetLastEventNonceByOracle(ctx sdk.Context, oracleAddr sdk.AccAddress, nonce uint64)

SetLastEventNonceByOracle sets the latest event nonce for a give oracle

func (Keeper) SetLastObservedBlockHeight

func (k Keeper) SetLastObservedBlockHeight(ctx sdk.Context, externalBlockHeight, blockHeight uint64)

SetLastObservedBlockHeight sets the block height in the store.

func (Keeper) SetLastObservedEventNonce

func (k Keeper) SetLastObservedEventNonce(ctx sdk.Context, nonce uint64)

SetLastObservedEventNonce sets the latest observed event nonce

func (Keeper) SetLastObservedOracleSet

func (k Keeper) SetLastObservedOracleSet(ctx sdk.Context, oracleSet types.OracleSet)

SetLastObservedOracleSet updates the last observed oracle set in the store

func (Keeper) SetLastOracleSlashBlockHeight

func (k Keeper) SetLastOracleSlashBlockHeight(ctx sdk.Context, blockHeight uint64)

SetLastOracleSlashBlockHeight sets the last proposal block height

func (Keeper) SetLastSlashedBatchBlock

func (k Keeper) SetLastSlashedBatchBlock(ctx sdk.Context, blockHeight uint64)

SetLastSlashedBatchBlock sets the latest slashed Batch block height

func (Keeper) SetLastSlashedOracleSetNonce

func (k Keeper) SetLastSlashedOracleSetNonce(ctx sdk.Context, nonce uint64)

SetLastSlashedOracleSetNonce sets the latest slashed oracleSet nonce

func (Keeper) SetLatestOracleSetNonce

func (k Keeper) SetLatestOracleSetNonce(ctx sdk.Context, nonce uint64)

SetLatestOracleSetNonce sets the latest oracleSet nonce

func (Keeper) SetOracle

func (k Keeper) SetOracle(ctx sdk.Context, oracle types.Oracle)

SetOracle save Oracle data

func (Keeper) SetOracleByBridger

func (k Keeper) SetOracleByBridger(ctx sdk.Context, bridgerAddr, oracleAddr sdk.AccAddress)

SetOracleByBridger sets the bridger key for a given oracle

func (Keeper) SetOracleByExternalAddress

func (k Keeper) SetOracleByExternalAddress(ctx sdk.Context, externalAddress string, oracleAddr sdk.AccAddress)

SetOracleByExternalAddress sets the external address for a given oracle

func (Keeper) SetOracleSetConfirm

func (k Keeper) SetOracleSetConfirm(ctx sdk.Context, oracleAddr sdk.AccAddress, oracleSetConfirm *types.MsgOracleSetConfirm)

SetOracleSetConfirm sets a oracleSet confirmation

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, ps *types.Params)

SetParams sets the parameters in the store

func (Keeper) SetPastExternalSignatureCheckpoint

func (k Keeper) SetPastExternalSignatureCheckpoint(ctx sdk.Context, checkpoint []byte)

SetPastExternalSignatureCheckpoint puts the checkpoint of a valset, batch, or logic call into a set in order to prove later that it existed at one point.

func (Keeper) SetProposalOracle

func (k Keeper) SetProposalOracle(ctx sdk.Context, proposalOracle *types.ProposalOracle)

func (Keeper) SlashOracle

func (k Keeper) SlashOracle(ctx sdk.Context, oracleAddrStr string)

func (Keeper) StoreBatch

func (k Keeper) StoreBatch(ctx sdk.Context, batch *types.OutgoingTxBatch) error

StoreBatch stores a transaction batch

func (Keeper) StoreOracleSet

func (k Keeper) StoreOracleSet(ctx sdk.Context, oracleSet *types.OracleSet)

StoreOracleSet is for storing a oracle set at a given height

func (Keeper) TransferAfter

func (k Keeper) TransferAfter(ctx sdk.Context, sender, receive string, amount, fee sdk.Coin) error

TransferAfter Hook operation after transfer transaction triggered by IBC module

func (Keeper) TryAttestation

func (k Keeper) TryAttestation(ctx sdk.Context, att *types.Attestation)

TryAttestation checks if an attestation has enough votes to be applied to the consensus state and has not already been marked Observed, then calls processAttestation to actually apply it to the state, and then marks it Observed and emits an event.

func (Keeper) UnbondedOracle

func (k Keeper) UnbondedOracle(ctx sdk.Context, oracle types.Oracle) error

func (Keeper) UnpackAttestationClaim

func (k Keeper) UnpackAttestationClaim(att *types.Attestation) (types.ExternalClaim, error)

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper, sk v020.StakingKeeper, bk v020.BankKeeper, legacyAmino *codec.LegacyAmino, paramsKey sdk.StoreKey) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from version 1 to 2.

type ModuleHandler

type ModuleHandler struct {
	QueryServer types.QueryServer
	MsgServer   types.MsgServer
}

type MultiSigUpdateResponse

type MultiSigUpdateResponse struct {
	OracleSet  types.OracleSet `json:"oracleSet"`
	Signatures [][]byte        `json:"signatures,omitempty"`
}

type Router

type Router interface {
	AddRoute(r string, moduleHandler *ModuleHandler) (rtr Router)
	HasRoute(r string) bool
	GetRoute(path string) (moduleHandler *ModuleHandler)
	Seal()
}

Router implements a cross chain EthereumMsgServer Handler router.

func NewRouter

func NewRouter() Router

NewRouter creates a new Router interface instance

type RouterKeeper

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

RouterKeeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine

func NewRouterKeeper

func NewRouterKeeper(rtr Router) RouterKeeper

NewRouterKeeper returns a new instance of the cross chain keeper

func (RouterKeeper) BatchConfirms

BatchConfirms returns the batch confirmations by nonce and token contract

func (RouterKeeper) BatchFees

BatchFees queries the batch fees from unbatched pool

func (RouterKeeper) BatchRequestByNonce

BatchRequestByNonce queries the BatchRequestByNonce of the bsc module

func (RouterKeeper) CurrentOracleSet

CurrentOracleSet queries the CurrentOracleSet of the bsc module

func (RouterKeeper) GetOracleByAddr

func (RouterKeeper) LastEventNonceByAddr

LastEventNonceByAddr returns the last event nonce for the given validator address, this allows eth oracles to figure out where they left off

func (RouterKeeper) LastOracleSetRequests

LastOracleSetRequests queries the LastOracleSetRequests of the bsc module

func (RouterKeeper) LastPendingBatchRequestByAddr

LastPendingBatchRequestByAddr queries the LastPendingBatchRequestByAddr of the bsc module

func (RouterKeeper) LastPendingOracleSetRequestByAddr

LastPendingOracleSetRequestByAddr queries the LastPendingOracleSetRequestByAddr of the bsc module

func (RouterKeeper) Logger

func (k RouterKeeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (RouterKeeper) OracleSetConfirm

OracleSetConfirm queries the OracleSetConfirm of the bsc module

func (RouterKeeper) OracleSetConfirmsByNonce

OracleSetConfirmsByNonce queries the OracleSetConfirmsByNonce of the bsc module

func (RouterKeeper) OracleSetRequest

OracleSetRequest queries the OracleSetRequest of the bsc module

func (RouterKeeper) Oracles

func (RouterKeeper) OutgoingTxBatches

OutgoingTxBatches queries the OutgoingTxBatches of the bsc module

func (RouterKeeper) Params

Params queries the params of the bsc module

func (RouterKeeper) Router

func (k RouterKeeper) Router() Router

Router returns the gov Keeper's Router

Jump to

Keyboard shortcuts

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