Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments to Token Info Fetcher #1931

Merged
merged 5 commits into from
Oct 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify native asset token information
  • Loading branch information
Nicholas Rodrigues Lordello committed Oct 9, 2023
commit 6c3aedd5c95a456c4c27f6b815ecaffb3f99f4a5
12 changes: 1 addition & 11 deletions crates/shared/src/token_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,9 @@ pub struct TokenInfoFetcher {
impl TokenInfoFetcher {
async fn fetch_token(&self, address: H160) -> Result<TokenInfo, Error> {
if address == BUY_ETH_ADDRESS {
let chain = self
.web3
.eth()
.chain_id()
.await
.map_err(|err| Error(err.to_string()))?;
return Ok(TokenInfo {
decimals: Some(18),
symbol: match chain.as_u64() {
1 | 5 => Some("ETH".to_string()),
100 => Some("xDAI".to_string()),
_ => None,
},
symbol: Some("NATIVE_ASSET".to_string()),
});
}

Expand Down