Delete 'encoding_struct'
#![deny(missing_debug_implementations, missing_docs)]
extern crate serde;
+#[macro_use]
+extern crate serde_derive;
extern crate serde_json;
#[macro_use]
extern crate exonum;
@@ -187,16 +189,13 @@ struct TimeApi {
blockchain: Blockchain,
}
-encoding_struct! {
/// Structure for saving validator's public key and last known local time.
+#[derive(Serialize)]
struct ValidatorTime {
- const SIZE = 44;
-
/// Validator's public key.
- field public_key: &PublicKey [00 => 32]
+ public_key: PublicKey,
/// Validator's time.
- field time: SystemTime [32 => 44]
- }
+ time: SystemTime,
}
/// Shortcut to get data from storage.
@@ -217,7 +216,10 @@ impl TimeApi {
let validators_time: Vec<_> = idx.iter()
.map(|(public_key, time)| {
- ValidatorTime::new(&public_key, time.time())
+ ValidatorTime {
+ public_key,
+ time: time.time(),
+ }
})
.collect();
