Documentation
¶
Overview ¶
evm_helpers.go EVM-specific helper functions used in inbound transaction verification.
svm_helpers.go SVM-specific helper functions used in inbound transaction verification.
Index ¶
- func IsValidSVMSender(accountKeys []string, expectedHex string) (string, error)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NormalizeEVMAddress(addr string) string
- func ParseEVMFundsAddedEventLogs(logs []interface{}, expectedTopic string) ([]utxverifiertypes.EVMFundsAddedEventData, error)
- func ParseSVMFundsAddedEventLog(logMessages []string, expectedDiscriminator []byte) ([]utxverifiertypes.SVMFundsAddedEventData, error)
- type Keeper
- func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState
- func (k Keeper) GetURegistryKeeper() types.UregistryKeeper
- func (k Keeper) GetVerifiedInboundTxMetadata(ctx context.Context, chain, txHash string) (*types.VerifiedTxMetadata, bool, error)
- func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error
- func (k Keeper) Logger() log.Logger
- func (k Keeper) SchemaBuilder() *collections.SchemaBuilder
- func (k Keeper) StoreVerifiedInboundTx(ctx context.Context, chain, txHash string, ...) error
- func (k Keeper) VerifyAndGetPayloadHash(ctx sdk.Context, ownerKey, txHash, chain string) ([]string, error)
- func (k Keeper) VerifyEVMInboundTx(ctx context.Context, ownerKey, txHash string, ...) (*utxverifiertypes.VerifiedTxMetadata, error)
- func (k Keeper) VerifySVMInboundTx(ctx context.Context, ownerKey, txHash string, ...) (*utxverifiertypes.VerifiedTxMetadata, error)
- type Querier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidSVMSender ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the module MsgServer interface.
func NormalizeEVMAddress ¶
NormalizeEVMAddress returns a lowercase hex address without 0x prefix
func ParseEVMFundsAddedEventLogs ¶
func ParseEVMFundsAddedEventLogs(
logs []interface{},
expectedTopic string,
) ([]utxverifiertypes.EVMFundsAddedEventData, error)
@notice Parses EVM logs to extract amount, decimals and payloadHash from the `FundsAdded` event. @dev This function scans logs for a specific event topic and decodes the `amountInUSD`, `payloadHash` fields. @param logs The array of raw EVM logs from the transaction receipt. @param expectedTopic The hash of the `FundsAdded` event signature (topic[0]) to match. @return amount The extracted amount in USD as a big.Int. @return decimals The number of decimals used for the USD amount. @return error An error if the event was not found or decoding failed.
Emits: event FundsAdded(
address indexed user, bytes32 indexed payloadHash, AmountInUSD AmountInUSD
);
func ParseSVMFundsAddedEventLog ¶
func ParseSVMFundsAddedEventLog( logMessages []string, expectedDiscriminator []byte, ) ([]utxverifiertypes.SVMFundsAddedEventData, error)
ParseSVMFundsAddedLog parses Solana log messages to extract the FundsAddedEvent @param logMessages Program logs from the transaction @param expectedDiscriminator First 8 bytes of event identifier @return event data or error if not found or corrupted
Types ¶
type Keeper ¶
type Keeper struct {
// state management
Params collections.Item[types.Params]
VerifiedInboundTxs collections.Map[string, types.VerifiedTxMetadata]
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService storetypes.KVStoreService, logger log.Logger, authority string, uregistryKeeper types.UregistryKeeper, ) Keeper
NewKeeper creates a new Keeper instance
func (*Keeper) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState
ExportGenesis exports the module's state to a genesis state.
func (Keeper) GetURegistryKeeper ¶
func (k Keeper) GetURegistryKeeper() types.UregistryKeeper
func (Keeper) GetVerifiedInboundTxMetadata ¶
func (*Keeper) InitGenesis ¶
InitGenesis initializes the module's state from a genesis state.
func (Keeper) SchemaBuilder ¶
func (k Keeper) SchemaBuilder() *collections.SchemaBuilder
func (Keeper) StoreVerifiedInboundTx ¶
func (Keeper) VerifyAndGetPayloadHash ¶
func (k Keeper) VerifyAndGetPayloadHash(ctx sdk.Context, ownerKey, txHash, chain string) ([]string, error)
VerifyAndGetLockedFunds verifies if the user has interacted with the gateway on the source chain and send the locked funds amount.
func (Keeper) VerifyEVMInboundTx ¶
func (k Keeper) VerifyEVMInboundTx( ctx context.Context, ownerKey, txHash string, chainConfig uregistrytypes.ChainConfig, ) (*utxverifiertypes.VerifiedTxMetadata, error)
func (Keeper) VerifySVMInboundTx ¶
func (k Keeper) VerifySVMInboundTx( ctx context.Context, ownerKey, txHash string, chainConfig uregistrytypes.ChainConfig, ) (*utxverifiertypes.VerifiedTxMetadata, error)
type Querier ¶
type Querier struct {
Keeper
}
func NewQuerier ¶
func (Querier) Params ¶
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Querier) VerifiedTxHash ¶
func (q Querier) VerifiedTxHash( goCtx context.Context, req *types.QueryVerifiedTxHashRequest, ) (*types.QueryVerifiedTxHashResponse, error)
VerifiedTxHash returns the verified metadata (if any) for a given txHash on a chain.