ronantakizawa/codereview-bench huggingface dataset:
Repository: paritytech/substrate
File: client/network/sync/src/lib.rs (Rust)

Code before:

		if let Some((id, request)) = self.state_request() {
			self.send_state_request(id, request);
		}

		for (id, request) in self.justification_requests().collect::<Vec<_>>() {
			self.send_block_request(id, request);
		}

		if let Some((id, request)) = self.warp_sync_request() {
			self.send_warp_sync_request(id, request);
		}
	}

	fn poll_pending_responses(&mut self, cx: &mut std::task::Context) -> Poll<ImportResult<B>> {
		let ready_responses = self
			.pending_responses
			.iter_mut()
			.filter_map(|(_, future)| match future.poll_unpin(cx) {
				Poll::Pending => None,
				Poll::Ready(result) => Some(result),
			})
			.collect::<Vec<_>>();

		for (id, request, response) in ready_responses {
			self.pending_responses.remove(&id).expect("peer to exist");

			match response {
				Ok(Ok(resp)) => match request {
					PeerRequest::Block(req) => {
						let response = match Self::decode_block_response(&resp[..]) {
							Ok(proto) => proto,
							Err(e) => {
								debug!(
									target: "sync",
									"Failed to decode block response from peer {:?}: {:?}.",
									id,
									e
								);
								self.network_service.report_peer(id, rep::BAD_MESSAGE);
								self.network_service
									.disconnect_peer(id, self.block_announce_protocol_name.clone());
								continue
							},
						};

						if let Some(import) = self.on_block_response(id, req, response) {
							return Poll::Ready(import)
						}
					},
					PeerRequest::State => {

Review comment (suggestion):
```suggestion
			self.pending_responses.remove(&id).expect("Peer was just iterated and exist; qed");
```

Code after:

		if let Some((id, request)) = self.state_request() {
			self.send_state_request(id, request);
		}

		for (id, request) in self.justification_requests().collect::<Vec<_>>() {
			self.send_block_request(id, request);
		}

		if let Some((id, request)) = self.warp_sync_request() {
			self.send_warp_sync_request(id, request);
		}
	}

	fn poll_pending_responses(&mut self, cx: &mut std::task::Context) -> Poll<ImportResult<B>> {
		let ready_responses = self
			.pending_responses
			.values_mut()
			.filter_map(|future| match future.poll_unpin(cx) {
				Poll::Pending => None,
				Poll::Ready(result) => Some(result),
			})
			.collect::<Vec<_>>();

		for (id, request, response) in ready_responses {
			self.pending_responses
				.remove(&id)
				.expect("Logic error: peer id from pending response is missing in the map.");

			match response {
				Ok(Ok(resp)) => match request {
					PeerRequest::Block(req) => {
						let response = match Self::decode_block_response(&resp[..]) {
							Ok(proto) => proto,
							Err(e) => {
								debug!(
									target: "sync",
									"Failed to decode block response from peer {:?}: {:?}.",
									id,
									e
								);
								self.network_service.report_peer(id, rep::BAD_MESSAGE);
								self.network_service
									.disconnect_peer(id, self.block_announce_protocol_name.clone());
								continue
							},
						};

						if let Some(import) = self.on_block_response(id, req, response) {
							return Poll::Ready(import)
						}
Repository: paritytech/substrate
File: client/network/sync/src/lib.rs (Rust)

Code before:
		}
	}

	fn process_outbound_requests(&mut self) {
		for (id, request) in self.block_requests() {
			self.send_block_request(id, request);
		}

		if let Some((id, request)) = self.state_request() {
			self.send_state_request(id, request);
		}

		for (id, request) in self.justification_requests().collect::<Vec<_>>() {
			self.send_block_request(id, request);
		}

		if let Some((id, request)) = self.warp_sync_request() {
			self.send_warp_sync_request(id, request);
		}
	}

	fn poll_pending_responses(&mut self, cx: &mut std::task::Context) -> Poll<ImportResult<B>> {
		let ready_responses = self
			.pending_responses
			.iter_mut()
			.filter_map(|(_, future)| match future.poll_unpin(cx) {
				Poll::Pending => None,
				Poll::Ready(result) => Some(result),
			})
			.collect::<Vec<_>>();

		for (id, request, response) in ready_responses {
			self.pending_responses
				.remove(&id)
				.expect("Peer was just iterated and exist; qed");

			match response {
				Ok(Ok(resp)) => match request {
					PeerRequest::Block(req) => {
						let response = match Self::decode_block_response(&resp[..]) {
							Ok(proto) => proto,
							Err(e) => {
								debug!(
									target: "sync",
									"Failed to decode block response from peer {:?}: {:?}.",
									id,
									e
								);
								self.network_service.report_peer(id, rep::BAD_MESSAGE);
								self.network_service
									.disconnect_peer(id, self.block_announce_protocol_name.clone());

Review comment (suggestion):
Nit:
```suggestion
			.values_mut()
			.filter_map(|future| match future.poll_unpin(cx) {
```



Code after:
		}
	}

	fn process_outbound_requests(&mut self) {
		for (id, request) in self.block_requests() {
			self.send_block_request(id, request);
		}

		if let Some((id, request)) = self.state_request() {
			self.send_state_request(id, request);
		}

		for (id, request) in self.justification_requests().collect::<Vec<_>>() {
			self.send_block_request(id, request);
		}

		if let Some((id, request)) = self.warp_sync_request() {
			self.send_warp_sync_request(id, request);
		}
	}

	fn poll_pending_responses(&mut self, cx: &mut std::task::Context) -> Poll<ImportResult<B>> {
		let ready_responses = self
			.pending_responses
			.values_mut()
			.filter_map(|future| match future.poll_unpin(cx) {
				Poll::Pending => None,
				Poll::Ready(result) => Some(result),
			})
			.collect::<Vec<_>>();

		for (id, request, response) in ready_responses {
			self.pending_responses
				.remove(&id)
				.expect("Logic error: peer id from pending response is missing in the map.");

			match response {
				Ok(Ok(resp)) => match request {
					PeerRequest::Block(req) => {
						let response = match Self::decode_block_response(&resp[..]) {
							Ok(proto) => proto,
							Err(e) => {
								debug!(
									target: "sync",
									"Failed to decode block response from peer {:?}: {:?}.",
									id,
									e
								);
								self.network_service.report_peer(id, rep::BAD_MESSAGE);
								self.network_service
									.disconnect_peer(id, self.block_announce_protocol_name.clone());
Repository: paritytech/substrate
File: frame/referenda/src/lib.rs (Rust)

Code before:
#![recursion_limit = "256"]
#![cfg_attr(not(feature = "std"), no_std)]

use codec::{Codec, Encode};
use frame_support::{
	dispatch::DispatchResult,
	ensure,
	traits::{
		schedule::{
			v3::{Anon as ScheduleAnon, Named as ScheduleNamed},
			DispatchTime,
		},
		Currency, Hash as PreimageHash, LockIdentifier, OnUnbalanced, OriginTrait, PollStatus,
		Polling, QueryPreimage, ReservableCurrency, StorePreimage, VoteTally,
	},
	BoundedVec,
};
use scale_info::TypeInfo;
use sp_runtime::{
	traits::{AtLeast32BitUnsigned, Bounded, Dispatchable, One, Saturating, Zero},
	DispatchError, Perbill,
};
use sp_std::{fmt::Debug, prelude::*};

#[cfg(any(test, feature = "try-runtime"))]
use sp_runtime::TryRuntimeError;

mod branch;
pub mod migration;
mod types;
pub mod weights;

use self::branch::{BeginDecidingBranch, OneFewerDecidingBranch, ServiceBranch};
pub use self::{
	pallet::*,
	types::{
		BalanceOf, BoundedCallOf, CallOf, Curve, DecidingStatus, DecidingStatusOf, Deposit,
		InsertSorted, NegativeImbalanceOf, PalletsOriginOf, ReferendumIndex, ReferendumInfo,
		ReferendumInfoOf, ReferendumStatus, ReferendumStatusOf, ScheduleAddressOf, TallyOf,
		TrackIdOf, TrackInfo, TrackInfoOf, TracksInfo, VotesOf,
	},
	weights::WeightInfo,
};

#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;

#[cfg(feature = "runtime-benchmarks")]
pub mod benchmarking;

Review comment (suggestion):
Small nit: do you mind removing this import and instead referring to `TryRuntimeError` as `sp_runtime::TryRuntimeError` inline where it is used? Kian and I have been trying to follow that convention, makes top level imports a bit cleaner.

Code after:
#![recursion_limit = "256"]
#![cfg_attr(not(feature = "std"), no_std)]

use codec::{Codec, Encode};
use frame_support::{
	dispatch::DispatchResult,
	ensure,
	traits::{
		schedule::{
			v3::{Anon as ScheduleAnon, Named as ScheduleNamed},
			DispatchTime,
		},
		Currency, Hash as PreimageHash, LockIdentifier, OnUnbalanced, OriginTrait, PollStatus,
		Polling, QueryPreimage, ReservableCurrency, StorePreimage, VoteTally,
	},
	BoundedVec,
};
use frame_system::pallet_prelude::BlockNumberFor;
use scale_info::TypeInfo;
use sp_runtime::{
	traits::{AtLeast32BitUnsigned, Bounded, Dispatchable, One, Saturating, Zero},
	DispatchError, Perbill,
};
use sp_std::{fmt::Debug, prelude::*};

mod branch;
pub mod migration;
mod types;
pub mod weights;

use self::branch::{BeginDecidingBranch, OneFewerDecidingBranch, ServiceBranch};
pub use self::{
	pallet::*,
	types::{
		BalanceOf, BoundedCallOf, CallOf, Curve, DecidingStatus, DecidingStatusOf, Deposit,
		InsertSorted, NegativeImbalanceOf, PalletsOriginOf, ReferendumIndex, ReferendumInfo,
		ReferendumInfoOf, ReferendumStatus, ReferendumStatusOf, ScheduleAddressOf, TallyOf,
		TrackIdOf, TrackInfo, TrackInfoOf, TracksInfo, VotesOf,
	},
	weights::WeightInfo,
};

#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;

#[cfg(feature = "runtime-benchmarks")]
pub mod benchmarking;

pub use frame_support::traits::Get;
Repository: paritytech/substrate
File: frame/contracts/src/tests.rs (Rust)

Code before:
			Code::Upload(wasm_caller),
			vec![],
			vec![],
			false,
		)
		.result
		.unwrap()
		.account_id;
		let addr_callee = Contracts::bare_instantiate(
			ALICE,
			0,
			GAS_LIMIT,
			None,
			Code::Upload(wasm_callee),
			vec![],
			vec![],
			false,
		)
		.result
		.unwrap()
		.account_id;

		// Give caller proxy access to Alice.
		assert_ok!(Proxy::add_proxy(RuntimeOrigin::signed(ALICE), addr_caller.clone(), (), 0));

		// Create a Proxy call that will attempt to transfer away's Alice balance, so we can test a
		// failed charge.
		let min_balance = <Test as Config>::Currency::minimum_balance();
		let transfer_call =
			Box::new(RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
				dest: CHARLIE,
				value: pallet_balances::Pallet::<Test>::free_balance(&ALICE) - min_balance,
			}));

		// Wrap the transfer call in a proxy call.
		let transfer_proxy_call = RuntimeCall::Proxy(pallet_proxy::Call::proxy {
			real: ALICE,
			force_proxy_type: Some(()),
			call: transfer_call,
		});

		// bump the deposit per byte to a high value to trigger a FundsUnavailable error.
		DEPOSIT_PER_BYTE.with(|c| *c.borrow_mut() = 100);

		let data = (
			100u32, // storage length
			addr_callee,
			transfer_proxy_call,
		);

		let result = <Pallet<Test>>::call(

Review comment (suggestion):
```suggestion
		// Create a Proxy call that will attempt to transfer away Alice's balance, so we can test a
```

Code after:
	})
}

#[test]
fn failed_deposit_charge_should_roll_back_call() {
	let (wasm_caller, _) = compile_module::<Test>("call_runtime_and_call").unwrap();
	let (wasm_callee, _) = compile_module::<Test>("store_call").unwrap();
	const ED: u64 = 200;

	let execute = || {
		ExtBuilder::default().existential_deposit(ED).build().execute_with(|| {
			let _ = Balances::deposit_creating(&ALICE, 1_000_000);

			// Instantiate both contracts.
			let addr_caller = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_caller.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;
			let addr_callee = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_callee.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;

			// Give caller proxy access to Alice.
			assert_ok!(Proxy::add_proxy(RuntimeOrigin::signed(ALICE), addr_caller.clone(), (), 0));

			// Create a Proxy call that will attempt to transfer away Alice's balance.
			let transfer_call =
				Box::new(RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
					dest: CHARLIE,
					value: pallet_balances::Pallet::<Test>::free_balance(&ALICE) - 2 * ED,
				}));
Repository: paritytech/substrate
File: frame/contracts/src/tests.rs (Rust)

Code before:
			params.extend_from_slice(message);

			<Pallet<Test>>::bare_call(
				ALICE,
				addr.clone(),
				0,
				GAS_LIMIT,
				None,
				params,
				false,
				Determinism::Enforced,
			)
			.result
			.unwrap()
		};

		// verification should succeed for "hello world"
		assert_return_code!(call_with(&b"hello world"), RuntimeReturnCode::Success);

		// verification should fail for other messages
		assert_return_code!(call_with(&b"hello worlD"), RuntimeReturnCode::Sr25519VerifyFailed);
	})
}

#[test]
fn test_failed_charge_should_roll_back_call() {
	let (wasm_caller, _) = compile_module::<Test>("call_runtime_and_call").unwrap();
	let (wasm_callee, _) = compile_module::<Test>("store").unwrap();

	ExtBuilder::default().existential_deposit(200).build().execute_with(|| {
		let _ = Balances::deposit_creating(&ALICE, 1_000_000);

		// Instantiate both contracts.
		let addr_caller = Contracts::bare_instantiate(
			ALICE,
			0,
			GAS_LIMIT,
			None,
			Code::Upload(wasm_caller),
			vec![],
			vec![],
			false,
		)
		.result
		.unwrap()
		.account_id;
		let addr_callee = Contracts::bare_instantiate(
			ALICE,
			0,
			GAS_LIMIT,
			None,

Review comment (bug):
```suggestion
fn failed_deposit_charge_should_roll_back_call() {
```

Code after:
			let signature: [u8; 64] = [
				184, 49, 74, 238, 78, 165, 102, 252, 22, 92, 156, 176, 124, 118, 168, 116, 247,
				99, 0, 94, 2, 45, 9, 170, 73, 222, 182, 74, 60, 32, 75, 64, 98, 174, 69, 55, 83,
				85, 180, 98, 208, 75, 231, 57, 205, 62, 4, 105, 26, 136, 172, 17, 123, 99, 90, 255,
				228, 54, 115, 63, 30, 207, 205, 131,
			];

			// Alice's public key
			#[rustfmt::skip]
			let public_key: [u8; 32] = [
				212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44,
				133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125,
			];

			let mut params = vec![];
			params.extend_from_slice(&signature);
			params.extend_from_slice(&public_key);
			params.extend_from_slice(message);

			<Pallet<Test>>::bare_call(
				ALICE,
				addr.clone(),
				0,
				GAS_LIMIT,
				None,
				params,
				false,
				Determinism::Enforced,
			)
			.result
			.unwrap()
		};

		// verification should succeed for "hello world"
		assert_return_code!(call_with(&b"hello world"), RuntimeReturnCode::Success);

		// verification should fail for other messages
		assert_return_code!(call_with(&b"hello worlD"), RuntimeReturnCode::Sr25519VerifyFailed);
	})
}

#[test]
fn failed_deposit_charge_should_roll_back_call() {
	let (wasm_caller, _) = compile_module::<Test>("call_runtime_and_call").unwrap();
	let (wasm_callee, _) = compile_module::<Test>("store_call").unwrap();
	const ED: u64 = 200;

	let execute = || {
		ExtBuilder::default().existential_deposit(ED).build().execute_with(|| {
			let _ = Balances::deposit_creating(&ALICE, 1_000_000);
Repository: paritytech/substrate
File: frame/contracts/src/tests.rs (Rust)

Code before:
			false,
		)
		.result
		.unwrap()
		.account_id;

		// Give caller proxy access to Alice.
		assert_ok!(Proxy::add_proxy(RuntimeOrigin::signed(ALICE), addr_caller.clone(), (), 0));

		// Create a Proxy call that will attempt to transfer away's Alice balance, so we can test a
		// failed charge.
		let min_balance = <Test as Config>::Currency::minimum_balance();
		let transfer_call =
			Box::new(RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
				dest: CHARLIE,
				value: pallet_balances::Pallet::<Test>::free_balance(&ALICE) - min_balance,
			}));

		// Wrap the transfer call in a proxy call.
		let transfer_proxy_call = RuntimeCall::Proxy(pallet_proxy::Call::proxy {
			real: ALICE,
			force_proxy_type: Some(()),
			call: transfer_call,
		});

		// bump the deposit per byte to a high value to trigger a FundsUnavailable error.
		DEPOSIT_PER_BYTE.with(|c| *c.borrow_mut() = 100);

		let data = (
			100u32, // storage length
			addr_callee,
			transfer_proxy_call,
		);

		let result = <Pallet<Test>>::call(
			RuntimeOrigin::signed(ALICE),
			addr_caller.clone(),
			0,
			GAS_LIMIT,
			None,
			data.encode(),
		);

		assert_err_ignore_postinfo!(result, TokenError::FundsUnavailable);
	})
}

#[test]
fn upload_code_works() {
	let (wasm, code_hash) = compile_module::<Test>("dummy").unwrap();


Review comment (suggestion):
```suggestion
		// Bump the deposit per byte to a high value to trigger a FundsUnavailable error.
```

Code after:
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_caller.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;
			let addr_callee = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_callee.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;

			// Give caller proxy access to Alice.
			assert_ok!(Proxy::add_proxy(RuntimeOrigin::signed(ALICE), addr_caller.clone(), (), 0));

			// Create a Proxy call that will attempt to transfer away Alice's balance.
			let transfer_call =
				Box::new(RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
					dest: CHARLIE,
					value: pallet_balances::Pallet::<Test>::free_balance(&ALICE) - 2 * ED,
				}));

			// Wrap the transfer call in a proxy call.
			let transfer_proxy_call = RuntimeCall::Proxy(pallet_proxy::Call::proxy {
				real: ALICE,
				force_proxy_type: Some(()),
				call: transfer_call,
			});

			let data = (
				(ED - DepositPerItem::get()) as u32, // storage length
				addr_callee,
				transfer_proxy_call,
			);

			<Pallet<Test>>::call(
				RuntimeOrigin::signed(ALICE),
				addr_caller.clone(),
Repository: paritytech/substrate
File: frame/contracts/src/tests.rs (Rust)

Code before:
				Code::Upload(wasm_caller.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;
			let addr_callee = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_callee.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;

			// Give caller proxy access to Alice.
			assert_ok!(Proxy::add_proxy(RuntimeOrigin::signed(ALICE), addr_caller.clone(), (), 0));

			// Create a Proxy call that will attempt to transfer away Alice's balance
			let transfer_call =
				Box::new(RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
					dest: CHARLIE,
					value: pallet_balances::Pallet::<Test>::free_balance(&ALICE) - 2 * ED,
				}));

			// Wrap the transfer call in a proxy call.
			let transfer_proxy_call = RuntimeCall::Proxy(pallet_proxy::Call::proxy {
				real: ALICE,
				force_proxy_type: Some(()),
				call: transfer_call,
			});

			let data = (
				(ED - DepositPerItem::get()) as u32, // storage length
				addr_callee,
				transfer_proxy_call,
			);

			<Pallet<Test>>::call(
				RuntimeOrigin::signed(ALICE),
				addr_caller.clone(),
				0,
				GAS_LIMIT,
				None,

Review comment (suggestion):
```suggestion
			// Create a Proxy call that will attempt to transfer away Alice's balance.
```

Code after:

#[test]
fn failed_deposit_charge_should_roll_back_call() {
	let (wasm_caller, _) = compile_module::<Test>("call_runtime_and_call").unwrap();
	let (wasm_callee, _) = compile_module::<Test>("store_call").unwrap();
	const ED: u64 = 200;

	let execute = || {
		ExtBuilder::default().existential_deposit(ED).build().execute_with(|| {
			let _ = Balances::deposit_creating(&ALICE, 1_000_000);

			// Instantiate both contracts.
			let addr_caller = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_caller.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;
			let addr_callee = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_callee.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;

			// Give caller proxy access to Alice.
			assert_ok!(Proxy::add_proxy(RuntimeOrigin::signed(ALICE), addr_caller.clone(), (), 0));

			// Create a Proxy call that will attempt to transfer away Alice's balance.
			let transfer_call =
				Box::new(RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
					dest: CHARLIE,
					value: pallet_balances::Pallet::<Test>::free_balance(&ALICE) - 2 * ED,
				}));

			// Wrap the transfer call in a proxy call.
			let transfer_proxy_call = RuntimeCall::Proxy(pallet_proxy::Call::proxy {
Repository: paritytech/substrate
File: frame/contracts/src/tests.rs (Rust)

Code before:
			<Pallet<Test>>::bare_call(
				ALICE,
				addr.clone(),
				0,
				GAS_LIMIT,
				None,
				params,
				false,
				Determinism::Enforced,
			)
			.result
			.unwrap()
		};

		// verification should succeed for "hello world"
		assert_return_code!(call_with(&b"hello world"), RuntimeReturnCode::Success);

		// verification should fail for other messages
		assert_return_code!(call_with(&b"hello worlD"), RuntimeReturnCode::Sr25519VerifyFailed);
	})
}

#[test]
fn failed_deposit_charge_should_roll_back_call() {
	let (wasm_caller, _) = compile_module::<Test>("call_runtime_and_call").unwrap();
	let (wasm_callee, _) = compile_module::<Test>("store").unwrap();
	const ED: u64 = 200;

	let execute = || {
		ExtBuilder::default().existential_deposit(ED).build().execute_with(|| {
			let _ = Balances::deposit_creating(&ALICE, 1_000_000);

			// Instantiate both contracts.
			let addr_caller = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_caller.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;
			let addr_callee = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,

Review comment (suggestion):
```suggestion
	let (wasm_callee, _) = compile_module::<Test>("call_store").unwrap();
```

Code after:
			<Pallet<Test>>::bare_call(
				ALICE,
				addr.clone(),
				0,
				GAS_LIMIT,
				None,
				params,
				false,
				Determinism::Enforced,
			)
			.result
			.unwrap()
		};

		// verification should succeed for "hello world"
		assert_return_code!(call_with(&b"hello world"), RuntimeReturnCode::Success);

		// verification should fail for other messages
		assert_return_code!(call_with(&b"hello worlD"), RuntimeReturnCode::Sr25519VerifyFailed);
	})
}

#[test]
fn failed_deposit_charge_should_roll_back_call() {
	let (wasm_caller, _) = compile_module::<Test>("call_runtime_and_call").unwrap();
	let (wasm_callee, _) = compile_module::<Test>("store_call").unwrap();
	const ED: u64 = 200;

	let execute = || {
		ExtBuilder::default().existential_deposit(ED).build().execute_with(|| {
			let _ = Balances::deposit_creating(&ALICE, 1_000_000);

			// Instantiate both contracts.
			let addr_caller = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,
				Code::Upload(wasm_caller.clone()),
				vec![],
				vec![],
				false,
			)
			.result
			.unwrap()
			.account_id;
			let addr_callee = Contracts::bare_instantiate(
				ALICE,
				0,
				GAS_LIMIT,
				None,