Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ksrichard committed Dec 11, 2024
1 parent 40d9936 commit 1e949ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
11 changes: 2 additions & 9 deletions applications/tari_dan_app_utilities/src/base_layer_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ use tari_core::{
base_node::comms_interface::ValidatorNodeChange,
transactions::{
tari_amount::MicroMinotari,
transaction_components::{
CodeTemplateRegistration,
SideChainFeatureData,
TransactionOutput,
ValidatorNodeRegistration,
},
transaction_components::{SideChainFeatureData, TransactionOutput, ValidatorNodeRegistration},
},
};
use tari_crypto::{
Expand All @@ -65,11 +60,9 @@ use tari_engine_types::{confidential::UnclaimedConfidentialOutput, substate::Sub
use tari_epoch_manager::{base_layer::EpochManagerHandle, EpochManagerError, EpochManagerReader};
use tari_shutdown::ShutdownSignal;
use tari_state_store_sqlite::SqliteStateStore;
use tari_template_lib::models::{EncryptedData, TemplateAddress, UnclaimedConfidentialOutputAddress};
use tari_template_lib::models::{EncryptedData, UnclaimedConfidentialOutputAddress};
use tokio::{task, task::JoinHandle, time};

use crate::template_manager::interface::{TemplateManagerError, TemplateManagerHandle};

const LOG_TARGET: &str = "tari::dan::base_layer_scanner";

pub fn spawn<TAddr: NodeAddressable + 'static>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use std::{collections::HashMap, convert::TryFrom, fs, sync::Arc};
use chrono::Utc;
use log::*;
use tari_common_types::types::{FixedHash, PublicKey};
use tari_core::transactions::transaction_components::{BuildInfo, CodeTemplateRegistration, TemplateType};
use tari_crypto::tari_utilities::{ByteArray, Hashable};
use tari_core::transactions::transaction_components::{CodeTemplateRegistration, TemplateType};
use tari_crypto::tari_utilities::ByteArray;
use tari_dan_common_types::{optional::Optional, services::template_provider::TemplateProvider, NodeAddressable};
use tari_dan_engine::{
flow::FlowFactory,
Expand All @@ -36,11 +36,7 @@ use tari_dan_engine::{
};
use tari_dan_storage::global::{DbTemplate, DbTemplateType, DbTemplateUpdate, GlobalDb, TemplateStatus};
use tari_dan_storage_sqlite::global::SqliteGlobalDbAdapter;
use tari_engine_types::{
calculate_template_binary_hash,
hashing::template_hasher32,
published_template::{PublishedTemplate, PublishedTemplateAddress},
};
use tari_engine_types::{calculate_template_binary_hash, hashing::template_hasher32};
use tari_template_builtin::{
get_template_builtin,
ACCOUNT_NFT_TEMPLATE_ADDRESS,
Expand Down Expand Up @@ -202,7 +198,7 @@ impl<TAddr: NodeAddressable> TemplateManager<TAddr> {
let mut flow_json = None;
let mut manifest = None;
let mut template_type = DbTemplateType::Wasm;
let mut template_hash = Hash::default();
let template_hash: Hash;
let mut template_name = template_name.unwrap_or(String::from("default"));
match template {
TemplateExecutable::CompiledWasm(binary) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@ pub struct TemplateManagerService<TAddr> {
rx_request: Receiver<TemplateManagerRequest>,
manager: TemplateManager<TAddr>,
completed_downloads: mpsc::Receiver<DownloadResult>,
download_queue: mpsc::Sender<DownloadRequest>,
// download_queue: mpsc::Sender<DownloadRequest>,
}

impl<TAddr: NodeAddressable + 'static> TemplateManagerService<TAddr> {
pub fn spawn(
rx_request: Receiver<TemplateManagerRequest>,
manager: TemplateManager<TAddr>,
download_queue: mpsc::Sender<DownloadRequest>,
_download_queue: mpsc::Sender<DownloadRequest>,
completed_downloads: mpsc::Receiver<DownloadResult>,
shutdown: ShutdownSignal,
) -> JoinHandle<anyhow::Result<()>> {
tokio::spawn(async move {
Self {
rx_request,
manager,
download_queue,
// download_queue,
completed_downloads,
}
.run(shutdown)
Expand Down

0 comments on commit 1e949ed

Please sign in to comment.