Skip to content

Commit f0a0354

Browse files
committed
Used ChainSpec::default().minimum_balance as minimum
1 parent 95be1da commit f0a0354

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/env/src/engine/off_chain/test_api.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use ink_engine::test_api::RecordedDebugMessages;
2727
use std::panic::UnwindSafe;
2828

2929
pub use super::call_data::CallData;
30+
pub use ink_engine::ext::ChainSpec;
3031
pub use ink_engine::ChainExtension;
3132

3233
/// Record for an emitted event.
@@ -55,8 +56,9 @@ pub fn set_account_balance<T>(account_id: T::AccountId, new_balance: T::Balance)
5556
where
5657
T: Environment<Balance = u128>, // Just temporary for the MVP!
5758
{
58-
if new_balance < T::Balance::from(1_000_000u64) {
59-
panic!("balance must be at least 1_000_000");
59+
let min = ChainSpec::default().minimum_balance;
60+
if new_balance < T::Balance::from(min) {
61+
panic!("balance must be at least [{}]", min);
6062
}
6163

6264
<EnvInstance as OnInstance>::on_instance(|instance| {

0 commit comments

Comments
 (0)