Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ksrichard committed Dec 5, 2024
1 parent c2b837c commit b3ace13
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions applications/tari_indexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use tari_common::{
};
use tari_consensus::consensus_constants::ConsensusConstants;
use tari_dan_app_utilities::{keypair::setup_keypair_prompt, substate_file_cache::SubstateFileCache};
use tari_dan_engine::transaction::TransactionProcessorConfigBuilder;
use tari_dan_engine::transaction::TransactionProcessorConfig;
use tari_dan_storage::global::DbFactory;
use tari_dan_storage_sqlite::SqliteDbFactory;
use tari_epoch_manager::{EpochManagerEvent, EpochManagerReader};
Expand Down Expand Up @@ -122,7 +122,7 @@ pub async fn run_indexer(config: ApplicationConfig, mut shutdown_signal: Shutdow

// dry run
let dry_run_transaction_processor = DryRunTransactionProcessor::new(
TransactionProcessorConfigBuilder::new()
TransactionProcessorConfig::builder()
.with_network(config.network)
.with_template_binary_max_size_bytes(consensus_constants.template_binary_max_size_bytes)
.build(),
Expand Down
4 changes: 2 additions & 2 deletions applications/tari_validator_node/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use tari_dan_common_types::{
ShardGroup,
VersionedSubstateId,
};
use tari_dan_engine::{fees::FeeTable, transaction::TransactionProcessorConfigBuilder};
use tari_dan_engine::{fees::FeeTable, transaction::TransactionProcessorConfig};
use tari_dan_p2p::TariMessagingSpec;
use tari_dan_storage::{
consensus_models::{Block, BlockId, SubstateRecord},
Expand Down Expand Up @@ -290,7 +290,7 @@ pub async fn spawn_services(

// Consensus
let payload_processor = TariDanTransactionProcessor::new(
TransactionProcessorConfigBuilder::new()
TransactionProcessorConfig::builder()
.with_network(config.network)
.with_template_binary_max_size_bytes(consensus_constants.template_binary_max_size_bytes)
.build(),
Expand Down
13 changes: 7 additions & 6 deletions dan_layer/engine/src/transaction/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ pub struct TransactionProcessorConfig {
pub template_binary_max_size_bytes: usize,
}

impl TransactionProcessorConfig {
pub fn builder() -> TransactionProcessorConfigBuilder {
TransactionProcessorConfigBuilder::default()
}
}

impl Default for TransactionProcessorConfig {
fn default() -> Self {
Self {
Expand All @@ -88,17 +94,12 @@ impl Default for TransactionProcessorConfig {
}
}

#[derive(Default)]
pub struct TransactionProcessorConfigBuilder {
config: TransactionProcessorConfig,
}

impl TransactionProcessorConfigBuilder {
pub fn new() -> Self {
Self {
config: Default::default(),
}
}

pub fn with_network(&mut self, network: Network) -> &mut Self {
self.config.network = network;
self
Expand Down
4 changes: 2 additions & 2 deletions dan_layer/template_test_tooling/src/template_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use tari_dan_engine::{
runtime::{AuthParams, RuntimeModule},
state_store::{memory::MemoryStateStore, new_memory_store, StateWriter},
template::LoadedTemplate,
transaction::{TransactionError, TransactionProcessor, TransactionProcessorConfigBuilder},
transaction::{TransactionError, TransactionProcessor, TransactionProcessorConfig},
wasm::LoadedWasmTemplate,
};
use tari_engine_types::{
Expand Down Expand Up @@ -474,7 +474,7 @@ impl TemplateTest {
initial_ownership_proofs: proofs,
};
let processor = TransactionProcessor::new(
TransactionProcessorConfigBuilder::new()
TransactionProcessorConfig::builder()
.with_network(Network::LocalNet)
.build(),
self.package.clone(),
Expand Down

0 comments on commit b3ace13

Please sign in to comment.