From 14c9cbd40e4de4b1bdb53b346707f230b3be73c4 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Wed, 28 Nov 2018 06:21:31 +0800 Subject: [PATCH] Deny unknown fields for chainspec (#9972) * Add deny_unknown_fields to chainspec * Add tests and fix existing one * Remove serde_ignored dependency for chainspec * Fix rpc test eth chain spec * Fix starting_nonce_test spec --- Cargo.lock | 14 +------ chainspec/Cargo.toml | 1 - chainspec/src/main.rs | 17 +------- json/src/spec/account.rs | 1 + json/src/spec/authority_round.rs | 2 + json/src/spec/basic_authority.rs | 2 + json/src/spec/builtin.rs | 5 +++ json/src/spec/engine.rs | 2 +- json/src/spec/ethash.rs | 3 ++ json/src/spec/genesis.rs | 2 +- json/src/spec/hardcoded_sync.rs | 1 + json/src/spec/instant_seal.rs | 2 + json/src/spec/null_engine.rs | 2 + json/src/spec/params.rs | 1 + json/src/spec/seal.rs | 4 ++ json/src/spec/spec.rs | 67 +++++++++++++++++++++++++++++++- json/src/spec/state.rs | 1 + json/src/spec/tendermint.rs | 2 + json/src/spec/validator_set.rs | 1 + rpc/src/v1/tests/eth.rs | 8 ++-- 20 files changed, 102 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 623a5967e..4a7c03391 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -210,7 +210,6 @@ name = "chainspec" version = "0.1.0" dependencies = [ "ethjson 0.1.0", - "serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -685,8 +684,8 @@ dependencies = [ "rlp_compress 0.1.0", "rlp_derive 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.78 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", "stats 0.1.0", "stop-guard 0.1.0", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3233,14 +3232,6 @@ dependencies = [ "syn 0.15.11 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "serde_ignored" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "serde_json" version = "1.0.32" @@ -4444,7 +4435,6 @@ dependencies = [ "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "15c141fc7027dd265a47c090bf864cf62b42c4d228bbcf4e51a0c9e2b0d3f7ef" "checksum serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)" = "225de307c6302bec3898c51ca302fc94a7a1697ef0845fcee6448f33c032249c" -"checksum serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "190e9765dcedb56be63b6e0993a006c7e3b071a016a304736e4a315dc01fb142" "checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" "checksum sha1 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "171698ce4ec7cbb93babeb3190021b4d72e96ccb98e33d277ae4ea959d6f2d9e" diff --git a/chainspec/Cargo.toml b/chainspec/Cargo.toml index 780fcdff4..8739ca7dc 100644 --- a/chainspec/Cargo.toml +++ b/chainspec/Cargo.toml @@ -6,4 +6,3 @@ authors = ["Marek Kotewicz "] [dependencies] ethjson = { path = "../json" } serde_json = "1.0" -serde_ignored = "0.0.4" diff --git a/chainspec/src/main.rs b/chainspec/src/main.rs index 708d74b50..43f9c8057 100644 --- a/chainspec/src/main.rs +++ b/chainspec/src/main.rs @@ -15,10 +15,8 @@ // along with Parity. If not, see . extern crate serde_json; -extern crate serde_ignored; extern crate ethjson; -use std::collections::BTreeSet; use std::{fs, env, process}; use ethjson::spec::Spec; @@ -41,24 +39,11 @@ fn main() { Err(_) => quit(&format!("{} could not be opened", path)), }; - let mut unused = BTreeSet::new(); - let mut deserializer = serde_json::Deserializer::from_reader(file); - - let spec: Result = serde_ignored::deserialize(&mut deserializer, |field| { - unused.insert(field.to_string()); - }); + let spec: Result = serde_json::from_reader(file); if let Err(err) = spec { quit(&format!("{} {}", path, err.to_string())); } - if !unused.is_empty() { - let err = unused.into_iter() - .map(|field| format!("{} unexpected field `{}`", path, field)) - .collect::>() - .join("\n"); - quit(&err); - } - println!("{} is valid", path); } diff --git a/json/src/spec/account.rs b/json/src/spec/account.rs index acc6d96b5..9a593db0c 100644 --- a/json/src/spec/account.rs +++ b/json/src/spec/account.rs @@ -23,6 +23,7 @@ use spec::builtin::Builtin; /// Spec account. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct Account { /// Builtin contract. pub builtin: Option, diff --git a/json/src/spec/authority_round.rs b/json/src/spec/authority_round.rs index ee7463530..2ee38c49c 100644 --- a/json/src/spec/authority_round.rs +++ b/json/src/spec/authority_round.rs @@ -23,6 +23,7 @@ use super::ValidatorSet; /// Authority params deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct AuthorityRoundParams { /// Block duration, in seconds. @@ -59,6 +60,7 @@ pub struct AuthorityRoundParams { /// Authority engine deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct AuthorityRound { /// Ethash params. pub params: AuthorityRoundParams, diff --git a/json/src/spec/basic_authority.rs b/json/src/spec/basic_authority.rs index 185663632..1d2b96360 100644 --- a/json/src/spec/basic_authority.rs +++ b/json/src/spec/basic_authority.rs @@ -21,6 +21,7 @@ use super::ValidatorSet; /// Authority params deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct BasicAuthorityParams { /// Block duration. @@ -31,6 +32,7 @@ pub struct BasicAuthorityParams { /// Authority engine deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct BasicAuthority { /// Ethash params. pub params: BasicAuthorityParams, diff --git a/json/src/spec/builtin.rs b/json/src/spec/builtin.rs index f7cb28b0e..38da42f1d 100644 --- a/json/src/spec/builtin.rs +++ b/json/src/spec/builtin.rs @@ -20,6 +20,7 @@ use uint::Uint; /// Linear pricing. #[derive(Debug, PartialEq, Deserialize, Clone)] +#[serde(deny_unknown_fields)] pub struct Linear { /// Base price. pub base: usize, @@ -29,6 +30,7 @@ pub struct Linear { /// Pricing for modular exponentiation. #[derive(Debug, PartialEq, Deserialize, Clone)] +#[serde(deny_unknown_fields)] pub struct Modexp { /// Price divisor. pub divisor: usize, @@ -36,6 +38,7 @@ pub struct Modexp { /// Pricing for alt_bn128_pairing. #[derive(Debug, PartialEq, Deserialize, Clone)] +#[serde(deny_unknown_fields)] pub struct AltBn128Pairing { /// Base price. pub base: usize, @@ -45,6 +48,7 @@ pub struct AltBn128Pairing { /// Pricing variants. #[derive(Debug, PartialEq, Deserialize, Clone)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "snake_case")] pub enum Pricing { /// Linear pricing. @@ -57,6 +61,7 @@ pub enum Pricing { /// Spec builtin. #[derive(Debug, PartialEq, Deserialize, Clone)] +#[serde(deny_unknown_fields)] pub struct Builtin { /// Builtin name. pub name: String, diff --git a/json/src/spec/engine.rs b/json/src/spec/engine.rs index 42e5763c8..3ff7c3458 100644 --- a/json/src/spec/engine.rs +++ b/json/src/spec/engine.rs @@ -20,6 +20,7 @@ use super::{Ethash, BasicAuthority, AuthorityRound, Tendermint, NullEngine, Inst /// Engine deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub enum Engine { /// Null engine. @@ -85,7 +86,6 @@ mod tests { "minimumDifficulty": "0x020000", "difficultyBoundDivisor": "0x0800", "durationLimit": "0x0d", - "registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b", "homesteadTransition" : "0x", "daoHardforkTransition": "0xffffffffffffffff", "daoHardforkBeneficiary": "0x0000000000000000000000000000000000000000", diff --git a/json/src/spec/ethash.rs b/json/src/spec/ethash.rs index c4869358c..fc61c3e8d 100644 --- a/json/src/spec/ethash.rs +++ b/json/src/spec/ethash.rs @@ -23,6 +23,7 @@ use hash::Address; /// Deserializable doppelganger of block rewards for EthashParams #[derive(Clone, Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(untagged)] pub enum BlockReward { Single(Uint), @@ -31,6 +32,7 @@ pub enum BlockReward { /// Deserializable doppelganger of EthashParams. #[derive(Clone, Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct EthashParams { /// See main EthashParams docs. @@ -97,6 +99,7 @@ pub struct EthashParams { /// Ethash engine deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct Ethash { /// Ethash params. pub params: EthashParams, diff --git a/json/src/spec/genesis.rs b/json/src/spec/genesis.rs index d41777def..3cbfd060c 100644 --- a/json/src/spec/genesis.rs +++ b/json/src/spec/genesis.rs @@ -23,6 +23,7 @@ use spec::Seal; /// Spec genesis. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct Genesis { /// Seal. @@ -64,7 +65,6 @@ mod tests { #[test] fn genesis_deserialization() { let s = r#"{ - "nonce": "0x0000000000000042", "difficulty": "0x400000000", "seal": { "ethereum": { diff --git a/json/src/spec/hardcoded_sync.rs b/json/src/spec/hardcoded_sync.rs index 40ffe0735..078e0e76a 100644 --- a/json/src/spec/hardcoded_sync.rs +++ b/json/src/spec/hardcoded_sync.rs @@ -21,6 +21,7 @@ use uint::Uint; /// Spec hardcoded sync. #[derive(Debug, PartialEq, Serialize, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct HardcodedSync { /// Hexadecimal of the RLP encoding of the header of the block to start synchronization from. diff --git a/json/src/spec/instant_seal.rs b/json/src/spec/instant_seal.rs index 9ac10c1b8..c15da8db4 100644 --- a/json/src/spec/instant_seal.rs +++ b/json/src/spec/instant_seal.rs @@ -18,6 +18,7 @@ /// Instant seal engine params deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct InstantSealParams { /// Whether to enable millisecond timestamp. @@ -27,6 +28,7 @@ pub struct InstantSealParams { /// Instant seal engine descriptor. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct InstantSeal { /// Instant seal parameters. pub params: InstantSealParams, diff --git a/json/src/spec/null_engine.rs b/json/src/spec/null_engine.rs index 520e9f197..946d1882d 100644 --- a/json/src/spec/null_engine.rs +++ b/json/src/spec/null_engine.rs @@ -20,6 +20,7 @@ use uint::Uint; /// Authority params deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct NullEngineParams { /// Block reward. @@ -28,6 +29,7 @@ pub struct NullEngineParams { /// Null engine descriptor #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct NullEngine { /// Ethash params. pub params: NullEngineParams, diff --git a/json/src/spec/params.rs b/json/src/spec/params.rs index 602c8e7bc..139e74b0f 100644 --- a/json/src/spec/params.rs +++ b/json/src/spec/params.rs @@ -22,6 +22,7 @@ use bytes::Bytes; /// Spec params. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct Params { /// Account start nonce, defaults to 0. diff --git a/json/src/spec/seal.rs b/json/src/spec/seal.rs index 608a7fa7f..69c907725 100644 --- a/json/src/spec/seal.rs +++ b/json/src/spec/seal.rs @@ -22,6 +22,7 @@ use bytes::Bytes; /// Ethereum seal. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct Ethereum { /// Seal nonce. @@ -32,6 +33,7 @@ pub struct Ethereum { /// AuthorityRound seal. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct AuthorityRoundSeal { /// Seal step. pub step: Uint, @@ -41,6 +43,7 @@ pub struct AuthorityRoundSeal { /// Tendermint seal. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct TendermintSeal { /// Seal round. pub round: Uint, @@ -52,6 +55,7 @@ pub struct TendermintSeal { /// Seal variants. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub enum Seal { /// Ethereum seal. diff --git a/json/src/spec/spec.rs b/json/src/spec/spec.rs index 21eefeeb2..9a5589d84 100644 --- a/json/src/spec/spec.rs +++ b/json/src/spec/spec.rs @@ -38,6 +38,7 @@ pub enum ForkSpec { /// Spec deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct Spec { /// Spec name. @@ -70,6 +71,71 @@ mod tests { use serde_json; use spec::spec::Spec; + #[test] + fn should_error_on_unknown_fields() { + let s = r#"{ + "name": "Morden", + "dataDir": "morden", + "engine": { + "Ethash": { + "params": { + "minimumDifficulty": "0x020000", + "difficultyBoundDivisor": "0x0800", + "durationLimit": "0x0d", + "homesteadTransition" : "0x", + "daoHardforkTransition": "0xffffffffffffffff", + "daoHardforkBeneficiary": "0x0000000000000000000000000000000000000000", + "daoHardforkAccounts": [] + } + } + }, + "params": { + "accountStartNonce": "0x0100000", + "maximumExtraDataSize": "0x20", + "minGasLimit": "0x1388", + "networkID" : "0x2", + "forkBlock": "0xffffffffffffffff", + "forkCanonHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "gasLimitBoundDivisor": "0x20", + "unknownField": "0x0" + }, + "genesis": { + "seal": { + "ethereum": { + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x00006d6f7264656e" + } + }, + "difficulty": "0x20000", + "author": "0x0000000000000000000000000000000000000000", + "timestamp": "0x00", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "extraData": "0x", + "gasLimit": "0x2fefd8" + }, + "nodes": [ + "enode://b1217cbaa440e35ed471157123fe468e19e8b5ad5bedb4b1fdbcbdab6fb2f5ed3e95dd9c24a22a79fdb2352204cea207df27d92bfd21bfd41545e8b16f637499@104.44.138.37:30303" + ], + "accounts": { + "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, + "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "1048576", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, + "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "1048576", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, + "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "1048576", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, + "102e61f5d8f9bc71d0ad4a084df4e65e05ce0e1c": { "balance": "1606938044258990275541962092341162602522202993782792835301376", "nonce": "1048576" } + }, + "hardcodedSync": { + "header": "f901f9a0d405da4e66f1445d455195229624e133f5baafe72b5cf7b3c36c12c8146e98b7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a05fb2b4bfdef7b314451cb138a534d225c922fc0e5fbe25e451142732c3e25c25a088d2ec6b9860aae1a2c3b299f72b6a5d70d7f7ba4722c78f2c49ba96273c2158a007c6fdfa8eea7e86b81f5b0fc0f78f90cc19f4aa60d323151e0cac660199e9a1b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302008003832fefba82524d84568e932a80a0a0349d8c3df71f1a48a9df7d03fd5f14aeee7d91332c009ecaff0a71ead405bd88ab4e252a7e8c2a23", + "totalDifficulty": "0x400000000", + "CHTs": [ + "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa", + "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544" + ] + } + }"#; + let result: Result = serde_json::from_str(s); + assert!(result.is_err()); + } + #[test] fn spec_deserialization() { let s = r#"{ @@ -90,7 +156,6 @@ mod tests { }, "params": { "accountStartNonce": "0x0100000", - "homesteadTransition": "0x789b0", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", "networkID" : "0x2", diff --git a/json/src/spec/state.rs b/json/src/spec/state.rs index d15ad540c..6227750e1 100644 --- a/json/src/spec/state.rs +++ b/json/src/spec/state.rs @@ -23,6 +23,7 @@ use spec::{Account, Builtin}; /// Blockchain test state deserializer. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct State(BTreeMap); impl State { diff --git a/json/src/spec/tendermint.rs b/json/src/spec/tendermint.rs index f2f321935..4cea89edf 100644 --- a/json/src/spec/tendermint.rs +++ b/json/src/spec/tendermint.rs @@ -21,6 +21,7 @@ use super::ValidatorSet; /// Tendermint params deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct TendermintParams { /// Valid validators. @@ -39,6 +40,7 @@ pub struct TendermintParams { /// Tendermint engine deserialization. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] pub struct Tendermint { /// Ethash params. pub params: TendermintParams, diff --git a/json/src/spec/validator_set.rs b/json/src/spec/validator_set.rs index 7c80ee754..babbb8a47 100644 --- a/json/src/spec/validator_set.rs +++ b/json/src/spec/validator_set.rs @@ -22,6 +22,7 @@ use hash::Address; /// Different ways of specifying validators. #[derive(Debug, PartialEq, Deserialize)] +#[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub enum ValidatorSet { /// A simple list of authorities. diff --git a/rpc/src/v1/tests/eth.rs b/rpc/src/v1/tests/eth.rs index 9a7bb19b1..6892f9912 100644 --- a/rpc/src/v1/tests/eth.rs +++ b/rpc/src/v1/tests/eth.rs @@ -218,7 +218,7 @@ fn eth_get_proof() { }"#; let res_latest = r#","address":"0xaaaf5374fce5edbc8e2a8697c15331677e6ebaaa","balance":"0x9","codeHash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470","nonce":"0x0","storageHash":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","storageProof":[]},"id":1}"#.to_owned(); - assert!(tester.handler.handle_request_sync(req_latest).unwrap().to_string().ends_with(res_latest.as_str())); + assert!(tester.handler.handle_request_sync(req_latest).unwrap().to_string().ends_with(res_latest.as_str())); // non-existant account let req_new_acc = r#"{ @@ -229,7 +229,7 @@ fn eth_get_proof() { }"#; let res_new_acc = r#","address":"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","balance":"0x0","codeHash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470","nonce":"0x0","storageHash":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","storageProof":[]},"id":3}"#.to_owned(); - assert!(tester.handler.handle_request_sync(req_new_acc).unwrap().to_string().ends_with(res_new_acc.as_str())); + assert!(tester.handler.handle_request_sync(req_new_acc).unwrap().to_string().ends_with(res_new_acc.as_str())); } #[test] @@ -277,6 +277,7 @@ const TRANSACTION_COUNT_SPEC: &'static [u8] = br#"{ "params": { "minimumDifficulty": "0x020000", "difficultyBoundDivisor": "0x0800", + "blockReward": "0x4563918244F40000", "durationLimit": "0x0d", "homesteadTransition": "0xffffffffffffffff", "daoHardforkTransition": "0xffffffffffffffff", @@ -287,7 +288,6 @@ const TRANSACTION_COUNT_SPEC: &'static [u8] = br#"{ }, "params": { "gasLimitBoundDivisor": "0x0400", - "blockReward": "0x4563918244F40000", "registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b", "accountStartNonce": "0x00", "maximumExtraDataSize": "0x20", @@ -325,6 +325,7 @@ const POSITIVE_NONCE_SPEC: &'static [u8] = br#"{ "params": { "minimumDifficulty": "0x020000", "difficultyBoundDivisor": "0x0800", + "blockReward": "0x4563918244F40000", "durationLimit": "0x0d", "homesteadTransition": "0xffffffffffffffff", "daoHardforkTransition": "0xffffffffffffffff", @@ -335,7 +336,6 @@ const POSITIVE_NONCE_SPEC: &'static [u8] = br#"{ }, "params": { "gasLimitBoundDivisor": "0x0400", - "blockReward": "0x4563918244F40000", "registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b", "accountStartNonce": "0x0100", "maximumExtraDataSize": "0x20",