mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
declone and close the door (#12035)
* declone and close the door * cargo fmt * remove brackets
This commit is contained in:
@@ -221,14 +221,7 @@ fn multisig_deposit_is_taken_and_returned_with_alt_call_storage() {
|
||||
let data = call.encode();
|
||||
let hash = blake2_256(&data);
|
||||
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
None,
|
||||
hash.clone(),
|
||||
0
|
||||
));
|
||||
assert_ok!(Multisig::approve_as_multi(Origin::signed(1), 3, vec![2, 3], None, hash, 0));
|
||||
assert_eq!(Balances::free_balance(1), 1);
|
||||
assert_eq!(Balances::reserved_balance(1), 4);
|
||||
|
||||
@@ -266,31 +259,18 @@ fn cancel_multisig_returns_deposit() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = call_transfer(6, 15).encode();
|
||||
let hash = blake2_256(&call);
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
None,
|
||||
hash.clone(),
|
||||
0
|
||||
));
|
||||
assert_ok!(Multisig::approve_as_multi(Origin::signed(1), 3, vec![2, 3], None, hash, 0));
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(2),
|
||||
3,
|
||||
vec![1, 3],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
hash,
|
||||
0
|
||||
));
|
||||
assert_eq!(Balances::free_balance(1), 6);
|
||||
assert_eq!(Balances::reserved_balance(1), 4);
|
||||
assert_ok!(Multisig::cancel_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
now(),
|
||||
hash.clone()
|
||||
),);
|
||||
assert_ok!(Multisig::cancel_as_multi(Origin::signed(1), 3, vec![2, 3], now(), hash),);
|
||||
assert_eq!(Balances::free_balance(1), 10);
|
||||
assert_eq!(Balances::reserved_balance(1), 0);
|
||||
});
|
||||
@@ -308,14 +288,7 @@ fn timepoint_checking_works() {
|
||||
let hash = blake2_256(&call);
|
||||
|
||||
assert_noop!(
|
||||
Multisig::approve_as_multi(
|
||||
Origin::signed(2),
|
||||
2,
|
||||
vec![1, 3],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
0
|
||||
),
|
||||
Multisig::approve_as_multi(Origin::signed(2), 2, vec![1, 3], Some(now()), hash, 0),
|
||||
Error::<Test>::UnexpectedTimepoint,
|
||||
);
|
||||
|
||||
@@ -424,20 +397,13 @@ fn multisig_3_of_3_works() {
|
||||
let call_weight = call.get_dispatch_info().weight;
|
||||
let data = call.encode();
|
||||
let hash = blake2_256(&data);
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
None,
|
||||
hash.clone(),
|
||||
0
|
||||
));
|
||||
assert_ok!(Multisig::approve_as_multi(Origin::signed(1), 3, vec![2, 3], None, hash, 0));
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(2),
|
||||
3,
|
||||
vec![1, 3],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
hash,
|
||||
0
|
||||
));
|
||||
assert_eq!(Balances::free_balance(6), 0);
|
||||
@@ -460,33 +426,20 @@ fn cancel_multisig_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = call_transfer(6, 15).encode();
|
||||
let hash = blake2_256(&call);
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
None,
|
||||
hash.clone(),
|
||||
0
|
||||
));
|
||||
assert_ok!(Multisig::approve_as_multi(Origin::signed(1), 3, vec![2, 3], None, hash, 0));
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(2),
|
||||
3,
|
||||
vec![1, 3],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
hash,
|
||||
0
|
||||
));
|
||||
assert_noop!(
|
||||
Multisig::cancel_as_multi(Origin::signed(2), 3, vec![1, 3], now(), hash.clone()),
|
||||
Multisig::cancel_as_multi(Origin::signed(2), 3, vec![1, 3], now(), hash),
|
||||
Error::<Test>::NotOwner,
|
||||
);
|
||||
assert_ok!(Multisig::cancel_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
now(),
|
||||
hash.clone()
|
||||
),);
|
||||
assert_ok!(Multisig::cancel_as_multi(Origin::signed(1), 3, vec![2, 3], now(), hash),);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -510,20 +463,14 @@ fn cancel_multisig_with_call_storage_works() {
|
||||
3,
|
||||
vec![1, 3],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
hash,
|
||||
0
|
||||
));
|
||||
assert_noop!(
|
||||
Multisig::cancel_as_multi(Origin::signed(2), 3, vec![1, 3], now(), hash.clone()),
|
||||
Multisig::cancel_as_multi(Origin::signed(2), 3, vec![1, 3], now(), hash),
|
||||
Error::<Test>::NotOwner,
|
||||
);
|
||||
assert_ok!(Multisig::cancel_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
now(),
|
||||
hash.clone()
|
||||
),);
|
||||
assert_ok!(Multisig::cancel_as_multi(Origin::signed(1), 3, vec![2, 3], now(), hash),);
|
||||
assert_eq!(Balances::free_balance(1), 10);
|
||||
});
|
||||
}
|
||||
@@ -533,14 +480,7 @@ fn cancel_multisig_with_alt_call_storage_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = call_transfer(6, 15).encode();
|
||||
let hash = blake2_256(&call);
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
None,
|
||||
hash.clone(),
|
||||
0
|
||||
));
|
||||
assert_ok!(Multisig::approve_as_multi(Origin::signed(1), 3, vec![2, 3], None, hash, 0));
|
||||
assert_eq!(Balances::free_balance(1), 6);
|
||||
assert_ok!(Multisig::as_multi(
|
||||
Origin::signed(2),
|
||||
@@ -770,23 +710,9 @@ fn duplicate_approvals_are_ignored() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let call = call_transfer(6, 15).encode();
|
||||
let hash = blake2_256(&call);
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(1),
|
||||
2,
|
||||
vec![2, 3],
|
||||
None,
|
||||
hash.clone(),
|
||||
0
|
||||
));
|
||||
assert_ok!(Multisig::approve_as_multi(Origin::signed(1), 2, vec![2, 3], None, hash, 0));
|
||||
assert_noop!(
|
||||
Multisig::approve_as_multi(
|
||||
Origin::signed(1),
|
||||
2,
|
||||
vec![2, 3],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
0
|
||||
),
|
||||
Multisig::approve_as_multi(Origin::signed(1), 2, vec![2, 3], Some(now()), hash, 0),
|
||||
Error::<Test>::AlreadyApproved,
|
||||
);
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
@@ -794,18 +720,11 @@ fn duplicate_approvals_are_ignored() {
|
||||
2,
|
||||
vec![1, 3],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
hash,
|
||||
0
|
||||
));
|
||||
assert_noop!(
|
||||
Multisig::approve_as_multi(
|
||||
Origin::signed(3),
|
||||
2,
|
||||
vec![1, 2],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
0
|
||||
),
|
||||
Multisig::approve_as_multi(Origin::signed(3), 2, vec![1, 2], Some(now()), hash, 0),
|
||||
Error::<Test>::AlreadyApproved,
|
||||
);
|
||||
});
|
||||
@@ -822,7 +741,7 @@ fn multisig_1_of_3_works() {
|
||||
let call = call_transfer(6, 15).encode();
|
||||
let hash = blake2_256(&call);
|
||||
assert_noop!(
|
||||
Multisig::approve_as_multi(Origin::signed(1), 1, vec![2, 3], None, hash.clone(), 0),
|
||||
Multisig::approve_as_multi(Origin::signed(1), 1, vec![2, 3], None, hash, 0),
|
||||
Error::<Test>::MinimumThreshold,
|
||||
);
|
||||
assert_noop!(
|
||||
@@ -906,20 +825,13 @@ fn multisig_handles_no_preimage_after_all_approve() {
|
||||
let call_weight = call.get_dispatch_info().weight;
|
||||
let data = call.encode();
|
||||
let hash = blake2_256(&data);
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(1),
|
||||
3,
|
||||
vec![2, 3],
|
||||
None,
|
||||
hash.clone(),
|
||||
0
|
||||
));
|
||||
assert_ok!(Multisig::approve_as_multi(Origin::signed(1), 3, vec![2, 3], None, hash, 0));
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
Origin::signed(2),
|
||||
3,
|
||||
vec![1, 3],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
hash,
|
||||
0
|
||||
));
|
||||
assert_ok!(Multisig::approve_as_multi(
|
||||
@@ -927,7 +839,7 @@ fn multisig_handles_no_preimage_after_all_approve() {
|
||||
3,
|
||||
vec![1, 2],
|
||||
Some(now()),
|
||||
hash.clone(),
|
||||
hash,
|
||||
0
|
||||
));
|
||||
assert_eq!(Balances::free_balance(6), 0);
|
||||
|
||||
Reference in New Issue
Block a user