Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
gshep committed Jun 16, 2022
1 parent b47b60e commit c2c4cf1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
36 changes: 24 additions & 12 deletions pallets/gear/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@ pub mod pallet {
allow_other_panics: bool,
) -> Result<GasInfo, Vec<u8>> {
let initial_gas = <T as pallet_gas::Config>::BlockGasLimit::get();
let GasInfo { min_limit, to_send, .. } = Self::calculate_gas_info_impl(
let GasInfo {
min_limit, to_send, ..
} = Self::calculate_gas_info_impl(
source,
kind.clone(),
initial_gas,
Expand All @@ -536,11 +538,15 @@ pub mod pallet {
allow_other_panics,
b"calculate_gas_salt1".to_vec(),
)
.map(|GasInfo { to_send, burned, .. }| GasInfo {
min_limit,
to_send,
burned,
})
.map(
|GasInfo {
to_send, burned, ..
}| GasInfo {
min_limit,
to_send,
burned,
},
)
}

#[cfg(test)]
Expand All @@ -551,7 +557,9 @@ pub mod pallet {
value: u128,
allow_other_panics: bool,
) -> Result<GasInfo, Vec<u8>> {
let GasInfo { min_limit, to_send, .. } = mock::run_with_ext_copy(|| {
let GasInfo {
min_limit, to_send, ..
} = mock::run_with_ext_copy(|| {
let initial_gas = <T as pallet_gas::Config>::BlockGasLimit::get();
Self::calculate_gas_info_impl(
source,
Expand All @@ -575,11 +583,15 @@ pub mod pallet {
allow_other_panics,
b"calculate_gas_salt".to_vec(),
)
.map(|GasInfo { to_send, burned, .. }| GasInfo {
min_limit,
to_send,
burned,
})
.map(
|GasInfo {
to_send, burned, ..
}| GasInfo {
min_limit,
to_send,
burned,
},
)
})
}

Expand Down
9 changes: 6 additions & 3 deletions pallets/gear/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2510,7 +2510,8 @@ fn no_redundant_gas_value_after_exiting() {
run_to_block(2, None);

let GasInfo {
min_limit: gas_spent, ..
min_limit: gas_spent,
..
} = Gear::calculate_gas_info(
USER_1.into_origin(),
HandleKind::Handle(prog_id),
Expand Down Expand Up @@ -3007,7 +3008,8 @@ fn gas_spent_precalculated() {
run_to_block(2, None);

let GasInfo {
min_limit: gas_spent_1, ..
min_limit: gas_spent_1,
..
} = Gear::calculate_gas_info(
USER_1.into_origin(),
HandleKind::Handle(prog_id),
Expand Down Expand Up @@ -3036,7 +3038,8 @@ fn gas_spent_precalculated() {
assert_eq!(gas_spent_1, total_cost as u64);

let GasInfo {
min_limit: gas_spent_2, ..
min_limit: gas_spent_2,
..
} = Gear::calculate_gas_info(
USER_1.into_origin(),
HandleKind::Handle(prog_id),
Expand Down

0 comments on commit c2c4cf1

Please sign in to comment.