From c28403e51b1c2d8db398113727a89c12365c51e8 Mon Sep 17 00:00:00 2001 From: _dssei_ Date: Mon, 8 Apr 2024 15:17:20 -0700 Subject: [PATCH] Added missing docs --- packages/sei-cosmwasm/src/querier.rs | 21 +++++++++++++++++++++ packages/sei-cosmwasm/src/query.rs | 5 +---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/sei-cosmwasm/src/querier.rs b/packages/sei-cosmwasm/src/querier.rs index 8ac0dfb..687d8a8 100644 --- a/packages/sei-cosmwasm/src/querier.rs +++ b/packages/sei-cosmwasm/src/querier.rs @@ -471,6 +471,27 @@ impl<'a> SeiQuerier<'a> { self.querier.query(&request) } + /// Queries the Sei address associated with a given EVM address. + /// + /// This function takes an `evm_address` as a parameter, which is a `String` representing the + /// EVM address. It returns a `StdResult`, which is a standard result type + /// in the `cosmwasm_std` library. The `SeiAddressResponse` struct contains the Sei address. + /// If the EVM address is not associated with any Sei address, the Sei address will be an empty + /// string. + /// + /// # Arguments + /// + /// * `evm_address` - A `String` that represents the EVM address. + /// + /// # Returns + /// + /// * `StdResult` - A standard result that wraps the `SeiAddressResponse` + /// struct. `SeiAddressResponse` contains the Sei address. If the EVM address is not associated + /// with any Sei address, the Sei address will be an empty string. + /// + /// # Errors + /// + /// This function will return an error if the query to the EVM fails. pub fn get_sei_address( &self, evm_address: String, diff --git a/packages/sei-cosmwasm/src/query.rs b/packages/sei-cosmwasm/src/query.rs index 0c81147..a63bf51 100644 --- a/packages/sei-cosmwasm/src/query.rs +++ b/packages/sei-cosmwasm/src/query.rs @@ -244,10 +244,6 @@ pub struct Erc721UriResponse { } /// `EvmAddressResponse` is a struct that represents a response containing an EVM address. -/// -/// It has two fields: -/// * `evm_address`: a `String` that represents the EVM address. -/// * `associated`: a `bool` that indicates whether the EVM address is associated or not. #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct EvmAddressResponse { /// The 20-byte EVM address associated to Sei address that's derived from the public part of a @@ -259,6 +255,7 @@ pub struct EvmAddressResponse { pub associated: bool } +/// `SeiAddressResponse` is a struct that represents a response containing a SEI address. #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct SeiAddressResponse { /// The SEI address associated to EVM address. Empty if the EVM address is not associated with