pub fn blockchain_path(data_dir: &Path, network: Network) -> PathBuf
Expand description
Cuprate’s blockchain directory.
This is the PATH used for any Cuprate blockchain files.
use cuprate_helper::{network::Network, fs::{CUPRATE_DATA_DIR, blockchain_path}};
assert_eq!(blockchain_path(&**CUPRATE_DATA_DIR, Network::Mainnet).as_path(), CUPRATE_DATA_DIR.join("blockchain"));
assert_eq!(blockchain_path(&**CUPRATE_DATA_DIR, Network::Stagenet).as_path(), CUPRATE_DATA_DIR.join(Network::Stagenet.to_string()).join("blockchain"));
assert_eq!(blockchain_path(&**CUPRATE_DATA_DIR, Network::Testnet).as_path(), CUPRATE_DATA_DIR.join(Network::Testnet.to_string()).join("blockchain"));