openethereum/json/src/spec
Lorenzo Manacorda e630f647d1 spec: Validate required divisor fields are not 0 (#7933)
* Add validate_non_zero function

It's used to validate that a Spec's uint field used as a divisor is not zero.

* Add deserialize_with to gas_limit_bound_divisor

Prevents panics due to divide-by-zero on the gas_limit_bound_divisor
field.

* Add deserialize_with to difficulty_bound_divisor

Prevents panics due to divide-by-zero on the difficulty_bound_divisor
field.

* Add validate_optional_non_zero function

Used to validate Option<Uint> divisor fields.

* Use deserialize_with on optional divisor fields.

* Add #[serde(default)] attribute to divisor fields

When using `#[serde(deserialize_with)]`, `#[serde(default)]` must be specified so that missing
fields can be deserialized with the deserializer for `None`.
2018-02-19 10:36:34 +01:00
..
account.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00
authority_round.rs Aura: Broadcast empty step messages instead of creating empty blocks (#7605) 2018-02-15 01:39:29 +01:00
basic_authority.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00
builtin.rs Byzantium updates (#5855) 2017-09-15 21:07:54 +02:00
engine.rs Generalize engine trait (#6591) 2017-09-26 14:19:08 +02:00
ethash.rs spec: Validate required divisor fields are not 0 (#7933) 2018-02-19 10:36:34 +01:00
genesis.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00
mod.rs Generalize engine trait (#6591) 2017-09-26 14:19:08 +02:00
null_engine.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00
params.rs spec: Validate required divisor fields are not 0 (#7933) 2018-02-19 10:36:34 +01:00
seal.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00
spec.rs Move more params to the common section. (#6134) 2017-07-31 12:34:29 +02:00
state.rs Fix whitespace (#4299) 2017-01-25 18:51:41 +01:00
tendermint.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00
validator_set.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00