Merge pull request #480 from LedgerHQ/fbe/fix_python_client_job_trigger
Fix python-client github job trigger
This commit is contained in:
4
.github/workflows/python-client.yml
vendored
4
.github/workflows/python-client.yml
vendored
@@ -7,11 +7,11 @@ on:
|
||||
- develop
|
||||
- master
|
||||
paths:
|
||||
- ./client/**
|
||||
- client/**
|
||||
- .github/workflows/python-client.yml
|
||||
pull_request:
|
||||
paths:
|
||||
- ./client/**
|
||||
- client/**
|
||||
- .github/workflows/python-client.yml
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -2,7 +2,7 @@ import rlp
|
||||
from enum import IntEnum
|
||||
from ragger.backend import BackendInterface
|
||||
from ragger.utils import RAPDU
|
||||
from typing import List, Optional
|
||||
from typing import List, Optional, Union
|
||||
|
||||
from .command_builder import CommandBuilder
|
||||
from .eip712 import EIP712FieldType
|
||||
@@ -13,13 +13,16 @@ from .tlv import format_tlv
|
||||
WEI_IN_ETH = 1e+18
|
||||
GWEI_IN_ETH = 1e+9
|
||||
|
||||
|
||||
class TxData:
|
||||
selector: bytes
|
||||
parameters: list[bytes]
|
||||
|
||||
def __init__(self, selector: bytes, params: list[bytes]):
|
||||
self.selector = selector
|
||||
self.parameters = params
|
||||
|
||||
|
||||
class StatusWord(IntEnum):
|
||||
OK = 0x9000
|
||||
ERROR_NO_INFO = 0x6a00
|
||||
@@ -30,6 +33,7 @@ class StatusWord(IntEnum):
|
||||
CONDITION_NOT_SATISFIED = 0x6985
|
||||
REF_DATA_NOT_FOUND = 0x6a88
|
||||
|
||||
|
||||
class DomainNameTag(IntEnum):
|
||||
STRUCTURE_TYPE = 0x01
|
||||
STRUCTURE_VERSION = 0x02
|
||||
@@ -121,7 +125,7 @@ class EthAppClient:
|
||||
gas_limit: int,
|
||||
destination: bytes,
|
||||
amount: float,
|
||||
data: TxData):
|
||||
data: Optional[TxData]):
|
||||
tx.append(int(gas_price * GWEI_IN_ETH))
|
||||
tx.append(gas_limit)
|
||||
tx.append(destination)
|
||||
@@ -143,8 +147,8 @@ class EthAppClient:
|
||||
destination: bytes,
|
||||
amount: float,
|
||||
chain_id: int,
|
||||
data: TxData = None):
|
||||
tx = list()
|
||||
data: Optional[TxData] = None):
|
||||
tx: List[Union[int, bytes]] = list()
|
||||
tx.append(nonce)
|
||||
tx = self._sign_common(tx, gas_price, gas_limit, destination, amount, data)
|
||||
tx.append(chain_id)
|
||||
@@ -161,9 +165,9 @@ class EthAppClient:
|
||||
gas_limit: int,
|
||||
destination: bytes,
|
||||
amount: float,
|
||||
data: TxData = None,
|
||||
access_list = list()):
|
||||
tx = list()
|
||||
data: Optional[TxData] = None,
|
||||
access_list=list()):
|
||||
tx: List[Union[int, bytes]] = list()
|
||||
tx.append(chain_id)
|
||||
tx.append(nonce)
|
||||
tx.append(int(max_prio_gas_price * GWEI_IN_ETH))
|
||||
|
||||
@@ -182,12 +182,12 @@ class CommandBuilder:
|
||||
P2Type.FILTERING_FIELD_NAME,
|
||||
self._eip712_filtering_send_name(name, sig))
|
||||
|
||||
def set_external_plugin(self, plugin_name: str, contract_address: bytes, method_selelector: bytes, sig: bytes) -> bytes:
|
||||
def set_external_plugin(self, plugin_name: str, contract_address: bytes, selector: bytes, sig: bytes) -> bytes:
|
||||
data = bytearray()
|
||||
data.append(len(plugin_name))
|
||||
data += self._string_to_bytes(plugin_name)
|
||||
data += contract_address
|
||||
data += method_selelector
|
||||
data += selector
|
||||
data += sig
|
||||
|
||||
return self._serialize(InsType.EXTERNAL_PLUGIN_SETUP,
|
||||
|
||||
@@ -14,6 +14,7 @@ def challenge(data: bytes) -> int:
|
||||
assert len(data) == 4
|
||||
return int.from_bytes(data, "big")
|
||||
|
||||
|
||||
def pk_addr(data: bytes, has_chaincode: bool = False):
|
||||
idx = 0
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import sha3
|
||||
|
||||
|
||||
def get_selector_from_function(fn: str) -> bytes:
|
||||
return sha3.keccak_256(fn.encode()).digest()[0:4]
|
||||
|
||||
Reference in New Issue
Block a user