mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 20:01:08 +00:00
Remove extra commas made redundent after rustfmt (#9404)
* Remove extra commas made redundent after rustfmt
This commit is contained in:
@@ -2468,7 +2468,7 @@ mod tests {
|
||||
let forbidden_call = Call::Balances(BalanceCall::transfer(CHARLIE, 22));
|
||||
|
||||
// simple cases: direct call
|
||||
assert_err!(ctx.ext.call_runtime(forbidden_call.clone()), BadOrigin,);
|
||||
assert_err!(ctx.ext.call_runtime(forbidden_call.clone()), BadOrigin);
|
||||
|
||||
// as part of a patch: return is OK (but it interrupted the batch)
|
||||
assert_ok!(ctx.ext.call_runtime(Call::Utility(UtilCall::batch(vec![
|
||||
|
||||
@@ -639,7 +639,7 @@ fn storage_size() {
|
||||
let addr = Contracts::contract_address(&ALICE, &code_hash, &[]);
|
||||
let bob_contract = ContractInfoOf::<Test>::get(&addr).unwrap().get_alive().unwrap();
|
||||
assert_eq!(bob_contract.storage_size, 4);
|
||||
assert_eq!(bob_contract.pair_count, 1,);
|
||||
assert_eq!(bob_contract.pair_count, 1);
|
||||
|
||||
assert_ok!(Contracts::call(
|
||||
Origin::signed(ALICE),
|
||||
@@ -650,7 +650,7 @@ fn storage_size() {
|
||||
));
|
||||
let bob_contract = ContractInfoOf::<Test>::get(&addr).unwrap().get_alive().unwrap();
|
||||
assert_eq!(bob_contract.storage_size, 4 + 4);
|
||||
assert_eq!(bob_contract.pair_count, 2,);
|
||||
assert_eq!(bob_contract.pair_count, 2);
|
||||
|
||||
assert_ok!(Contracts::call(
|
||||
Origin::signed(ALICE),
|
||||
@@ -661,7 +661,7 @@ fn storage_size() {
|
||||
));
|
||||
let bob_contract = ContractInfoOf::<Test>::get(&addr).unwrap().get_alive().unwrap();
|
||||
assert_eq!(bob_contract.storage_size, 4);
|
||||
assert_eq!(bob_contract.pair_count, 1,);
|
||||
assert_eq!(bob_contract.pair_count, 1);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -682,8 +682,8 @@ fn empty_kv_pairs() {
|
||||
let addr = Contracts::contract_address(&ALICE, &code_hash, &[]);
|
||||
let bob_contract = ContractInfoOf::<Test>::get(&addr).unwrap().get_alive().unwrap();
|
||||
|
||||
assert_eq!(bob_contract.storage_size, 0,);
|
||||
assert_eq!(bob_contract.pair_count, 1,);
|
||||
assert_eq!(bob_contract.storage_size, 0);
|
||||
assert_eq!(bob_contract.pair_count, 1);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf<Test>) -> bool) {
|
||||
ContractInfoOf::<Test>::get(&addr).unwrap().get_alive().unwrap().rent_allowance,
|
||||
allowance,
|
||||
);
|
||||
assert_eq!(Balances::free_balance(&addr), balance,);
|
||||
assert_eq!(Balances::free_balance(&addr), balance);
|
||||
|
||||
// Make contract have exactly the subsistence threshold
|
||||
Balances::make_free_balance_be(&addr, subsistence_threshold);
|
||||
@@ -1357,14 +1357,14 @@ fn restoration(
|
||||
assert_eq!(django_contract.storage_size, 8);
|
||||
assert_eq!(django_contract.trie_id, django_trie_id);
|
||||
assert_eq!(django_contract.deduct_block, System::block_number());
|
||||
assert_eq!(Storage::<Test>::read(&django_trie_id, &delta_key), Some(vec![40, 0, 0, 0]),);
|
||||
assert_eq!(Storage::<Test>::read(&django_trie_id, &delta_key), Some(vec![40, 0, 0, 0]));
|
||||
match (test_different_storage, test_restore_to_with_dirty_storage, test_code_evicted) {
|
||||
(true, false, false) => {
|
||||
assert_err_ignore_postinfo!(result, Error::<Test>::InvalidTombstone,);
|
||||
assert_err_ignore_postinfo!(result, Error::<Test>::InvalidTombstone);
|
||||
assert_eq!(System::events(), vec![]);
|
||||
},
|
||||
(_, true, false) => {
|
||||
assert_err_ignore_postinfo!(result, Error::<Test>::InvalidContractOrigin,);
|
||||
assert_err_ignore_postinfo!(result, Error::<Test>::InvalidContractOrigin);
|
||||
assert_eq!(
|
||||
System::events(),
|
||||
vec![
|
||||
@@ -1428,7 +1428,7 @@ fn restoration(
|
||||
);
|
||||
},
|
||||
(false, false, true) => {
|
||||
assert_err_ignore_postinfo!(result, Error::<Test>::CodeNotFound,);
|
||||
assert_err_ignore_postinfo!(result, Error::<Test>::CodeNotFound);
|
||||
assert_refcount!(set_rent_code_hash, 0);
|
||||
assert_eq!(System::events(), vec![]);
|
||||
},
|
||||
@@ -1576,7 +1576,7 @@ fn cannot_self_destruct_through_draning() {
|
||||
|
||||
// Call BOB which makes it send all funds to the zero address
|
||||
// The contract code asserts that the correct error value is returned.
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr, 0, GAS_LIMIT, vec![],));
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr, 0, GAS_LIMIT, vec![]));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2155,7 +2155,7 @@ fn lazy_removal_works() {
|
||||
child::put(trie, &[99], &42);
|
||||
|
||||
// Terminate the contract
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, vec![],));
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, vec![]));
|
||||
|
||||
// Contract info should be gone
|
||||
assert!(!<ContractInfoOf::<Test>>::contains_key(&addr));
|
||||
@@ -2209,7 +2209,7 @@ fn lazy_removal_partial_remove_works() {
|
||||
<ContractInfoOf<Test>>::insert(&addr, ContractInfo::Alive(info.clone()));
|
||||
|
||||
// Terminate the contract
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, vec![],));
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, vec![]));
|
||||
|
||||
// Contract info should be gone
|
||||
assert!(!<ContractInfoOf::<Test>>::contains_key(&addr));
|
||||
@@ -2286,7 +2286,7 @@ fn lazy_removal_does_no_run_on_full_block() {
|
||||
<ContractInfoOf<Test>>::insert(&addr, ContractInfo::Alive(info.clone()));
|
||||
|
||||
// Terminate the contract
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, vec![],));
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, vec![]));
|
||||
|
||||
// Contract info should be gone
|
||||
assert!(!<ContractInfoOf::<Test>>::contains_key(&addr));
|
||||
@@ -2359,7 +2359,7 @@ fn lazy_removal_does_not_use_all_weight() {
|
||||
<ContractInfoOf<Test>>::insert(&addr, ContractInfo::Alive(info.clone()));
|
||||
|
||||
// Terminate the contract
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, vec![],));
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr.clone(), 0, GAS_LIMIT, vec![]));
|
||||
|
||||
// Contract info should be gone
|
||||
assert!(!<ContractInfoOf::<Test>>::contains_key(&addr));
|
||||
@@ -2543,7 +2543,7 @@ fn refcounter() {
|
||||
let addr2 = Contracts::contract_address(&ALICE, &code_hash, &[2]);
|
||||
|
||||
// Terminating one contract should decrement the refcount
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr0, 0, GAS_LIMIT, vec![],));
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr0, 0, GAS_LIMIT, vec![]));
|
||||
assert_refcount!(code_hash, 2);
|
||||
|
||||
// make remaining contracts eligible for eviction
|
||||
@@ -2657,7 +2657,7 @@ fn debug_message_logging_disabled() {
|
||||
let result = Contracts::bare_call(ALICE, addr.clone(), 0, GAS_LIMIT, vec![], false);
|
||||
assert_matches!(result.result, Ok(_));
|
||||
// the dispatchables always run without debugging
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr, 0, GAS_LIMIT, vec![],));
|
||||
assert_ok!(Contracts::call(Origin::signed(ALICE), addr, 0, GAS_LIMIT, vec![]));
|
||||
assert!(result.debug_message.is_empty());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn macro_gen_signature() {
|
||||
assert_eq!(gen_signature!((i32)), FunctionType::new(vec![ValueType::I32], vec![]),);
|
||||
assert_eq!(gen_signature!((i32)), FunctionType::new(vec![ValueType::I32], vec![]));
|
||||
|
||||
assert_eq!(
|
||||
gen_signature!( (i32, u32) -> u32 ),
|
||||
|
||||
@@ -507,7 +507,7 @@ mod tests {
|
||||
#[test]
|
||||
fn contract_transfer() {
|
||||
let mut mock_ext = MockExt::default();
|
||||
assert_ok!(execute(CODE_TRANSFER, vec![], &mut mock_ext,));
|
||||
assert_ok!(execute(CODE_TRANSFER, vec![], &mut mock_ext));
|
||||
|
||||
assert_eq!(&mock_ext.transfers, &[TransferEntry { to: ALICE, value: 153 }]);
|
||||
}
|
||||
@@ -561,7 +561,7 @@ mod tests {
|
||||
#[test]
|
||||
fn contract_call() {
|
||||
let mut mock_ext = MockExt::default();
|
||||
assert_ok!(execute(CODE_CALL, vec![], &mut mock_ext,));
|
||||
assert_ok!(execute(CODE_CALL, vec![], &mut mock_ext));
|
||||
|
||||
assert_eq!(
|
||||
&mock_ext.calls,
|
||||
@@ -787,7 +787,7 @@ mod tests {
|
||||
#[test]
|
||||
fn contract_instantiate() {
|
||||
let mut mock_ext = MockExt::default();
|
||||
assert_ok!(execute(CODE_INSTANTIATE, vec![], &mut mock_ext,));
|
||||
assert_ok!(execute(CODE_INSTANTIATE, vec![], &mut mock_ext));
|
||||
|
||||
assert_matches!(
|
||||
&mock_ext.instantiates[..],
|
||||
@@ -884,7 +884,7 @@ mod tests {
|
||||
#[test]
|
||||
fn contract_call_limited_gas() {
|
||||
let mut mock_ext = MockExt::default();
|
||||
assert_ok!(execute(&CODE_TRANSFER_LIMITED_GAS, vec![], &mut mock_ext,));
|
||||
assert_ok!(execute(&CODE_TRANSFER_LIMITED_GAS, vec![], &mut mock_ext));
|
||||
|
||||
assert_eq!(
|
||||
&mock_ext.calls,
|
||||
@@ -1014,7 +1014,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn caller() {
|
||||
assert_ok!(execute(CODE_CALLER, vec![], MockExt::default(),));
|
||||
assert_ok!(execute(CODE_CALLER, vec![], MockExt::default()));
|
||||
}
|
||||
|
||||
/// calls `seal_address` and compares the result with the constant 69.
|
||||
@@ -1062,7 +1062,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn address() {
|
||||
assert_ok!(execute(CODE_ADDRESS, vec![], MockExt::default(),));
|
||||
assert_ok!(execute(CODE_ADDRESS, vec![], MockExt::default()));
|
||||
}
|
||||
|
||||
const CODE_BALANCE: &str = r#"
|
||||
@@ -1108,7 +1108,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn balance() {
|
||||
assert_ok!(execute(CODE_BALANCE, vec![], MockExt::default(),));
|
||||
assert_ok!(execute(CODE_BALANCE, vec![], MockExt::default()));
|
||||
}
|
||||
|
||||
const CODE_GAS_PRICE: &str = r#"
|
||||
@@ -1154,7 +1154,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn gas_price() {
|
||||
assert_ok!(execute(CODE_GAS_PRICE, vec![], MockExt::default(),));
|
||||
assert_ok!(execute(CODE_GAS_PRICE, vec![], MockExt::default()));
|
||||
}
|
||||
|
||||
const CODE_GAS_LEFT: &str = r#"
|
||||
@@ -1252,7 +1252,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn value_transferred() {
|
||||
assert_ok!(execute(CODE_VALUE_TRANSFERRED, vec![], MockExt::default(),));
|
||||
assert_ok!(execute(CODE_VALUE_TRANSFERRED, vec![], MockExt::default()));
|
||||
}
|
||||
|
||||
const CODE_RETURN_FROM_START_FN: &str = r#"
|
||||
@@ -1332,7 +1332,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn now() {
|
||||
assert_ok!(execute(CODE_TIMESTAMP_NOW, vec![], MockExt::default(),));
|
||||
assert_ok!(execute(CODE_TIMESTAMP_NOW, vec![], MockExt::default()));
|
||||
}
|
||||
|
||||
const CODE_MINIMUM_BALANCE: &str = r#"
|
||||
@@ -1377,7 +1377,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn minimum_balance() {
|
||||
assert_ok!(execute(CODE_MINIMUM_BALANCE, vec![], MockExt::default(),));
|
||||
assert_ok!(execute(CODE_MINIMUM_BALANCE, vec![], MockExt::default()));
|
||||
}
|
||||
|
||||
const CODE_TOMBSTONE_DEPOSIT: &str = r#"
|
||||
@@ -1422,7 +1422,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn tombstone_deposit() {
|
||||
assert_ok!(execute(CODE_TOMBSTONE_DEPOSIT, vec![], MockExt::default(),));
|
||||
assert_ok!(execute(CODE_TOMBSTONE_DEPOSIT, vec![], MockExt::default()));
|
||||
}
|
||||
|
||||
const CODE_RANDOM: &str = r#"
|
||||
@@ -1596,7 +1596,7 @@ mod tests {
|
||||
#[test]
|
||||
fn deposit_event() {
|
||||
let mut mock_ext = MockExt::default();
|
||||
assert_ok!(execute(CODE_DEPOSIT_EVENT, vec![], &mut mock_ext,));
|
||||
assert_ok!(execute(CODE_DEPOSIT_EVENT, vec![], &mut mock_ext));
|
||||
|
||||
assert_eq!(
|
||||
mock_ext.events,
|
||||
@@ -2033,7 +2033,7 @@ mod tests {
|
||||
let call = Call::System(frame_system::Call::remark(b"Hello World".to_vec()));
|
||||
let mut ext = MockExt::default();
|
||||
let result = execute(CODE_CALL_RUNTIME, call.encode(), &mut ext).unwrap();
|
||||
assert_eq!(*ext.runtime_calls.borrow(), vec![call],);
|
||||
assert_eq!(*ext.runtime_calls.borrow(), vec![call]);
|
||||
// 0 = ReturnCode::Success
|
||||
assert_eq!(u32::from_le_bytes(result.data.0.try_into().unwrap()), 0);
|
||||
}
|
||||
@@ -2050,6 +2050,6 @@ mod tests {
|
||||
origin: ErrorOrigin::Caller,
|
||||
})
|
||||
);
|
||||
assert_eq!(*ext.runtime_calls.borrow(), vec![],);
|
||||
assert_eq!(*ext.runtime_calls.borrow(), vec![]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user