Skip to content

Commit

Permalink
lock to tari v0.47.0-pre.0 and fix cucumbers
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Mar 8, 2023
1 parent a1f0907 commit 482ec9b
Show file tree
Hide file tree
Showing 32 changed files with 250 additions and 204 deletions.
204 changes: 122 additions & 82 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions applications/tari_dan_app_grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ version = "0.50.0-pre.0"
edition = "2018"

[dependencies]
tari_common_types = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_common_types" }
tari_comms = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_comms" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_common_types" }
tari_comms = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_comms" }
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", tag = "v0.16.6" }

tari_dan_common_types = { path = "../../dan_layer/common_types" }
Expand All @@ -24,4 +24,4 @@ prost = "0.9"
tonic = "0.6.2"

[build-dependencies]
tari_common = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_common", features = ["build"] }
tari_common = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_common", features = ["build"] }
4 changes: 2 additions & 2 deletions applications/tari_dan_app_grpc/src/conversions/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ impl TryFrom<proto::transaction::Instruction> for tari_engine_types::instruction
message: request.log_message,
},
4 => Instruction::ClaimBurn {
claim: ConfidentialClaim {
claim: Box::new(ConfidentialClaim {
commitment_address: request.claim_burn_commitment_address.try_into()?,
range_proof: request.claim_burn_range_proof,
proof_of_knowledge: request
.claim_burn_proof_of_knowledge
.ok_or_else(|| anyhow!("claim_burn_proof_of_knowledge not provided"))?
.try_into()?,
},
}),
},
_ => return Err(anyhow!("invalid instruction_type")),
};
Expand Down
12 changes: 6 additions & 6 deletions applications/tari_dan_app_utilities/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ edition = "2018"
license = "BSD-3-Clause"

[dependencies]
tari_app_grpc = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_app_grpc" }
tari_base_node_grpc_client = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_base_node_grpc_client" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_common_types" }
tari_comms = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_comms" }
tari_core = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_core", default-features = false, features = ["transactions"] }
tari_app_grpc = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_app_grpc" }
tari_base_node_grpc_client = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_base_node_grpc_client" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_common_types" }
tari_comms = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_comms" }
tari_core = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_core", default-features = false, features = ["transactions"] }
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", tag = "v0.16.6" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_shutdown" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_shutdown" }

tari_dan_common_types = { path = "../../dan_layer/common_types" }
tari_dan_core = { path = "../../dan_layer/core" }
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_dan_wallet_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "0.50.0-pre.0"
edition = "2018"

[dependencies]
tari_common_types = { git = "https://github.com/tari-project/tari.git", branch = "development" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0" }
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", tag = "v0.16.6" }
tari_dan_common_types = { path = "../../dan_layer/common_types" }
tari_dan_engine = { path = "../../dan_layer/engine" }
Expand Down
6 changes: 3 additions & 3 deletions applications/tari_dan_wallet_cli/src/command/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ use tari_wallet_daemon_client::{
WalletDaemonClient,
};

use crate::from_hex::FromHex;
use crate::{from_base64::FromBase64, from_hex::FromHex};

#[derive(Debug, Subcommand, Clone)]
pub enum TransactionSubcommand {
Expand Down Expand Up @@ -401,11 +401,11 @@ pub async fn handle_claim_burn(

let instructions = vec![
Instruction::ClaimBurn {
claim: ConfidentialClaim {
claim: Box::new(ConfidentialClaim {
commitment_address,
range_proof,
proof_of_knowledge,
},
}),
},
Instruction::PutLastInstructionOutputOnWorkspace { key: b"burn".to_vec() },
Instruction::CallMethod {
Expand Down
6 changes: 3 additions & 3 deletions applications/tari_dan_wallet_daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ version = "0.50.0-pre.0"
edition = "2018"

[dependencies]
tari_common = { git = "https://github.com/tari-project/tari.git", branch = "development" }
tari_common = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0" }
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", tag = "v0.16.6" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", branch = "development" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", branch = "development" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0" }
tari_dan_wallet_sdk = { path = "../../dan_layer/wallet/sdk" }
tari_dan_wallet_storage_sqlite = { path = "../../dan_layer/wallet/storage_sqlite" }
tari_transaction = { path = "../../dan_layer/transaction" }
Expand Down
22 changes: 11 additions & 11 deletions applications/tari_indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ version = "0.50.0-pre.0"
edition = "2018"

[dependencies]
tari_app_grpc = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_app_grpc" }
tari_app_utilities = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_app_utilities" }
tari_base_node_grpc_client = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_base_node_grpc_client" }
tari_common = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_common" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_common_types" }
tari_comms = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_comms" }
tari_app_grpc = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_app_grpc" }
tari_app_utilities = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_app_utilities" }
tari_base_node_grpc_client = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_base_node_grpc_client" }
tari_common = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_common" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_common_types" }
tari_comms = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_comms" }
tari_comms_logging = { path = "../../comms/tari_comms_logging" }
tari_comms_rpc_macros = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_comms_rpc_macros" }
tari_core = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_core", default-features = false, features = ["transactions"] }
tari_comms_rpc_macros = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_comms_rpc_macros" }
tari_core = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_core", default-features = false, features = ["transactions"] }
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", tag = "v0.16.6" }
tari_p2p = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_p2p" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_shutdown" }
tari_storage = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_storage" }
tari_p2p = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_p2p" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_shutdown" }
tari_storage = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_storage" }

