Skip to content

Commit

Permalink
Fix issue 3724: The generated files of EVM-compatible chain cannot pa…
Browse files Browse the repository at this point in the history
…ss test (#3725)

Co-authored-by: satoshiotomakan <[email protected]>
  • Loading branch information
10gic and satoshiotomakan authored Mar 15, 2024
1 parent 102fa2b commit c4ffde3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit c4ffde3

Please sign in to comment.