Document TransactionStatus and fix termination conditions. (#4446)

* Document TransactionStatus and fix termination conditions.

* Update client/rpc-api/src/author/mod.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Tomasz Drwięga
2019-12-18 21:28:25 +01:00
committed by Gavin Wood
parent 06e382b0d4
commit 216f77d91f
6 changed files with 58 additions and 20 deletions
@@ -84,12 +84,13 @@ impl<H: Clone, H2: Clone> Sender<H, H2> {
/// Some state change (perhaps another extrinsic was included) rendered this extrinsic invalid.
pub fn usurped(&mut self, hash: H) {
self.send(TransactionStatus::Usurped(hash))
self.send(TransactionStatus::Usurped(hash));
self.finalized = true;
}
/// Extrinsic has been finalized in block with given hash.
pub fn finalized(&mut self, hash: H2) {
self.send(TransactionStatus::Finalized(hash));
/// Extrinsic has been included in block with given hash.
pub fn in_block(&mut self, hash: H2) {
self.send(TransactionStatus::InBlock(hash));
self.finalized = true;
}
@@ -103,6 +104,7 @@ impl<H: Clone, H2: Clone> Sender<H, H2> {
/// Transaction has been dropped from the pool because of the limit.
pub fn dropped(&mut self) {
self.send(TransactionStatus::Dropped);
self.finalized = true;
}
/// The extrinsic has been broadcast to the given peers.