Commit Graph

55 Commits

Author SHA1 Message Date
dependabot-preview[bot] eda308aa3d
chore(deps): bump anyhow from 1.0.37 to 1.0.38 (#139)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.37 to 1.0.38.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.37...1.0.38)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-11 11:41:21 +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 25f6bdff22 fix: bump to tokio-tungstenite 13.0 2021-01-10 12:05:12 +02:00
Curtis Spencer 9a9f4523e0
Upgrade reqwest to 0.11.0 to ensure only 1 version of tokio used (#136)
This commit also removes the patch stanza in the top level Cargo.toml as the
older tokio tungstenite (0.12.0) is pulled in when ethers is used as a
dependency on another project.
2021-01-07 15:24:07 +02:00
dependabot-preview[bot] b63c272abe
chore(deps): bump pin-project from 1.0.2 to 1.0.3 (#135)
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.0.2...v1.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-01-06 14:39:56 +02:00
Georgios Konstantopoulos 98a00e8b7a
chore: use published coins-ledger (#132) 2021-01-05 14:15:18 +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 5860a1df6c
Trim some dependencies (#116)
* core: trim deps

* providers: trim deps

* contract: trim deps

* middleware: trim deps

* signers: trim deps
2020-12-25 02:17:21 +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 d9db40402b
feat: derives &, Arc and Box for Middleware (#109)
* test: can stack Middlewares with Arcs

* feat: derive &, Box and Arc impls for Middleware

* chore: fix spacing
2020-12-18 13:15:19 +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 62b7ce4366
feat: Transaction Gas Price Escalator middleware (#81)
* fix(signers): make Signer send by blocking on Ledger calls

* fix(providers): use Arc in WS impl to allow cloning

* feat(middleware): add geometric gas price escalator

* test(middleware): ensure that we can still stack everything up

* fix(middleware): default to tokio/async-std

* chore: fix clippy

* docs(middleware): add docs and rename middlewares

* chore: fix doctests

* feat: add linear gas escalator

https://github.com/makerdao/pymaker/blob/master/tests/test_gas.py\#L107
https://github.com/makerdao/pymaker/blob/master/pymaker/gas.py\#L129

* feat: add constructors to gas escalators
2020-10-08 18:56:36 +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
Rohit Narurkar 237f011259
(feat) gas oracle support (#56)
* (feat) gas oracle support

* (refactor) make a separate module | fix clippy warning

* add gas oracle to client using dynamic dispatch

* fix doc build in multicall module

* gas oracle returns U256

* support gas price fetching from client

* avoid querying for unsupported gas categories

* changes based on PR review

* add support for gasnow API, refactor gwei to wei
2020-08-18 21:47:56 +03:00
Georgios Konstantopoulos da20a042d7
chore(provider): make websockets optional (#45) 2020-07-02 18:33:16 +03:00
Georgios Konstantopoulos bb1ac9c666
Improve Ganache Flexibility (#37)
* feat(core): add more features to ganache

* test(provider): choose endpoint dynamically

* test(signer): choose endpoint and accounts dynamically

* test(contract): choose endpoint and accounts dynamically

* fix: dynamic port / accounts in examples

* core(chore): fix doctest
2020-06-22 16:42:34 +03:00
Georgios Konstantopoulos 0cfeadadf4
Websockets + TLS for Async-Std / Tokio (#30)
* fix: relax trait bounds on JsonRpcClient

* refactor(provider): move http client to separate dir

* feat(provider): add initial Websocket support over Stream/Sink + Tungstenite

* test(provider): add websocket test

* feat(provider): add convenience method using tokio/async-std behind a feature flag

* test(provider): add websocket ssl test

* feat(provider): add TLS websockets for tokio/async-std

* docs(provider): add websocket docs / examples

* fix(provider): make tokio an optional dep
2020-06-21 10:17:11 +03:00
Georgios Konstantopoulos 8240b26a80
docs: add missing attribution to Gnosis for codegen & macros 2020-06-20 17:02:57 +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 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 570b45eb10
ABI Encoder v2 + ABI Spec v6.6 (#17)
* feat(core): update ethabi and enable more Toeknize impls

* feat(contract/abigen): implement simple AbiEncoderV2

* tests(ethers): add abigen example

* fix(core): fix abi tests

* chore: make clippy happy
2020-06-16 15:08:42 +03:00
Georgios Konstantopoulos d90b03da06
Add streamed logs to the provider (#9)
* feat(provider): implement Streamed logs

This utilizes eth_getFilterChanges. The stream struct must be instantiated with a factory that yields logs/hashes.
Consumers are expected to use the `FilterStream` trait in order to simplify their type definitions

* feat(provider): expose streaming methods

* test(provider): add new blocks/pending txs test

* feat(contract): allow events to be streamed

* test(contract): add integration test for streaming event logs

* perf(contract-factory): take abi and bytecode by value instead of reference

The abi, bytecode and the factory's deploy method now consume the structs instead of being passed by reference. While this means that
consumers might need to clone before using them, this gives us some more flexiblity around factories inside helper functions

* refactor(contract): use test helpers to reduce code dup

* chore: make clippy happy
2020-06-15 11:46:07 +03:00
Georgios Konstantopoulos 030fc671fe
docs(contract): expand contract docs 2020-06-10 21:20:47 +03:00
Georgios Konstantopoulos 6156c4bf90
feat(signers): join the transaction futures 2020-06-10 13:34:48 +03:00
Georgios Konstantopoulos 27ca5dd55a
simplify signers 2020-06-02 01:27:23 +03:00
Georgios Konstantopoulos 5170b7ec9f
use pure rust libsecp 2020-05-31 20:54:58 +03:00
Georgios Konstantopoulos a9643fc9f6
refactor ethers-types -> ethers-core 2020-05-31 19:01:34 +03:00
Georgios Konstantopoulos 0013edf0e1
refactor ethers-utils to be part of ethers-types 2020-05-31 18:31:13 +03:00
Georgios Konstantopoulos d4bc43ee5b
feat(types): add solc bindings 2020-05-31 18:10:13 +03:00
Georgios Konstantopoulos bdda7d0883
add deployer 2020-05-30 23:04:08 +03:00
Georgios Konstantopoulos bc523b6d60
refactor ethers-abi to be part of ethers-types 2020-05-28 12:04:12 +03:00
Georgios Konstantopoulos 7c465c2027
add some block tests 2020-05-28 00:48:48 +03:00
Georgios Konstantopoulos 453579e347
add test for utils 2020-05-28 00:03:15 +03:00
Georgios Konstantopoulos bd6fee59cb
feat: add ens support 2020-05-27 14:32:44 +03:00
Georgios Konstantopoulos f42aaf2588
refactor(ethers-contract): split to modules 2020-05-27 11:46:16 +03:00
Georgios Konstantopoulos 099fa5d7ef
progress 2020-05-27 01:41:27 +03:00
Georgios Konstantopoulos c46442dd12
complete refactor 2020-05-26 14:01:46 +03:00
Georgios Konstantopoulos 28dc014ae3
WIP 2020-05-26 13:44:35 +03:00
Georgios Konstantopoulos 6a73bab70d
wip 2020-05-26 13:37:17 +03:00
Georgios Konstantopoulos 2bec170968
WIP 2020-05-26 13:24:19 +03:00
Georgios Konstantopoulos e7c9e19409
wip 2020-05-26 12:52:15 +03:00
Georgios Konstantopoulos 3f313ede01
el refactor 2020-05-26 12:37:31 +03:00
Georgios Konstantopoulos d3b9b378c5
feat: add tokenization and improve contract API for events 2020-05-25 21:14:13 +03:00