Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zktony committed Nov 14, 2023
1 parent f97fe09 commit 1bda98e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pallets/thea-executor/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ fn test_do_withdrawal() {
let asset_id = 1u128;
// Set asset balance
Balances::set_balance(&sender, 1_000_000_000_000_000_000);
Assets::mint_into(asset_id, &sender, 1_000_000_000_000_000_000);
let _ = Assets::mint_into(asset_id, &sender, 1_000_000_000_000_000_000);
// Set withdrawal Fee
assert_ok!(TheaExecutor::set_withdrawal_fee(RuntimeOrigin::root(), 1, 100));
assert_ok!(TheaExecutor::update_asset_metadata(RuntimeOrigin::root(), asset_id, 12));
Expand All @@ -430,8 +430,8 @@ fn test_do_withdrawal_with_total_amount_consumed_returns_error() {
let sender = 2u64;
let asset_id = 1u128;
// Set asset balance
Balances::set_balance(&sender, 1_000_000_000_000_000_000);
Assets::mint_into(asset_id, &sender, 100_300_903u128);
let _ = Balances::set_balance(&sender, 1_000_000_000_000_000_000);
assert_ok!(Assets::mint_into(asset_id, &sender, 100_300_903u128));
// Set withdrawal Fee
assert_ok!(TheaExecutor::set_withdrawal_fee(RuntimeOrigin::root(), 1, 100));
assert_ok!(TheaExecutor::update_asset_metadata(RuntimeOrigin::root(), asset_id, 12));
Expand Down
4 changes: 4 additions & 0 deletions pallets/thea-message-handler/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
BuildStorage, Permill,
};
use polkadex_primitives::AssetId;

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
Expand Down Expand Up @@ -201,6 +202,9 @@ impl thea_executor::Config for Test {
type ParaId = ParaId;
type Swap = AssetConversion;
type WeightInfo = thea_executor::weights::WeightInfo<Test>;
type MultiAssetIdAdapter = AssetId;
type AssetBalanceAdapter = u128;
type ExistentialDeposit = ExistentialDeposit;
}

impl crate::Config for Test {
Expand Down
5 changes: 5 additions & 0 deletions pallets/thea/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
BuildStorage, Permill,
};
use polkadex_primitives::AssetId;

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
type Balance = u128;
Expand Down Expand Up @@ -197,6 +199,9 @@ impl thea_executor::Config for Test {
type ParaId = ParaId;
type WeightInfo = thea_executor::weights::WeightInfo<Test>;
type Swap = AssetConversion;
type MultiAssetIdAdapter = AssetId;
type AssetBalanceAdapter = u128;
type ExistentialDeposit = ExistentialDeposit;
}

impl<C> frame_system::offchain::SendTransactionTypes<C> for Test
Expand Down

0 comments on commit 1bda98e

Please sign in to comment.