Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

spec: Validate required divisor fields are not 0 #7933

Merged
merged 6 commits into from
Feb 19, 2018
Merged

spec: Validate required divisor fields are not 0 #7933

merged 6 commits into from
Feb 19, 2018

Commits on Feb 18, 2018

  1. Add validate_non_zero function

    It's used to validate that a Spec's uint field used as a divisor is not zero.
    asymmetric committed Feb 18, 2018
    Configuration menu
    Copy the full SHA
    555e0cb View commit details
    Browse the repository at this point in the history
  2. Add deserialize_with to gas_limit_bound_divisor

    Prevents panics due to divide-by-zero on the gas_limit_bound_divisor
    field.
    asymmetric committed Feb 18, 2018
    Configuration menu
    Copy the full SHA
    452f9ee View commit details
    Browse the repository at this point in the history
  3. Add deserialize_with to difficulty_bound_divisor

    Prevents panics due to divide-by-zero on the difficulty_bound_divisor
    field.
    asymmetric committed Feb 18, 2018
    Configuration menu
    Copy the full SHA
    019f42b View commit details
    Browse the repository at this point in the history
  4. Add validate_optional_non_zero function

    Used to validate Option<Uint> divisor fields.
    asymmetric committed Feb 18, 2018
    Configuration menu
    Copy the full SHA
    03cd954 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    889ded2 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2018

  1. 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`.
    asymmetric committed Feb 19, 2018
    Configuration menu
    Copy the full SHA
    4bb478b View commit details
    Browse the repository at this point in the history