tari_dan_app_grpc = { path = "../tari_dan_app_grpc" }
tari_dan_app_utilities = { path = "../tari_dan_app_utilities" }
Expand Down
36 changes: 18 additions & 18 deletions applications/tari_validator_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ version = "0.50.0-pre.0"
edition = "2018"

[dependencies]
tari_app_utilities = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_app_utilities" }
tari_app_grpc = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_app_grpc" }
tari_common = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_common" }
tari_comms = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_comms" }
tari_comms_rpc_macros = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_comms_rpc_macros" }
tari_app_utilities = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_app_utilities" }
tari_app_grpc = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_app_grpc" }
tari_common = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_common" }
tari_comms = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_comms" }
tari_comms_rpc_macros = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_comms_rpc_macros" }
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", tag = "v0.16.6" }
tari_p2p = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_p2p" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_shutdown" }
tari_storage = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_storage" }
tari_core = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_core", default-features = false, features = ["transactions"] }
tari_p2p = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_p2p" }
tari_shutdown = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_shutdown" }
tari_storage = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_storage" }
tari_core = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_core", default-features = false, features = ["transactions"] }
tari_dan_app_grpc = { path = "../tari_dan_app_grpc" }
tari_dan_app_utilities = { path = "../tari_dan_app_utilities" }
tari_dan_core = { path = "../../dan_layer/core" }
tari_dan_storage = { path = "../../dan_layer/storage" }
tari_dan_storage_sqlite = { path = "../../dan_layer/storage_sqlite" }
tari_dan_common_types = { path = "../../dan_layer/common_types" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_common_types" }
tari_common_types = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_common_types" }
tari_dan_engine = { path = "../../dan_layer/engine" }
tari_template_builtin = { path = "../../dan_layer/template_builtin" }
tari_template_lib = { path = "../../dan_layer/template_lib" }
tari_base_node_grpc_client = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_base_node_grpc_client" }
tari_wallet_grpc_client = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_wallet_grpc_client" }
tari_base_node_grpc_client = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_base_node_grpc_client" }
tari_wallet_grpc_client = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_wallet_grpc_client" }
tari_engine_types = { path = "../../dan_layer/engine_types" }
tari_validator_node_client = { path = "../../clients/validator_node_client" }
tari_comms_logging = { path = "../../comms/tari_comms_logging" }
Expand Down Expand Up @@ -66,17 +66,17 @@ tower-http = { version = "0.3.0", features = ["cors"] }
tower-layer = "0.3"

[build-dependencies]
tari_common = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_common", features = ["build"] }
tari_common = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_common", features = ["build"] }

[dev-dependencies]
# FIXME: the newest version failed compilation due to a missing "bool_to_option" unstable feature
cucumber = { version = "0.13.0" }
tempfile = "3.3.0"
tari_test_utils = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_test_utils" }
tari_base_node = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_base_node" }
tari_console_wallet = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_console_wallet" }
tari_comms_dht = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_comms_dht" }
tari_wallet = { git = "https://github.com/tari-project/tari.git", branch = "development", package = "tari_wallet" }
tari_test_utils = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_test_utils" }
tari_base_node = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_base_node" }
tari_console_wallet = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_console_wallet" }
tari_comms_dht = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_comms_dht" }
tari_wallet = { git = "https://github.com/tari-project/tari.git", tag = "v0.47.0-pre.0", package = "tari_wallet" }
tari_validator_node_cli = { path = "../tari_validator_node_cli" }
tari_transaction_manifest = { path = "../../dan_layer/transaction_manifest" }
tari_indexer = { path = "../tari_indexer" }
Expand Down
5 changes: 2 additions & 3 deletions applications/tari_validator_node/tests/cucumber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ use tari_common::initialize_logging;
use tari_common_types::types::{FixedHash, PublicKey};
use tari_comms::multiaddr::Multiaddr;
use tari_crypto::{
ristretto::{RistrettoPublicKey, RistrettoSecretKey},
ristretto::{RistrettoComSig, RistrettoPublicKey, RistrettoSecretKey},
tari_utilities::hex::Hex,
};
use tari_dan_app_grpc::proto;
use tari_dan_app_utilities::base_node_client::GrpcBaseNodeClient;
use tari_dan_common_types::QuorumDecision;
use tari_dan_core::services::BaseNodeClient;
Expand Down Expand Up @@ -96,7 +95,7 @@ pub struct TariWorld {
cli_data_dir: Option<String>,
current_scenario_name: Option<String>,
commitments: IndexMap<String, Vec<u8>>,
commitment_ownership_proofs: IndexMap<String, proto::transaction::CommitmentSignature>,
commitment_ownership_proofs: IndexMap<String, RistrettoComSig>,
rangeproofs: IndexMap<String, Vec<u8>>,
addresses: IndexMap<String, String>,
num_databases_saved: usize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ async fn when_i_claim_burn(

let instructions = [
Instruction::ClaimBurn {
claim: ConfidentialClaim {
claim: Box::new(ConfidentialClaim {
commitment_address: commitment.to_vec().try_into()?,
range_proof: rangeproof.clone(),
proof_of_knowledge: proof.clone().try_into()?,
},
proof_of_knowledge: proof.clone(),
}),
},
Instruction::PutLastInstructionOutputOnWorkspace { key: b"burn".to_vec() },
Instruction::CallMethod {
Expand Down
15 changes: 11 additions & 4 deletions applications/tari_validator_node/tests/steps/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use std::time::Duration;

use cucumber::{given, when};
use tari_app_grpc::tari_rpc::GetBalanceRequest;
use tari_crypto::tari_utilities::ByteArray;
use tari_common_types::types::{Commitment, PrivateKey, PublicKey};
use tari_crypto::{ristretto::RistrettoComSig, tari_utilities::ByteArray};
use tokio::time::sleep;

use crate::{spawn_wallet, TariWorld};
Expand Down Expand Up @@ -51,9 +52,15 @@ async fn when_i_burn_on_wallet(

assert!(resp.is_success);
world.commitments.insert(commitment, resp.commitment);
world
.commitment_ownership_proofs
.insert(proof, resp.ownership_proof.unwrap());
// TODO: use proto::transaction::CommitmentSignature to deserialize once we update tari to include https://github.com/tari-project/tari/pull/5200
world.commitment_ownership_proofs.insert(
proof,
RistrettoComSig::new(
Commitment::from_public_key(&PublicKey::from_bytes(&resp.ownership_proof[0..32]).unwrap()),
PrivateKey::from_bytes(&resp.ownership_proof[32..64]).unwrap(),
PrivateKey::from_bytes(&resp.ownership_proof[64..]).unwrap(),
),
);
world.rangeproofs.insert(range_proof, resp.rangeproof);
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 482ec9b

Please sign in to comment.