Commit Graph

169 Commits

Author SHA1 Message Date
Nick Hynes 26324343ec
fix: use once_cell with feature=std in abigen (#401) 2021-08-23 14:50:55 +03:00
Matthias Seitz ea566663d4
feat: wasm support (#390)
* feat: partial wasm32 support

* make compile for wasm32

* feat: att async-trait attr

* make compatible with wasm

* add type alias for archs

* rustfmt

* add wasm ci

* make compile with wasm-pack test

* make compile with wasm-pack test

* make compile with wasm-pack test

* make compile with wasm-pack test

* ci: disable wasmpack

* feat: use wasm timer delay

* feat: add wasm provider

* rustfmt

* misc refactor

* add wasm example

* make example a directory

* untrack error log

* move profile to root

* fix unused imports

* ci: enable wasm-pack test

* style: unify websocket implementations

* fix: typos

* fix: make policy compatible with wasm target

* chore: do not include ethers-wasm example as top level workspace member

* chore: modify wasm32 dependencies

* chore: make note about getrandom

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-08-23 12:56:44 +03:00
Georgios Konstantopoulos 8891ed38b4
chore: pull ethers to top level directory (#398)
* chore: pull up ethers to top level directory

* chore: enable ws feature when running examples

* chore: fix paths

* chore: enable ipc feature when running examples
2021-08-21 15:34:21 +03:00
Rohit Narurkar ad779c867f
feat: fee estimation with custom/default fn (#369)
* feat: fee estimation with custom/default fn

* fix: clippy and percentage calc fix

* calculate priority fee only if base fee above threshold

* chore: some comments

* fix: use legacy tx for ganache

* test: test a few cases for fee estimation using utils
2021-08-19 17:01:40 +03:00
James Prestwich 42aeeedcce
bug: log streams properly end when internal stream closes (#387) 2021-08-19 10:01:49 +03:00
Georgios Konstantopoulos 6cb7cac675
Release: 0.4 (#382)
* fix(abigen): use `no_deps` to avoid touching a Cargo.lock

* fix: use once_cell default features

* release: publish versions

core/providers/signers: 0.4.6
contract: 0.4.7
middleware: 0.4.8
ethers: 0.4.0
2021-08-16 11:54:12 +03:00
Matthias Seitz ba5f650dec
feat: generate rust structs from solidity JSON ABI (#378)
* add raw abi model

* feat: simplify struct representation

* feat: add struct generation

* use structs as function input

* fix: failing test

* add example

* rustfmt
2021-08-16 10:29:44 +03:00
Georgios Konstantopoulos 453504cb78 chore: remove default feature on futures-util from all crates 2021-08-15 20:25:11 +03:00
Georgios Konstantopoulos 60ff4660df
feat: multiple addresses on Filter (#375)
* feat: support multiple addresses in filters

To support filtering of 1..n addresses we had to add the ValueOrArray
enum to the log types and refactor some ethers-contract code

Fixes: #240

Signed-off-by: Sebastian Martinez <sebastinez@me.com>

* chore: fmt

* fix: use legacy tx in unit test due to Ganache

Co-authored-by: Sebastian Martinez <sebastinez@me.com>
2021-08-12 19:19:24 +03:00
Matthias Seitz 109a6b85ee
fix: only wrap single struct param in a tuple (#368) 2021-08-11 03:21:30 +03:00
Georgios Konstantopoulos 25c2e0e199
feat(ethers-contract): typed txs (part 4) (#362)
* feat(contract): use eip-1559 txs by default

This may break any tests which use Ganache, since it only supports legacy transactions.
We should replace Ganache with hardhat where possible

* fix(providers): always try setting default_sender

* chore: make all test transactions legacy

* feat(multicall): allow submitting legacy txs

* chore: default to legacy txs via feature flag

This is useful for chains like Celo that do not support the Typed Envelope

* fix: use legacy txs in ds proxy deployment / tests

* chore: fix review comments
2021-08-09 03:50:38 +03:00
Georgios Konstantopoulos dcbfacf5bc
feat: typed txs provider / middleware changes (part 3) (#357)
* feat(providers): add eth_feeHistory api

* add access list

* feat: fill transactions with access list / default sender info

* feat: add helpers for operating on the txs enum

* feat: send_transaction takes TypedTransaction now

* fix(contract): temp wrap all contract txs as Legacy txs

* feat(middleware): use TypedTransaction in Transformer

* feat(signers): use TypedTransaction in Wallet/Ledger

* feat(core): add helpers for setting typed tx fields

* feat(signer): use typed transactions

* fix(middleware): adjust nonce/gas/escalators for TypedTxs

The GPO and the Escalators will throw an error if they are provided an EIP1559 transaction

* fix(providers): ensure the correct account's nonce is filled

* fix: add .into() to txs until we make the fn call more generic

* Revert "fix: add .into() to txs until we make the fn call more generic"

This reverts commit 04dc34b26d0e3f418ed3fc69ea35ad538b83dd50.

* feat: generalize send_transaction interface

* fix: only set the nonce manually in the Signer middleware

* fix(transformer): fill the transaction after transformation

* chore: fix compilation errors & lints

* fix(signer): set the correct account's nonce

* feat: make trace_call / call take TypedTransaction

* fix: set sender to transaction in signer

* chore: ethgasstation broke

* chore: cargo fmt / lints

* Fix(signer): pass the chain id

* fix: final tx encoding fixes

1. Normalize v values for eip1559/2730
2. Make access lists mandatory for 1559
3. do not double-rlp on rlp_signed

* fix: set access list only if available

* test: check 1559 / 2930 txs

* fix: do not prepend a 0 for Legacy txs & test

* chore: code review comments

* chore: fix aws signer signature
2021-08-09 03:31:11 +03:00
Georgios Konstantopoulos 746d8b7bf2
chore(abigen): allow clippy enum variant names (#364) 2021-08-06 15:47:57 +03:00
Matthias Seitz b0b4f4e09e
feat: detect ethers crate paths in derive macros (#366)
* feat: determine ethers crate name using metadata

* use crate detection
2021-08-06 15:47:17 +03:00
Matthias Seitz 9d38d1a412
fix: convert tuple arguments to tuples (#363) 2021-08-02 18:24:22 +02:00
Georgios Konstantopoulos 9fc142ca61
feat: stream_with_meta (#354) 2021-07-30 14:01:38 +03:00
Georgios Konstantopoulos 9dca606eaf
fix: make chain_id mandatory (#286)
* chore: update deps (#352)

* chore(deps): bump elliptic-curve from 0.10.4 to 0.10.5

Bumps [elliptic-curve](https://github.com/RustCrypto/traits) from 0.10.4 to 0.10.5.
- [Release notes](https://github.com/RustCrypto/traits/releases)
- [Commits](https://github.com/RustCrypto/traits/compare/elliptic-curve-v0.10.4...elliptic-curve-v0.10.5)

---
updated-dependencies:
- dependency-name: elliptic-curve
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* chore: bump deps

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(core): make chain id mandatory

* fix(signers): make chain id mandatory

* test: make chain id mandatory

* test: add missing chain id

* fix: add missing chain id

* chore(wallet): set chain_id by default to 1

* ci: run CI on master

* fix(yubi): add missing chain id

* chore: skip ganache test with celo features

* ci: run only on push to master

* fix: add missing chain id

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-29 23:22:25 +03:00
dependabot[bot] faeec7d316
chore(deps): bump futures-util from 0.3.15 to 0.3.16 (#348)
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.15 to 0.3.16.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.15...0.3.16)

---
updated-dependencies:
- dependency-name: futures-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-26 11:23:34 +03:00
Matthias Seitz ed83223b93
cargo clippy --fix (#346) 2021-07-24 21:53:40 +03:00
Georgios Konstantopoulos 04bbd1b424
fix: make event types thread safe (#341) 2021-07-13 14:13:12 +03:00
Zaki Manian 371b7d1576
Update crypto deps for ethers (#333)
* Update crypto deps for ethers

* Update version 0.4.0

* Missed a version

* Fix internal version dependencies

* chore: use published eth-keystore-rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-07-07 20:18:14 +03:00
James Prestwich d722c1a6af
feature: PendingTransaction returns Option (#327)
* feature: PendingTransaction returns Option

* chore: expand safety reasoning in pending tx expect

* chore: clippy lints

* bug: check readiness of future before taking receipt option
2021-07-06 11:06:18 +03:00
dependabot[bot] 3234942d87
chore(deps): bump futures-util from 0.3.14 to 0.3.15 (#290)
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.14 to 0.3.15.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.14...0.3.15)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 14:20:58 +03:00
dependabot[bot] ffcef0afa8
chore(deps): bump thiserror from 1.0.24 to 1.0.26 (#328)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.24 to 1.0.26.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.24...1.0.26)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 14:14:51 +03:00
Georgios Konstantopoulos 0453ea84df
chore: fix lints (#329) 2021-07-05 14:03:38 +03:00
Oliver Nordbjerg 7b68c70cd9
Add xDai multicall contract address (#324) 2021-07-05 13:37:12 +03:00
dependabot[bot] ce20e312e3
chore(deps): bump once_cell from 1.7.2 to 1.8.0 (#317)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.7.2 to 1.8.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.7.2...v1.8.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-16 19:17:00 +03:00
Matthias Seitz b5a2ee9a3d
fix: event decoding for events with zero or one parameters (#300)
* fix: support events with zero or one paramaters

* test: test against events with zero and one parameter
2021-05-28 10:44:42 +03:00
Matthias Seitz ac6d4d70a6
fix: off by one error during event decoding (#296) 2021-05-24 11:52:21 +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
Georgios Konstantopoulos 33a39cff86
fix: remove dependency on curl (#285) 2021-05-01 21:26:37 +03:00
dependabot-preview[bot] 180679545e
chore(deps): bump pin-project from 1.0.6 to 1.0.7 (#279)
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.0.6...v1.0.7)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-27 22:35:50 +03:00
dependabot-preview[bot] 2b94066cd5
chore(deps): bump tokio from 1.4.0 to 1.5.0 (#275)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.4.0...tokio-1.5.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-16 10:09:43 +03:00
dependabot-preview[bot] 332fe4887b
chore(deps): bump futures-util from 0.3.13 to 0.3.14 (#268)
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.13 to 0.3.14.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.13...0.3.14)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-15 19:46:45 +03:00
Matthias Seitz 32b4e9e3f5
fix(abigen): add indexed attribute when deriving EthEvent (#255)
* fix(abigen): add indexed attribute when deriving EthEvent

* chore(clippy): make clippy happy
2021-04-02 08:46:39 +03:00
dependabot-preview[bot] f3cb4f4f88
chore(deps): bump tokio from 1.2.0 to 1.4.0 (#242)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.2.0 to 1.4.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.2.0...tokio-1.4.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-22 20:37:58 +02:00
Matthias Seitz 816c5fc071
feat(abigen): extend ethevent trait methods and decoding (#239)
* feat: extend EthEvent with decode_log method and support indexed proc
macro attributes

* test: check that ethevent proc macro attributes compile

* docs: document EthEvent proc macro attributes and add example

* refactor: change decode_log to take a reference

* refactor: use ethers as fully qualified path

* feat: add events enum generation

* feat: introduce EthLogDecode trait

* feat: generate EthLogDecode implementations

* refactor: use fully qualified syntax during abigen

* fix: switch to new Event builder

* fix: make test compile again

* test: update failing tests

* refactor: rename event function

* chore(clippy): make clippy happy

* fix: rename the event correctly

* fix: add missing indexed attribute

* Revert "fix: rename the event correctly"

This reverts commit 03eabc3ead.

* fix: make indexed names optional

* fix: dsproxy name

* fix: rename ethers top level module imports
2021-03-19 17:44:59 +02:00
Matthias Seitz c525c71d96
style: remove token instead cloning them (#236) 2021-03-18 07:31:49 +02: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
Matthias Seitz 57010c1c60
feat(abigen): include ethevent proc macro in abigen code gen workflow (#232)
* fix: make EthEvent name method a trait method

* refactor: make expand methods members of Context

* fix: make AbiParser parsing non consumeable

* feat: add struct expanding

* feat: use derive(EthEvent) in abigen workflow

* test: check EthEvent in abigen macro

* test: make test compile again

* refactor: simplify and optimize abi parsing from single str

* test: add human readable abigen tests
2021-03-16 21:37:19 +02:00
Matthias Seitz 0c18f9b32c
fix: make EthEvent abi attribute work for tuple inputs (#229)
* fix: try to parse the provided abi as tuple

* test: validate ethevent abi attribute

* docs: document ethevent abi attribute
2021-03-16 10:12:32 +02:00
Matthias Seitz 7b10b76e20
feat: add EthEvent proc macro derive support (#227)
* refactor: extract error module and use error macros

* feat: add solidity struct parser

* refactor: add AbiParse and support struct parsing

* test: add more struct parsing tests

* feat: add EthAbiType proc macro derive for deriving Tokenizable trait

* test: add EthAbiType derive tests

* refactor: extract tokenizeable implementation in separate method

* chore(test): use EthAbiType derive instead implementing Detokenizeable

* feat: introduce EthEvent trait

* feat: add EthEvent proc macro derive support

* test: add proc macro derive tests

* chore: rustfmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-03-15 13:59:52 +02:00
dependabot-preview[bot] 08cacfeee8
chore(deps): bump serde from 1.0.123 to 1.0.124 (#222)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.123 to 1.0.124.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.123...v1.0.124)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-08 09:48:24 +02:00
dependabot-preview[bot] b425e2bd9a
chore(deps): bump hex from 0.4.2 to 0.4.3 (#220)
Bumps [hex](https://github.com/KokaKiwi/rust-hex) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/KokaKiwi/rust-hex/releases)
- [Commits](https://github.com/KokaKiwi/rust-hex/compare/v0.4.2...v0.4.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-03-04 09:30:36 +02:00
Georgios Konstantopoulos 61767c8dd2
release: 0.2.2 (#219) 2021-03-04 09:30:27 +02:00
dependabot-preview[bot] 0c3bb7b9c1
chore(deps): bump once_cell from 1.7.0 to 1.7.2 (#218)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.7.0 to 1.7.2.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.7.0...v1.7.2)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-03 10:36:06 +02:00
dependabot-preview[bot] 5081ca2ad1
chore(deps): bump serde_json from 1.0.62 to 1.0.64 (#215)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.62 to 1.0.64.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.62...v1.0.64)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-03-02 14:53:33 +02:00
dependabot-preview[bot] ff07be3c77
chore(deps): bump futures-util from 0.3.12 to 0.3.13 (#207)
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.12 to 0.3.13.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.12...0.3.13)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-25 09:17:09 +02:00
dependabot-preview[bot] cf643e5ef1
chore(deps): bump once_cell from 1.6.0 to 1.7.0 (#212)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.6.0...v1.7.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-25 09:17:02 +02:00
dependabot-preview[bot] e88da4501c
chore(deps): bump once_cell from 1.5.2 to 1.6.0 (#206)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.5.2 to 1.6.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.5.2...v1.6.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-23 09:31:12 +02:00
James Prestwich 3e5f7a795f
feature: report path on failed abigen load (#205) 2021-02-22 20:35:40 +02:00
dependabot-preview[bot] eb318a2689
chore(deps): bump thiserror from 1.0.23 to 1.0.24 (#204)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.23 to 1.0.24.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.23...1.0.24)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-22 10:04:18 +02:00
lerencao 732ff29d14
make abigen reproducible (#200)
* use BTreeMap to make abigen bindings deterministic
2021-02-19 08:34:56 +02:00
Georgios Konstantopoulos a43299c838
fix(abigen): correctly parse params in human readable abi (#194)
* fix(abigen): correctly parse params in human readable abi

* chore: make clippy happy

* test: remove unwrap

* chore: make clippy happy again

* chore: fix contract.rs example

* chore: rename to contract using human readable format

* examples: add abigen example with path to abi

* fix: pin funty version to fix bitvec error

* chore: remove unused import

* chore: fix deps
2021-02-16 19:10:26 +02:00
dependabot-preview[bot] 6e5fd198cb
chore(deps): bump serde_json from 1.0.61 to 1.0.62 (#190)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.61 to 1.0.62.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.61...v1.0.62)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-10 11:55:48 +02:00
dependabot-preview[bot] 5109ff654e
chore(deps): bump pin-project from 1.0.4 to 1.0.5 (#187)
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.0.4 to 1.0.5.
- [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.4...v1.0.5)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-08 11:56:43 +02:00
dependabot-preview[bot] 625cbbcf81
chore(deps): bump tokio from 1.1.1 to 1.2.0 (#189)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.1.1...tokio-1.2.0)

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-02-08 11:56:27 +02:00
dependabot-preview[bot] b69f68f089
chore(deps): bump serde from 1.0.120 to 1.0.123 (#181)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.120 to 1.0.123.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.120...v1.0.123)

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-26 17:41:58 +02:00
dependabot-preview[bot] 09094360d2
chore(deps): bump tokio from 1.0.2 to 1.1.0 (#179)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.0.2...tokio-1.1.0)

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-26 17:41:53 +02:00
dependabot-preview[bot] 11e3284f22
chore(deps): bump serde from 1.0.119 to 1.0.120 (#176)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.119 to 1.0.120.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.119...v1.0.120)

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-23 12:31:24 +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
dependabot-preview[bot] 2769c97018
chore(deps): bump futures-util from 0.3.11 to 0.3.12 (#171)
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.11 to 0.3.12.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.11...0.3.12)

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-18 07:38:07 +02:00
dependabot-preview[bot] 810bb142f3
chore(deps): bump futures-util from 0.3.9 to 0.3.11 (#159)
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.9 to 0.3.11.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.9...0.3.11)

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-16 10:59:59 +02:00
Georgios Konstantopoulos fc4b3e4ce4
release: bump to 0.2.0 (#151) 2021-01-13 20:10:50 +02:00
dependabot-preview[bot] 177f0c3eb9
chore(deps): bump serde from 1.0.118 to 1.0.119 (#146)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.118 to 1.0.119.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.118...v1.0.119)

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-12 10:02:30 +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
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 5f292670fc
docs: add more docs (#130) 2020-12-31 21:08:12 +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 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 3a2fd3e814
Returning a `PendingTransaction` after sending a tx (#107)
* feat(providers): return a PendingTransaction from send_tx calls

* feat(providers): expose the internal provider to all middlewares

* fix(middleware): use the returned PendingTx instead of using a hash

* fix(contract): use the pending tx returned value

Note1: To support that, we need to clone the tx when sending in order to make lifetimes work out
Note2: Multicall does not support that feature

* fix(ethers): adjust examples

* chore: fix provider test

* chore: fix celo test

BREAKING CHANGE
2020-12-17 13:26:01 +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 eb26915081
feat: allow encoding/decoding function data (#90)
* feat: allow encoding/decoding function data

* feat: allow decoding event data

* feat: human readable abi

inspired from https://blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917

* test: add event / fn decoding tests

* chore: fix clippy

* feat(abigen): allow providing args in human readable format
2020-10-29 09:48:24 +02:00
Pawan Dhananjay 35e24ed412
refactor: extract minimal features of Contract into BaseContract (#88)
* refactor: extract minimal features of Contract into BaseContract

* refactor: move BaseContract to own file

* chore: ensure celo test passes

* chore: fix clippy

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2020-10-27 12:57:01 +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 bf1d1e098f
fix: replace FilterStream with concrete type (#69)
* fix: replace FilterStream with concrete type

* fix: use PinBoxFut type alias

* ci: fix CI error with ledger
2020-09-23 11:04:54 +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 a3fa77744e
fix(BREAKING): return Option for txs/receipts/blocks (#64)
* fix(BREAKING): return Option for txs/receipts/blocks

Otherwise if a user asks for a transaction hash or block that does not exist yet they'll get an Error

* test: ensure that unmined txs return None receipts

* test: fix remaining tests

* chore: re-enable sparkpool gas oracle

* chore: fix celo tests

* fix: run the non-existing data against infura

* fix: fix etherscan gas oracle tests
2020-09-17 14:06:56 +03:00
Georgios Konstantopoulos cff6eb45a5
fix: make multicall work by reference (#58)
* fix: make multicall work by reference

* chore: update readme with solc / ganache requirements

* chore: cargo fmt

* chore: fix doctests

* fix: disable sparkpool gasnow test
2020-08-21 15:54:23 +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
Rohit Narurkar 516b431a48
add support for gas estimate and calldata from ContractCall (#53)
* add support for gas estimate and calldata from ContractCall

* fix celo tests for get_block and get_tx
2020-08-12 11:35:33 +03:00
Rohit Narurkar a9bb98b5a7
Implement Multicall functionality for batched calls (#43)
* Implement Multicall functionality for batched calls

* Documentation, some modifications as suggested in the review

* (Abigen) handle single input arg and set output irrespective of mutability

* implement send functionality and allow clearing calls

* Fix detokenization, dont require pre-processing anymore

* panic when more than supported number of calls are pushed

* add doc for panics in case of add_call

* (multicall) eth_balance support, update bindings

* refactor: move multicall to its own directory

* fix: add infura api key

* ci: ensure CI runs on PRs from forks

* test(multicall): re-use aggregate call

* contract: make multicall docs compile and remove redundant clones

* ci: add public etherscan API key so that forks don't get rate limited

* chore: adjust test contract naming

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2020-07-03 19:52:09 +03:00
Georgios Konstantopoulos 41998d6d2d
fix(tokens): make token decoding abiencoderv2 friendly 2020-07-03 18:51:19 +03:00
Georgios Konstantopoulos 3d2d40699f
Fix buggy non-nested tuples (#48)
* test(tokens): ensure nested tuples tokenize properly

* test(contract): add failing test with 2 args

This happens because the args are serialized as Token::Tuple, while instead they should be just a vector

* fix(tokens): add token flattening method to fix non-nested tuples

* fix: do not export the flatten function
2020-07-03 17:37:38 +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 1cfbc7b3c3
Replace contract client references with Arc (#35)
* feat(provider): allow specifying a default polling interval param

This parameter is going to be used for all subsequent client calls by default. It can still be overriden with the internal
`interval` calls

* feat(contract): replace reference to Client with Arc

* feat(abigen): adjusts codegen to use Arcs

* fix(ethers): adjust examples to new apis

* fix(provider): return TxHash instead of PendingTransaction on tx submission

Returning a PendingTransaction allowed us to have nice ethers.js-like syntax where you submit
a transaction and then can immediately await it. Unfortunately, now that we use Arcs and not lifetimes
this meant that we would need to bind the function call in a variable, and then await on it, which is pretty
bad UX.

To fix this, we revert back to returning a TxHash and introduce a convenience method on the provider and the
contract which takes a tx_hash and returns a PendingTransaction object. The syntax ends up being slightly
more verbose (although more explicit), but the issue is fixed.
2020-06-22 11:44:08 +03:00
Georgios Konstantopoulos 7a17e54fbd
feat(contract): add helper to query events w/ metadata (block num + tx hash) (#33)
* feat(contract): add helper to query events w/ metadata (block num + tx hash)
2020-06-22 01:08:40 +03:00
Georgios Konstantopoulos 833ca33f60
feat(signers): make Signer on Client optional (#34)
This allows using Contract either in read-only mode (e.g. for fetching data/events)
or for using the accounts on the node as senders
2020-06-21 21:19:59 +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 7ff8b8222c
Dual license under MIT/Apache 2 (#28)
* fix: dual license MIT / Apache 2

* provider: add missing license
2020-06-18 08:20:20 +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