Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 6c1371e

Browse files
authored
Revert "Remove need for 04/16 nightly rust (#689)" (#692)
1 parent f50f7ee commit 6c1371e

File tree

13 files changed

+39
-40
lines changed

13 files changed

+39
-40
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
- uses: actions-rs/toolchain@v1
1212
with:
13-
toolchain: nightly
13+
toolchain: nightly-2023-04-16
1414
components: clippy
1515
target: wasm32-unknown-unknown
1616
override: true
@@ -45,7 +45,7 @@ jobs:
4545

4646
- uses: actions-rs/toolchain@v1
4747
with:
48-
toolchain: nightly
48+
toolchain: nightly-2023-04-16
4949
components: clippy
5050
target: wasm32-unknown-unknown
5151
override: true
@@ -68,11 +68,11 @@ jobs:
6868

6969
- name: Build wasm
7070
env:
71-
RUSTUP_TOOLCHAIN: nightly
71+
RUSTUP_TOOLCHAIN: nightly-2023-04-16
7272
run: wasm-pack build ./mutiny-wasm --release --target web --scope mutinywallet
7373

7474
- name: Publish wasm
7575
run: wasm-pack publish --access public -t web
7676
env:
77-
RUSTUP_TOOLCHAIN: nightly
77+
RUSTUP_TOOLCHAIN: nightly-2023-04-16
7878
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
- name: Install nightly toolchain
2525
uses: actions-rs/toolchain@v1
2626
with:
27-
toolchain: nightly
27+
toolchain: nightly-2023-04-16
2828
components: rustfmt
2929
profile: minimal
3030

3131
- name: Check formatting
3232
run: |
33-
cargo +nightly fmt -- --check
33+
cargo +nightly-2023-04-16 fmt -- --check
3434
3535
website:
3636
name: Build WASM binary
@@ -39,7 +39,7 @@ jobs:
3939
- uses: actions/checkout@v3
4040
- uses: actions-rs/toolchain@v1
4141
with:
42-
toolchain: nightly
42+
toolchain: nightly-2023-04-16
4343
target: wasm32-unknown-unknown
4444
override: true
4545
profile: minimal
@@ -61,20 +61,20 @@ jobs:
6161
6262
- name: Build wasm package
6363
env:
64-
RUSTUP_TOOLCHAIN: nightly
64+
RUSTUP_TOOLCHAIN: nightly-2023-04-16
6565
run: wasm-pack build ./mutiny-wasm --release --target web
6666

6767
browser_tests:
6868
name: Browser Tests
6969
runs-on: ubuntu-latest
7070
env:
71-
RUSTUP_TOOLCHAIN: nightly
71+
RUSTUP_TOOLCHAIN: nightly-2023-04-16
7272
WASM_BINDGEN_TEST_TIMEOUT: 240
7373
steps:
7474
- uses: actions/checkout@v3
7575
- uses: actions-rs/toolchain@v1
7676
with:
77-
toolchain: nightly
77+
toolchain: nightly-2023-04-16
7878
target: wasm32-unknown-unknown
7979
override: true
8080
profile: minimal
@@ -112,7 +112,7 @@ jobs:
112112
- uses: actions/checkout@v3
113113
- uses: actions-rs/toolchain@v1
114114
with:
115-
toolchain: nightly
115+
toolchain: nightly-2023-04-16
116116
components: clippy
117117
target: wasm32-unknown-unknown
118118
override: true
@@ -155,7 +155,7 @@ jobs:
155155
- name: Install Rust
156156
uses: actions-rs/toolchain@v1
157157
with:
158-
toolchain: nightly
158+
toolchain: nightly-2023-04-16
159159
override: true
160160
profile: minimal
161161
components: clippy
@@ -202,7 +202,7 @@ jobs:
202202
- name: Install Rust
203203
uses: actions-rs/toolchain@v1
204204
with:
205-
toolchain: nightly
205+
toolchain: nightly-2023-04-16
206206
override: true
207207
profile: minimal
208208
components: clippy
@@ -249,7 +249,7 @@ jobs:
249249
- name: Install Rust
250250
uses: actions-rs/toolchain@v1
251251
with:
252-
toolchain: nightly
252+
toolchain: nightly-2023-04-16
253253
override: true
254254
profile: minimal
255255
components: clippy

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ AR=/opt/homebrew/opt/llvm/bin/llvm-ar CC=/opt/homebrew/opt/llvm/bin/clang
2929

3030
### Dependencies
3131

32-
- [rust](https://www.rust-lang.org/) (specifically, nightly: `rustup toolchain install nightly` and `rustup target add wasm32-unknown-unknown --toolchain nightly`)
32+
- [rust](https://www.rust-lang.org/) (specifically, nightly: `rustup toolchain install nightly-2023-04-16` and `rustup target add wasm32-unknown-unknown --toolchain nightly-2023-04-16`)
3333

3434
- [node](https://nodejs.org/en/)
3535

mutiny-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ log = "=0.4.18"
5050
futures = "0.3.25"
5151
thiserror = "1.0"
5252
anyhow = "1.0"
53-
miniscript = { version = "9.0.1", default-features = false, features = ["no-std"] }
53+
miniscript = { version = "9.0.0", default-features = false, features = ["no-std"] }
5454

5555
[dev-dependencies]
5656
wasm-bindgen-test = "0.3.33"

mutiny-core/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
default = "nightly"
2+
channel = "nightly-2023-04-16"

mutiny-core/src/gossip.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,11 @@ impl LnPeerMetadata {
335335
};
336336

337337
// combine nodes from both
338-
let mut nodes: Vec<String> = primary.nodes.into_iter().chain(secondary.nodes).collect();
338+
let mut nodes: Vec<String> = primary
339+
.nodes
340+
.into_iter()
341+
.chain(secondary.nodes.into_iter())
342+
.collect();
339343

340344
// remove duplicates
341345
nodes.sort();

mutiny-core/src/ldkstorage.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ impl<S: MutinyStorage> MutinyNodePersister<S> {
134134
.scan(MONITORS_PREFIX_KEY, Some(suffix))
135135
.map_err(|_| io::ErrorKind::Other)?;
136136

137-
let res =
138-
channel_monitor_list
139-
.into_iter()
140-
.try_fold(Vec::new(), |mut accum, (_, data)| {
137+
let res = channel_monitor_list
138+
.iter()
139+
.fold(Ok(Vec::new()), |current_res, (_, data)| match current_res {
140+
Err(e) => Err(e),
141+
Ok(mut accum) => {
141142
let mut buffer = Cursor::new(data);
142143
match <(BlockHash, ChannelMonitor<InMemorySigner>)>::read(
143144
&mut buffer,
@@ -152,7 +153,8 @@ impl<S: MutinyStorage> MutinyNodePersister<S> {
152153
format!("Failed to deserialize ChannelMonitor: {e}"),
153154
)),
154155
}
155-
})?;
156+
}
157+
})?;
156158

157159
Ok(res)
158160
}
@@ -254,12 +256,8 @@ impl<S: MutinyStorage> MutinyNodePersister<S> {
254256
channel_monitor_mut_references,
255257
);
256258
let mut readable_kv_value = Cursor::new(bytes);
257-
let Ok((_, channel_manager)) =
258-
<(BlockHash, PhantomChannelManager<S>)>::read(&mut readable_kv_value, read_args)
259-
else {
260-
return Err(MutinyError::ReadError {
261-
source: MutinyStorageError::Other(anyhow!("could not read manager")),
262-
});
259+
let Ok((_, channel_manager)) = <(BlockHash, PhantomChannelManager<S>)>::read(&mut readable_kv_value, read_args) else {
260+
return Err(MutinyError::ReadError { source: MutinyStorageError::Other(anyhow!("could not read manager")) })
263261
};
264262
Ok(ReadChannelManager {
265263
channel_manager,

mutiny-core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![allow(
44
incomplete_features,
55
clippy::extra_unused_type_parameters,
6-
clippy::arc_with_non_send_sync,
76
type_alias_bounds
87
)]
98
#![feature(io_error_other)]

mutiny-core/src/nodemanager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ impl<S: MutinyStorage> NodeManager<S> {
11691169
log_warn!(self.logger, "Failed to get bdk history: {e}");
11701170
e
11711171
})
1172-
.unwrap_or_default();
1172+
.unwrap_or(vec![]);
11731173

11741174
let mut activity = Vec::with_capacity(lightning.len() + onchain.len());
11751175
for ln in lightning {
@@ -2117,7 +2117,7 @@ impl<S: MutinyStorage> NodeManager<S> {
21172117
.collect();
21182118

21192119
// correctly set is_connected
2120-
for peer in &mut storage_peers {
2120+
for mut peer in &mut storage_peers {
21212121
if connected_peers.contains(&peer.pubkey) {
21222122
peer.is_connected = true;
21232123
}

mutiny-core/src/nostr/nwc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ pub struct PendingNwcInvoice {
345345

346346
impl PartialOrd for PendingNwcInvoice {
347347
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
348-
Some(self.cmp(other))
348+
self.invoice
349+
.to_string()
350+
.partial_cmp(&other.invoice.to_string())
349351
}
350352
}
351353

0 commit comments

Comments
 (0)