--- a/pallets/balances-adapter/src/lib.rs +++ b/pallets/balances-adapter/src/lib.rs @@ -20,6 +20,11 @@ Self(SubstrateRecorder::new(u64::MAX)) } + /// Creates a handle + pub fn new_with_gas_limit(gas_limit: u64) -> NativeFungibleHandle { + Self(SubstrateRecorder::new(gas_limit)) + } + /// Check if the collection is internal pub fn check_is_internal(&self) -> DispatchResult { Ok(()) --- a/runtime/common/dispatch.rs +++ b/runtime/common/dispatch.rs @@ -122,7 +122,9 @@ fn dispatch(collection_id: CollectionId) -> Result { if collection_id == pallet_common::NATIVE_FUNGIBLE_COLLECTION_ID { - return Ok(Self::NativeFungible(NativeFungibleHandle::new())); + return Ok(Self::NativeFungible( + NativeFungibleHandle::new_with_gas_limit(u64::MAX), + )); } let handle = >::try_get(collection_id)?; @@ -188,7 +190,7 @@ fn call(handle: &mut impl PrecompileHandle) -> Option { if let Some(collection_id) = map_eth_to_id(&handle.code_address()) { if collection_id == pallet_common::NATIVE_FUNGIBLE_COLLECTION_ID { - >::new().call(handle) + >::new_with_gas_limit(handle.remaining_gas()).call(handle) } else { let collection = >::new_with_gas_limit( collection_id,