Skip to content

Commit

Permalink
Format the node crate
Browse files Browse the repository at this point in the history
`node` is excluded from the workspace so it currently does not get
formatted by `just fmt`.

Modify the `justfile` so that the `node` directory gets formatted.

Includes a trivial error message change to make the line shorter.
  • Loading branch information
tcharding committed Dec 19, 2024
1 parent d6bfd70 commit 3426723
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
set export

REPO_DIR := `git rev-parse --show-toplevel`

default:
@just --list

Expand All @@ -16,6 +20,7 @@ lint:
# Run cargo fmt
fmt:
cargo +$(cat ./nightly-version) fmt --all
cd $REPO_DIR/node > /dev/null; cargo +$(cat ../nightly-version) fmt

# Check the formatting
format:
Expand Down
9 changes: 5 additions & 4 deletions node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ impl Node {
match client_base.create_wallet(wallet) {
Ok(json) => {
debug!("created wallet: {}", json.name());
},
}
Err(e) => {
debug!("initial create_wallet unsuccessful, try loading instead: {:?}", e);
debug!("initial create_wallet failed, try load instead: {:?}", e);
let wallet = client_base.load_wallet(wallet)?.name();
debug!("loaded wallet: {}", wallet);
}
Expand Down Expand Up @@ -577,9 +577,9 @@ mod test {
use tempfile::TempDir;

use super::*;
use crate::{exe_path, get_available_port, Node, Conf, LOCAL_IP};
#[cfg(not(feature = "28_0"))]
use crate::P2P;
use crate::{exe_path, get_available_port, Conf, Node, LOCAL_IP};

#[test]
fn test_local_ip() {
Expand Down Expand Up @@ -706,7 +706,8 @@ mod test {
let node2 = Node::with_conf(&exe, &conf_node2).unwrap();

// Create Node 3 Connected To Node
let conf_node3 = Conf::<'_> { p2p: node2.p2p_connect(false).unwrap(), ..Default::default() };
let conf_node3 =
Conf::<'_> { p2p: node2.p2p_connect(false).unwrap(), ..Default::default() };
let node3 = Node::with_conf(exe_path().unwrap(), &conf_node3).unwrap();

// Get each nodes Peers
Expand Down
20 changes: 18 additions & 2 deletions node/src/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ pub const VERSION: &str = "0.18.1";
pub const VERSION: &str = "0.17.1";

// To make --no-default-features work we have to enable some feature, use most recent version same as for default.
#[cfg(all(not(feature = "28_0"), not(feature = "27_1"), not(feature = "27_0"), not(feature = "26_2"), not(feature = "26_1"), not(feature = "26_0"), not(feature = "25_2"), not(feature = "24_2"), not(feature = "23_2"), not(feature = "22_1"), not(feature = "0_21_2"), not(feature = "0_20_2"), not(feature = "0_19_1"), not(feature = "0_18_1"), not(feature = "0_17_1")))]
#[allow(dead_code)] // for --no-default-features
#[cfg(all(
not(feature = "28_0"),
not(feature = "27_1"),
not(feature = "27_0"),
not(feature = "26_2"),
not(feature = "26_1"),
not(feature = "26_0"),
not(feature = "25_2"),
not(feature = "24_2"),
not(feature = "23_2"),
not(feature = "22_1"),
not(feature = "0_21_2"),
not(feature = "0_20_2"),
not(feature = "0_19_1"),
not(feature = "0_18_1"),
not(feature = "0_17_1")
))]
#[allow(dead_code)] // for --no-default-features
pub const VERSION: &str = "28.0";

0 comments on commit 3426723

Please sign in to comment.