Skip to content

Commit d832460

Browse files
committed
Fix CI
1 parent 04c48f2 commit d832460

6 files changed

Lines changed: 36 additions & 37 deletions

File tree

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ version = "0.1.0"
1313
[workspace.dependencies]
1414
bech32 = { version = "0.11", default-features = false }
1515
chrono = { version = "0.4", default-features = false }
16-
derive_more = { version = "2.1.1", default-features = false }
17-
hex = { version = "0.4.3", default-features = false }
18-
image = "0.25.8"
19-
ledger_device_sdk = "1.35.1"
20-
ledger_secure_sdk_sys = "1.16.1"
21-
num_enum = { version = "0.7.5", default-features = false }
16+
derive_more = { version = "2.1", default-features = false }
17+
hex = { version = "0.4", default-features = false }
18+
image = "0.25"
19+
ledger_device_sdk = "1.35"
20+
ledger_secure_sdk_sys = "1.16"
21+
num_enum = { version = "0.7", default-features = false }
2222
num-traits = { version = "0.2", default-features = false }
2323
# Note: the testmacro crate is published by Ledger and its source code comes from the `testmacro`
2424
# dir inside the sdk repo, i.e. https://github.com/LedgerHQ/ledger-device-rust-sdk/tree/cad196841dbd72c037cfa01bec81a4a3ae57a04e/testmacro
2525
# (though the published version is a bit older).
26-
testmacro = "0.1.0"
26+
testmacro = "0.1"
2727

2828
mintlayer-app-core = { path = "crates/app-core" }
2929
mintlayer-messages = { path = "crates/messages" }

crates/app-core/src/app_ui/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ pub fn compress_public_key<const T: char>(
8181
pub fn to_public_key_hash(pk: &Secp256k1PublicKey) -> Result<PublicKeyHash, StatusWord> {
8282
let mut hasher = Hasher::new();
8383

84-
encode_to(&mlcp::PublicKey::Secp256k1Schnorr(*pk), &mut hasher);
84+
encode_to(mlcp::PublicKey::Secp256k1Schnorr(*pk), &mut hasher);
8585

8686
let full_hash = hasher.finalize()?;
87-
let pkh: [u8; PUBLIC_KEY_HASH_SIZE] = cut_array(&full_hash.as_fixed_bytes());
87+
let pkh: [u8; PUBLIC_KEY_HASH_SIZE] = cut_array(full_hash.as_fixed_bytes());
8888

8989
Ok(PublicKeyHash(pkh))
9090
}

crates/app-core/src/handlers/sign_tx/summary_collector.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,9 @@ fn into_coin_or_token_id_and_amount(
366366

367367
#[cfg(test)]
368368
mod tests {
369-
use crate::testing::prelude::*;
370-
use crate::StatusWord;
369+
use mintlayer_messages::{AdditionalOrderInfo, AdditionalUtxoInfo, TxInputWithAdditionalInfo};
371370

372-
use mintlayer_messages::{
373-
mlcp, AdditionalOrderInfo, AdditionalUtxoInfo, TxInputWithAdditionalInfo,
374-
};
371+
use crate::{mlcp, testing::prelude::*, StatusWord};
375372

376373
use super::*;
377374

tests/application_client/mintlayer_command_sender.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def get_public_key_with_confirmation(
126126
p1=GetPublicKeyP1.P1_CONFIRM,
127127
p2=P2.P2_LAST,
128128
data=data,
129-
) as response:
130-
yield response
129+
):
130+
yield
131131

132132
@contextmanager
133133
def sign_message(
@@ -166,8 +166,8 @@ def sign_message(
166166
p1=SignMessageP1.P1_NEXT,
167167
p2=P2.P2_LAST,
168168
data=chunks[-1],
169-
) as response:
170-
yield response
169+
):
170+
yield
171171

172172
def sign_tx(self, transaction: Transaction) -> Generator[SignTxStep, None, None]:
173173
# ---- Start req ----
@@ -291,8 +291,10 @@ def _send_chunked_sync(self, data: bytes, expected_last_response_variant: str):
291291
)
292292
return decode_response_variant(response.data, expected_last_response_variant)
293293

294-
def get_async_response(self) -> Optional[RAPDU]:
295-
return self.backend.last_async_response
294+
def get_async_response(self) -> RAPDU:
295+
response = self.backend.last_async_response
296+
assert response is not None
297+
return response
296298

297299
def get_all_signatures(self, transaction: Transaction) -> List[TxInputSignature]:
298300
next_sig = sign_tx_next_req_obj.encode({"ReturnNextSignature": None}).data

tests/application_client/mintlayer_utils.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ class TxInputSignatureResponse:
1919

2020
@staticmethod
2121
def from_data(response: bytes):
22-
response = decode_response_variant(response, "TxInputSignature")
22+
decoded_response = decode_response_variant(response, "TxInputSignature")
2323

24-
signature = bytes.fromhex(response["signature"][2:])
24+
signature = bytes.fromhex(decoded_response["signature"][2:])
2525
assert len(signature) == 64
2626

2727
return TxInputSignatureResponse(
2828
signature=signature,
29-
input_idx=response["input_idx"],
30-
multisig_idx=response["multisig_idx"],
31-
has_next=response["has_next"],
29+
input_idx=decoded_response["input_idx"],
30+
multisig_idx=decoded_response["multisig_idx"],
31+
has_next=decoded_response["has_next"],
3232
)
3333

3434

@@ -85,21 +85,21 @@ def expected_sig_indices(self) -> set[TxInputSignatureIndices]:
8585
return result
8686

8787

88-
def decode_response(response: bytes):
88+
def decode_response(response: bytes) -> dict:
8989
response_bytes = scalecodec.base.ScaleBytes(response)
9090
response_obj = scalecodec.base.RuntimeConfiguration().create_scale_object(
9191
"Response", data=response_bytes
9292
)
9393
return response_obj.decode()
9494

9595

96-
def decode_response_variant(response: bytes, expected_variant: str):
97-
response = decode_response(response)
96+
def decode_response_variant(response: bytes, expected_variant: str) -> dict:
97+
decoded_response = decode_response(response)
9898

9999
assert (
100-
isinstance(response, dict)
101-
and len(response) == 1
102-
and expected_variant in response
103-
), f"Expecting a dict with a single key '{expected_variant}', but got: {response!r}"
100+
isinstance(decoded_response, dict)
101+
and len(decoded_response) == 1
102+
and expected_variant in decoded_response
103+
), f"Expecting a dict with a single key '{expected_variant}', but got: {decoded_response!r}"
104104

105-
return response[expected_variant]
105+
return decoded_response[expected_variant]

0 commit comments

Comments
 (0)