Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ci, .gitignore and rust toolchain updates, lint fixes #7

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
components: clippy
- name: Lint
run: cargo clippy -- -D warnings
run: cargo clippy --all-targets --all-features -- -D warnings

format:
runs-on: ubuntu-latest
Expand All @@ -45,4 +45,4 @@ jobs:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Tests
run: cargo test
run: cargo test --all-features
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/target

# Test files
/datacore
/dataindex
/dataldk0
/dataldk1
/dataldk2
/tmp

# will have compiled files and executables
/target

# These are backup files generated by rustfmt
**/*.rs.bk

# intellij files
.idea/
.vscode/

# MaxOS files
.DS_Store
*.swp
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[toolchain]
channel = "stable"
components = ["clippy", "rustfmt"]
targets = []
profile = "minimal"
2 changes: 1 addition & 1 deletion src/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn do_backup(wallet_dir: PathBuf, backup_path: &str, password: &str) -> Resu
tracing::info!("starting backup...");
let backup_file = PathBuf::from(&backup_path);
if backup_file.exists() {
return Err(APIError::InvalidBackupPath)?;
Err(APIError::InvalidBackupPath)?;
}
let tmp_base_path = _get_parent_path(&backup_file)?;
let files = _get_backup_paths(&tmp_base_path)?;
Expand Down
2 changes: 1 addition & 1 deletion src/test/backup_and_restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async fn backup_and_restore() {

restore(node1_addr, &node1_backup_path, &node1_password).await;

let ignores = RegexSet::new(&[r"log*"]).unwrap();
let ignores = RegexSet::new([r"log*"]).unwrap();
let cmp = dircmp::Comparison::new(ignores);
let diff = cmp
.compare(old_test_dir_node1_path, Path::new(&test_dir_node1))
Expand Down
2 changes: 1 addition & 1 deletion src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn get_ldk_sockets(peer_ports: &[u16]) -> Vec<SocketAddr> {
async fn start_daemon(node_test_dir: &str, node_peer_port: u16) -> SocketAddr {
let listener = TcpListener::bind("0.0.0.0:0".parse::<SocketAddr>().unwrap()).unwrap();
let node_address = listener.local_addr().unwrap();
std::fs::create_dir_all(node_test_dir.clone()).unwrap();
std::fs::create_dir_all(node_test_dir).unwrap();
let args = LdkUserInfo {
storage_dir_path: node_test_dir.to_string(),
ldk_peer_listening_port: node_peer_port,
Expand Down