Skip to content

Commit

Permalink
Merge pull request fedimint#6092 from tvolk131/remove_unused_env_vars
Browse files Browse the repository at this point in the history
chore: remove unused const strings
  • Loading branch information
tvolk131 authored Sep 27, 2024
2 parents 3409977 + 072fb85 commit 4ccc526
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 50 deletions.
2 changes: 0 additions & 2 deletions fedimint-build/src/envs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ pub const FORCE_GIT_HASH_ENV: &str = "FEDIMINT_BUILD_FORCE_GIT_HASH";

/// Env variable the cargo will set during crate build to pass the detected git
/// hash to the binary itself.
// Note: Keep in sync with `fedimint_core::envs`, which is not reused-to avoid
// introducing extra dependencies between core and build modules.
pub const FEDIMINT_BUILD_CODE_VERSION_ENV: &str = "FEDIMINT_BUILD_CODE_VERSION";
2 changes: 0 additions & 2 deletions fedimint-client/src/transaction/sm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ use crate::{DynGlobalClientContext, DynState};
/// Reserved module instance id used for client-internal state machines
pub const TRANSACTION_SUBMISSION_MODULE_INSTANCE: ModuleInstanceId = 0xffff;

pub const LOG_TARGET: &str = "transaction_submission";

const RETRY_INTERVAL: Duration = Duration::from_secs(5);

