Commit Graph

43 Commits

Author SHA1 Message Date
Matthias Seitz ed83223b93
cargo clippy --fix (#346) 2021-07-24 21:53:40 +03:00
Georgios Konstantopoulos 0453ea84df
chore: fix lints (#329) 2021-07-05 14:03:38 +03:00
Matthias Seitz 1dda336a78
feat: add filter utility function (#316)
* feat: add filter utility function

* chore: typo

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* chore: typo

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-06-13 20:39:36 +03:00
guanqun 01cc80769c
feat: make I256::from_raw() as const (#305)
* feat: make I256::from_raw() as const

* misc: fix 'cargo fmt' issue
2021-06-01 17:36:02 +03:00
guanqun 28c5c4febd
docs: typo fix (#292) 2021-05-13 13:51:43 +03:00
Gabriel Coutinho de Paula 6ec8312b8c
Expose `LogMeta` type and add more fields, and expose FilterBlockOption (#294)
* Expose `LogMeta` and add more fields

* Add tests for `query_with_meta`

* Expose `FilterBlockOption`

* Run rustfmt
2021-05-13 13:51:27 +03:00
James Prestwich b014ac9f27
feature: Signature derives Copy trait (#288)
* feature: Signature derives Copy trait

* drive-by: set Celo chain ID in tests
2021-05-09 12:47:21 +03:00
Rohit Narurkar 79862ffda5
feat: mnemonic phrase support for wallet (#256)
* feat: mnemonic phrase support for wallet

* refactor: better error handling and clippy linting

* fix: derive from path and tests

* chore: renamed package coins-bip39

* refactor: convenient builder API to setup mnemonic wallet

* refactor: re-export coins-bip39 for convenience

* clippy: fix warnings for multiple complex types in provider

* feat: randomly generated mnemonic phrase can be written to storage
2021-04-05 10:44:58 +03:00
Georgios Konstantopoulos 5eb31ceae9
chore: use latest ethabi (#253)
* chore: use latest ethabi

* chore: use re-exported ethereum types
2021-04-01 20:02:34 +03:00
Georgios Konstantopoulos 5dbed7cbd2
chore: use upstream ethabi (#248)
* chore: use upstream ethabi

* chore: make clippy happy
2021-03-31 11:20:08 +03:00
Gabriel Coutinho de Paula 530bfe2b71
feat: add support for EIP-234 and EIP-1898 (#231)
* Add support for EIP-234

* Add support for EIP-1898

* Remove redundant field names

* Remove useless conversion

* Change `unwrap_or` to `unwrap_or_else`
2021-03-16 21:46:07 +02:00
Rohit Narurkar 4c8d3c81e7
Feat/is middleware signer (#182)
* feat: signature from_str can handle 0x-prefixed strings

* feat: add is_signer method to the middleware trait

* fix: eth_sign Signature deserialisation

* chore: refactor for cleaner decoding of Signature
2021-01-28 08:51:53 +02:00
James Prestwich 1048652a8c
doc: note EIP-658 in TransactionReceipt (#178) 2021-01-23 10:38:21 +02:00
Rohit Narurkar 3105431007
feat: Transformer middleware with DsProxy impl (#165)
* feat: basic structure of proxy wallet middleware with DsProxy

* feat: build DsProxy contract, minor fixes, naming convention changes

* fix: add provider error in contract error

* fix: left pad storage value

* fix: delete gnosis safe for now

* feat(ds_proxy): execute code or target

* test(ds_proxy): transformer middleware tests

* fix: clippy should be happy

* fix(tests): ds proxy execute code

* chore: add documentation

* chore: formatting
2021-01-22 11:25:22 +02:00
Georgios Konstantopoulos 1b12fd8aff
I256 implementation (#175)
* Resolve: add I256 implementation

* Resolve: add I256 implementation - Untracked files

* fix: make i256 tests work

Co-authored-by: 1saf <me@ansaf.net>
2021-01-19 14:21:46 +02:00
Rohit Narurkar b1461cc48d
Support for encrypted JSON keystore (#138)
* feat: add support for encrypted json keystores

* fix: ignore gitkeep file from keystore tests

* feat: use tempfile crate for temporary test dir/files
2021-01-11 11:39:14 +02:00
Georgios Konstantopoulos 29a3a16085
chore: upgrade to latest ethtypes (#137)
* chore: upgrade to latest ethtypes

* chore: fix doctests
2021-01-10 14:03:37 +02:00
Georgios Konstantopoulos 5c1f8f532a
Upgrade to Tokio 1.0 and remove async-std (#120)
* feat(providers): tokio 1.0

BREAKING: This removes async-std as a compatibility option

* feat: tokio 1.0 in rest of crates

* fix: patch Cargo.toml until deps are released

* fix(contract): load ws deps

* feat: bytes 1.0 (#121)

* feat(core): move to bytes::Bytes

* feat: adjust rest of crates to Bytes

* chore: bump deps

CI fails due to:
https://github.com/snapview/tokio-tungstenite/pull/142#discussion_r550445144

* chore: use latest tokio-tungstenite

* ci: split tests into jobs (#129)

* Switch to `hex` (#128)

* fix(core): replace rustc_hex with hex

* fix(providers): replace rustc_hex with hex

* chore: replace rustc-hex with hex

* chore: cargo fmt

* fix(ledger): copy address from string correctly

* chore: fix flaky tests

Fixes #105
2020-12-31 19:19:14 +02:00
Georgios Konstantopoulos dc4c2a807e
feat(providers): add tracing (#113)
* feat(provider): add async tracing

* feat(middleware): add tracing to gas escalator

* chore: make clippy happy
2020-12-24 22:23:05 +02:00
Georgios Konstantopoulos e9204ac72d chore: remove dead code 2020-12-24 17:47:32 +02:00
Georgios Konstantopoulos b0bfd550fb
fix: reschedule waker if receipt is immediately available (#103)
* fix: reschedule waker if receipt is immediately available

* chore: update minor deps

`cargo update`

* chore: make clippy happy
2020-12-16 14:05:16 +02:00
Georgios Konstantopoulos 1ece5d2020
Contract & Provider eth_subscribe support (#100)
* fix(block): fix block decoding from ws

* feat(pubsub): add pubsub traits and sub stream

Also use DeserializeOwned alias

* feat(transports): add notification type

* feat(ws): rewrite Ws for subscription support

* feat(provider): add eth_subscribe

* fix(celo): disable some celo tests due to ganache incompatibilities

* test(rinkeby): fix flaky test

* feat(contract): WS subscription bindings (#101)

* feat(middleware): add subscriptions to middleware methods

* feat(contract): add subscribe method to contracts
2020-11-30 11:33:06 +02:00
Georgios Konstantopoulos 84aafbbd1f
Misc Fixes (#97)
* fix: use generic instead of impl Trait

* fix: do not skip first 4 bytes when decoding outputs
2020-11-12 12:08:20 +02:00
Georgios Konstantopoulos c30f45fc72
feat: port over tracing from rust-web3 (#93) 2020-10-31 12:44:08 +02:00
Georgios Konstantopoulos a22f1f9aa0
Geth TxPool API Support (#86)
* feat: support for txpool API

* feat: add a geth spawner test helper

* fix(txpool): use TxRequest instead of new data struct

The `raw` field is no longer present in latest geth's response.

* fix(txpool): use proper api response format

ref: https://github.com/ethereum/go-ethereum/pull/21720

Also add a Geth test

* ci: install geth 1.9.23

Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
2020-10-24 11:13:13 +03:00
Georgios Konstantopoulos 938972e9cc
Address checksum (#85)
* feat: addr checksum encoding

* fix: replace format! with encode to hex

* chore: Fix celo tests

* perf(checksum): convert loop to iterator

Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
2020-10-18 13:22:10 +03:00
Georgios Konstantopoulos ac93c0bc65
fix: update signature error 2020-10-14 14:59:31 +03:00
Georgios Konstantopoulos aa37f74c4b
feat: generalize wallet/private key + yubihsm2 (#75)
* feat: generalize wallet/private key

* fix: adjust celo tests

* YubiHSM2 Support (#76)

* feat: support YubiHSM2
2020-10-02 11:41:16 +03:00
Georgios Konstantopoulos c65497543e
feat: convert signing to k256 (#72)
* feat: convert signing to k256

* fix: pass pre-hashed message to sig verification

* feat: wrap the hash to a Digest implementation

* refactor: cleanup and move digest impl to separate file

* chore: adjust abigen tests due to rust update

* test: add byte equality test between ethers-rs / web3.js signatures

* fix(keys): use 512 blocks for sha256

Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
Co-authored-by: Alex Vlasov <alex.m.vlasov@gmail.com>
2020-10-01 11:02:21 +03:00
Georgios Konstantopoulos 2d51c523ba
feature: Middleware Architecture (#65)
* feat: convert Provider to Middleware trait

* feat: move gas oracle to middleware crate

* feat: move signer to middleware crate

* feat: add nonce manager middleware and test stacking

* refactor: convert generic middleware jsonrpc type to associated type

* feat: move ethers-contract to middleware arch

* test(provider): make tests pass

* test(middleware): move middleware tests from signer

* test: fix ethers examples

* fix(contract): make tests compile

* chore: fix clippy

* feat: deduplicate trait delegation

* refactor(signer): deduplicate tx signing logic across signers

* fix doctests

* fix: examples, celo tests and ci
2020-09-25 00:33:09 +03:00
Georgios Konstantopoulos 95fcbe5240
feat: ledger support (#66)
* feat: ledger support

Adds support for Ledger Nano S Eth app (v1.3.7)

- sign message
- sign transaction
- get addresses
- get app version

* fix: fix eth docstring

* fix: take into account EIP155

* feat: convert Signer to async

* feat: implement Signer for Ledger

* ci: run celo-only tests explicitly

This is done to avoid using --all-features

* fix: remove async from with_signer

* chore: fix doctests

* fix: add Send/Sync to SignerError

* ci: update etherscan key

* test: disable etherscan abigen tests temporarily
2020-09-20 18:17:02 +03:00
Georgios Konstantopoulos 6197d8bb12
fix(core): serialize filters properly and always rewake (#61)
* fix: serialize filters properly

* test: add filter log tests

* fix(stream): always re-wake
2020-08-31 23:40:49 +03:00
Georgios Konstantopoulos d0f1752db0
feat(core/block): add epochSnarkData to the celo block (#46)
* feat(core/block): add epochSnarkData to the celo block

* test(block): add celo celo snark data test
2020-07-09 10:07:44 +03:00
Georgios Konstantopoulos 1cbd86dbd3
fix(block): add Randomness when using celo (#44)
* fix(block): add Randomness when using celo

Also do not compile the fields which were removed in https://github.com/celo-org/celo-blockchain/pull/913/

* test(block): add celo block test
2020-07-02 16:05:27 +03:00
Georgios Konstantopoulos 4ff466a593
fix intradoc links and add missing cargo metadata (#29) 2020-06-20 16:55:07 +03:00
Georgios Konstantopoulos ba5ae5a894
Add Celo support (#8)
* feat(types): add optional Celo support

* feat: add Celo feature flags to all crates

* test(provider): add get_transaction celo test

* test(signer): add send_transaction celo test

* test(contract): add deploy and call contract function celo test
2020-06-17 12:22:01 +03:00
Georgios Konstantopoulos 20493e0190
Fix Pending Transactions and EIP-155 (#22)
* fix(provider): ensure the Pending transaction calls the waker to get polled again

* feat(core): allow setting the blocktime in ganache

* test(provider): move pending txs test to integration tests + use block time

* fix(signers): make EIP-155 optional and fix sighash generation bug
2020-06-17 11:02:03 +03:00
Georgios Konstantopoulos 2c734f0d61
fix(core): make Signature.v a u64 instead of a u8 and expose `verify` (#21)
u8 would not work if a large chain_id was used
2020-06-17 09:45:15 +03:00
Georgios Konstantopoulos 1a47e933ae
feat(signers): implement Serde and make Wallet API smaller (#20)
* feat(signers): implement Serde and make API smaller

* fix: add abigen as a dev-dependency feature
2020-06-17 09:38:04 +03:00
Georgios Konstantopoulos b47c89455c
ci: skip tests with external deps 2020-06-03 00:16:08 +03:00
Georgios Konstantopoulos b0feff2432
fix: serialize null filters 2020-06-03 00:10:46 +03:00
Georgios Konstantopoulos 27ca5dd55a
simplify signers 2020-06-02 01:27:23 +03:00
Georgios Konstantopoulos cd4914d37f
refactor: pull crates to root dir 2020-06-01 21:24:22 +03:00