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

Tokenfactory metadata display fix #3337

Merged
merged 7 commits into from
Nov 14, 2023
4 changes: 2 additions & 2 deletions cosmwasm/contracts/ibc-translator/src/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ pub fn convert_cw20_to_bank_and_send(

let mut symbol = token_info.symbol;
if symbol.is_empty() {
symbol = tf_scaled_denom;
symbol = tf_scaled_denom.clone();
}
let tf_description =
token_info.name.clone() + ", " + symbol.as_str() + ", " + tokenfactory_denom.as_str();
let tf_metadata = Metadata {
description: Some(tf_description),
base: Some(tokenfactory_denom.clone()),
denom_units: vec![tf_denom_unit_base, tf_denom_unit_scaled],
display: Some(tokenfactory_denom.clone()),
display: Some(tf_scaled_denom),
name: Some(token_info.name),
symbol: Some(symbol),
};
Expand Down
6 changes: 3 additions & 3 deletions cosmwasm/contracts/ibc-translator/tests/reply_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,15 @@ fn convert_cw20_to_bank_happy_path_create_denom() {
+ "/"
+ token_info_response.decimals.to_string().as_str();
let tf_denom_unit_scaled = DenomUnit {
denom: tf_scaled_denom,
denom: tf_scaled_denom.clone(),
exponent: u32::from(token_info_response.decimals),
aliases: vec![],
};
let tf_metadata = Metadata {
description: Some(tf_description),
base: Some(tokenfactory_denom.clone()),
denom_units: vec![tf_denom_unit_base, tf_denom_unit_scaled],
display: Some(tokenfactory_denom.clone()),
display: Some(tf_scaled_denom),
name: Some(token_info_response.name),
symbol: Some(token_info_response.symbol),
};
Expand Down Expand Up @@ -609,7 +609,7 @@ fn convert_cw20_to_bank_happy_path_create_denom_empty_symbol() {
description: Some(tf_description),
base: Some(tokenfactory_denom.clone()),
denom_units: vec![tf_denom_unit_base, tf_denom_unit_scaled],
display: Some(tokenfactory_denom.clone()),
display: Some(tf_scaled_denom.clone()),
name: Some(token_info_response.name),
symbol: Some(tf_scaled_denom), // CW20 symbol is empty, use tf_scaled_denom
};
Expand Down
Loading