Skip to content
Snippets Groups Projects
Commit dc02d7e1 authored by Éloïs's avatar Éloïs
Browse files

[feat] block-doc: add field members_count on BlockDocTrait

parent 427f93bd
No related branches found
No related tags found
1 merge request!236Elois/tmp
...@@ -75,6 +75,8 @@ pub trait BlockDocumentTrait { ...@@ -75,6 +75,8 @@ pub trait BlockDocumentTrait {
fn inner_hash(&self) -> Option<Hash>; fn inner_hash(&self) -> Option<Hash>;
/// Get number of compute members in the current frame /// Get number of compute members in the current frame
fn issuers_count(&self) -> usize; fn issuers_count(&self) -> usize;
/// Get number of members in wot
fn members_count(&self) -> usize;
/// Get block number /// Get block number
fn number(&self) -> BlockNumber; fn number(&self) -> BlockNumber;
/// Get common difficulty (PoW) /// Get common difficulty (PoW)
...@@ -161,6 +163,12 @@ impl BlockDocumentTrait for BlockDocument { ...@@ -161,6 +163,12 @@ impl BlockDocumentTrait for BlockDocument {
} }
} }
#[inline] #[inline]
fn members_count(&self) -> usize {
match self {
BlockDocument::V10(block) => block.members_count(),
}
}
#[inline]
fn common_time(&self) -> u64 { fn common_time(&self) -> u64 {
match self { match self {
BlockDocument::V10(block) => block.common_time(), BlockDocument::V10(block) => block.common_time(),
......
...@@ -273,6 +273,9 @@ Transactions:{transactions} ...@@ -273,6 +273,9 @@ Transactions:{transactions}
fn issuers_count(&self) -> usize { fn issuers_count(&self) -> usize {
self.issuers_count self.issuers_count
} }
fn members_count(&self) -> usize {
self.members_count
}
fn number(&self) -> BlockNumber { fn number(&self) -> BlockNumber {
self.number self.number
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment