Skip to content

Commit

Permalink
fix: cargo format and fix after merge (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksrichard authored Sep 25, 2024
1 parent 0d76bbb commit adc796c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xtrgpuminer"
version = "0.1.9"
version = "0.1.10"
edition = "2021"


Expand Down
2 changes: 1 addition & 1 deletion src/config_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Default for ConfigFile {
http_server_port: 18000,
// In range 1-1000
gpu_percentage: 1000,
grid_size: 32
grid_size: 32,
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/cuda_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ impl EngineImpl for CudaEngine {

fn create_main_function(&self, context: &Self::Context) -> Result<Self::Function, anyhow::Error> {
info!(target: LOG_TARGET, "Create CUDA main function");
let module = Module::from_ptx(include_str!("../cuda/keccak.ptx"), &[
ModuleJitOption::GenerateLineInfo(true),
])?;
let module = Module::from_ptx(
include_str!("../cuda/keccak.ptx"),
&[ModuleJitOption::GenerateLineInfo(true)],
)?;
// let func = context.module.get_function("keccakKernel")?;
Ok(CudaFunction { module })
}
Expand Down
21 changes: 7 additions & 14 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use cust::{
};
use log::{error, info, warn};
use minotari_app_grpc::tari_rpc::{
Block,
BlockHeader as grpc_header,
NewBlockTemplate,
TransactionOutput as GrpcTransactionOutput,
Block, BlockHeader as grpc_header, NewBlockTemplate, TransactionOutput as GrpcTransactionOutput,
};
use num_format::{Locale, ToFormattedString};
use sha3::Digest;
Expand All @@ -22,9 +19,7 @@ use tari_core::{
blocks::BlockHeader,
consensus::ConsensusManager,
transactions::{
key_manager::create_memory_db_key_manager,
tari_amount::MicroMinotari,
transaction_components::RangeProofType,
key_manager::create_memory_db_key_manager, tari_amount::MicroMinotari, transaction_components::RangeProofType,
},
};
use tari_shutdown::Shutdown;
Expand Down Expand Up @@ -62,20 +57,17 @@ mod p2pool_client;
mod stats_store;
mod tari_coinbase;

#[tokio::main]
async fn main() {
match main_inner().await {
Ok(()) => {},
const LOG_TARGET: &str = "tari::gpuminer";

#[tokio::main]
async fn main() {
match main_inner().await {
Ok(()) => {
info!(target: LOG_TARGET, "Starting gpu_miner successfully");
std::process::exit(0);
},
Err(err) => {
eprintln!("Error: {:#?}", err);
error!(target: LOG_TARGET, "Gpu_miner error: {}", err);
std::process::exit(1);
},
}
Expand Down Expand Up @@ -192,8 +184,9 @@ async fn main_inner() -> Result<(), anyhow::Error> {
if let Some(percentage) = cli.gpu_percentage {
config.gpu_percentage = percentage;
}
if let Some(gridSize) = cli.grid_size {
config.grid_size = gridSize;
if let Some(grid_size) = cli.grid_size {
config.grid_size = grid_size;
}
if let Some(coinbase_extra) = cli.coinbase_extra {
config.coinbase_extra = coinbase_extra;
}
Expand Down
12 changes: 2 additions & 10 deletions src/node_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ use std::time::{Duration, Instant};
use anyhow::anyhow;
use log::{error, info, warn};
use minotari_app_grpc::tari_rpc::{
base_node_client::BaseNodeClient,
pow_algo::PowAlgos,
sha_p2_pool_client::ShaP2PoolClient,
Block,
Empty,
GetNewBlockResult,
NewBlockTemplate,
NewBlockTemplateRequest,
NewBlockTemplateResponse,
PowAlgo,
base_node_client::BaseNodeClient, pow_algo::PowAlgos, sha_p2_pool_client::ShaP2PoolClient, Block, Empty,
GetNewBlockResult, NewBlockTemplate, NewBlockTemplateRequest, NewBlockTemplateResponse, PowAlgo,
};
use tari_common_types::tari_address::TariAddress;
use tonic::{async_trait, transport::Channel};
Expand Down
10 changes: 2 additions & 8 deletions src/p2pool_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ use std::time::Duration;
use anyhow::{anyhow, Error};
use log::{error, info, warn};
use minotari_app_grpc::tari_rpc::{
pow_algo::PowAlgos,
sha_p2_pool_client::ShaP2PoolClient,
Block,
GetNewBlockRequest,
NewBlockTemplate,
NewBlockTemplateResponse,
PowAlgo,
SubmitBlockRequest,
pow_algo::PowAlgos, sha_p2_pool_client::ShaP2PoolClient, Block, GetNewBlockRequest, NewBlockTemplate,
NewBlockTemplateResponse, PowAlgo, SubmitBlockRequest,
};
use tari_common_types::tari_address::TariAddress;
use tonic::{async_trait, transport::Channel};
Expand Down
15 changes: 4 additions & 11 deletions src/tari_coinbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,17 @@ use tari_common_types::{tari_address::TariAddress, types::PublicKey};
use tari_core::{
consensus::ConsensusConstants,
one_sided::{
diffie_hellman_stealth_domain_hasher,
shared_secret_to_output_encryption_key,
diffie_hellman_stealth_domain_hasher, shared_secret_to_output_encryption_key,
shared_secret_to_output_spending_key,
},
transactions::{
key_manager::{MemoryDbKeyManager, TariKeyId, TransactionKeyManagerBranch, TransactionKeyManagerInterface},
tari_amount::MicroMinotari,
transaction_components::{
encrypted_data::PaymentId,
CoinBaseExtra,
RangeProofType,
Transaction,
TransactionKernel,
TransactionOutput,
WalletOutput,
encrypted_data::PaymentId, CoinBaseExtra, RangeProofType, Transaction, TransactionKernel,
TransactionOutput, WalletOutput,
},
CoinbaseBuildError,
CoinbaseBuilder,
CoinbaseBuildError, CoinbaseBuilder,
},
};
use tari_crypto::keys::PublicKey as PK;
Expand Down

0 comments on commit adc796c

Please sign in to comment.