Skip to content

Commit

Permalink
fixup! [index] concurrent unified balances
Browse files Browse the repository at this point in the history
  • Loading branch information
lightmark authored and bowenyang007 committed May 31, 2024
1 parent 1f53518 commit 5fe8abe
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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");
}
}

0 comments on commit 5fe8abe

Please sign in to comment.