Skip to content

Commit

Permalink
Adapt 'ledger_app_clients'
Browse files Browse the repository at this point in the history
- Add 'send_raw' function
- Add error code 'EXCEPTION_OVERFLOW'
  • Loading branch information
cedelavergne-ledger committed Apr 3, 2024
1 parent cb5ca03 commit a974ac6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/src/ledger_app_clients/ethereum/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class StatusWord(IntEnum):
INVALID_P1_P2 = 0x6b00
CONDITION_NOT_SATISFIED = 0x6985
REF_DATA_NOT_FOUND = 0x6a88
EXCEPTION_OVERFLOW = 0x6807


class DomainNameTag(IntEnum):
Expand Down Expand Up @@ -49,6 +50,15 @@ def _exchange(self, payload: bytes):
def response(self) -> Optional[RAPDU]:
return self._client.last_async_response

def send_raw(self, cla: int, ins: int, p1: int, p2: int, payload: bytes):
header = bytearray()
header.append(cla)
header.append(ins)
header.append(p1)
header.append(p2)
header.append(len(payload))
return self._exchange(header + payload)

def eip712_send_struct_def_struct_name(self, name: str):
return self._exchange_async(self._cmd_builder.eip712_send_struct_def_struct_name(name))

Expand Down

0 comments on commit a974ac6

Please sign in to comment.