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:
Aaro Altonen
2022-09-26 15:10:09 +03:00
committed by GitHub
parent ea377d0b17
commit 4c19c13d05
32 changed files with 466 additions and 471 deletions
@@ -36,9 +36,6 @@ pub type Message<B> = generic::Message<
<B as BlockT>::Extrinsic,
>;
/// A set of transactions.
pub type Transactions<E> = Vec<E>;
/// Remote call response.
#[derive(Debug, PartialEq, Eq, Clone, Encode, Decode)]
pub struct RemoteCallResponse {
@@ -59,7 +56,7 @@ pub struct RemoteReadResponse {
/// Generic types.
pub mod generic {
use super::{RemoteCallResponse, RemoteReadResponse, Transactions};
use super::{RemoteCallResponse, RemoteReadResponse};
use bitflags::bitflags;
use codec::{Decode, Encode, Input, Output};
use sc_client_api::StorageProof;
@@ -146,9 +143,10 @@ pub mod generic {
BlockResponse(BlockResponse<Header, Hash, Extrinsic>),
/// Block announce.
BlockAnnounce(BlockAnnounce<Header>),
/// Transactions.
Transactions(Transactions<Extrinsic>),
/// Consensus protocol message.
// NOTE: index is incremented by 1 due to transaction-related
// message that was removed
#[codec(index = 6)]
Consensus(ConsensusMessage),
/// Remote method call request.
RemoteCallRequest(RemoteCallRequest<Hash>),