difftreelog
fix gas limit
in: master
2 files changed
pallets/balances-adapter/src/lib.rsdiffbeforeafterboth20 Self(SubstrateRecorder::new(u64::MAX))20 Self(SubstrateRecorder::new(u64::MAX))21 }21 }2223 /// Creates a handle24 pub fn new_with_gas_limit(gas_limit: u64) -> NativeFungibleHandle<T> {25 Self(SubstrateRecorder::new(gas_limit))26 }222723 /// Check if the collection is internal28 /// Check if the collection is internal24 pub fn check_is_internal(&self) -> DispatchResult {29 pub fn check_is_internal(&self) -> DispatchResult {runtime/common/dispatch.rsdiffbeforeafterboth--- a/runtime/common/dispatch.rs
+++ b/runtime/common/dispatch.rs
@@ -122,7 +122,9 @@
fn dispatch(collection_id: CollectionId) -> Result<Self, DispatchError> {
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 = <CollectionHandle<T>>::try_get(collection_id)?;
@@ -188,7 +190,7 @@
fn call(handle: &mut impl PrecompileHandle) -> Option<PrecompileResult> {
if let Some(collection_id) = map_eth_to_id(&handle.code_address()) {
if collection_id == pallet_common::NATIVE_FUNGIBLE_COLLECTION_ID {
- <NativeFungibleHandle<T>>::new().call(handle)
+ <NativeFungibleHandle<T>>::new_with_gas_limit(handle.remaining_gas()).call(handle)
} else {
let collection = <CollectionHandle<T>>::new_with_gas_limit(
collection_id,