Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
rust
Dunitrust
Commits
dc02d7e1
Commit
dc02d7e1
authored
5 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[feat] block-doc: add field members_count on BlockDocTrait
parent
427f93bd
No related branches found
No related tags found
1 merge request
!236
Elois/tmp
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/dubp/block-doc/src/block.rs
+8
-0
8 additions, 0 deletions
lib/dubp/block-doc/src/block.rs
lib/dubp/block-doc/src/block/v10.rs
+3
-0
3 additions, 0 deletions
lib/dubp/block-doc/src/block/v10.rs
with
11 additions
and
0 deletions
lib/dubp/block-doc/src/block.rs
+
8
−
0
View file @
dc02d7e1
...
@@ -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
(),
...
...
This diff is collapsed.
Click to expand it.
lib/dubp/block-doc/src/block/v10.rs
+
3
−
0
View file @
dc02d7e1
...
@@ -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
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment