Merge pull request #267 from poanetwork/afck-contributions

Add missing Batch::contributions getter.
This commit is contained in:
Vladimir Komendantskiy 2018-10-15 11:41:47 +01:00 committed by GitHub
commit 3af821dc88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,11 @@ impl<C, N: NodeIdT> Batch<C, N> {
&self.netinfo
}
/// Returns the contributions and their proposers.
pub fn contributions(&self) -> impl Iterator<Item = (&N, &C)> {
self.contributions.iter()
}
/// Returns an iterator over references to all transactions included in the batch.
pub fn iter<'a>(&'a self) -> impl Iterator<Item = <&'a C as IntoIterator>::Item>
where