cuprate_helper::fs

Function txpool_path

Source
pub fn txpool_path(data_dir: &Path, network: Network) -> PathBuf
Expand description

Cuprate’s txpool directory.

This is the PATH used for any Cuprate txpool files.

use cuprate_helper::{network::Network, fs::{CUPRATE_DATA_DIR, txpool_path}};

assert_eq!(txpool_path(&**CUPRATE_DATA_DIR, Network::Mainnet).as_path(), CUPRATE_DATA_DIR.join("txpool"));
assert_eq!(txpool_path(&**CUPRATE_DATA_DIR, Network::Stagenet).as_path(), CUPRATE_DATA_DIR.join(Network::Stagenet.to_string()).join("txpool"));
assert_eq!(txpool_path(&**CUPRATE_DATA_DIR, Network::Testnet).as_path(), CUPRATE_DATA_DIR.join(Network::Testnet.to_string()).join("txpool"));