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

Fix issue #3724: The generated files of EVM-compatible chain cannot pass test #3725

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion codegen-v2/src/codegen/template_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl TemplateGenerator {
.add_pattern("{TW_CRATE_NAME}", coin.id.to_tw_crate_name())
.add_pattern("{COIN_ID}", coin.id.as_str())
.add_pattern("{COIN_TYPE}", coin.coin_type())
.add_pattern("{COIN_NAME}", &coin.name)
.add_pattern("{COIN_NAME}", if coin.display_name.len() > 0 { &coin.display_name } else { &coin.name })
.add_pattern("{SYMBOL}", &coin.symbol)
.add_pattern("{DECIMALS}", coin.decimals)
.add_pattern("{P2PKH_PREFIX}", coin.p2pkh_prefix)
Expand Down
3 changes: 3 additions & 0 deletions codegen-v2/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ pub struct CoinExplorer {
pub struct CoinItem {
pub id: CoinId,
pub name: String,
#[serde(rename = "displayName")]
#[serde(default)]
pub display_name: String,
#[serde(rename = "coinId")]
pub coin_id_number: u32,
pub symbol: String,
Expand Down
Loading