Introduce ext_println to contract runtime (#2239)

* Implement `ext_println` in contract runtime

* Only allow contracts to import `ext_println` on dev chains

* Configure dev chain to allow contracts with `ext_println`

* Increment spec version

* Docs

* Rename config to the more specific enable_println
This commit is contained in:
Andrew Jones
2019-04-11 14:49:17 +01:00
committed by Sergei Pepyakin
parent 18df051947
commit 1e0c1d8850
5 changed files with 75 additions and 14 deletions
+5
View File
@@ -527,6 +527,10 @@ pub struct Schedule<Gas> {
/// What is the maximal memory pages amount is allowed to have for
/// a contract.
pub max_memory_pages: u32,
/// Whether the `ext_println` function is allowed to be used contracts.
/// MUST only be enabled for `dev` chains, NOT for production chains
pub enable_println: bool,
}
impl<Gas: As<u64>> Default for Schedule<Gas> {
@@ -543,6 +547,7 @@ impl<Gas: As<u64>> Default for Schedule<Gas> {
sandbox_data_write_cost: Gas::sa(1),
max_stack_height: 64 * 1024,
max_memory_pages: 16,
enable_println: false,
}
}
}