Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix merge unresovle #232

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 3 additions & 25 deletions c-pallets/cacher/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use super::*;
use frame_support::{assert_noop, assert_ok};
use mock::{new_test_ext, Cacher, Origin, Test};
use mock::{new_test_ext, Cacher, RuntimeOrigin, Test};
use sp_runtime::traits::Hash;
use pallet_balances::Error as BalancesError;

Expand Down Expand Up @@ -41,15 +41,8 @@ fn update_works() {
byte_price: 200u32.into(),
};
// Wrong accout update fails.
<<<<<<< HEAD
<<<<<<< HEAD
assert_noop!(Cacher::update(RuntimeOrigin::signed(2), new_info.clone()), Error::<Test>::UnRegister);
=======
assert_noop!(Cacher::update(Origin::signed(2), new_info.clone()), Error::<Test>::UnRegistered);
>>>>>>> main
=======

assert_noop!(Cacher::update(RuntimeOrigin::signed(2), new_info.clone()), Error::<Test>::UnRegister);
>>>>>>> main
// Update works.
assert_ok!(Cacher::update(RuntimeOrigin::signed(1), new_info.clone()));

Expand All @@ -69,15 +62,8 @@ fn logout_works() {
assert_ok!(Cacher::register(RuntimeOrigin::signed(1), info.clone()));

// Wrong accout logout fails.
<<<<<<< HEAD
<<<<<<< HEAD
assert_noop!(Cacher::logout(RuntimeOrigin::signed(2)), Error::<Test>::UnRegister);
=======
assert_noop!(Cacher::logout(Origin::signed(2)), Error::<Test>::UnRegistered);
>>>>>>> main
=======
assert_noop!(Cacher::logout(RuntimeOrigin::signed(2)), Error::<Test>::UnRegister);
>>>>>>> main

// Logout works.
assert_ok!(Cacher::logout(RuntimeOrigin::signed(1)));
});
Expand Down Expand Up @@ -105,15 +91,7 @@ fn pay_works() {
let bills: BoundedVec<_, <Test as Config>::BillsLimit> = bill_vec.try_into().unwrap();

// Pay fails.
<<<<<<< HEAD
<<<<<<< HEAD
assert_noop!(Cacher::pay(RuntimeOrigin::signed(1), bills.clone()), Error::<Test>::InsufficientBalance);
=======
assert_noop!(Cacher::pay(Origin::signed(1), bills.clone()), BalancesError::<Test>::InsufficientBalance);
>>>>>>> main
=======
assert_noop!(Cacher::pay(RuntimeOrigin::signed(1), bills.clone()), Error::<Test>::InsufficientBalance);
>>>>>>> main

<Test as Config>::Currency::make_free_balance_be(&1, BalanceOf::<Test>::max_value());
let balance_befor_1 = <Test as Config>::Currency::free_balance(&1);
Expand Down
Loading