Skip to content

Commit

Permalink
chore: Update to miden-base's next
Browse files Browse the repository at this point in the history
  • Loading branch information
igamigo committed Sep 17, 2024
1 parent f263955 commit e1a4a3d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 27 deletions.
30 changes: 15 additions & 15 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion bin/faucet/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use miden_tx::{
use rand::{rngs::StdRng, thread_rng, Rng};
use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng};
use tonic::transport::Channel;
use tracing::{error, info};

use crate::{config::FaucetConfig, errors::FaucetError};

Expand Down Expand Up @@ -113,9 +114,10 @@ impl FaucetClient {
.executor
.execute_transaction(self.id, 0, &[], transaction_args)
.map_err(|err| {
error!("{err}");
FaucetError::InternalServerError(format!("Failed to execute transaction: {}", err))
})?;

Ok((executed_tx, output_note))
}

Expand Down
12 changes: 3 additions & 9 deletions bin/faucet/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::{
fmt::{Display, Formatter},
path::PathBuf,
};
use std::fmt::{Display, Formatter};

use miden_node_utils::config::{Endpoint, DEFAULT_FAUCET_SERVER_PORT, DEFAULT_NODE_RPC_PORT};
use serde::{Deserialize, Serialize};
Expand All @@ -18,8 +15,6 @@ pub struct FaucetConfig {
pub node_url: String,
/// Timeout for RPC requests in milliseconds
pub timeout_ms: u64,
/// Location to store database files
pub database_filepath: PathBuf,
/// Possible options on the amount of asset that should be dispersed on each faucet request
pub asset_amount_options: Vec<u64>,
/// Token symbol of the generated fungible asset
Expand All @@ -39,8 +34,8 @@ impl FaucetConfig {
impl Display for FaucetConfig {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!(
"{{ endpoint: \"{}\", database_filepath: {:?}, asset_amount_options: {:?}, token_symbol: {}, decimals: {}, max_supply: {} }}",
self.endpoint, self.database_filepath, self.asset_amount_options, self.token_symbol, self.decimals, self.max_supply
"{{ endpoint: \"{}\", asset_amount_options: {:?}, token_symbol: {}, decimals: {}, max_supply: {} }}",
self.endpoint, self.asset_amount_options, self.token_symbol, self.decimals, self.max_supply
))
}
}
Expand All @@ -51,7 +46,6 @@ impl Default for FaucetConfig {
endpoint: Endpoint::localhost(DEFAULT_FAUCET_SERVER_PORT),
node_url: Endpoint::localhost(DEFAULT_NODE_RPC_PORT).to_string(),
timeout_ms: 10000,
database_filepath: PathBuf::from("store.sqlite3"),
asset_amount_options: vec![100, 500, 1000],
token_symbol: "POL".to_string(),
decimals: 8,
Expand Down
1 change: 0 additions & 1 deletion config/miden-faucet.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
endpoint = { host = "localhost", port = 8080 }
database_filepath = "store.sqlite3"
node_url = "http://localhost:57291"
timeout_ms = 10000

Expand Down
2 changes: 1 addition & 1 deletion crates/store/src/db/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,5 +990,5 @@ pub fn mock_account_code() -> AccountCode {
add
end
";
AccountCode::compile(account_code, TransactionKernel::assembler()).unwrap()
AccountCode::compile(account_code, TransactionKernel::assembler(), false).unwrap()
}

0 comments on commit e1a4a3d

Please sign in to comment.