Skip to content

Commit 8338efa

Browse files
committed
fix: lints and tests
1 parent e7bb1cb commit 8338efa

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

packages/injective-test-tube/src/module/helpers.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use prost::Message;
1818
use std::str::FromStr;
1919
use test_tube_inj::Module;
2020

21+
#[allow(dead_code)]
2122
pub fn add_exchange_admin(
2223
app: &InjectiveTestApp,
2324
validator: &SigningAccount,
@@ -90,6 +91,7 @@ pub fn add_exchange_admin(
9091
.unwrap();
9192
}
9293

94+
#[allow(dead_code)]
9395
pub fn launch_price_feed_oracle(
9496
app: &InjectiveTestApp,
9597
signer: &SigningAccount,
@@ -168,6 +170,7 @@ pub fn launch_price_feed_oracle(
168170
.unwrap();
169171
}
170172

173+
#[allow(dead_code)]
171174
pub fn launch_insurance_fund(
172175
app: &InjectiveTestApp,
173176
signer: &SigningAccount,

packages/injective-test-tube/src/module/wasm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ where
6969
.iter()
7070
.map(|c| injective_std::types::cosmos::base::v1beta1::Coin {
7171
denom: c.denom.parse().unwrap(),
72-
amount: format!("{}", c.amount.to_string()),
72+
amount: format!("{}", c.amount),
7373
})
7474
.collect(),
7575
},
@@ -96,7 +96,7 @@ where
9696
.iter()
9797
.map(|c| injective_std::types::cosmos::base::v1beta1::Coin {
9898
denom: c.denom.parse().unwrap(),
99-
amount: format!("{}", c.amount.to_string()),
99+
amount: format!("{}", c.amount),
100100
})
101101
.collect(),
102102
contract: contract.to_owned(),

packages/injective-test-tube/src/runner/app.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ mod tests {
201201
fn test_get_block_height() {
202202
let app = InjectiveTestApp::default();
203203

204-
assert_eq!(app.get_block_height(), 1i64);
204+
assert_eq!(app.get_block_height(), 500i64);
205205

206206
app.increase_time(10u64);
207207

208-
assert_eq!(app.get_block_height(), 2i64);
208+
assert_eq!(app.get_block_height(), 501i64);
209209
}
210210

211211
#[test]
@@ -275,7 +275,8 @@ mod tests {
275275
allow_admin_burn: true,
276276
};
277277

278-
assert_eq!(app.get_block_height(), 4i64);
278+
let mut current_block_height = 503i64;
279+
assert_eq!(app.get_block_height(), current_block_height);
279280

280281
let _res: ExecuteResponse<MsgCreateDenomResponse> = app
281282
.execute_multiple(
@@ -286,12 +287,13 @@ mod tests {
286287
&acc,
287288
)
288289
.unwrap();
289-
290-
assert_eq!(app.get_block_height(), 5i64);
290+
current_block_height += 1;
291+
assert_eq!(app.get_block_height(), current_block_height);
291292

292293
app.init_account(&coins(100_000_000_000_000_000_000u128, "inj")) // 100 inj
293294
.unwrap();
294-
assert_eq!(app.get_block_height(), 6i64);
295+
current_block_height += 1;
296+
assert_eq!(app.get_block_height(), current_block_height);
295297
}
296298

297299
#[test]
@@ -491,8 +493,9 @@ mod tests {
491493
.unwrap();
492494

493495
assert_eq!(res.gas_info.gas_wanted, gas_limit);
494-
assert_eq!(Uint256::new(bob_balance), Uint256::new(initial_balance) - amount.amount);
496+
assert_eq!(
497+
Uint256::new(bob_balance),
498+
Uint256::new(initial_balance) - amount.amount
499+
);
495500
}
496501
}
497-
498-

packages/test-tube/src/runner/app.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@ impl BaseApp {
338338

339339
let amount = cosmrs::Coin {
340340
denom: self.fee_denom.parse().unwrap(),
341-
amount: (((gas_limit as f64) * (gas_price.amount.to_string().parse::<u128>().unwrap() as f64)).ceil() as u64)
341+
amount: (((gas_limit as f64)
342+
* (gas_price.amount.to_string().parse::<u128>().unwrap() as f64))
343+
.ceil() as u64)
342344
.into(),
343345
};
344346
Ok(Fee::from_amount_and_gas(amount, gas_limit))

0 commit comments

Comments
 (0)