diff --git a/CHANGELOG.md b/CHANGELOG.md index 10bbfd63e..32f2fbfe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # CHANGELOG +## Unreleased +### Breaking changes + +### Features + +### Improvements +- [\#694](https://github.com/Manta-Network/Manta/pull/694) Switch to u128::MAX in fungible ledger transfer integration test. + +### Bug fixes + ## v3.2.1 ### Breaking changes - [Dolphin] [\#628](https://github.com/Manta-Network/Manta/pull/628) Improve RPC performance, add `max_receivers` and `max_senders` fields in the RPC request. diff --git a/pallets/manta-pay/src/test/payment.rs b/pallets/manta-pay/src/test/payment.rs index fda885689..2e515466d 100644 --- a/pallets/manta-pay/src/test/payment.rs +++ b/pallets/manta-pay/src/test/payment.rs @@ -160,9 +160,7 @@ where Some(id) => id, None => rng.gen(), }; - // FIXME: get rid of the division after parity fixes the pallet-asset bug - let double_balance: u128 = rng.gen(); - let total_free_balance = AssetValue(double_balance / 2); + let total_free_balance = AssetValue(rng.gen()); let balances = value_distribution(count, total_free_balance, rng); initialize_test(asset_id, total_free_balance + DEFAULT_ASSET_ED); let mut utxo_accumulator = UtxoAccumulator::new(UTXO_ACCUMULATOR_MODEL.clone()); @@ -232,9 +230,7 @@ where Some(id) => id, None => rng.gen(), }; - // FIXME: This is a workaround due to the substrate asset bug - let double_balance: u128 = rng.gen(); - let total_free_balance = AssetValue(double_balance / 2); + let total_free_balance = AssetValue(rng.gen()); let balances = value_distribution(count, total_free_balance, rng); initialize_test(asset_id, total_free_balance + DEFAULT_ASSET_ED); let mut utxo_accumulator = UtxoAccumulator::new(UTXO_ACCUMULATOR_MODEL.clone()); @@ -314,10 +310,7 @@ fn to_private_should_work() { let mut rng = OsRng; new_test_ext().execute_with(|| { let asset_id = rng.gen(); - // FIXME: get rid of divide by two after parity fix pallet-asset - // This is to work around the substrate bug - let double_supply: u128 = rng.gen(); - let total_free_supply = AssetValue(double_supply / 2); + let total_free_supply = AssetValue(rng.gen()); initialize_test(asset_id, total_free_supply + DEFAULT_ASSET_ED); mint_tokens( asset_id, @@ -331,10 +324,7 @@ fn to_private_should_work() { fn native_asset_to_private_should_work() { let mut rng = OsRng; new_test_ext().execute_with(|| { - // FIXME: get rid of divide by two after parity fix pallet-asset - // This is to work around the substrate bug - let double_supply: u128 = rng.gen(); - let total_free_supply = AssetValue(double_supply / 2); + let total_free_supply = AssetValue(rng.gen()); initialize_test(NATIVE_ASSET_ID, total_free_supply + DEFAULT_ASSET_ED); mint_tokens( NATIVE_ASSET_ID, @@ -350,9 +340,7 @@ fn overdrawn_mint_should_not_work() { let mut rng = OsRng; new_test_ext().execute_with(|| { let asset_id = rng.gen(); - // FIXME: remove the division after parity fix the pallet-asset bug - let double_supply: u128 = rng.gen(); - let total_supply = AssetValue(double_supply / 2); + let total_supply = AssetValue(rng.gen()); initialize_test(asset_id, total_supply + DEFAULT_ASSET_ED); assert_noop!( MantaPayPallet::to_private( diff --git a/runtime/calamari/tests/integration_tests.rs b/runtime/calamari/tests/integration_tests.rs index 59c5b648a..bc359fb88 100644 --- a/runtime/calamari/tests/integration_tests.rs +++ b/runtime/calamari/tests/integration_tests.rs @@ -50,7 +50,7 @@ use manta_primitives::{ AssetConfig, AssetLocation, AssetRegistrarMetadata, FungibleLedger, FungibleLedgerError, }, constants::time::{DAYS, HOURS}, - types::{AccountId, Header}, + types::{AccountId, Balance, Header}, }; use session_key_primitives::helpers::{get_account_id_from_seed, get_collator_keys_from_seed}; use xcm::{ @@ -1108,8 +1108,7 @@ fn concrete_fungible_ledger_transfers_work() { ),); // Register and mint for testing. - // TODO:: Switch to u128::MAX when we start using https://github.com/paritytech/substrate/pull/11241 - let amount = INITIAL_BALANCE; + let amount = Balance::MAX; assert_ok!(CalamariConcreteFungibleLedger::mint( >::StartNonNativeAssetId::get(), &alice.clone(), @@ -1182,7 +1181,7 @@ fn concrete_fungible_ledger_transfers_work() { >::StartNonNativeAssetId::get(), alice.clone() ), - INITIAL_BALANCE - transfer_amount + u128::MAX - transfer_amount ); assert_eq!( Assets::balance(