#[derive(Debug, Clone)]
Expand Down
8 changes: 0 additions & 8 deletions fedimint-core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,14 +1030,6 @@ impl SGroup for G1Projective {
/// of the config
pub const META_FEDERATION_NAME_KEY: &str = "federation_name";

/// Key under which the vetted gateways can be sent to client in the `meta` part
/// of the config
pub const META_VETTED_GATEWAYS_KEY: &str = "vetted_gateways";

/// Key under which the override URL can be sent to client in the `meta` part
/// of the config
pub const META_OVERRIDE_URL_KEY: &str = "meta_override_url";

pub fn load_from_file<T: DeserializeOwned>(path: &Path) -> Result<T, anyhow::Error> {
let file = std::fs::File::open(path)?;
Ok(serde_json::from_reader(file)?)
Expand Down
1 change: 0 additions & 1 deletion fedimint-core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ pub const MODULE_INSTANCE_ID_GLOBAL: u16 = u16::MAX;
// Note: needs to be in alphabetical order of ModuleKind of each module,
// as this is the ordering we currently hardcoded.
// Should be used only for pre-modularization code we still have left
pub const LEGACY_HARDCODED_INSTANCE_ID_LN: ModuleInstanceId = 0;
pub const LEGACY_HARDCODED_INSTANCE_ID_MINT: ModuleInstanceId = 1;
pub const LEGACY_HARDCODED_INSTANCE_ID_WALLET: ModuleInstanceId = 2;

Expand Down
1 change: 0 additions & 1 deletion fedimint-core/src/endpoint_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub const CONSENSUS_CONFIG_GEN_PARAMS_ENDPOINT: &str = "consensus_config_gen_par
pub const DEFAULT_CONFIG_GEN_PARAMS_ENDPOINT: &str = "default_config_gen_params";
pub const VERIFY_CONFIG_HASH_ENDPOINT: &str = "verify_config_hash";
pub const RECOVER_ENDPOINT: &str = "recover";
pub const REGISTER_GATEWAY_ENDPOINT: &str = "register_gateway";
pub const RUN_DKG_ENDPOINT: &str = "run_dkg";
pub const SET_CONFIG_GEN_CONNECTIONS_ENDPOINT: &str = "set_config_gen_connections";
pub const SET_CONFIG_GEN_PARAMS_ENDPOINT: &str = "set_config_gen_params";
Expand Down
6 changes: 1 addition & 5 deletions fedimint-core/src/envs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ use jsonrpsee_core::Serialize;
use serde::Deserialize;
use tracing::warn;

// Note: Keep in sync with `fedimint_build::envs`, which is not reused-to avoid
// introducing extra dependencies between core and build modules.
pub const FEDIMINT_BUILD_CODE_VERSION_ENV: &str = "FEDIMINT_BUILD_CODE_VERSION";

/// In tests we want to routinely enable an extra unknown module to ensure
/// all client code handles correct modules that client doesn't know about.
pub const FM_USE_UNKNOWN_MODULE_ENV: &str = "FM_USE_UNKNOWN_MODULE";
Expand All @@ -37,7 +33,7 @@ pub fn is_rbf_withdrawal_enabled() -> bool {
is_env_var_set("FM_UNSAFE_ENABLE_RBF_WITHDRAWAL")
}

/// Get value of [`FEDIMINT_BUILD_CODE_VERSION_ENV`] at compile time
/// Get value of `FEDIMINT_BUILD_CODE_VERSION` at compile time
#[macro_export]
macro_rules! fedimint_build_code_version_env {
() => {
Expand Down
5 changes: 0 additions & 5 deletions fedimint-server/src/config/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ pub const JSON_EXT: &str = "json";

pub const ENCRYPTED_EXT: &str = "encrypt";

/// Temporary directiry where server configs are stored / removed through the
/// setup process On setup complete, the configs are moved to the server config
/// directory and the staging directory is removed
pub const CONFIG_STAGING_DIR: &str = "cfg_staging";

/// Reads the server from the local, private, and consensus cfg files
pub fn read_server_config(password: &str, path: &Path) -> anyhow::Result<ServerConfig> {
let salt = fs::read_to_string(path.join(SALT_FILE))?;
Expand Down
18 changes: 0 additions & 18 deletions fedimint-testing-core/src/envs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@ pub const FM_PORT_ESPLORA_ENV: &str = "FM_PORT_ESPLORA";
// Env variable to TODO
pub const FM_TEST_DIR_ENV: &str = "FM_TEST_DIR";

// Env variable to TODO
pub const FM_PORT_CLN_ENV: &str = "FM_PORT_CLN";

// Env variable to TODO
pub const FM_GATEWAY_LIGHTNING_ADDR_ENV: &str = "FM_GATEWAY_LIGHTNING_ADDR";

// Env variable to TODO
pub const FM_PORT_LND_LISTEN_ENV: &str = "FM_PORT_LND_LISTEN";

// Env variable to TODO
pub const FM_LND_RPC_ADDR_ENV: &str = "FM_LND_RPC_ADDR";

// Env variable to TODO
pub const FM_LND_MACAROON_ENV: &str = "FM_LND_MACAROON";

// Env variable to TODO
pub const FM_LND_TLS_CERT_ENV: &str = "FM_LND_TLS_CERT";

// Env variable to TODO
pub const FM_TEST_BITCOIND_RPC_ENV: &str = "FM_TEST_BITCOIND_RPC";

Expand Down
3 changes: 0 additions & 3 deletions fedimintd/src/envs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,5 @@ pub const FM_BIND_METRICS_API_ENV: &str = "FM_BIND_METRICS_API";
// Env variable to TODO
pub const FM_PORT_ESPLORA_ENV: &str = "FM_PORT_ESPLORA";

// Api authentication (pass,...)
pub const FM_DEFAULT_API_SECRETS_ENV: &str = "FM_DEFAULT_API_SECRETS";

// Can be used to absolutely override the values stored in the db
pub const FM_FORCE_API_SECRETS_ENV: &str = "FM_FORCE_API_SECRETS";
2 changes: 1 addition & 1 deletion modules/fedimint-mint-client/benches/notes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use fedimint_core::encoding::Decodable;
use fedimint_mint_client::{SpendableNote, SpendableNoteUndecoded};

fn bench_note_decoding(c: &mut Criterion) {
pub const NOTE_HEX : &str = "a5dd3ebacad1bc48bd8718eed5a8da1d68f91323bef2848ac4fa2e6f8eed710f3178fd4aef047cc234e6b1127086f33cc408b39818781d9521475360de6b205f3328e490a6d99d5e2553a4553207c8bd";
const NOTE_HEX : &str = "a5dd3ebacad1bc48bd8718eed5a8da1d68f91323bef2848ac4fa2e6f8eed710f3178fd4aef047cc234e6b1127086f33cc408b39818781d9521475360de6b205f3328e490a6d99d5e2553a4553207c8bd";

let mut group = c.benchmark_group("SpendableNote decoding");

Expand Down
2 changes: 0 additions & 2 deletions modules/fedimint-mint-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ use crate::output::{

const MINT_E_CASH_TYPE_CHILD_ID: ChildId = ChildId(0);

pub const LOG_TARGET: &str = "client::module::mint";

/// An encapsulation of [`FederationId`] and e-cash notes in the form of
/// [`TieredMulti<SpendableNote>`] for the purpose of spending e-cash
/// out-of-band. Also used for validating and reissuing such out-of-band notes.
Expand Down
2 changes: 0 additions & 2 deletions modules/fedimint-wallet-client/src/client_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ impl fmt::Display for TweakIdx {
}

impl TweakIdx {
pub const ZERO: Self = TweakIdx(0);

#[must_use]
pub fn next(self) -> Self {
Self(self.0 + 1)
Expand Down

0 comments on commit 4ccc526

Please sign in to comment.