openethereum/json/src
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
..
blockchain Byzantium updates (#5855) 2017-09-15 21:07:54 +02:00
misc Proper default accounts RPCs (#4580) 2017-02-20 16:33:12 +01:00
spec spec: Validate required divisor fields are not 0 (#7933) 2018-02-19 10:36:34 +01:00
state Byzantium updates (#5855) 2017-09-15 21:07:54 +02:00
test Difficulty tests 2017-10-10 14:51:12 +02:00
transaction Fix whitespace (#4299) 2017-01-25 18:51:41 +01:00
trie updated serde to version 1.0 2017-07-06 11:36:15 +02:00
vm dissolve util (#7460) 2018-01-10 15:35:18 +03:00
bytes.rs updated serde to version 1.0 2017-07-06 11:36:15 +02:00
hash.rs bloom refactor (#7475) 2018-01-14 22:43:28 +01:00
lib.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00
maybe.rs dissolve util (#7460) 2018-01-10 15:35:18 +03:00
uint.rs spec: Validate required divisor fields are not 0 (#7933) 2018-02-19 10:36:34 +01:00