Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zjb0807 committed Oct 8, 2024
1 parent c205a06 commit cb6afa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion modules/loans/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ impl ExtBuilder {
}
.assimilate_storage(&mut t)
.unwrap();
t.into()

let mut ext = sp_io::TestExternalities::new(t);
ext.execute_with(|| System::set_block_number(1));
ext
}
}
3 changes: 0 additions & 3 deletions modules/loans/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ fn check_update_loan_underflow_work() {
#[test]
fn adjust_position_should_work() {
ExtBuilder::default().build().execute_with(|| {
System::set_block_number(1);
assert_eq!(Currencies::free_balance(BTC, &ALICE), 1000);

// balance too low
Expand Down Expand Up @@ -166,7 +165,6 @@ fn update_loan_should_work() {
#[test]
fn transfer_loan_should_work() {
ExtBuilder::default().build().execute_with(|| {
System::set_block_number(1);
assert_ok!(LoansModule::update_loan(&ALICE, BTC, 400, 500));
assert_ok!(LoansModule::update_loan(&BOB, BTC, 100, 600));
assert_eq!(LoansModule::positions(BTC, &ALICE).debit, 500);
Expand All @@ -190,7 +188,6 @@ fn transfer_loan_should_work() {
#[test]
fn confiscate_collateral_and_debit_work() {
ExtBuilder::default().build().execute_with(|| {
System::set_block_number(1);
assert_ok!(LoansModule::update_loan(&BOB, BTC, 5000, 1000));
assert_eq!(Currencies::free_balance(BTC, &LoansModule::account_id()), 0);

Expand Down

0 comments on commit cb6afa9

Please sign in to comment.