mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Fix unstable-light-client + ChainHeadBackend tx events (#1865)
* Fix unstable-light-client + ChainHeadBackend tx events * Add note that Broadcasted event should no longer be returned at all * fmt
This commit is contained in:
@@ -682,9 +682,7 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for ChainHeadBackend<T> {
|
||||
rpc_methods::TransactionStatus::BestChainBlockIncluded { block: None } => {
|
||||
TransactionStatus::NoLongerInBestBlock
|
||||
}
|
||||
rpc_methods::TransactionStatus::Broadcasted { num_peers } => {
|
||||
TransactionStatus::Broadcasted { num_peers }
|
||||
}
|
||||
rpc_methods::TransactionStatus::Broadcasted => TransactionStatus::Broadcasted,
|
||||
rpc_methods::TransactionStatus::Dropped { error, .. } => {
|
||||
TransactionStatus::Dropped { message: error }
|
||||
}
|
||||
|
||||
@@ -709,10 +709,11 @@ pub enum TransactionStatus<Hash> {
|
||||
/// Transaction is part of the future queue.
|
||||
Validated,
|
||||
/// The transaction has been broadcast to other nodes.
|
||||
Broadcasted {
|
||||
/// Number of peers it's been broadcast to.
|
||||
num_peers: u32,
|
||||
},
|
||||
///
|
||||
/// Note: This event is no longer expected to be returned as of
|
||||
/// the chainHead_v1 spec, but we do so for compatibility with
|
||||
/// older versions of Smoldot, which do return it.
|
||||
Broadcasted,
|
||||
/// Transaction has been included in block with given details.
|
||||
/// Null is returned if the transaction is no longer in any block
|
||||
/// of the best chain.
|
||||
@@ -737,8 +738,6 @@ pub enum TransactionStatus<Hash> {
|
||||
},
|
||||
/// The transaction was dropped.
|
||||
Dropped {
|
||||
/// Was the transaction broadcasted to other nodes before being dropped?
|
||||
broadcasted: bool,
|
||||
/// Human readable message; why was it dropped.
|
||||
error: String,
|
||||
},
|
||||
|
||||
@@ -354,10 +354,8 @@ impl<T: Config + Send + Sync + 'static> Backend<T> for LegacyBackend<T> {
|
||||
RpcTransactionStatus::Retracted(_) => None,
|
||||
// These roughly map across:
|
||||
RpcTransactionStatus::Ready => Some(TransactionStatus::Validated),
|
||||
RpcTransactionStatus::Broadcast(peers) => {
|
||||
Some(TransactionStatus::Broadcasted {
|
||||
num_peers: peers.len() as u32,
|
||||
})
|
||||
RpcTransactionStatus::Broadcast(_peers) => {
|
||||
Some(TransactionStatus::Broadcasted)
|
||||
}
|
||||
RpcTransactionStatus::InBlock(hash) => {
|
||||
Some(TransactionStatus::InBestBlock {
|
||||
|
||||
@@ -290,10 +290,7 @@ pub enum TransactionStatus<Hash> {
|
||||
/// Transaction is part of the future queue.
|
||||
Validated,
|
||||
/// The transaction has been broadcast to other nodes.
|
||||
Broadcasted {
|
||||
/// Number of peers it's been broadcast to.
|
||||
num_peers: u32,
|
||||
},
|
||||
Broadcasted,
|
||||
/// Transaction is no longer in a best block.
|
||||
NoLongerInBestBlock,
|
||||
/// Transaction has been included in block with given hash.
|
||||
|
||||
Reference in New Issue
Block a user