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

Commit

Permalink
[builtin]: multi-prices add info field
Browse files Browse the repository at this point in the history
It might be hard to read chain specs with several activations points.
This commit introduces a `info` field which may be used to write some
information about the current activation such as:

`Istanbul hardfork EIP-1108` or something similar.
  • Loading branch information
niklasad1 committed Oct 1, 2019
1 parent 4e84111 commit a5c52b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions json/src/spec/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pub enum Pricing {
#[derive(Debug, PartialEq, Deserialize, Clone)]
#[serde(deny_unknown_fields)]
pub struct PricingWithActivation {
/// Description of the activation
pub info: Option<String>,
/// Builtin pricing.
pub price: InnerPricing,
/// Activation block.
Expand Down Expand Up @@ -125,6 +127,7 @@ mod tests {
"price": {"linear": { "base": 3000, "word": 0 }}
},
{
"info": "enable fake EIP at block 500",
"activate_at": 500,
"price": {"linear": { "base": 10, "word": 0 }}
}
Expand All @@ -134,10 +137,12 @@ mod tests {
assert_eq!(deserialized.name, "ecrecover");
assert_eq!(deserialized.pricing, Pricing::Multi(vec![
PricingWithActivation {
info: None,
activate_at: Uint(0.into()),
price: InnerPricing::Linear(Linear { base: 3000, word: 0 })
},
PricingWithActivation {
info: Some(String::from("enable fake EIP at block 500")),
activate_at: Uint(500.into()),
price: InnerPricing::Linear(Linear { base: 10, word: 0 })
}
Expand Down

0 comments on commit a5c52b8

Please sign in to comment.