File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
pallets/api-vnext/src/fungibles/precompiles Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -222,15 +222,24 @@ where
222
222
Ok ( mintCall:: abi_encode_returns ( & mintReturn { } ) )
223
223
} ,
224
224
IFungiblesCalls :: burn( burnCall { token, account, value } ) => {
225
- env. charge ( <T as Config < I > >:: WeightInfo :: burn ( ) ) ?;
225
+ let charged = env. charge ( <T as Config < I > >:: WeightInfo :: burn ( ) ) ?;
226
226
227
227
self :: burn :: < T , I > (
228
228
to_runtime_origin ( env. caller ( ) ) ,
229
229
( * token) . into ( ) ,
230
230
env. to_account_id ( & ( * account. 0 ) . into ( ) ) ,
231
231
value. saturating_to ( ) ,
232
- ) // TODO: adjust weight
233
- . map_err ( |e| e. error ) ?;
232
+ )
233
+ . map_err ( |e| {
234
+ // Adjust weight
235
+ if let Some ( actual_weight) = e. post_info . actual_weight {
236
+ // TODO: replace with `env.adjust_gas(charged, result.weight);` once
237
+ // #8693 lands
238
+ env. gas_meter_mut ( )
239
+ . adjust_gas ( charged, RuntimeCosts :: Precompile ( actual_weight) ) ;
240
+ }
241
+ e. error
242
+ } ) ?;
234
243
235
244
let from = account;
236
245
let to = Address :: default ( ) ;
You can’t perform that action at this time.
0 commit comments