mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 07:41:08 +00:00
declone and close the door (#12035)
* declone and close the door * cargo fmt * remove brackets
This commit is contained in:
@@ -1416,12 +1416,7 @@ mod tests {
|
||||
loader.counter += 1;
|
||||
loader.map.insert(
|
||||
hash,
|
||||
MockExecutable {
|
||||
func: Rc::new(f),
|
||||
func_type,
|
||||
code_hash: hash.clone(),
|
||||
refcount: 1,
|
||||
},
|
||||
MockExecutable { func: Rc::new(f), func_type, code_hash: hash, refcount: 1 },
|
||||
);
|
||||
hash
|
||||
})
|
||||
@@ -2189,7 +2184,6 @@ mod tests {
|
||||
let dummy_ch = MockLoader::insert(Call, |_, _| exec_success());
|
||||
let instantiated_contract_address = Rc::new(RefCell::new(None::<AccountIdOf<Test>>));
|
||||
let instantiator_ch = MockLoader::insert(Call, {
|
||||
let dummy_ch = dummy_ch.clone();
|
||||
let instantiated_contract_address = Rc::clone(&instantiated_contract_address);
|
||||
move |ctx, _| {
|
||||
// Instantiate a contract and save it's address in `instantiated_contract_address`.
|
||||
@@ -2252,7 +2246,6 @@ mod tests {
|
||||
fn instantiation_traps() {
|
||||
let dummy_ch = MockLoader::insert(Constructor, |_, _| Err("It's a trap!".into()));
|
||||
let instantiator_ch = MockLoader::insert(Call, {
|
||||
let dummy_ch = dummy_ch.clone();
|
||||
move |ctx, _| {
|
||||
// Instantiate a contract and save it's address in `instantiated_contract_address`.
|
||||
assert_matches!(
|
||||
|
||||
@@ -139,7 +139,7 @@ impl TestExtension {
|
||||
}
|
||||
|
||||
fn last_seen_inputs() -> (u32, u32, u32, u32) {
|
||||
TEST_EXTENSION.with(|e| e.borrow().last_seen_inputs.clone())
|
||||
TEST_EXTENSION.with(|e| e.borrow().last_seen_inputs)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3478,8 +3478,8 @@ fn set_code_hash() {
|
||||
phase: Phase::Initialization,
|
||||
event: Event::Contracts(crate::Event::ContractCodeUpdated {
|
||||
contract: contract_addr.clone(),
|
||||
new_code_hash: new_code_hash.clone(),
|
||||
old_code_hash: code_hash.clone(),
|
||||
new_code_hash,
|
||||
old_code_hash: code_hash,
|
||||
}),
|
||||
topics: vec![],
|
||||
},
|
||||
|
||||
@@ -403,7 +403,7 @@ mod tests {
|
||||
salt: &[u8],
|
||||
) -> Result<(AccountIdOf<Self::T>, ExecReturnValue), ExecError> {
|
||||
self.instantiates.push(InstantiateEntry {
|
||||
code_hash: code_hash.clone(),
|
||||
code_hash,
|
||||
value,
|
||||
data: data.to_vec(),
|
||||
gas_left: gas_limit,
|
||||
@@ -541,7 +541,7 @@ mod tests {
|
||||
signature: &[u8; 65],
|
||||
message_hash: &[u8; 32],
|
||||
) -> Result<[u8; 33], ()> {
|
||||
self.ecdsa_recover.borrow_mut().push((signature.clone(), message_hash.clone()));
|
||||
self.ecdsa_recover.borrow_mut().push((*signature, *message_hash));
|
||||
Ok([3; 33])
|
||||
}
|
||||
fn contract_info(&mut self) -> &mut crate::ContractInfo<Self::T> {
|
||||
|
||||
Reference in New Issue
Block a user