mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41:09 +00:00
error type implementations
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
|
||||
//! Types representing extrinsics/transactions that have been submitted to a node.
|
||||
|
||||
use std::task::Poll;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::utils::strip_compact_prefix;
|
||||
use crate::{
|
||||
backend::{BlockRef, StreamOfResults, TransactionStatus as BackendTxStatus},
|
||||
@@ -14,7 +13,7 @@ use crate::{
|
||||
events::EventsClient,
|
||||
Config,
|
||||
};
|
||||
use crate::prelude::*;
|
||||
use core::task::Poll;
|
||||
use derivative::Derivative;
|
||||
use futures::{Stream, StreamExt};
|
||||
|
||||
@@ -25,8 +24,8 @@ pub struct TxProgress<T: Config, C> {
|
||||
client: C,
|
||||
}
|
||||
|
||||
impl<T: Config, C> std::fmt::Debug for TxProgress<T, C> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
impl<T: Config, C> fmt::Debug for TxProgress<T, C> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("TxProgress")
|
||||
.field("sub", &"<subscription>")
|
||||
.field("ext_hash", &self.ext_hash)
|
||||
@@ -125,9 +124,9 @@ impl<T: Config, C: Clone> Stream for TxProgress<T, C> {
|
||||
type Item = Result<TxStatus<T, C>, Error>;
|
||||
|
||||
fn poll_next(
|
||||
mut self: std::pin::Pin<&mut Self>,
|
||||
cx: &mut std::task::Context<'_>,
|
||||
) -> std::task::Poll<Option<Self::Item>> {
|
||||
mut self: core::pin::Pin<&mut Self>,
|
||||
cx: &mut core::task::Context<'_>,
|
||||
) -> core::task::Poll<Option<Self::Item>> {
|
||||
let sub = match self.sub.as_mut() {
|
||||
Some(sub) => sub,
|
||||
None => return Poll::Ready(None),
|
||||
@@ -169,7 +168,7 @@ impl<T: Config, C: Clone> Stream for TxProgress<T, C> {
|
||||
|
||||
/// Possible transaction statuses returned from our [`TxProgress::next()`] call.
|
||||
#[derive(Derivative)]
|
||||
#[derivative(Debug(bound = "C: std::fmt::Debug"))]
|
||||
#[derivative(Debug(bound = "C: fmt::Debug"))]
|
||||
pub enum TxStatus<T: Config, C> {
|
||||
/// Transaction is part of the future queue.
|
||||
Validated,
|
||||
@@ -223,7 +222,7 @@ impl<T: Config, C> TxStatus<T, C> {
|
||||
|
||||
/// This struct represents a transaction that has made it into a block.
|
||||
#[derive(Derivative)]
|
||||
#[derivative(Debug(bound = "C: std::fmt::Debug"))]
|
||||
#[derivative(Debug(bound = "C: fmt::Debug"))]
|
||||
pub struct TxInBlock<T: Config, C> {
|
||||
block_ref: BlockRef<T::Hash>,
|
||||
ext_hash: T::Hash,
|
||||
|
||||
Reference in New Issue
Block a user