Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 96da14c

Browse files
authored
Rework default values used by the RelayChainCli (#189)
This reworks the default values used by the RelayChainCli for stuff like the listen port etc. This also renames all the contracts related stuff to `cumulus-*` to support `.cargo/config` overrides.
1 parent 9603b2f commit 96da14c

File tree

13 files changed

+265
-325
lines changed

13 files changed

+265
-325
lines changed

Cargo.lock

Lines changed: 202 additions & 202 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rococo-parachains/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ sc-informant = { git = "https://github.com/paritytech/substrate", branch = "roco
4949
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "rococo-branch" }
5050

5151
# RPC related dependencies
52-
pallet-contracts-rpc = { path = "./pallets/contracts/rpc" }
52+
cumulus-pallet-contracts-rpc = { path = "./pallets/contracts/rpc" }
5353
jsonrpc-core = "14.2.0"
5454

5555
# Cumulus dependencies

rococo-parachains/contracts-runtime/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ pallet-sudo = { git = "https://github.com/paritytech/substrate", default-feature
3434
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
3535

3636
# In-Tree Fork of seal that does not use child trie nor storage transactions
37-
pallet-contracts = { path = "../pallets/contracts", default-features = false }
38-
pallet-contracts-primitives = { path = "../pallets/contracts/common", default-features = false }
39-
pallet-contracts-rpc-runtime-api = { path = "../pallets/contracts/rpc/runtime-api", default-features = false }
37+
cumulus-pallet-contracts = { path = "../pallets/contracts", default-features = false }
38+
cumulus-pallet-contracts-primitives = { path = "../pallets/contracts/common", default-features = false }
39+
cumulus-pallet-contracts-rpc-runtime-api = { path = "../pallets/contracts/rpc/runtime-api", default-features = false }
4040

4141
# Cumulus dependencies
4242
cumulus-runtime = { path = "../../runtime", default-features = false }
@@ -71,9 +71,9 @@ std = [
7171
"frame-executive/std",
7272
"frame-system/std",
7373
"pallet-balances/std",
74-
"pallet-contracts/std",
75-
"pallet-contracts-primitives/std",
76-
"pallet-contracts-rpc-runtime-api/std",
74+
"cumulus-pallet-contracts/std",
75+
"cumulus-pallet-contracts-primitives/std",
76+
"cumulus-pallet-contracts-rpc-runtime-api/std",
7777
"pallet-randomness-collective-flip/std",
7878
"pallet-timestamp/std",
7979
"pallet-sudo/std",

rococo-parachains/contracts-runtime/src/lib.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#[cfg(feature = "std")]
2323
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
2424

25-
use pallet_contracts_rpc_runtime_api::ContractExecResult;
25+
use cumulus_pallet_contracts_rpc_runtime_api::ContractExecResult;
2626
use sp_api::impl_runtime_apis;
2727
use sp_core::OpaqueMetadata;
2828
use sp_runtime::{
@@ -269,23 +269,23 @@ parameter_types! {
269269
pub const SurchargeReward: Balance = 0;
270270
}
271271

272-
impl pallet_contracts::Trait for Runtime {
272+
impl cumulus_pallet_contracts::Trait for Runtime {
273273
type Time = Timestamp;
274274
type Randomness = RandomnessCollectiveFlip;
275275
type Currency = Balances;
276276
type Call = Call;
277277
type Event = Event;
278-
type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer<Runtime>;
279-
type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter<Runtime>;
278+
type DetermineContractAddress = cumulus_pallet_contracts::SimpleAddressDeterminer<Runtime>;
279+
type TrieIdGenerator = cumulus_pallet_contracts::TrieIdFromParentCounter<Runtime>;
280280
type RentPayment = ();
281-
type SignedClaimHandicap = pallet_contracts::DefaultSignedClaimHandicap;
281+
type SignedClaimHandicap = cumulus_pallet_contracts::DefaultSignedClaimHandicap;
282282
type TombstoneDeposit = TombstoneDeposit;
283-
type StorageSizeOffset = pallet_contracts::DefaultStorageSizeOffset;
283+
type StorageSizeOffset = cumulus_pallet_contracts::DefaultStorageSizeOffset;
284284
type RentByteFee = RentByteFee;
285285
type RentDepositOffset = RentDepositOffset;
286286
type SurchargeReward = SurchargeReward;
287-
type MaxDepth = pallet_contracts::DefaultMaxDepth;
288-
type MaxValueSize = pallet_contracts::DefaultMaxValueSize;
287+
type MaxDepth = cumulus_pallet_contracts::DefaultMaxDepth;
288+
type MaxValueSize = cumulus_pallet_contracts::DefaultMaxValueSize;
289289
type WeightPrice = pallet_transaction_payment::Module<Self>;
290290
}
291291

@@ -298,7 +298,7 @@ construct_runtime! {
298298
System: frame_system::{Module, Call, Storage, Config, Event<T>},
299299
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
300300
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
301-
Contracts: pallet_contracts::{Module, Call, Config, Storage, Event<T>},
301+
Contracts: cumulus_pallet_contracts::{Module, Call, Config, Storage, Event<T>},
302302
Sudo: pallet_sudo::{Module, Call, Storage, Config<T>, Event<T>},
303303
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
304304
ParachainUpgrade: cumulus_parachain_upgrade::{Module, Call, Storage, Inherent, Event},
@@ -413,7 +413,7 @@ impl_runtime_apis! {
413413
}
414414
}
415415

416-
impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>
416+
impl cumulus_pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>
417417
for Runtime
418418
{
419419
fn call(
@@ -438,13 +438,13 @@ impl_runtime_apis! {
438438
fn get_storage(
439439
address: AccountId,
440440
key: [u8; 32],
441-
) -> pallet_contracts_primitives::GetStorageResult {
441+
) -> cumulus_pallet_contracts_primitives::GetStorageResult {
442442
Contracts::get_storage(address, key)
443443
}
444444

445445
fn rent_projection(
446446
address: AccountId,
447-
) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {
447+
) -> cumulus_pallet_contracts_primitives::RentProjectionResult<BlockNumber> {
448448
Contracts::rent_projection(address)
449449
}
450450
}

rococo-parachains/pallets/contracts/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "pallet-contracts"
2+
name = "cumulus-pallet-contracts"
33
version = "2.0.0-rc3"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2018"
@@ -24,7 +24,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", default-features = f
2424
sp-sandbox = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
2525
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
2626
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
27-
pallet-contracts-primitives = { path = "./common", default-features = false }
27+
cumulus-pallet-contracts-primitives = { path = "./common", default-features = false }
2828

2929
[dev-dependencies]
3030
wabt = "0.10"
@@ -49,5 +49,5 @@ std = [
4949
"parity-wasm/std",
5050
"pwasm-utils/std",
5151
"wasmi-validation/std",
52-
"pallet-contracts-primitives/std",
52+
"cumulus-pallet-contracts-primitives/std",
5353
]

rococo-parachains/pallets/contracts/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "pallet-contracts-primitives"
2+
name = "cumulus-pallet-contracts-primitives"
33
version = "2.0.0-rc3"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2018"

rococo-parachains/pallets/contracts/rpc/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "pallet-contracts-rpc"
2+
name = "cumulus-pallet-contracts-rpc"
33
version = "0.8.0-rc3"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2018"
@@ -22,8 +22,8 @@ sp-rpc = { git = "https://github.com/paritytech/substrate", default-features = f
2222
serde = { version = "1.0.101", features = ["derive"] }
2323
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
2424
sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
25-
pallet-contracts-primitives = { path = "../common" }
26-
pallet-contracts-rpc-runtime-api = { path = "./runtime-api" }
25+
cumulus-pallet-contracts-primitives = { path = "../common" }
26+
cumulus-pallet-contracts-rpc-runtime-api = { path = "./runtime-api" }
2727

2828
[dev-dependencies]
2929
serde_json = "1.0.41"

rococo-parachains/pallets/contracts/rpc/runtime-api/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "pallet-contracts-rpc-runtime-api"
2+
name = "cumulus-pallet-contracts-rpc-runtime-api"
33
version = "0.8.0-rc3"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
edition = "2018"
@@ -16,7 +16,7 @@ sp-api = { git = "https://github.com/paritytech/substrate", default-features = f
1616
codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
1717
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
1818
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "rococo-branch" }
19-
pallet-contracts-primitives = { path = "../../common", default-features = false }
19+
cumulus-pallet-contracts-primitives = { path = "../../common", default-features = false }
2020

2121
[features]
2222
default = ["std"]
@@ -25,5 +25,5 @@ std = [
2525
"codec/std",
2626
"sp-std/std",
2727
"sp-runtime/std",
28-
"pallet-contracts-primitives/std",
28+
"cumulus-pallet-contracts-primitives/std",
2929
]

rococo-parachains/pallets/contracts/rpc/runtime-api/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#![cfg_attr(not(feature = "std"), no_std)]
2525

2626
use codec::{Codec, Decode, Encode};
27-
use pallet_contracts_primitives::{GetStorageResult, RentProjectionResult};
27+
use cumulus_pallet_contracts_primitives::{GetStorageResult, RentProjectionResult};
2828
use sp_runtime::RuntimeDebug;
2929
use sp_std::vec::Vec;
3030

rococo-parachains/pallets/contracts/rpc/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::sync::Arc;
2222
use codec::Codec;
2323
use jsonrpc_core::{Error, ErrorCode, Result};
2424
use jsonrpc_derive::rpc;
25-
use pallet_contracts_primitives::RentProjection;
25+
use cumulus_pallet_contracts_primitives::RentProjection;
2626
use serde::{Deserialize, Serialize};
2727
use sp_api::ProvideRuntimeApi;
2828
use sp_blockchain::HeaderBackend;
@@ -35,7 +35,7 @@ use sp_runtime::{
3535
use std::convert::TryInto;
3636

3737
pub use self::gen_client::Client as ContractsClient;
38-
pub use pallet_contracts_rpc_runtime_api::{
38+
pub use cumulus_pallet_contracts_rpc_runtime_api::{
3939
self as runtime_api, ContractExecResult, ContractsApi as ContractsRuntimeApi,
4040
};
4141

@@ -54,10 +54,10 @@ const CONTRACT_IS_A_TOMBSTONE: i64 = 3;
5454
const GAS_PER_SECOND: u64 = 1_000_000_000_000;
5555

5656
/// A private newtype for converting `ContractAccessError` into an RPC error.
57-
struct ContractAccessError(pallet_contracts_primitives::ContractAccessError);
57+
struct ContractAccessError(cumulus_pallet_contracts_primitives::ContractAccessError);
5858
impl From<ContractAccessError> for Error {
5959
fn from(e: ContractAccessError) -> Error {
60-
use pallet_contracts_primitives::ContractAccessError::*;
60+
use cumulus_pallet_contracts_primitives::ContractAccessError::*;
6161
match e.0 {
6262
DoesntExist => Error {
6363
code: ErrorCode::ServerError(CONTRACT_DOESNT_EXIST),

0 commit comments

Comments
 (0)