Explorar o código

script/research/nodes-tool: update structs

aggstam %!s(int64=4) %!d(string=hai) anos
pai
achega
e85ab2d204

+ 1 - 0
script/research/nodes-tool/Cargo.toml

@@ -11,6 +11,7 @@ features = ["blockchain", "node", "wallet"]
 
 
 async-std = "1.12.0"
 async-std = "1.12.0"
 blake3 = "1.3.1"
 blake3 = "1.3.1"
+serde = "1.0.138"
 sled = "0.34.7"
 sled = "0.34.7"
 
 
 [workspace]
 [workspace]

+ 7 - 11
script/research/nodes-tool/src/main.rs

@@ -29,6 +29,7 @@ struct ParticipantInfo {
     _address: String,
     _address: String,
     _joined: u64,
     _joined: u64,
     _voted: Option<u64>,
     _voted: Option<u64>,
+    _quarantined: Option<u64>,
 }
 }
 
 
 impl ParticipantInfo {
 impl ParticipantInfo {
@@ -36,7 +37,8 @@ impl ParticipantInfo {
         let _address = participant.address.to_string();
         let _address = participant.address.to_string();
         let _joined = participant.joined;
         let _joined = participant.joined;
         let _voted = participant.voted;
         let _voted = participant.voted;
-        ParticipantInfo { _address, _joined, _voted }
+        let _quarantined = participant.quarantined;
+        ParticipantInfo { _address, _joined, _voted, _quarantined }
     }
     }
 }
 }
 
 
@@ -82,30 +84,24 @@ impl StreamletMetadataInfo {
 
 
 #[derive(Debug)]
 #[derive(Debug)]
 struct MetadataInfo {
 struct MetadataInfo {
-    _proof: String,
-    _rand_seed: String,
-    _signature: String,
+    _address: String,
 }
 }
 
 
 impl MetadataInfo {
 impl MetadataInfo {
     pub fn new(metadata: &Metadata) -> MetadataInfo {
     pub fn new(metadata: &Metadata) -> MetadataInfo {
-        let _proof = metadata.proof.clone();
-        let _rand_seed = metadata.rand_seed.clone();
-        let _signature = metadata.signature.clone();
-        MetadataInfo { _proof, _rand_seed, _signature }
+        let _address = metadata.address.to_string();
+        MetadataInfo { _address }
     }
     }
 }
 }
 
 
 #[derive(Debug)]
 #[derive(Debug)]
 struct ProposalInfo {
 struct ProposalInfo {
-    _address: String,
     _block: BlockInfo,
     _block: BlockInfo,
     _sm: StreamletMetadataInfo,
     _sm: StreamletMetadataInfo,
 }
 }
 
 
 impl ProposalInfo {
 impl ProposalInfo {
     pub fn new(proposal: &BlockProposal) -> ProposalInfo {
     pub fn new(proposal: &BlockProposal) -> ProposalInfo {
-        let _address = proposal.address.to_string();
         let _header = proposal.block.header.headerhash();
         let _header = proposal.block.header.headerhash();
         let mut _txs = vec![];
         let mut _txs = vec![];
         for tx in &proposal.block.txs {
         for tx in &proposal.block.txs {
@@ -116,7 +112,7 @@ impl ProposalInfo {
         let _block =
         let _block =
             BlockInfo { _hash: _header, _magic: proposal.block.magic, _header, _txs, _metadata };
             BlockInfo { _hash: _header, _magic: proposal.block.magic, _header, _txs, _metadata };
         let _sm = StreamletMetadataInfo::new(&proposal.block.sm);
         let _sm = StreamletMetadataInfo::new(&proposal.block.sm);
-        ProposalInfo { _address, _block, _sm }
+        ProposalInfo { _block, _sm }
     }
     }
 }
 }