mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 00:01:09 +00:00
Convert all UK spelling to US (#2138)
* all the ise * forgot a misspelling * a few more replacements * bump impl * rollback and fixes * bump impl again * Add aliases for RPC * Update on_demand.rs
This commit is contained in:
@@ -93,6 +93,6 @@ impl<H: hash::Hash + traits::Member + Serialize, H2: Clone> Listener<H, H2> {
|
||||
|
||||
/// Transaction was pruned from the pool.
|
||||
pub fn pruned(&mut self, header_hash: H2, tx: &H) {
|
||||
self.fire(tx, |watcher| watcher.finalised(header_hash))
|
||||
self.fire(tx, |watcher| watcher.finalized(header_hash))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,7 +728,7 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn should_trigger_ready_and_finalised() {
|
||||
fn should_trigger_ready_and_finalized() {
|
||||
// given
|
||||
let pool = pool();
|
||||
let watcher = pool.submit_and_watch(&BlockId::Number(0), uxt(Transfer {
|
||||
@@ -748,12 +748,12 @@ mod tests {
|
||||
// then
|
||||
let mut stream = watcher.into_stream().wait();
|
||||
assert_eq!(stream.next(), Some(Ok(watcher::Status::Ready)));
|
||||
assert_eq!(stream.next(), Some(Ok(watcher::Status::Finalised(H256::from_low_u64_be(2).into()))));
|
||||
assert_eq!(stream.next(), Some(Ok(watcher::Status::Finalized(H256::from_low_u64_be(2).into()))));
|
||||
assert_eq!(stream.next(), None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_trigger_ready_and_finalised_when_pruning_via_hash() {
|
||||
fn should_trigger_ready_and_finalized_when_pruning_via_hash() {
|
||||
// given
|
||||
let pool = pool();
|
||||
let watcher = pool.submit_and_watch(&BlockId::Number(0), uxt(Transfer {
|
||||
@@ -773,7 +773,7 @@ mod tests {
|
||||
// then
|
||||
let mut stream = watcher.into_stream().wait();
|
||||
assert_eq!(stream.next(), Some(Ok(watcher::Status::Ready)));
|
||||
assert_eq!(stream.next(), Some(Ok(watcher::Status::Finalised(H256::from_low_u64_be(2).into()))));
|
||||
assert_eq!(stream.next(), Some(Ok(watcher::Status::Finalized(H256::from_low_u64_be(2).into()))));
|
||||
assert_eq!(stream.next(), None);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ pub enum Status<H, H2> {
|
||||
Future,
|
||||
/// Extrinsic is part of the ready queue.
|
||||
Ready,
|
||||
/// Extrinsic has been finalised in block with given hash.
|
||||
Finalised(H2),
|
||||
/// Extrinsic has been finalized in block with given hash.
|
||||
Finalized(H2),
|
||||
/// Some state change (perhaps another extrinsic was included) rendered this extrinsic invalid.
|
||||
Usurped(H),
|
||||
/// The extrinsic has been broadcast to the given peers.
|
||||
@@ -70,14 +70,14 @@ impl<H, H2> Watcher<H, H2> {
|
||||
#[derive(Debug)]
|
||||
pub struct Sender<H, H2> {
|
||||
receivers: Vec<mpsc::UnboundedSender<Status<H, H2>>>,
|
||||
finalised: bool,
|
||||
finalized: bool,
|
||||
}
|
||||
|
||||
impl<H, H2> Default for Sender<H, H2> {
|
||||
fn default() -> Self {
|
||||
Sender {
|
||||
receivers: Default::default(),
|
||||
finalised: false,
|
||||
finalized: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,17 +108,17 @@ impl<H: Clone, H2: Clone> Sender<H, H2> {
|
||||
self.send(Status::Usurped(hash))
|
||||
}
|
||||
|
||||
/// Extrinsic has been finalised in block with given hash.
|
||||
pub fn finalised(&mut self, hash: H2) {
|
||||
self.send(Status::Finalised(hash));
|
||||
self.finalised = true;
|
||||
/// Extrinsic has been finalized in block with given hash.
|
||||
pub fn finalized(&mut self, hash: H2) {
|
||||
self.send(Status::Finalized(hash));
|
||||
self.finalized = true;
|
||||
}
|
||||
|
||||
/// Extrinsic has been marked as invalid by the block builder.
|
||||
pub fn invalid(&mut self) {
|
||||
self.send(Status::Invalid);
|
||||
// we mark as finalised as there are no more notifications
|
||||
self.finalised = true;
|
||||
// we mark as finalized as there are no more notifications
|
||||
self.finalized = true;
|
||||
}
|
||||
|
||||
/// Transaction has been dropped from the pool because of the limit.
|
||||
@@ -132,9 +132,9 @@ impl<H: Clone, H2: Clone> Sender<H, H2> {
|
||||
}
|
||||
|
||||
|
||||
/// Returns true if the are no more listeners for this extrinsic or it was finalised.
|
||||
/// Returns true if the are no more listeners for this extrinsic or it was finalized.
|
||||
pub fn is_done(&self) -> bool {
|
||||
self.finalised || self.receivers.is_empty()
|
||||
self.finalized || self.receivers.is_empty()
|
||||
}
|
||||
|
||||
fn send(&mut self, status: Status<H, H2>) {
|
||||
|
||||
Reference in New Issue
Block a user