Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit a98e77f

Browse files
authored
Merge pull request #197 from isabeltomb/update-transact-to-sawtooth-dep
Replace transact dependencies with sawtooth
2 parents 3266008 + 9dc2e07 commit a98e77f

File tree

9 files changed

+23
-22
lines changed

9 files changed

+23
-22
lines changed

cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ tokio-core = "0.1"
1919
users = "0.6"
2020
yaml-rust = "0.4"
2121
reqwest = {version = "0.11", features = ["blocking", "json"], default-features = false}
22+
sawtooth = "0.8"
2223
serde = "1.0"
2324
serde_json = "1.0"
2425
serde_derive = "1.0"
2526
sabre-sdk = {path = "../sdks/rust"}
26-
transact = "0.5"
2727

2828
[build-dependencies]
2929
protoc-rust = "2"
@@ -47,4 +47,4 @@ experimental = [
4747
]
4848

4949
[patch.crates-io]
50-
transact = { git = "https://github.com/hyperledger/transact" }
50+
sawtooth = { git = "https://github.com/hyperledger/sawtooth-lib" }

cli/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ use std::error::Error as StdError;
1717

1818
use sabre_sdk::protocol::payload::{ActionBuildError, SabrePayloadBuildError};
1919
use sabre_sdk::protos::ProtoConversionError;
20-
use transact::{
21-
protocol::{batch::BatchBuildError, transaction::TransactionBuildError},
20+
use sawtooth::{
2221
protos::ProtoConversionError as TransactProtoConversionError,
22+
transact::protocol::{batch::BatchBuildError, transaction::TransactionBuildError},
2323
};
2424

2525
#[derive(Debug)]

cli/src/submit.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ use reqwest::{
2020
};
2121
use std::fmt;
2222

23-
use transact::{protocol::batch::Batch, protos::IntoBytes};
23+
use sawtooth::protos::IntoBytes;
24+
use sawtooth::transact::protocol::batch::Batch;
2425

2526
use crate::error::CliError;
2627

@@ -160,7 +161,7 @@ mod tests {
160161

161162
use cylinder::{secp256k1::Secp256k1Context, Context};
162163
use mockito;
163-
use transact::protocol::{
164+
use sawtooth::transact::protocol::{
164165
batch::{Batch, BatchBuilder},
165166
transaction::{HashMethod, TransactionBuilder},
166167
};

example/intkey_multiply/processor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ experimental = [
5353
]
5454

5555
[patch.crates-io]
56-
transact = { git = "https://github.com/hyperledger/transact" }
56+
sawtooth = { git = "https://github.com/hyperledger/sawtooth-lib" }

sdks/rust/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protobuf = "2.19"
3030
sha2 = "0.10"
3131

3232
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
33-
transact = "0.5"
33+
sawtooth = { version = "0.8", dependencies = ["family-sabre"]}
3434
cylinder = "0.2"
3535

3636
[build-dependencies]
@@ -53,4 +53,4 @@ experimental = [
5353
]
5454

5555
[patch.crates-io]
56-
transact = { git = "https://github.com/hyperledger/transact" }
56+
sawtooth = { git = "https://github.com/hyperledger/sawtooth-lib" }

sdks/rust/src/protocol/payload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use protobuf::Message;
1616
use protobuf::RepeatedField;
1717
#[cfg(not(target_arch = "wasm32"))]
18-
use transact::protocol::transaction::{HashMethod, TransactionBuilder};
18+
use sawtooth::transact::protocol::transaction::{HashMethod, TransactionBuilder};
1919

2020
use std::error::Error as StdError;
2121

tp/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ log = "0.4"
3535
simple_logger = "1.16"
3636
clap = "2"
3737
protobuf = "2.19"
38+
sawtooth = { version = "0.8", features = ["family-sabre", "transact-execution"] }
3839
sha2 = "0.10"
3940
wasmi = "0.9"
40-
transact = {version = "0.5", features = ["family-sabre"]}
4141

4242
[build-dependencies]
4343
protoc-rust = "2"
@@ -58,4 +58,4 @@ experimental = [
5858
]
5959

6060
[patch.crates-io]
61-
transact = { git = "https://github.com/hyperledger/transact" }
61+
sawtooth = { git = "https://github.com/hyperledger/sawtooth-lib" }

tp/src/handler.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ use sawtooth_sdk::processor::handler::ApplyError;
2020
use sawtooth_sdk::processor::handler::TransactionContext;
2121
use sawtooth_sdk::processor::handler::TransactionHandler;
2222

23-
use transact::families::sabre::handler::SabreTransactionHandler;
24-
use transact::handler::ContextError;
25-
use transact::handler::TransactionHandler as TransactHandler;
26-
use transact::protocol::transaction::Transaction;
27-
use transact::protos::transaction::TransactionHeader;
23+
use sawtooth::families::sabre::handler::SabreTransactionHandler;
24+
use sawtooth::protos::transaction::TransactionHeader;
25+
use sawtooth::transact::handler::ContextError;
26+
use sawtooth::transact::handler::TransactionHandler as TransactHandler;
27+
use sawtooth::transact::protocol::transaction::Transaction;
2828

2929
/// The namespace registry prefix for global state (00ec00)
3030
const NAMESPACE_REGISTRY_PREFIX: &str = "00ec00";
@@ -39,7 +39,7 @@ struct SabreContext<'a> {
3939
sawtooth_context: &'a dyn TransactionContext,
4040
}
4141

42-
impl<'a> transact::handler::TransactionContext for SabreContext<'a> {
42+
impl<'a> sawtooth::transact::handler::TransactionContext for SabreContext<'a> {
4343
fn get_state_entry(&self, address: &str) -> Result<Option<Vec<u8>>, ContextError> {
4444
let results = self
4545
.sawtooth_context
@@ -162,10 +162,10 @@ impl TransactionHandler for SabreHandler {
162162
.apply(&txn_pair, &mut sabre_context)
163163
{
164164
Ok(()) => Ok(()),
165-
Err(transact::handler::ApplyError::InvalidTransaction(msg)) => {
165+
Err(sawtooth::transact::handler::ApplyError::InvalidTransaction(msg)) => {
166166
Err(ApplyError::InvalidTransaction(msg))
167167
}
168-
Err(transact::handler::ApplyError::InternalError(msg)) => {
168+
Err(sawtooth::transact::handler::ApplyError::InternalError(msg)) => {
169169
Err(ApplyError::InternalError(msg))
170170
}
171171
}

tp/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ mod handler;
2222
use clap::Arg;
2323
use log::LevelFilter;
2424

25+
use sawtooth::families::sabre::admin;
26+
use sawtooth::families::sabre::handler::SabreTransactionHandler;
2527
use sawtooth_sdk::processor::TransactionProcessor;
26-
use transact::families::sabre::admin;
27-
use transact::families::sabre::handler::SabreTransactionHandler;
2828

2929
use self::handler::SabreHandler;
3030

0 commit comments

Comments
 (0)