Skip to content

Commit

Permalink
debug: add SUDO to Centrifuge runtime for chopticks usage
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Nov 1, 2023
1 parent 0a9ef1c commit 0e97398
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions runtime/centrifuge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ homepage = "https://centrifuge.io/"
repository = "https://github.com/centrifuge/centrifuge-chain"

[dependencies]
# WARNING: This dependency should never be merged into production. The purpose is to streamline chopsticks integration.
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.38" }

# third-party dependencies
codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] }
hex-literal = { version = "0.3.4", default-features = false }
Expand Down Expand Up @@ -259,6 +262,7 @@ std = [
"xcm-primitives/std",
"xcm/std",
"axelar-gateway-precompile/std",
"pallet-sudo/std",
]

runtime-benchmarks = [
Expand Down Expand Up @@ -412,6 +416,7 @@ try-runtime = [
"runtime-common/try-runtime",
"sp-runtime/try-runtime",
"axelar-gateway-precompile/try-runtime",
"pallet-sudo/std",
]

# A feature that should be enabled when the runtime should be build for on-chain
Expand Down
13 changes: 12 additions & 1 deletion runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ use pallet_restricted_tokens::{
pub use pallet_timestamp::Call as TimestampCall;
pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment};
use pallet_transaction_payment_rpc_runtime_api::{FeeDetails, RuntimeDispatchInfo};
use pallet_uniques::mock::{Balances, Uniques};
use polkadot_runtime_common::{prod_or_fast, BlockHashCount, SlowAdjustingFeeUpdate};
use runtime_common::{account_conversion::AccountConverter, xcm::AccountIdToMultiLocation};
use scale_info::TypeInfo;
use sp_api::impl_runtime_apis;
use sp_core::{OpaqueMetadata, H160, H256, U256};
use sp_core::{offchain::Timestamp, OpaqueMetadata, H160, H256, U256};
use sp_inherents::{CheckInherentsResult, InherentData};
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
Expand Down Expand Up @@ -1819,6 +1820,12 @@ impl pallet_order_book::Config for Runtime {
type Weights = weights::pallet_order_book::WeightInfo<Runtime>;
}

// WARNING: Never merge into production!
impl pallet_sudo::Config for Runtime {
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
}

// Frame Order in this block dictates the index of each one in the metadata
// Any addition should be done at the bottom
// Any deletion affects the following frames during runtime upgrades
Expand All @@ -1835,6 +1842,9 @@ construct_runtime!(
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3,
ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4,

// WARNING: Never merge into production
Sudo: pallet_sudo = 10,

// money stuff
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 20,
TransactionPayment: pallet_transaction_payment::{Event<T>, Pallet, Storage} = 21,
Expand Down Expand Up @@ -1987,6 +1997,7 @@ mod __runtime_api_use {

#[cfg(not(feature = "disable-runtime-api"))]
use __runtime_api_use::*;
use cfg_traits::{fees::Fees, interest::InterestAccrual};

#[cfg(not(feature = "disable-runtime-api"))]
impl_runtime_apis! {
Expand Down
1 change: 1 addition & 0 deletions src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ fn centrifuge_genesis(
polkadot_xcm: centrifuge_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
},
sudo: Default::default(),
}
}

Expand Down

0 comments on commit 0e97398

Please sign in to comment.