Skip to content

Commit

Permalink
Added missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dssei committed Apr 8, 2024
1 parent a2a5d4e commit c28403e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
21 changes: 21 additions & 0 deletions packages/sei-cosmwasm/src/querier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SeiAddressResponse>`, 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<SeiAddressResponse>` - 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,
Expand Down
5 changes: 1 addition & 4 deletions packages/sei-cosmwasm/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c28403e

Please sign in to comment.