Skip to content

Commit

Permalink
submit recv_packet on cosmos with 0x prefixed starknet denom
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Jan 10, 2025
1 parent d4f2c76 commit 4d5b5d3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion relayer/crates/starknet-chain-components/src/types/amount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ impl StarknetAmount {

impl Display for StarknetAmount {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}-{:?}", self.quantity, self.token_address)
write!(
f,
"{}-{}",
self.quantity,
self.token_address.to_fixed_hex_string()
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum Denom {
impl Display for Denom {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Denom::Native(denom) => write!(f, "{}", denom),
Denom::Native(denom) => write!(f, "{}", denom.to_fixed_hex_string()),
Denom::Hosted(denom) => write!(f, "{}", denom),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub enum Participant {
impl Display for Participant {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Participant::Native(address) => write!(f, "{}", address),
Participant::Native(address) => write!(f, "{}", address.to_fixed_hex_string()),
Participant::External(address) => write!(f, "{}", address),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ fn test_starknet_ics20_contract() -> Result<(), Error> {
let cosmos_ibc_denom = derive_ibc_denom(
&ics20_port,
&cosmos_channel_id,
&IbcDenom::base(&erc20_token_address.to_string()),
&IbcDenom::base(&Denom::Native(erc20_token_address).to_string()),
)?;

info!("cosmos ibc denom: {:?}", cosmos_ibc_denom);
Expand Down

0 comments on commit 4d5b5d3

Please sign in to comment.