Commit Graph

8 Commits

Author SHA1 Message Date
DaniPopes 0734fce48c
fix(contract, signers): cyclic deps (#1730)
* fix(signers): cyclic deps

* fix(contract): cyclic deps

* fix: feature
2022-09-24 12:41:04 -07:00
Dan Cline d5de795382
Use EIP155 for all signers with empty transaction `chain_id` (#1198)
* remove error when signing with a different chain

 - a chain_id mismatch between the signer and the transaction is valid
   since the behavior is the same between two signers with different
   chain ids
 - a specified chain_id should be signed regardless of the chain_id of
   the signer
 - refactor `sign_hash` to no longer take an `eip155` flag - it now
   _just_ signs hashes. EIP155 is specific to transactions, so we
   now normalize the `v` value in `sign_transaction_sync`

* use signer chain_id for tx in trezor signer

 - use the trezor signer's chain_id if the transaction's chain_id
   doesn't exist
 - sets the chain_id in both `sign_tx` and the Signer implementation's
   `sign_transaction`

* use signer chain_id for tx in ledger signer

 - use the ledger signer's chain_id if the transaction's chain_id
   doesn't exist
 - sets the chain_id in both `sign_tx` and the Signer implementation's
   `sign_transaction`

* prefer transaction chain_id in aws signer

 - uses the signer chain_id if the transaction chain_id doesn't exist
 - refactor `sign_digest_with_eip155` to take an input chain_id, so the
   signer chain_id is not used every time. If we want to enforce
   transaction and signer chain ids to be consistent, this should be
   undone

* add private key signing test for an empty chain_id

* Apply suggestions from code review

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* Update ethers-signers/src/ledger/mod.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-05-02 11:51:25 -07:00
Georgios Konstantopoulos 0c949f65bb chore: lints 2022-01-29 21:19:49 +02:00
joshieDo c6b51e3ae0
feat/trezor: cache session on filesystem (#747)
* save and read from cache

* fix

* read/write from/to file directly

* add cache_dir to TrezorEthereum

* fmt & clippy
2021-12-30 01:38:29 +02:00
Matthias Seitz e24117a1e1
chore(clippy): make clippy happy (#705) 2021-12-19 06:28:38 +02:00
joshieDo 5bf3f73548
fix: contract creation on trezor (#695)
* fix contract creation on trezor

* handle when _to_ param is an empty string

* return TrezorError when receiving an ENS name

* fix typo
2021-12-15 19:52:06 +02:00
joshieDo ebf52934e4
fix handling empty tx parameters (#686) 2021-12-13 19:39:24 +02:00
joshieDo 6bf325dcab
feat: trezor support (#663)
* added trezor signer

* linting

* TrezorHDPath instead of HDPath

* update trezor_client rev. added compatible hidapi backend

* remove unused variables

* keep track of the client session_id

* add to Other derivation paths to trezor

* remove commented macro

* remove unnecessary drops

* no ens

* added TrezorTransaction that loads from TypedTransaction

* enforce minimum firmware version

* add big data test to trezor app

* clippy

* replace trezor-client git with published crate

* change one char string to char

* bump trezor-client, with ethereum feature only
2021-12-13 08:23:01 -07:00