Skip to content

Commit

Permalink
sdk master update & revive support
Browse files Browse the repository at this point in the history
  • Loading branch information
smohan-dw committed Jan 29, 2025
1 parent 12de509 commit 17d75f7
Show file tree
Hide file tree
Showing 15 changed files with 1,851 additions and 1,858 deletions.
2,487 changes: 1,121 additions & 1,366 deletions Cargo.lock

Large diffs are not rendered by default.

907 changes: 454 additions & 453 deletions Cargo.toml

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions node/cli/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use sc_cli::Result;
use sc_client_api::UsageProvider;
use sp_inherents::{InherentData, InherentDataProvider};
use sp_keyring::Sr25519Keyring;
use sp_runtime::OpaqueExtrinsic;
use sp_runtime::{generic, OpaqueExtrinsic};

use std::{sync::Arc, time::Duration};

Expand Down Expand Up @@ -221,6 +221,7 @@ fn braid_sign_call(
frame_system::CheckWeight::<runtime::Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
frame_system::WeightReclaim::<runtime::Runtime>::new(),
);

let payload = runtime::SignedPayload::from_raw(
Expand All @@ -237,6 +238,7 @@ fn braid_sign_call(
(),
(),
None,
(),
),
);

Expand Down Expand Up @@ -277,6 +279,7 @@ fn loom_sign_call(
frame_system::CheckWeight::<runtime::Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
frame_system::WeightReclaim::<runtime::Runtime>::new(),
);

let payload = runtime::SignedPayload::from_raw(
Expand All @@ -293,6 +296,7 @@ fn loom_sign_call(
(),
(),
None,
(),
),
);

Expand Down Expand Up @@ -333,6 +337,7 @@ fn weave_sign_call(
frame_system::CheckWeight::<runtime::Runtime>::new(),
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::<runtime::Runtime>::from(0, None),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
frame_system::WeightReclaim::<runtime::Runtime>::new(),
);

let payload = runtime::SignedPayload::from_raw(
Expand All @@ -348,13 +353,14 @@ fn weave_sign_call(
(),
(),
None,
(),
),
);

let signature = payload.using_encoded(|p| acc.sign(p));
runtime::UncheckedExtrinsic::new_signed(
generic::UncheckedExtrinsic::new_signed(
call,
sp_runtime::AccountId32::from(acc.public()).into(),
<AccountId>::from(sp_runtime::AccountId32::from(acc.public())),
cord_primitives::Signature::Sr25519(signature),
extra,
)
Expand Down
3 changes: 1 addition & 2 deletions node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
Vec::default(),
));

let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
let (network, system_rpc_tx, tx_handler_controller, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
net_config,
Expand Down Expand Up @@ -907,7 +907,6 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
);
}

network_starter.start_network();
Ok(NewFullBase {
task_manager,
client,
Expand Down
2 changes: 1 addition & 1 deletion node/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sc-client-api = { workspace = true }
sc-client-db = { features = ["rocksdb"], workspace = true }
sc-consensus = { workspace = true }
sc-executor = { workspace = true }
sc-service = { features = ["rocksdb", "test-helpers"], workspace = true }
sc-service = { features = ["rocksdb"], workspace = true }
sp-api = { workspace = true }
sp-block-builder = { workspace = true }
sp-blockchain = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions runtimes/braid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ where
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
frame_system::WeightReclaim::<Runtime>::new(),
);
let raw_payload = SignedPayload::new(call, tx_ext)
.map_err(|e| {
Expand Down Expand Up @@ -645,6 +646,7 @@ impl pallet_multisig::Config for Runtime {
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
type BlockNumberProvider = frame_system::Pallet<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -1249,6 +1251,7 @@ pub type TxExtension = (
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
frame_system::WeightReclaim<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down
5 changes: 4 additions & 1 deletion runtimes/loom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ where
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
frame_system::WeightReclaim::<Runtime>::new(),
);
let raw_payload = SignedPayload::new(call, tx_ext)
.map_err(|e| {
Expand Down Expand Up @@ -802,6 +803,7 @@ impl pallet_multisig::Config for Runtime {
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = weights::pallet_multisig::WeightInfo<Runtime>;
type BlockNumberProvider = frame_system::Pallet<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -1424,6 +1426,7 @@ pub type TxExtension = (
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
frame_system::WeightReclaim<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -1596,7 +1599,7 @@ impl_runtime_apis! {
}

fn current_set_id() -> sp_consensus_grandpa::SetId {
Grandpa::current_set_id()
pallet_grandpa::CurrentSetId::<Runtime>::get()
}

fn submit_report_equivocation_unsigned_extrinsic(
Expand Down
4 changes: 4 additions & 0 deletions runtimes/weave/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ pallet-offences-benchmarking = { workspace = true, optional = true }
pallet-paged-list = { workspace = true }
pallet-preimage = { workspace = true }
pallet-remark = { workspace = true }
pallet-revive = { workspace = true }
pallet-root-offences = { workspace = true }
pallet-root-testing = { workspace = true }
pallet-sudo = { workspace = true }
Expand Down Expand Up @@ -229,6 +230,7 @@ std = [
"pallet-paged-list/std",
"pallet-preimage/std",
"pallet-remark/std",
"pallet-revive/std",
"pallet-root-offences/std",
"pallet-root-testing/std",
"pallet-sudo/std",
Expand Down Expand Up @@ -319,6 +321,7 @@ runtime-benchmarks = [
"pallet-offences/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-remark/runtime-benchmarks",
"pallet-revive/runtime-benchmarks",
"pallet-safe-mode/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-session-benchmarking/runtime-benchmarks",
Expand Down Expand Up @@ -374,6 +377,7 @@ try-runtime = [
"pallet-offences/try-runtime",
"pallet-preimage/try-runtime",
"pallet-remark/try-runtime",
"pallet-revive/try-runtime",
"pallet-root-testing/try-runtime",
"pallet-safe-mode/try-runtime",
"pallet-scheduler/try-runtime",
Expand Down
4 changes: 0 additions & 4 deletions runtimes/weave/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ use sp_genesis_builder::PresetId;
use sp_keyring::Sr25519Keyring;
use sp_runtime::{traits::IdentifyAccount, Perbill};

// #[cfg(not(feature = "std"))]
// use sp_std::alloc::format;
// use sp_std::{vec, vec::Vec};

/// Helper function to generate a crypto pair from seed
fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
TPublic::Pair::from_string(&format!("//{}", seed), None)
Expand Down
Loading

0 comments on commit 17d75f7

Please sign in to comment.