From c272af87b5922b64447cdb528a40206fc3ca0732 Mon Sep 17 00:00:00 2001 From: "Shawn T. Amundson" Date: Wed, 9 Aug 2023 12:01:44 -0500 Subject: [PATCH] Move transact::protocol::* to protocol::* This is an incremental step toward integrating transact fully into libsawtooth. This removes the transact feature guard on these protocol structs, with the exception of receipt; receipt needs further refactoring so that it does not reference non-protocol code. Signed-off-by: Shawn T. Amundson --- libsawtooth/src/{transact => }/protocol/batch.rs | 0 libsawtooth/src/{transact => }/protocol/command.rs | 0 .../src/{transact => }/protocol/key_value_state.rs | 0 libsawtooth/src/protocol/mod.rs | 11 +++++++++++ libsawtooth/src/{transact => }/protocol/receipt.rs | 0 libsawtooth/src/{transact => }/protocol/sabre/mod.rs | 0 .../src/{transact => }/protocol/sabre/payload.rs | 0 .../src/{transact => }/protocol/sabre/state.rs | 0 .../src/{transact => }/protocol/transaction.rs | 0 libsawtooth/src/transact/protocol/mod.rs | 12 ++++++------ 10 files changed, 17 insertions(+), 6 deletions(-) rename libsawtooth/src/{transact => }/protocol/batch.rs (100%) rename libsawtooth/src/{transact => }/protocol/command.rs (100%) rename libsawtooth/src/{transact => }/protocol/key_value_state.rs (100%) rename libsawtooth/src/{transact => }/protocol/receipt.rs (100%) rename libsawtooth/src/{transact => }/protocol/sabre/mod.rs (100%) rename libsawtooth/src/{transact => }/protocol/sabre/payload.rs (100%) rename libsawtooth/src/{transact => }/protocol/sabre/state.rs (100%) rename libsawtooth/src/{transact => }/protocol/transaction.rs (100%) diff --git a/libsawtooth/src/transact/protocol/batch.rs b/libsawtooth/src/protocol/batch.rs similarity index 100% rename from libsawtooth/src/transact/protocol/batch.rs rename to libsawtooth/src/protocol/batch.rs diff --git a/libsawtooth/src/transact/protocol/command.rs b/libsawtooth/src/protocol/command.rs similarity index 100% rename from libsawtooth/src/transact/protocol/command.rs rename to libsawtooth/src/protocol/command.rs diff --git a/libsawtooth/src/transact/protocol/key_value_state.rs b/libsawtooth/src/protocol/key_value_state.rs similarity index 100% rename from libsawtooth/src/transact/protocol/key_value_state.rs rename to libsawtooth/src/protocol/key_value_state.rs diff --git a/libsawtooth/src/protocol/mod.rs b/libsawtooth/src/protocol/mod.rs index 0a72e9fb9..2091a3199 100644 --- a/libsawtooth/src/protocol/mod.rs +++ b/libsawtooth/src/protocol/mod.rs @@ -17,13 +17,24 @@ //! Structs that cover the core protocols of the Sawtooth system. +#[cfg(feature = "transact-protocol-batch")] +pub mod batch; #[cfg(feature = "protocol-block")] pub mod block; pub mod block_info; +pub mod command; #[cfg(feature = "protocol-genesis")] pub mod genesis; pub mod identity; +#[cfg(feature = "transact-key-value-state")] +pub mod key_value_state; +#[cfg(feature = "transact")] +pub mod receipt; +#[cfg(any(feature = "transact-protocol-sabre", feature = "family-sabre"))] +pub mod sabre; pub mod setting; +#[cfg(feature = "transact-protocol-transaction")] +pub mod transaction; #[cfg(feature = "cylinder")] use cylinder::SigningError; diff --git a/libsawtooth/src/transact/protocol/receipt.rs b/libsawtooth/src/protocol/receipt.rs similarity index 100% rename from libsawtooth/src/transact/protocol/receipt.rs rename to libsawtooth/src/protocol/receipt.rs diff --git a/libsawtooth/src/transact/protocol/sabre/mod.rs b/libsawtooth/src/protocol/sabre/mod.rs similarity index 100% rename from libsawtooth/src/transact/protocol/sabre/mod.rs rename to libsawtooth/src/protocol/sabre/mod.rs diff --git a/libsawtooth/src/transact/protocol/sabre/payload.rs b/libsawtooth/src/protocol/sabre/payload.rs similarity index 100% rename from libsawtooth/src/transact/protocol/sabre/payload.rs rename to libsawtooth/src/protocol/sabre/payload.rs diff --git a/libsawtooth/src/transact/protocol/sabre/state.rs b/libsawtooth/src/protocol/sabre/state.rs similarity index 100% rename from libsawtooth/src/transact/protocol/sabre/state.rs rename to libsawtooth/src/protocol/sabre/state.rs diff --git a/libsawtooth/src/transact/protocol/transaction.rs b/libsawtooth/src/protocol/transaction.rs similarity index 100% rename from libsawtooth/src/transact/protocol/transaction.rs rename to libsawtooth/src/protocol/transaction.rs diff --git a/libsawtooth/src/transact/protocol/mod.rs b/libsawtooth/src/transact/protocol/mod.rs index c72a7ae54..12bd966a0 100644 --- a/libsawtooth/src/transact/protocol/mod.rs +++ b/libsawtooth/src/transact/protocol/mod.rs @@ -21,12 +21,12 @@ //! scheduled and executed. The resuls of execution are stored in transaction receipts. #[cfg(feature = "transact-protocol-batch")] -pub mod batch; -pub mod command; +pub use crate::protocol::batch; +pub use crate::protocol::command; #[cfg(feature = "transact-key-value-state")] -pub mod key_value_state; -pub mod receipt; +pub use crate::protocol::key_value_state; +pub use crate::protocol::receipt; #[cfg(any(feature = "transact-protocol-sabre", feature = "family-sabre"))] -pub mod sabre; +pub use crate::protocol::sabre; #[cfg(feature = "transact-protocol-transaction")] -pub mod transaction; +pub use crate::protocol::transaction;