Skip to content

Commit

Permalink
Merge branch 'development' into fix/reduce-err-to-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi authored Sep 2, 2022
2 parents 807be9e + 004c219 commit 8c935e9
Show file tree
Hide file tree
Showing 73 changed files with 661 additions and 688 deletions.
47 changes: 24 additions & 23 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions applications/tari_app_grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ authors = ["The Tari Development Community"]
description = "This crate is to provide a single source for all cross application grpc files and conversions to and from tari::core"
repository = "https://github.com/tari-project/tari"
license = "BSD-3-Clause"
version = "0.37.0"
version = "0.38.0"
edition = "2018"

[dependencies]
tari_common_types = { version = "^0.37", path = "../../base_layer/common_types" }
tari_common_types = { version = "^0.38", path = "../../base_layer/common_types" }
tari_comms = { path = "../../comms/core" }
tari_core = { path = "../../base_layer/core" }
tari_crypto = { git = "https://github.com/tari-project/tari-crypto.git", tag = "v0.15.5" }
Expand Down
10 changes: 0 additions & 10 deletions applications/tari_app_grpc/proto/wallet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ service Wallet {
rpc SetBaseNode(SetBaseNodeRequest) returns (SetBaseNodeResponse);

rpc StreamTransactionEvents(TransactionEventRequest) returns (stream TransactionEventResponse);
rpc SeedWords(Empty) returns (SeedWordsResponse);
rpc DeleteSeedWordsFile(Empty) returns (FileDeletedResponse);
}

message GetVersionRequest { }
Expand Down Expand Up @@ -309,11 +307,3 @@ message TransactionEvent {
message TransactionEventResponse {
TransactionEvent transaction = 1;
}

message SeedWordsResponse {
repeated string words = 1;
}

message FileDeletedResponse {

}
2 changes: 1 addition & 1 deletion applications/tari_app_utilities/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tari_app_utilities"
version = "0.37.0"
version = "0.38.0"
authors = ["The Tari Development Community"]
edition = "2018"
license = "BSD-3-Clause"
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_base_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["The Tari Development Community"]
description = "The tari full base node implementation"
repository = "https://github.com/tari-project/tari"
license = "BSD-3-Clause"
version = "0.37.0"
version = "0.38.0"
edition = "2018"

[dependencies]
Expand Down
6 changes: 3 additions & 3 deletions applications/tari_console_wallet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tari_console_wallet"
version = "0.37.0"
version = "0.38.0"
authors = ["The Tari Development Community"]
edition = "2018"
license = "BSD-3-Clause"
Expand All @@ -22,9 +22,9 @@ tari_utilities = { git = "https://github.com/tari-project/tari_utilities.git", t

# Uncomment for tokio tracing via tokio-console (needs "tracing" featurs)
#console-subscriber = "0.1.3"
#tokio = { version = "1.14", features = ["signal", "tracing"] }
#tokio = { version = "1.20", features = ["signal", "tracing"] }
# Uncomment for normal use (non tokio-console tracing)
tokio = { version = "1.14", default-features = false, features = ["signal", "sync"] }
tokio = { version = "1.20", default-features = false, features = ["signal", "sync"] }

base64 = "0.13.0"
bitflags = "1.2.1"
Expand Down
14 changes: 4 additions & 10 deletions applications/tari_console_wallet/src/automation/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,23 +704,17 @@ pub async fn command_runner(
set_base_node_peer(wallet.clone(), args.public_key.into(), args.address).await?;
wallet
.db
.set_client_key_value(CUSTOM_BASE_NODE_PUBLIC_KEY_KEY.to_string(), public_key.to_string())
.await?;
.set_client_key_value(CUSTOM_BASE_NODE_PUBLIC_KEY_KEY.to_string(), public_key.to_string())?;
wallet
.db
.set_client_key_value(CUSTOM_BASE_NODE_ADDRESS_KEY.to_string(), net_address.to_string())
.await?;
.set_client_key_value(CUSTOM_BASE_NODE_ADDRESS_KEY.to_string(), net_address.to_string())?;
println!("Custom base node peer saved in wallet database.");
},
ClearCustomBaseNode => {
wallet
.db
.clear_client_value(CUSTOM_BASE_NODE_PUBLIC_KEY_KEY.to_string())
.await?;
wallet
.db
.clear_client_value(CUSTOM_BASE_NODE_ADDRESS_KEY.to_string())
.await?;
.clear_client_value(CUSTOM_BASE_NODE_PUBLIC_KEY_KEY.to_string())?;
wallet.db.clear_client_value(CUSTOM_BASE_NODE_ADDRESS_KEY.to_string())?;
println!("Custom base node peer cleared from wallet database.");
},
InitShaAtomicSwap(args) => {
Expand Down
45 changes: 1 addition & 44 deletions applications/tari_console_wallet/src/grpc/wallet_grpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,8 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use std::{
convert::{TryFrom, TryInto},
fs,
path::PathBuf,
};
use std::convert::{TryFrom, TryInto};

use clap::Parser;
use futures::{
channel::mpsc::{self, Sender},
future,
Expand All @@ -48,7 +43,6 @@ use tari_app_grpc::{
CoinSplitResponse,
CreateBurnTransactionRequest,
CreateBurnTransactionResponse,
FileDeletedResponse,
GetBalanceRequest,
GetBalanceResponse,
GetCoinbaseRequest,
Expand All @@ -67,7 +61,6 @@ use tari_app_grpc::{
ImportUtxosResponse,
RevalidateRequest,
RevalidateResponse,
SeedWordsResponse,
SendShaAtomicSwapRequest,
SendShaAtomicSwapResponse,
SetBaseNodeRequest,
Expand Down Expand Up @@ -106,7 +99,6 @@ use tokio::{sync::broadcast, task};
use tonic::{Request, Response, Status};

use crate::{
cli::Cli,
grpc::{convert_to_transaction_event, TransactionWrapper},
notifier::{CANCELLED, CONFIRMATION, MINED, NEW_BLOCK_MINED, QUEUED, RECEIVED, SENT},
};
Expand Down Expand Up @@ -880,41 +872,6 @@ impl wallet_server::Wallet for WalletGrpcServer {
},
}
}

/// Returns the contents of a seed words file, provided via CLI
async fn seed_words(&self, _: Request<tari_rpc::Empty>) -> Result<Response<SeedWordsResponse>, Status> {
let cli = Cli::parse();

let filepath: PathBuf = match cli.seed_words_file_name {
Some(filepath) => filepath,
None => return Err(Status::not_found("file path is empty")),
};

let words = fs::read_to_string(filepath)?
.split(' ')
.collect::<Vec<&str>>()
.iter()
.map(|&x| x.into())
.collect::<Vec<String>>();

Ok(Response::new(SeedWordsResponse { words }))
}

/// Deletes the seed words file, provided via CLI
async fn delete_seed_words_file(
&self,
_: Request<tari_rpc::Empty>,
) -> Result<Response<FileDeletedResponse>, Status> {
let cli = Cli::parse();

// WARNING: the filepath used is supplied as an argument
fs::remove_file(match cli.seed_words_file_name {
Some(filepath) => filepath,
None => return Err(Status::not_found("file path is empty")),
})?;

Ok(Response::new(FileDeletedResponse {}))
}
}

async fn handle_completed_tx(
Expand Down
Loading

0 comments on commit 8c935e9

Please sign in to comment.