Skip to content

Commit

Permalink
ci(speculos): set version to sha-f430e51, fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
notmandatory committed Jun 3, 2024
1 parent c50a409 commit 474310e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
strategy:
matrix:
rust:
- version: stable # STABLE
features: miniscript
# - version: stable # STABLE
# features: miniscript
- version: 1.63.0 # MSRV
features: miniscript
emulator:
Expand All @@ -58,17 +58,8 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ci/
file: ci/Dockerfile.${{ matrix.emulator.name }}
tags: hwi/${{ matrix.emulator.name }}_emulator:latest
load: true
cache-from: type=gha
cache-to: type=gha
- name: Build simulator image
run: docker build -t hwi/${{ matrix.emulator.name }}_emulator:latest ./ci -f ci/Dockerfile.${{ matrix.emulator.name }}
- name: Run simulator image
run: docker run --name simulator --network=host hwi/${{ matrix.emulator.name }}_emulator &
- name: Install Python
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile.ledger
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/ledgerhq/speculos
FROM ghcr.io/ledgerhq/speculos:sha-f430e51

RUN apt-get update
RUN apt-get install wget -y
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv="1.48.0"
msrv="1.63.0"
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mod tests {
#[serial]
fn test_enumerate() {
let devices = HWIClient::enumerate().unwrap();
assert!(devices.len() > 0);
assert!(!devices.is_empty());
}

#[test]
Expand All @@ -83,7 +83,7 @@ mod tests {
.expect("No devices found. Either plug in a hardware wallet, or start a simulator.")
.as_ref()
.expect("Error when opening the first device");
HWIClient::get_client(&device, true, TESTNET).unwrap()
HWIClient::get_client(device, true, TESTNET).unwrap()
}

#[test]
Expand Down Expand Up @@ -119,8 +119,8 @@ mod tests {
let client = get_first_device();
let account = Some(10);
let descriptor = client.get_descriptors::<String>(account).unwrap();
assert!(descriptor.internal.len() > 0);
assert!(descriptor.receive.len() > 0);
assert!(!descriptor.internal.is_empty());
assert!(!descriptor.receive.is_empty());
}

#[test]
Expand All @@ -141,8 +141,8 @@ mod tests {
let descriptor = client
.get_descriptors::<Descriptor<DescriptorPublicKey>>(account)
.unwrap();
assert!(descriptor.internal.len() > 0);
assert!(descriptor.receive.len() > 0);
assert!(!descriptor.internal.is_empty());
assert!(!descriptor.receive.is_empty());
}

#[test]
Expand Down Expand Up @@ -199,7 +199,7 @@ mod tests {
fn test_sign_tx() {
let devices = HWIClient::enumerate().unwrap();
let device = devices.first().unwrap().as_ref().unwrap();
let client = HWIClient::get_client(&device, true, TESTNET).unwrap();
let client = HWIClient::get_client(device, true, TESTNET).unwrap();
let derivation_path = DerivationPath::from_str("m/44'/1'/0'/0/0").unwrap();

let address = client
Expand Down Expand Up @@ -237,7 +237,7 @@ mod tests {
input: vec![previous_txin],
output: vec![TxOut {
value: Amount::from_sat(50),
script_pubkey: script_pubkey,
script_pubkey,
}],
},
xpub: Default::default(),
Expand Down

0 comments on commit 474310e

Please sign in to comment.