File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -801,7 +801,7 @@ where
801801
802802 fn rent_allowance ( & self ) -> BalanceOf < T > {
803803 storage:: rent_allowance :: < T > ( & self . ctx . self_account )
804- . unwrap_or ( <BalanceOf < T > >:: max_value ( ) ) // Must never be triggered actually
804+ . unwrap_or_else ( |_| <BalanceOf < T > >:: max_value ( ) ) // Must never be triggered actually
805805 }
806806
807807 fn block_number ( & self ) -> T :: BlockNumber { self . block_number }
Original file line number Diff line number Diff line change @@ -648,7 +648,7 @@ impl<T: Trait> Module<T> {
648648 let cfg = Config :: preload ( ) ;
649649 let vm = WasmVm :: new ( & cfg. schedule ) ;
650650 let loader = WasmLoader :: new ( & cfg. schedule ) ;
651- let mut ctx = ExecutionContext :: top_level ( origin. clone ( ) , & cfg, & vm, & loader) ;
651+ let mut ctx = ExecutionContext :: top_level ( origin, & cfg, & vm, & loader) ;
652652 func ( & mut ctx, gas_meter)
653653 }
654654}
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ fn compute_fee_per_block<T: Trait>(
104104
105105 effective_storage_size
106106 . checked_mul ( & T :: RentByteFee :: get ( ) )
107- . unwrap_or ( <BalanceOf < T > >:: max_value ( ) )
107+ . unwrap_or_else ( || <BalanceOf < T > >:: max_value ( ) )
108108}
109109
110110/// Returns amount of funds available to consume by rent mechanism.
@@ -179,7 +179,7 @@ fn consider_case<T: Trait>(
179179
180180 let dues = fee_per_block
181181 . checked_mul ( & blocks_passed. saturated_into :: < u32 > ( ) . into ( ) )
182- . unwrap_or ( <BalanceOf < T > >:: max_value ( ) ) ;
182+ . unwrap_or_else ( || <BalanceOf < T > >:: max_value ( ) ) ;
183183 let insufficient_rent = rent_budget < dues;
184184
185185 // If the rent payment cannot be withdrawn due to locks on the account balance, then evict the
You can’t perform that action at this time.
0 commit comments