Documentation ¶
Index ¶
- Constants
- Variables
- func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState
- func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(keeper Keeper) sdk.Querier
- type AttestationHandler
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.AccAddress, _ sdk.AccAddress)
- func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.AccAddress, _ sdk.AccAddress)
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.AccAddress)
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.AccAddress, valAddr sdk.AccAddress)
- func (h Hooks) BeforeDelegationCreated(_ sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.AccAddress)
- func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
- func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.AccAddress)
- func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.AccAddress, fraction sdk.Dec)
- type Keeper
- func (k Keeper) AddToOutgoingPool(ctx sdk.Context, sender sdk.AccAddress, counterpartReceiver string, ...) (uint64, error)
- func (k Keeper) Attest(ctx sdk.Context, claim types.EthereumClaim) (*types.Attestation, error)
- func (k Keeper) BatchConfirms(c context.Context, req *types.QueryBatchConfirmsRequest) (*types.QueryBatchConfirmsResponse, error)
- func (k Keeper) BatchFees(c context.Context, req *types.QueryBatchFeeRequest) (*types.QueryBatchFeeResponse, error)
- func (k Keeper) BatchRequestByNonce(c context.Context, req *types.QueryBatchRequestByNonceRequest) (*types.QueryBatchRequestByNonceResponse, error)
- func (k Keeper) BuildOutgoingTXBatch(ctx sdk.Context, contractAddress string, maxElements int, tokenType uint64, ...) (*types.OutgoingTxBatch, error)
- func (k Keeper) CancelOutgoingTXBatch(ctx sdk.Context, tokenContract string, nonce uint64) error
- func (k Keeper) CurrentValset(c context.Context, req *types.QueryCurrentValsetRequest) (*types.QueryCurrentValsetResponse, error)
- func (k Keeper) DeleteAttestation(ctx sdk.Context, eventNonce uint64, claimHash []byte, att *types.Attestation)
- func (k Keeper) DeleteBatch(ctx sdk.Context, batch types.OutgoingTxBatch)
- func (k Keeper) DeleteValset(ctx sdk.Context, nonce uint64)
- func (k Keeper) DenomToERC20(c context.Context, req *types.QueryDenomToERC20Request) (*types.QueryDenomToERC20Response, error)
- func (k Keeper) DenomToERC20Lookup(ctx sdk.Context, denom string) (bool, string, error)
- func (k Keeper) DenomToERC721Lookup(ctx sdk.Context, denom string) (bool, string, error)
- func (k Keeper) ERC20ToDenom(c context.Context, req *types.QueryERC20ToDenomRequest) (*types.QueryERC20ToDenomResponse, error)
- func (k Keeper) ERC20ToDenomLookup(ctx sdk.Context, tokenContract string) (bool, string)
- func (k Keeper) ERC721ToDenomLookup(ctx sdk.Context, tokenContract string) (bool, string)
- func (k Keeper) GetAllBatchFees(ctx sdk.Context) (batchFees []*types.BatchFees)
- func (k Keeper) GetAllGravityIDs(ctx sdk.Context) (ids []string)
- func (k Keeper) GetAttestation(ctx sdk.Context, eventNonce uint64, claimHash []byte) *types.Attestation
- func (k Keeper) GetAttestationClaim(att *types.Attestation) (types.EthereumClaim, error)
- func (k Keeper) GetAttestationMapping(ctx sdk.Context) (out map[uint64][]types.Attestation)
- func (k Keeper) GetBatchConfirmByNonceAndTokenContractWithGID(ctx sdk.Context, nonce uint64, tokenContract string) (out []types.MsgConfirmBatch)
- func (k Keeper) GetBatchConfirmWithGID(ctx sdk.Context, nonce uint64, tokenContract string, validator sdk.AccAddress) *types.MsgConfirmBatch
- func (k Keeper) GetBatchFeesByTokenType(ctx sdk.Context, tokenContractAddr string) *types.BatchFees
- func (k Keeper) GetCurrentValset(ctx sdk.Context) *types.Valset
- func (k Keeper) GetDelegateKeyByEth(c context.Context, req *types.QueryDelegateKeysByEthAddress) (*types.QueryDelegateKeysByEthAddressResponse, error)
- func (k Keeper) GetDelegateKeyByOrchestrator(c context.Context, req *types.QueryDelegateKeysByOrchestratorAddress) (*types.QueryDelegateKeysByOrchestratorAddressResponse, error)
- func (k Keeper) GetDelegateKeyByValidator(c context.Context, req *types.QueryDelegateKeysByValidatorAddress) (*types.QueryDelegateKeysByValidatorAddressResponse, error)
- func (k Keeper) GetDelegateKeys(ctx sdk.Context) []*types.MsgSetOrchestratorAddress
- func (k Keeper) GetLastEventNonceByValidator(ctx sdk.Context, validator sdk.AccAddress) uint64
- func (k Keeper) GetLastObservedEthereumBlockHeight(ctx sdk.Context) types.LastObservedEthereumBlockHeight
- func (k Keeper) GetLastObservedEventNonceWithGid(ctx sdk.Context) uint64
- func (k Keeper) GetLastOutgoingBatchByTokenType(ctx sdk.Context, token string) *types.OutgoingTxBatch
- func (k Keeper) GetLastUnBondingBlockHeight(ctx sdk.Context) uint64
- func (k Keeper) GetLastValsetConfirmNonce(ctx sdk.Context) uint64
- func (k Keeper) GetLatestValset(ctx sdk.Context) (out *types.Valset)
- func (k Keeper) GetLatestValsetNonce(ctx sdk.Context) uint64
- func (k Keeper) GetMapedERC721Token(ctx sdk.Context, wrc721 string) (string, bool)
- func (k Keeper) GetMapedEthToken(ctx sdk.Context, wrc20 string) (string, bool)
- func (k Keeper) GetMapedWRC721Token(ctx sdk.Context, erc721 string) (string, bool)
- func (k Keeper) GetMapedWlkToken(ctx sdk.Context, erc20 string) (string, bool)
- func (k Keeper) GetOutgoingTXBatch(ctx sdk.Context, tokenContract string, nonce uint64) *types.OutgoingTxBatch
- func (k Keeper) GetOutgoingTxBatches(ctx sdk.Context) (out []*types.OutgoingTxBatch)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPendingSendToEth(c context.Context, req *types.QueryPendingSendToEth) (*types.QueryPendingSendToEthResponse, error)
- func (k Keeper) GetPoolTransactions(ctx sdk.Context) []*types.OutgoingTransferTx
- func (k Keeper) GetRequestBatch(ctx sdk.Context, tokenContract string, nonce uint64) *types.RequestBatch
- func (k Keeper) GetTokenMetaData(ctx sdk.Context, contract string) types.MetaData
- func (k Keeper) GetUnbondingvalidators(unbondingVals []byte) []sdk.AccAddress
- func (k Keeper) GetValset(ctx sdk.Context, nonce uint64) *types.Valset
- func (k Keeper) GetValsetConfirmByGID(ctx sdk.Context, nonce uint64, validator sdk.AccAddress) *types.MsgValsetConfirm
- func (k Keeper) GetValsetConfirmsByGID(ctx sdk.Context, nonce uint64) (confirms []*types.MsgValsetConfirm)
- func (k Keeper) GetValsets(ctx sdk.Context) (out []*types.Valset)
- func (k Keeper) HasValsetRequest(ctx sdk.Context, nonce uint64) bool
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IsWlkToken(token string) bool
- func (k Keeper) IterateAttestaions(ctx sdk.Context, cb func([]byte, types.Attestation) bool)
- func (k Keeper) IterateBatchConfirmByNonceAndTokenContractWithGID(ctx sdk.Context, nonce uint64, tokenContract string, ...)
- func (k Keeper) IterateERC20ToDenom(ctx sdk.Context, cb func([]byte, *types.ERC20ToDenom) bool)
- func (k Keeper) IterateERC721ToDenom(ctx sdk.Context, cb func([]byte, *types.ERC20ToDenom) bool)
- func (k Keeper) IterateOutgoingPoolByFee(ctx sdk.Context, contract string, ...)
- func (k Keeper) IterateOutgoingTXBatches(ctx sdk.Context, cb func(key []byte, batch *types.OutgoingTxBatch) bool)
- func (k Keeper) IterateValsetConfirmByNonceWithGID(ctx sdk.Context, nonce uint64, cb func([]byte, types.MsgValsetConfirm) bool)
- func (k Keeper) IterateValsets(ctx sdk.Context, cb func(key []byte, val *types.Valset) bool)
- func (k Keeper) LastEventNonceByAddr(c context.Context, req *types.QueryLastEventNonceByAddrRequest) (*types.QueryLastEventNonceByAddrResponse, error)
- func (k Keeper) LastPendingBatchRequestByAddr(c context.Context, req *types.QueryLastPendingBatchRequestByAddrRequest) (*types.QueryLastPendingBatchRequestByAddrResponse, error)
- func (k Keeper) LastPendingValsetRequestByAddr(c context.Context, req *types.QueryLastPendingValsetRequestByAddrRequest) (*types.QueryLastPendingValsetRequestByAddrResponse, error)
- func (k Keeper) LastValsetRequests(c context.Context, req *types.QueryLastValsetRequestsRequest) (*types.QueryLastValsetRequestsResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OutgoingTxBatchExecuted(ctx sdk.Context, tokenContract string, nonce uint64) error
- func (k Keeper) OutgoingTxBatches(c context.Context, req *types.QueryOutgoingTxBatchesRequest) (*types.QueryOutgoingTxBatchesResponse, error)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveFromOutgoingPoolAndRefund(ctx sdk.Context, txId uint64, sender sdk.AccAddress) error
- func (k Keeper) Reset(ctx sdk.Context)
- func (k Keeper) SetAttestation(ctx sdk.Context, eventNonce uint64, claimHash []byte, att *types.Attestation)
- func (k Keeper) SetBatchConfirmWithGID(ctx sdk.Context, batch *types.MsgConfirmBatch) []byte
- func (k *Keeper) SetCurrentGid(gid string)
- func (k Keeper) SetLastObservedEthereumBlockHeight(ctx sdk.Context, ethereumHeight uint64)
- func (k Keeper) SetLastUnBondingBlockHeight(ctx sdk.Context, unbondingBlockHeight uint64)
- func (k Keeper) SetLatestValsetNonce(ctx sdk.Context, nonce uint64)
- func (k Keeper) SetParams(ctx sdk.Context, ps types.Params)
- func (k Keeper) SetTokenMetaData(ctx sdk.Context, contract string, meta types.MetaData)
- func (k Keeper) SetValsetConfirmByGID(ctx sdk.Context, valsetConf types.MsgValsetConfirm) []byte
- func (k Keeper) SetValsetRequest(ctx sdk.Context) *types.Valset
- func (k Keeper) StoreBatch(ctx sdk.Context, batch *types.OutgoingTxBatch, requestor common.Address)
- func (k Keeper) StoreBatchUnsafe(ctx sdk.Context, batch *types.OutgoingTxBatch)
- func (k Keeper) StoreValset(ctx sdk.Context, valset *types.Valset)
- func (k Keeper) StoreValsetUnsafe(ctx sdk.Context, valset *types.Valset)
- func (k Keeper) TryAttestation(ctx sdk.Context, att *types.Attestation)
- func (k Keeper) ValsetConfirm(c context.Context, req *types.QueryValsetConfirmRequest) (*types.QueryValsetConfirmResponse, error)
- func (k Keeper) ValsetConfirmsByNonce(c context.Context, req *types.QueryValsetConfirmsByNonceRequest) (*types.QueryValsetConfirmsByNonceResponse, error)
- func (k Keeper) ValsetRequest(c context.Context, req *types.QueryValsetRequestRequest) (*types.QueryValsetRequestResponse, error)
- type MultiSigUpdateResponse
Constants ¶
const ( ERC20 = iota ERC721 )
const MaxResults = 100 // todo: impl pagination
const OutgoingTxBatchSize = 100
Variables ¶
var MAX_UINT, _ = new(big.Int).SetString("115792089237316195423570985008687907853269984665640564039457", 10)
Functions ¶
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState
ExportGenesis exports all the state needed to restart the chain from the current state of the chain
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState)
InitGenesis starts a chain from a genesis state
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the gov MsgServer interface for the provided Keeper.
func NewQuerier ¶
NewQuerier is the module level router for state queries
Types ¶
type AttestationHandler ¶
type AttestationHandler struct {
// contains filtered or unexported fields
}
AttestationHandler processes `observed` Attestations
func (AttestationHandler) Handle ¶
func (a AttestationHandler) Handle(ctx sdk.Context, gravityID string, att types.Attestation, claim types.EthereumClaim) error
Handle is the entry point for Attestation processing. TODO-JT add handler for ERC20DeployedEvent
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Wrapper struct
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.AccAddress, _ sdk.AccAddress)
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.AccAddress, _ sdk.AccAddress)
func (Hooks) AfterValidatorCreated ¶
func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.AccAddress)
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.AccAddress, valAddr sdk.AccAddress)
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(_ sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.AccAddress)
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.AccAddress)
func (Hooks) BeforeValidatorModified ¶
func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.AccAddress)
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct { AccountKeeper account.AccountKeeper StakingKeeper staking.StakingKeeper SupplyKeeper supply.Keeper SlashingKeeper slashing.Keeper AttestationHandler interface { Handle(sdk.Context, string, types.Attestation, types.EthereumClaim) error } // 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.Codec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper account.AccountKeeper, stakingKeeper staking.StakingKeeper, supplyKeeper supply.Keeper, slashingKeeper slashing.Keeper) Keeper
NewKeeper returns a new instance of the gravity keeper
func (Keeper) AddToOutgoingPool ¶
func (k Keeper) AddToOutgoingPool(ctx sdk.Context, sender sdk.AccAddress, counterpartReceiver string, amount sdk.Coin, fee sdk.Coin, tokenType uint64) (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) Attest ¶
func (k Keeper) Attest(ctx sdk.Context, claim types.EthereumClaim) (*types.Attestation, error)
TODO-JT: carefully look at atomicity of this function
func (Keeper) BatchConfirms ¶
func (k Keeper) BatchConfirms(c context.Context, req *types.QueryBatchConfirmsRequest) (*types.QueryBatchConfirmsResponse, error)
BatchConfirms returns the batch confirmations by nonce and token contract
func (Keeper) BatchFees ¶
func (k Keeper) BatchFees(c context.Context, req *types.QueryBatchFeeRequest) (*types.QueryBatchFeeResponse, error)
BatchFees queries the batch fees from unbatched pool
func (Keeper) BatchRequestByNonce ¶
func (k Keeper) BatchRequestByNonce(c context.Context, req *types.QueryBatchRequestByNonceRequest) (*types.QueryBatchRequestByNonceResponse, error)
BatchRequestByNonce queries the BatchRequestByNonce of the gravity module
func (Keeper) BuildOutgoingTXBatch ¶
func (k Keeper) BuildOutgoingTXBatch(ctx sdk.Context, contractAddress string, maxElements int, tokenType uint64, requestor common.Address) (*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 withtout 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 ¶
CancelOutgoingTXBatch releases all TX in the batch and deletes the batch
func (Keeper) CurrentValset ¶
func (k Keeper) CurrentValset(c context.Context, req *types.QueryCurrentValsetRequest) (*types.QueryCurrentValsetResponse, error)
CurrentValset queries the CurrentValset of the gravity module
func (Keeper) DeleteAttestation ¶
func (k Keeper) DeleteAttestation(ctx sdk.Context, eventNonce uint64, claimHash []byte, 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) DeleteValset ¶
DeleteValset deletes the valset at a given nonce from state
func (Keeper) DenomToERC20 ¶
func (k Keeper) DenomToERC20(c context.Context, req *types.QueryDenomToERC20Request) (*types.QueryDenomToERC20Response, error)
DenomToERC20 queries the Cosmos Denom that maps to an Ethereum ERC20
func (Keeper) DenomToERC20Lookup ¶
DenomToERC20 returns (bool isCosmosOriginated, string ERC20, err) Using this information, you can see if an asset is native to Cosmos or Ethereum, and get its corresponding ERC20 address This will return an error if it cant parse the denom as a gravity denom, and then also can't find the denom in an index of ERC20 contracts deployed on Ethereum to serve as synthetic Cosmos assets.
func (Keeper) DenomToERC721Lookup ¶ added in v1.6.21
func (Keeper) ERC20ToDenom ¶
func (k Keeper) ERC20ToDenom(c context.Context, req *types.QueryERC20ToDenomRequest) (*types.QueryERC20ToDenomResponse, error)
ERC20ToDenom queries the ERC20 contract that maps to an Ethereum ERC20 if any
func (Keeper) ERC20ToDenomLookup ¶
ERC20ToDenom returns (bool isCosmosOriginated, string denom, err) Using this information, you can see if an ERC20 address represents an asset is native to Cosmos or Ethereum, and get its corresponding denom
func (Keeper) ERC721ToDenomLookup ¶ added in v1.6.21
func (Keeper) GetAllBatchFees ¶
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 desireable to request
func (Keeper) GetAllGravityIDs ¶ added in v1.6.47
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) GetAttestationClaim ¶ added in v1.6.47
func (k Keeper) GetAttestationClaim(att *types.Attestation) (types.EthereumClaim, error)
func (Keeper) GetAttestationMapping ¶
GetAttestationMapping returns a mapping of eventnonce -> attestations at that nonce
func (Keeper) GetBatchConfirmByNonceAndTokenContractWithGID ¶ added in v1.6.47
func (k Keeper) GetBatchConfirmByNonceAndTokenContractWithGID(ctx sdk.Context, nonce uint64, tokenContract string) (out []types.MsgConfirmBatch)
GetBatchConfirmByNonceAndTokenContract returns the batch confirms
func (Keeper) GetBatchConfirmWithGID ¶ added in v1.6.47
func (k Keeper) GetBatchConfirmWithGID(ctx sdk.Context, nonce uint64, tokenContract string, validator sdk.AccAddress) *types.MsgConfirmBatch
GetBatchConfirm returns a batch confirmation given its nonce, the token contract, and a validator address
func (Keeper) GetBatchFeesByTokenType ¶
GetBatchFeesByTokenType gets the fees the next batch of a given token type would have if created. 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
func (Keeper) GetCurrentValset ¶
GetCurrentValset 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) GetDelegateKeyByEth ¶
func (k Keeper) GetDelegateKeyByEth(c context.Context, req *types.QueryDelegateKeysByEthAddress) (*types.QueryDelegateKeysByEthAddressResponse, error)
func (Keeper) GetDelegateKeyByOrchestrator ¶
func (k Keeper) GetDelegateKeyByOrchestrator(c context.Context, req *types.QueryDelegateKeysByOrchestratorAddress) (*types.QueryDelegateKeysByOrchestratorAddressResponse, error)
func (Keeper) GetDelegateKeyByValidator ¶
func (k Keeper) GetDelegateKeyByValidator(c context.Context, req *types.QueryDelegateKeysByValidatorAddress) (*types.QueryDelegateKeysByValidatorAddressResponse, error)
func (Keeper) GetDelegateKeys ¶
func (k Keeper) GetDelegateKeys(ctx sdk.Context) []*types.MsgSetOrchestratorAddress
GetDelegateKeys iterates both the EthAddress and Orchestrator address indexes to produce a vector of MsgSetOrchestratorAddress entires containing all the delgate keys for state export / import. This may seem at first glance to be excessively complicated, why not combine the EthAddress and Orchestrator address indexes and simply iterate one thing? The answer is that even though we set the Eth and Orchestrator address in the same place we use them differently we always go from Orchestrator address to Validator address and from validator address to Ethereum address we want to keep looking up the validator address for various reasons, so a direct Orchestrator to Ethereum address mapping will mean having to keep two of the same data around just to provide lookups.
For the time being this will serve
func (Keeper) GetLastEventNonceByValidator ¶
GetLastEventNonceByValidator returns the latest event nonce for a given validator
func (Keeper) GetLastObservedEthereumBlockHeight ¶
func (k Keeper) GetLastObservedEthereumBlockHeight(ctx sdk.Context) types.LastObservedEthereumBlockHeight
GetLastObservedEthereumBlockHeight height gets the block height to of the last observed attestation from the store
func (Keeper) GetLastObservedEventNonceWithGid ¶ added in v1.6.47
GetLastObservedEventNonce returns the latest observed event nonce
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) GetLastUnBondingBlockHeight ¶
GetLastUnBondingBlockHeight returns the last unbonding block height
func (Keeper) GetLastValsetConfirmNonce ¶ added in v1.6.24
GetLastValsetConfirmNonce returns the latest observed valset confirm nonce
func (Keeper) GetLatestValset ¶
GetLatestValset returns the latest validator set in state
func (Keeper) GetLatestValsetNonce ¶
GetLatestValsetNonce returns the latest valset nonce
func (Keeper) GetMapedERC721Token ¶ added in v1.6.21
func (Keeper) GetMapedEthToken ¶ added in v1.5.53
func (Keeper) GetMapedWRC721Token ¶ added in v1.6.21
func (Keeper) GetMapedWlkToken ¶ added in v1.5.53
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) GetPendingSendToEth ¶
func (k Keeper) GetPendingSendToEth(c context.Context, req *types.QueryPendingSendToEth) (*types.QueryPendingSendToEthResponse, error)
func (Keeper) GetPoolTransactions ¶
func (k Keeper) GetPoolTransactions(ctx sdk.Context) []*types.OutgoingTransferTx
GetPoolTransactions, grabs all transactions from the tx pool, useful for queries or genesis save/load
func (Keeper) GetRequestBatch ¶ added in v1.6.21
func (k Keeper) GetRequestBatch(ctx sdk.Context, tokenContract string, nonce uint64) *types.RequestBatch
GetRequestBatch loads a batch object. Returns nil when not exists.
func (Keeper) GetTokenMetaData ¶ added in v1.5.53
func (Keeper) GetUnbondingvalidators ¶
func (k Keeper) GetUnbondingvalidators(unbondingVals []byte) []sdk.AccAddress
GetUnbondingvalidators returns UnbondingValidators. Adding here in gravity keeper as cdc is available inside endblocker.
func (Keeper) GetValsetConfirmByGID ¶ added in v1.6.47
func (k Keeper) GetValsetConfirmByGID(ctx sdk.Context, nonce uint64, validator sdk.AccAddress) *types.MsgValsetConfirm
GetValsetConfirm returns a valset confirmation by a nonce and validator address
func (Keeper) GetValsetConfirmsByGID ¶ added in v1.6.47
func (k Keeper) GetValsetConfirmsByGID(ctx sdk.Context, nonce uint64) (confirms []*types.MsgValsetConfirm)
GetValsetConfirms returns all validator set confirmations by nonce
func (Keeper) GetValsets ¶
GetValsets returns all the validator sets in state
func (Keeper) HasValsetRequest ¶
HasValsetRequest returns true if a valset defined by a nonce exists
func (Keeper) IsWlkToken ¶ added in v1.5.53
func (Keeper) IterateAttestaions ¶
IterateAttestaions iterates through all attestations
func (Keeper) IterateBatchConfirmByNonceAndTokenContractWithGID ¶ added in v1.6.47
func (k Keeper) IterateBatchConfirmByNonceAndTokenContractWithGID(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 TODO: specify which nonce this is
func (Keeper) IterateERC20ToDenom ¶
IterateERC20ToDenom iterates over erc20 to denom relations
func (Keeper) IterateERC721ToDenom ¶ added in v1.6.21
IterateERC721ToDenom iterates over erc721 to denom relations
func (Keeper) IterateOutgoingPoolByFee ¶
func (k Keeper) IterateOutgoingPoolByFee(ctx sdk.Context, contract string, cb func(uint64, *types.OutgoingTransferTx) bool)
IterateOutgoingPoolByFee iterates over the outgoing pool which is sorted by fee
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) IterateValsetConfirmByNonceWithGID ¶ added in v1.6.47
func (k Keeper) IterateValsetConfirmByNonceWithGID(ctx sdk.Context, nonce uint64, cb func([]byte, types.MsgValsetConfirm) bool)
IterateValsetConfirmByNonce iterates through all valset confirms by nonce in ASC order MARK finish-batches: this is where the key is iterated in the old (presumed working) code TODO: specify which nonce this is
func (Keeper) IterateValsets ¶
IterateValsets retruns all valsetRequests
func (Keeper) LastEventNonceByAddr ¶
func (k Keeper) LastEventNonceByAddr(c context.Context, req *types.QueryLastEventNonceByAddrRequest) (*types.QueryLastEventNonceByAddrResponse, error)
LastEventNonceByAddr returns the last event nonce for the given validator address, this allows eth oracles to figure out where they left off
func (Keeper) LastPendingBatchRequestByAddr ¶
func (k Keeper) LastPendingBatchRequestByAddr(c context.Context, req *types.QueryLastPendingBatchRequestByAddrRequest) (*types.QueryLastPendingBatchRequestByAddrResponse, error)
LastPendingBatchRequestByAddr queries the LastPendingBatchRequestByAddr of the gravity module
func (Keeper) LastPendingValsetRequestByAddr ¶
func (k Keeper) LastPendingValsetRequestByAddr(c context.Context, req *types.QueryLastPendingValsetRequestByAddrRequest) (*types.QueryLastPendingValsetRequestByAddrResponse, error)
LastPendingValsetRequestByAddr queries the LastPendingValsetRequestByAddr of the gravity module
func (Keeper) LastValsetRequests ¶
func (k Keeper) LastValsetRequests(c context.Context, req *types.QueryLastValsetRequestsRequest) (*types.QueryLastValsetRequestsResponse, error)
LastValsetRequests queries the LastValsetRequests of the gravity module
func (Keeper) OutgoingTxBatchExecuted ¶
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 ¶
func (k Keeper) OutgoingTxBatches(c context.Context, req *types.QueryOutgoingTxBatchesRequest) (*types.QueryOutgoingTxBatchesResponse, error)
OutgoingTxBatches queries the OutgoingTxBatches of the gravity module
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the params of the gravity 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) SetBatchConfirmWithGID ¶ added in v1.6.47
SetBatchConfirm sets a batch confirmation by a validator
func (*Keeper) SetCurrentGid ¶ added in v1.6.47
func (Keeper) SetLastObservedEthereumBlockHeight ¶
SetLastObservedEthereumBlockHeight sets the block height in the store.
func (Keeper) SetLastUnBondingBlockHeight ¶
SetLastUnBondingBlockHeight sets the last unbonding block height
func (Keeper) SetLatestValsetNonce ¶
SetLatestValsetNonce sets the latest valset nonce
func (Keeper) SetTokenMetaData ¶ added in v1.5.53
func (Keeper) SetValsetConfirmByGID ¶ added in v1.6.47
SetValsetConfirm sets a valset confirmation
func (Keeper) SetValsetRequest ¶
SetValsetRequest returns a new instance of the Gravity BridgeValidatorSet i.e. {"nonce": 1, "memebers": [{"eth_addr": "foo", "power": 11223}]}
func (Keeper) StoreBatch ¶
StoreBatch stores a transaction batch
func (Keeper) StoreBatchUnsafe ¶
func (k Keeper) StoreBatchUnsafe(ctx sdk.Context, batch *types.OutgoingTxBatch)
StoreBatchUnsafe stores a transaction batch w/o setting the height
func (Keeper) StoreValset ¶
StoreValset is for storing a valiator set at a given height
func (Keeper) StoreValsetUnsafe ¶
StoreValsetUnsafe is for storing a valiator set at a given height
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) ValsetConfirm ¶
func (k Keeper) ValsetConfirm(c context.Context, req *types.QueryValsetConfirmRequest) (*types.QueryValsetConfirmResponse, error)
ValsetConfirm queries the ValsetConfirm of the gravity module
func (Keeper) ValsetConfirmsByNonce ¶
func (k Keeper) ValsetConfirmsByNonce(c context.Context, req *types.QueryValsetConfirmsByNonceRequest) (*types.QueryValsetConfirmsByNonceResponse, error)
ValsetConfirmsByNonce queries the ValsetConfirmsByNonce of the gravity module
func (Keeper) ValsetRequest ¶
func (k Keeper) ValsetRequest(c context.Context, req *types.QueryValsetRequestRequest) (*types.QueryValsetRequestResponse, error)
ValsetRequest queries the ValsetRequest of the gravity module