Skip to content

Commit

Permalink
Merge branch 'feat/pop-api' into al3mart/query_relay_number
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwht committed Mar 4, 2024
2 parents 5fa282a + 275f487 commit cbb14e4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 309 deletions.
3 changes: 3 additions & 0 deletions networks/rococo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ default_command = "./target/release/pop-node"

[[parachains.collators]]
name = "pop"
command = "./target/release/pop-node"
port = 9944
args = ["-lruntime::contracts=debug", "-lpopapi::extension=debug"]
1 change: 0 additions & 1 deletion pop-api/src/impls/mod.rs

This file was deleted.

107 changes: 0 additions & 107 deletions pop-api/src/impls/pop_network.rs

This file was deleted.

1 change: 0 additions & 1 deletion pop-api/src/interfaces/mod.rs

This file was deleted.

197 changes: 0 additions & 197 deletions pop-api/src/interfaces/nfts.rs

This file was deleted.

3 changes: 0 additions & 3 deletions pop-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]

pub mod impls;
pub mod interfaces;

use pop_api_primitives::storage_keys;

Check warning on line 3 in pop-api/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `pop_api_primitives::storage_keys`

warning: unused import: `pop_api_primitives::storage_keys` --> pop-api/src/lib.rs:3:5 | 3 | use pop_api_primitives::storage_keys; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
pub mod v0;

Expand Down
9 changes: 9 additions & 0 deletions runtime/src/extensions/ext_impl/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ where
let len = env.in_len();
let call: <T as SysConfig>::RuntimeCall = env.read_as_unbounded(len)?;

// conservative weight estimate for deserializing the input. The actual weight is less and should utilize a custom benchmark
let base_weight: Weight = T::DbWeight::get().reads(len.into());

// weight for dispatching the call
let dispatch_weight = call.get_dispatch_info().weight;

// charge weight for the cost of the deserialization and the dispatch
let _ = env.charge_weight(base_weight.saturating_add(dispatch_weight))?;

log::debug!(target:LOG_TARGET, " dispatch inputted RuntimeCall: {:?}", call);

let sender = env.ext().caller();
Expand Down

0 comments on commit cbb14e4

Please sign in to comment.