Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-alpha.40'
Browse files Browse the repository at this point in the history
  • Loading branch information
nekofar committed Sep 28, 2023
2 parents 790d570 + 599f702 commit 66fc665
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.0.0-alpha.40] - 2023-09-28

### Refactor

- Update `get_wallet_handle` function for clarity

## [1.0.0-alpha.39] - 2023-09-28

### Refactor
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lilnouns-bots"
version = "1.0.0-alpha.39"
version = "1.0.0-alpha.40"
authors = ["Milad Nekofar <milad@nekofar.com>"]
edition = "2021"
description = "Our bots are designed to keep the Lil Nouns DAO community informed and engaged."
Expand Down
16 changes: 7 additions & 9 deletions src/utils/ens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ pub async fn get_domain_field(domain: &str, field: &str) -> Result<String> {
}

pub async fn get_wallet_handle(address: &str, field: &str) -> String {
return if let Ok(domain) = get_domain_name(address).await {
if let Ok(handle) = get_domain_field(domain.as_str(), field).await {
format!("@{}", handle)
} else {
domain
}
} else {
get_short_address(address)
};
match get_domain_name(address).await {
Ok(domain) => match get_domain_field(&domain, field).await {
Ok(handle) if !handle.is_empty() => format!("@{}", handle),
_ => domain,
},
Err(_) => get_short_address(address),
}
}

0 comments on commit 66fc665

Please sign in to comment.