spec loading cleanup (#858)

* spec loading cleanup in progress

* changed engine field in json spec

* refactored engine params

* polishing spec loading refactor

* fixed compiling json tests

* fixed compiling parity

* removed warnings

* removed commented out code

* fixed failing test

* bringing back removed TODO in spec.
This commit is contained in:
Marek Kotewicz
2016-04-09 19:20:35 +02:00
committed by Gav Wood
parent d823fd7685
commit 373284ca0a
46 changed files with 957 additions and 704 deletions

View File

@@ -17,14 +17,16 @@
//! Spec builtin deserialization.
/// Linear pricing.
#[derive(Debug, PartialEq, Deserialize)]
#[derive(Debug, PartialEq, Deserialize, Clone)]
pub struct Linear {
base: u64,
word: u64,
/// Base price.
pub base: usize,
/// Price for word.
pub word: usize,
}
/// Pricing variants.
#[derive(Debug, PartialEq, Deserialize)]
#[derive(Debug, PartialEq, Deserialize, Clone)]
pub enum Pricing {
/// Linear pricing.
#[serde(rename="linear")]
@@ -32,10 +34,12 @@ pub enum Pricing {
}
/// Spec builtin.
#[derive(Debug, PartialEq, Deserialize)]
#[derive(Debug, PartialEq, Deserialize, Clone)]
pub struct Builtin {
name: String,
pricing: Pricing,
/// Builtin name.
pub name: String,
/// Builtin pricing.
pub pricing: Pricing,
}
#[cfg(test)]