contracts: Move Schedule from Storage to Config (#8773)

* Move `Schedule` from Storage to Config

* Updated CHANGELOG

* Fix nits from review

* Fix migration

* Print the debug buffer as tracing message

* Use `debug` instead of `trace` and update README

* Add additional assert to test

* Rename `schedule_version` to `instruction_weights_version`

* Fixed typo

* Added more comments to wat fixtures

* Add clarification for the `debug_message` field
This commit is contained in:
Alexander Theißen
2021-05-13 21:56:11 +02:00
committed by GitHub
parent 3c0270fe57
commit 1ac95b6ba6
23 changed files with 1465 additions and 1056 deletions
+2 -11
View File
@@ -22,7 +22,7 @@ use sc_chain_spec::ChainSpecExtension;
use sp_core::{Pair, Public, crypto::UncheckedInto, sr25519};
use serde::{Serialize, Deserialize};
use node_runtime::{
AuthorityDiscoveryConfig, BabeConfig, BalancesConfig, ContractsConfig, CouncilConfig,
AuthorityDiscoveryConfig, BabeConfig, BalancesConfig, CouncilConfig,
DemocracyConfig, GrandpaConfig, ImOnlineConfig, SessionConfig, SessionKeys, StakerStatus,
StakingConfig, ElectionsConfig, IndicesConfig, SocietyConfig, SudoConfig, SystemConfig,
TechnicalCommitteeConfig, wasm_binary_unwrap, MAX_NOMINATIONS,
@@ -146,7 +146,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
let endowed_accounts: Vec<AccountId> = vec![root_key.clone()];
testnet_genesis(initial_authorities, vec![], root_key, Some(endowed_accounts), false)
testnet_genesis(initial_authorities, vec![], root_key, Some(endowed_accounts))
}
/// Staging testnet config.
@@ -212,7 +212,6 @@ pub fn testnet_genesis(
initial_nominators: Vec<AccountId>,
root_key: AccountId,
endowed_accounts: Option<Vec<AccountId>>,
enable_println: bool,
) -> GenesisConfig {
let mut endowed_accounts: Vec<AccountId> = endowed_accounts.unwrap_or_else(|| {
vec![
@@ -308,11 +307,6 @@ pub fn testnet_genesis(
.collect(),
phantom: Default::default(),
},
pallet_contracts: ContractsConfig {
// println should only be enabled on development chains
current_schedule: pallet_contracts::Schedule::default()
.enable_println(enable_println),
},
pallet_sudo: SudoConfig {
key: root_key,
},
@@ -352,7 +346,6 @@ fn development_config_genesis() -> GenesisConfig {
vec![],
get_account_id_from_seed::<sr25519::Public>("Alice"),
None,
true,
)
}
@@ -380,7 +373,6 @@ fn local_testnet_genesis() -> GenesisConfig {
vec![],
get_account_id_from_seed::<sr25519::Public>("Alice"),
None,
false,
)
}
@@ -414,7 +406,6 @@ pub(crate) mod tests {
vec![],
get_account_id_from_seed::<sr25519::Public>("Alice"),
None,
false,
)
}