diff --git a/tig-structs/src/core.rs b/tig-structs/src/core.rs index a777a79..8dcb1b0 100644 --- a/tig-structs/src/core.rs +++ b/tig-structs/src/core.rs @@ -349,7 +349,7 @@ serializable_struct_with_getters! { // Player child structs serializable_struct_with_getters! { PlayerDetails { - name: String, + name: Option, is_multisig: bool, } } diff --git a/tig-utils/src/eth.rs b/tig-utils/src/eth.rs index 448afe0..3542f67 100644 --- a/tig-utils/src/eth.rs +++ b/tig-utils/src/eth.rs @@ -255,7 +255,7 @@ mod web3_feature { } ]"#; - pub async fn lookup_ens_name(rpc_url: &str, address: &str) -> Result { + pub async fn lookup_ens_name(rpc_url: &str, address: &str) -> Result> { let transport = web3::transports::Http::new(rpc_url)?; let eth = web3::Web3::new(transport).eth(); @@ -271,11 +271,11 @@ mod web3_feature { .query("getNames", (addresses,), None, Options::default(), None) .await?; - // Return first name or address if empty + // Return first name or none if empty Ok(if !names[0].is_empty() { - names[0].clone() + Some(names[0].clone()) } else { - address.to_string() + None }) } }