mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 03:58:04 +00:00
Move transactions protocol to its own crate (#12264)
* Move transaction protocol to its own crate * Update Cargo.lock * Fix binaries * Update client/network/transactions/src/lib.rs Co-authored-by: Dmitry Markin <dmitry@markin.tech> * Update client/service/src/builder.rs Co-authored-by: Bastian Köcher <info@kchr.de> * Apply review comments * Revert one change and apply cargo-fmt * Remove Transaction from Message * Add array-bytes * trigger CI * Add comment about codec index Co-authored-by: Dmitry Markin <dmitry@markin.tech> Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
@@ -604,35 +604,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Provides ability to propagate transactions over the network.
|
||||
pub trait NetworkTransaction<H> {
|
||||
/// You may call this when new transactions are imported by the transaction pool.
|
||||
///
|
||||
/// All transactions will be fetched from the `TransactionPool` that was passed at
|
||||
/// initialization as part of the configuration and propagated to peers.
|
||||
fn trigger_repropagate(&self);
|
||||
|
||||
/// You must call when new transaction is imported by the transaction pool.
|
||||
///
|
||||
/// This transaction will be fetched from the `TransactionPool` that was passed at
|
||||
/// initialization as part of the configuration and propagated to peers.
|
||||
fn propagate_transaction(&self, hash: H);
|
||||
}
|
||||
|
||||
impl<T, H> NetworkTransaction<H> for Arc<T>
|
||||
where
|
||||
T: ?Sized,
|
||||
T: NetworkTransaction<H>,
|
||||
{
|
||||
fn trigger_repropagate(&self) {
|
||||
T::trigger_repropagate(self)
|
||||
}
|
||||
|
||||
fn propagate_transaction(&self, hash: H) {
|
||||
T::propagate_transaction(self, hash)
|
||||
}
|
||||
}
|
||||
|
||||
/// Provides ability to announce blocks to the network.
|
||||
pub trait NetworkBlock<BlockHash, BlockNumber> {
|
||||
/// Make sure an important block is propagated to peers.
|
||||
|
||||
Reference in New Issue
Block a user