diff --git a/rust/processor/src/models/fungible_asset_models/v2_fungible_asset_balances.rs b/rust/processor/src/models/fungible_asset_models/v2_fungible_asset_balances.rs index 918af6eae..adf510b30 100644 --- a/rust/processor/src/models/fungible_asset_models/v2_fungible_asset_balances.rs +++ b/rust/processor/src/models/fungible_asset_models/v2_fungible_asset_balances.rs @@ -104,7 +104,7 @@ fn get_primary_fungible_store_address( let mut preimage = hex_to_raw_bytes(owner_address)?; preimage.append(&mut hex_to_raw_bytes(metadata_address)?); preimage.push(0xFC); - Ok(format!("0x{}", hex::encode(sha3_256(&preimage)))) + Ok(standardize_address(&hex::encode(sha3_256(&preimage)))) } impl From<&CurrentFungibleAssetBalance> for CurrentUnifiedFungibleAssetBalance { @@ -362,4 +362,13 @@ mod tests { fungible_store_address, )); } + + #[test] + fn test_paired_metadata_address() { + assert_eq!( + get_paired_metadata_address("0x1::aptos_coin::AptosCoin"), + *APT_METADATA_ADDRESS_HEX + ); + assert_eq!(get_paired_metadata_address("0x66c34778730acbb120cefa57a3d98fd21e0c8b3a51e9baee530088b2e444e94c::moon_coin::MoonCoin"), "0xf772c28c069aa7e4417d85d771957eb3c5c11b5bf90b1965cda23b899ebc0384"); + } }