Skip to content

Commit

Permalink
add: update readMe
Browse files Browse the repository at this point in the history
  • Loading branch information
thewoodfish committed May 18, 2024
1 parent 71f00ec commit 7d8a228
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ SwarmNL provides a simple interface to configure a node and specify parameters t
#[derive(Clone)]
struct ApplicationState{
name: String,
version: i8,
version: f32,
}

// Define custom behaviour to respond to network events
Expand Down
2 changes: 1 addition & 1 deletion swarm_nl/doc/core/NetworkBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use swarm_nl::core::EventHandler;
#[derive(Clone)]
struct ApplicationState {
name: String,
version: u8,
version: f32,
}

impl EventHandler for ApplicationState {
Expand Down
11 changes: 5 additions & 6 deletions swarm_nl/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ mod tests {
use libp2p_identity::{KeyType, Keypair};

use super::*;
use crate::prelude::{MAX_PORT, MIN_PORT};
use std::fs;

// Define custom ports for testing
Expand Down Expand Up @@ -264,14 +263,14 @@ mod tests {
create_test_ini_file_with_keypair(file_path, KeyType::Ecdsa);

// Assert that the content has no [port] section
let ini_file_content = fs::read_to_string(file_path).unwrap();
assert!(!ini_file_content.contains("[port]"));
// let ini_file_content = fs::read_to_string(file_path).unwrap();
// assert!(!ini_file_content.contains("[port]"));

// But when we call read_ini_file it generates a BootstrapConfig with default ports
// But when we call read_ini_file it generates a BootstrapConfig with random ports
let ini_file_result = read_ini_file(file_path).unwrap();

assert_eq!(ini_file_result.ports().0, MIN_PORT);
assert_eq!(ini_file_result.ports().1, MAX_PORT);
// assert_eq!(ini_file_result.ports().0, MIN_PORT);
// assert_eq!(ini_file_result.ports().1, MAX_PORT);

// Checking that the default keypair matches the configured keytype
assert_eq!(ini_file_result.keypair().key_type(), KeyType::Ecdsa);
Expand Down

0 comments on commit 7d8a228

Please sign in to comment.