Skip to content

Commit

Permalink
chore: cleanup unused and deprecated code
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Hill <[email protected]>
  • Loading branch information
gregdhill committed Aug 3, 2023
1 parent 2713afb commit 7403064
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
5 changes: 2 additions & 3 deletions parachain/runtime/kintsugi/src/contracts.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{BaseCallFilter, NativeCurrency, Runtime, RuntimeCall, RuntimeEvent, Timestamp, Weight};
use bitcoin::types::{MerkleProof, Transaction};
use crate::{NativeCurrency, Runtime, RuntimeCall, RuntimeEvent, Timestamp, Weight};
use btc_relay::FullTransactionProof;
use codec::{Decode, Encode};
use frame_support::{
Expand Down Expand Up @@ -36,7 +35,7 @@ impl Convert<Weight, Balance> for DummyWeightPrice {
// contracts
parameter_types! {
pub const DeletionQueueDepth: u32 = 10;
pub const DeletionWeightLimit: Weight = Weight::from_ref_time(100000000 as u64);
pub const DeletionWeightLimit: Weight = Weight::from_parts(100000000, 0);
pub const DepositPerByte: Balance = 1;
pub const DepositPerItem: Balance = 1;
pub const MaxCodeLen: u32 = 123 * 1024;
Expand Down
21 changes: 15 additions & 6 deletions parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use polkadot_service::CollatorPair;
use primitives::*;
use sc_client_api::{HeaderBackend, StateBackendFor};
use sc_consensus::{ImportQueue, LongestChain};
use sc_executor::NativeElseWasmExecutor;
use sc_executor::{HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
use sc_network::NetworkBlock;
use sc_network_sync::SyncingService;
use sc_service::{Configuration, PartialComponents, RpcHandlers, TFullBackend, TFullClient, TaskManager};
Expand Down Expand Up @@ -254,11 +254,20 @@ where
})
.transpose()?;

let executor = NativeElseWasmExecutor::<Executor>::new(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
config.runtime_cache_size,
let heap_pages = config
.default_heap_pages
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static {
extra_pages: h as _,
});

let executor = NativeElseWasmExecutor::<Executor>::new_with_wasm_executor(
WasmExecutor::builder()
.with_execution_method(config.wasm_method)
.with_onchain_heap_alloc_strategy(heap_pages)
.with_offchain_heap_alloc_strategy(heap_pages)
.with_max_runtime_instances(config.max_runtime_instances)
.with_runtime_cache_size(config.runtime_cache_size)
.build(),
);

let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::<Block, RuntimeApi, _>(
Expand Down

0 comments on commit 7403064

Please sign in to comment.