Skip to content

Commit

Permalink
fix ci failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Pana committed Nov 7, 2024
1 parent 70f91f4 commit f453921
Show file tree
Hide file tree
Showing 52 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pending_review_screen = []
curve = ["secp256k1"]
flags = "0"
path = ["44'/503'"]
name = "Conflux"
name = "Conflux Core"

[package.metadata.ledger.nanox]
icon = "icons/cfx_14.gif"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ This is the Conflux Ledger device app, which is developed in Rust. This project

## Work to be done

1. Unit conversion in the tx show UI
1. Unit conversion in the tx show UI
2. Setting read and write: c app is through action
3. Icons for stax and flex
3. Icons for stax and flex
4. More test cases
5. Nanox rlp compile issue
5. Nanox rlp compile issue: need manual impl rlp decode
2 changes: 1 addition & 1 deletion docs/APDU.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ Status words tend to be similar to common [APDU responses](https://www.eftlab.co

| Field name | Length (bytes) | Description |
| --- | --- | --- |
| RData | var | Reponse data (can be empty) |
| RData | var | Response data (can be empty) |
| SW | 2 | Status word containing command processing status (e.g. `0x9000` for success) |
Binary file modified icons/cfx_32.gif
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/cfx_32_1.gif
Binary file not shown.
Binary file modified icons/cfx_40.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/cfx_40_1.gif
Binary file not shown.
Binary file modified icons/cfx_64.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/cfx_64_1.gif
Binary file not shown.
Binary file added icons/dark_cfx_32.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/dark_cfx_40.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/dark_cfx_64.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/cfx_addr/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ pub const TESTNET_PREFIX: &str = "cfxtest";
pub const NETWORK_ID_PREFIX: &str = "net";

// address types
pub const ADDRESS_TYPE_BUILTIN: &'static str = "builtin";
pub const ADDRESS_TYPE_CONTRACT: &'static str = "contract";
pub const ADDRESS_TYPE_NULL: &'static str = "null";
pub const ADDRESS_TYPE_UNKNOWN: &'static str = "unknown";
pub const ADDRESS_TYPE_USER: &'static str = "user";
pub const ADDRESS_TYPE_BUILTIN: &str = "builtin";
pub const ADDRESS_TYPE_CONTRACT: &str = "contract";
pub const ADDRESS_TYPE_NULL: &str = "null";
pub const ADDRESS_TYPE_UNKNOWN: &str = "unknown";
pub const ADDRESS_TYPE_USER: &str = "user";

// These two network_ids are reserved.
pub const RESERVED_NETWORK_IDS: [u64; 2] = [1, 1029];
2 changes: 1 addition & 1 deletion src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ pub const APP_FLAG_BLIND_SIGNING_ENABLED: usize = 0x01;

pub const APP_FLAG_DETAILED_DISPLAY_ENABLED: usize = 0x02;

pub const PERSONAL_SIGN_PREFIX: &'static str = "\x19Conflux Signed Message:\n";
pub const PERSONAL_SIGN_PREFIX: &str = "\x19Conflux Signed Message:\n";
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl TryFrom<ApduHeader> for Instruction {
#[cfg(any(target_os = "stax", target_os = "flex"))]
fn show_status_and_home_if_needed(ins: &Instruction, tx_ctx: &mut TxContext, status: &AppSW) {
let (show_status, status_type) = match (ins, status) {
(Instruction::GetPubkey { display: true }, AppSW::Deny | AppSW::Ok) => {
(Instruction::GetPubkey { display: true, return_chain_code: _ }, AppSW::Deny | AppSW::Ok) => {
(true, StatusType::Address)
}
(Instruction::SignTx { .. }, AppSW::Deny | AppSW::Ok) if tx_ctx.finished() => {
Expand Down
10 changes: 7 additions & 3 deletions tests/application_client/command_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class P2(IntEnum):
P2_LAST = 0x00
# Parameter 2 for more APDU to receive.
P2_MORE = 0x80

# Parameter 2 for true.
P2_TRUE = 0x01

class InsType(IntEnum):
Expand Down Expand Up @@ -92,12 +92,16 @@ def get_public_key(self, path: str) -> RAPDU:


@contextmanager
def get_public_key_with_confirmation(self, path: str, chain_id: int) -> Generator[None, None, None]:
def get_public_key_with_confirmation(self,
path: str,
chain_id: int
) -> Generator[None, None, None]:
with self.backend.exchange_async(cla=CLA,
ins=InsType.GET_PUBLIC_KEY,
p1=P1.P1_CONFIRM,
p2=P2.P2_TRUE,
data=pack_derivation_path(path) + chain_id.to_bytes(4, 'big')) as response:
data=pack_derivation_path(path) + chain_id.to_bytes(4, 'big'),
) as response:
yield response


Expand Down
2 changes: 1 addition & 1 deletion tests/application_client/response_unpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def unpack_get_app_name_response(response: bytes) -> str:
# PATCH (1)
def unpack_get_version_response(response: bytes) -> Tuple[int, int, int]:
assert len(response) == 4
flag, major, minor, patch = unpack("BBBB", response)
_, major, minor, patch = unpack("BBBB", response)
return (major, minor, patch)

# Unpack from response:
Expand Down
4 changes: 3 additions & 1 deletion tests/application_client/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ class TransactionError(Exception):

class Transaction:
def __init__(self, **kwargs: TxParam):

self.tx = CfxTransaction.from_dict(kwargs)

def serialize(self) -> bytes:
return self.tx.encode(allow_unsigned=True)

def get_internal_tx(self) -> dict:
return self.tx.to_dict()
Binary file modified tests/snapshots/flex/test_app_mainmenu/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_get_public_key_confirm_refused/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_get_public_key_confirm_refused/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/snapshots/flex/test_personal_sign/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/snapshots/flex/test_personal_sign/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/snapshots/flex/test_personal_sign/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/snapshots/flex/test_personal_sign/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_sign_tx_long_tx/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_sign_tx_long_tx/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_sign_tx_long_tx/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_long_tx/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_long_tx/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/00005.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx_no_memo/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx_no_memo/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx_no_memo/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx_no_memo/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_long_tx/00001.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_refused/00001.png
Binary file modified tests/snapshots/nanosp/test_sign_tx_short_tx/00001.png

0 comments on commit f453921

Please sign in to comment.