V2.5.12 stable (#11336)
* Enable EIP-2384 for ice age hard fork (#11281) * ethcore/res: activate agharta on classic 9573000 (#11331) * Istanbul HF in xDai (2019-12-12) (#11299) * Istanbul HF in POA Core (2019-12-19) (#11298) * Istanbul HF in POA Sokol (2019-12-05) (#11282) * Activate ecip-1061 on kotti and mordor (#11338) * Enable basic verification of local transactions (#11332) * Disallow EIP-86 style null signatures for transactions outside tests (#11335)
This commit is contained in:
@@ -203,6 +203,28 @@ mod tests {
|
||||
]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deserialization_alt_bn128_const_operations() {
|
||||
let s = r#"{
|
||||
"name": "alt_bn128_mul",
|
||||
"pricing": {
|
||||
"100500": {
|
||||
"price": { "alt_bn128_const_operations": { "price": 123 }}
|
||||
}
|
||||
}
|
||||
}"#;
|
||||
let builtin: Builtin = serde_json::from_str::<BuiltinCompat>(s).unwrap().into();
|
||||
assert_eq!(builtin.name, "alt_bn128_mul");
|
||||
assert_eq!(builtin.pricing, map![
|
||||
100500 => PricingAt {
|
||||
info: None,
|
||||
price: Pricing::AltBn128ConstOperations(AltBn128ConstOperations {
|
||||
price: 123,
|
||||
}),
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn activate_at() {
|
||||
let s = r#"{
|
||||
|
||||
@@ -97,6 +97,7 @@ impl<'a> Visitor<'a> for UintVisitor {
|
||||
}
|
||||
}
|
||||
|
||||
/// Deserialize and validate that the value is non-zero
|
||||
pub fn validate_non_zero<'de, D>(d: D) -> Result<Uint, D::Error> where D: Deserializer<'de> {
|
||||
let value = Uint::deserialize(d)?;
|
||||
|
||||
@@ -107,6 +108,7 @@ pub fn validate_non_zero<'de, D>(d: D) -> Result<Uint, D::Error> where D: Deseri
|
||||
Ok(value)
|
||||
}
|
||||
|
||||
/// Deserialize and validate that the value is non-zero
|
||||
pub fn validate_optional_non_zero<'de, D>(d: D) -> Result<Option<Uint>, D::Error> where D: Deserializer<'de> {
|
||||
let value: Option<Uint> = Option::deserialize(d)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user