Commit Graph

373 Commits

Author SHA1 Message Date
dependabot[bot] 404e9c2416
chore(deps): bump futures-util from 0.3.16 to 0.3.17 (#423)
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.16 to 0.3.17.
- [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.16...0.3.17)

---
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-08-31 08:48:24 +03:00
Georgios Konstantopoulos b5909d05b0
ci: run examples in CI (#421)
* ci: run examples in CI

* fix(ens): set the resolved ens addr for gas estimation

* fix(contract-examples): use legacy sends with ganache

* fix(ens-example): ensure test runs when forking from mainnet

* fix(watch-blocks-example): run our own provider with preset blocktime
2021-08-30 14:00:30 +03:00
Matthias Seitz 824bedbd42
feat: add quorum provider (#409)
* feat: add quorum provider

* feat: add quorum provider example

* fix: make compile with wasm32

* feat: normalize requests with block height

* fix: lowercase eth_call

* chore: fix doctest

* chore: remove Sync/Send requirement

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-08-29 14:03:53 +03:00
Georgios Konstantopoulos 9df4d21d3b
(cargo-release) version 0.5.1 (#414) 2021-08-29 02:53:10 +03:00
Georgios Konstantopoulos 38c7f5030f
chore: remove cyclical dependencies (#410)
* chore(core): remove ethers dep

* chore(providers): remove ethers dep

tests using higher-rank crates are temporarily disabled

* chore(middleware): remove ethers dep and move tests over from providers

* chore(signers): remove ethers dep

* fix(contracts): correctly determine ethers sub-crates & remove ethers

* fix: re-enable tests for all members

* fix: make contract compile without middleware dep

move over the test using middleware to ethers-middleware

* chore: cargo fmt

* chore(contract): add missing import

* WIP

* WIP

* fix(middleware): use rustls as dev dep

* chore: cargo fmt

* fix: use different key for nonce manager to avoid nonce conflicts

* chore: fix celo test ported over to middlewares

the test had the same private key with an existing middleware test,
causing potential nonce reuses

it now also uses a different storage contract, so we had to change
it to use u256 instead of string

* fix(middleware): enable contracts/celo feature

* chore: ignore non-eip2718 txs to rinkeby
2021-08-29 00:06:29 +03:00
Georgios Konstantopoulos 6cc20688d0
fix(abigen): generate correct imports depending on ethers crate usage (#413) 2021-08-28 21:53:01 +03:00
Georgios Konstantopoulos 526617fcbd
fix: make packages default members so they get executed on unit tests (#411) 2021-08-28 03:54:46 +03:00
Oliver Nordbjerg 72c77dd0cb
Fix RLP encoding of gas price (#408) 2021-08-27 11:09:34 +03:00
dependabot[bot] 38175c4b1a
chore(deps): bump bytes from 1.0.1 to 1.1.0 (#407)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.0.1...v1.1.0)

---
updated-dependencies:
- dependency-name: bytes
  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-08-26 11:29:52 +03:00
dependabot[bot] 8ba1885f0b
chore(deps): bump elliptic-curve from 0.10.5 to 0.10.6 (#406)
Bumps [elliptic-curve](https://github.com/RustCrypto/traits) from 0.10.5 to 0.10.6.
- [Release notes](https://github.com/RustCrypto/traits/releases)
- [Commits](https://github.com/RustCrypto/traits/compare/elliptic-curve-v0.10.5...elliptic-curve/v0.10.6)

---
updated-dependencies:
- dependency-name: elliptic-curve
  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-08-24 10:23:41 +03:00
dependabot[bot] 93916450c6
chore(deps): bump coins-ledger from 0.3.0 to 0.4.0 (#405)
Bumps [coins-ledger](https://github.com/summa-tx/bitcoins-rs) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/summa-tx/bitcoins-rs/releases)
- [Changelog](https://github.com/summa-tx/bitcoins-rs/blob/main/release.toml)
- [Commits](https://github.com/summa-tx/bitcoins-rs/compare/v0.3.0...coins-ledger-v0.4.0)

---
updated-dependencies:
- dependency-name: coins-ledger
  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-08-24 10:23:33 +03:00
Matthias Seitz d35444cc49
feat: add wasm http provider support (#403)
* fix: use on wasm only

* feat: enable http provider in wasm

* add http example

* chore: add more verbosity to example

* fix: double webpack issue

* use mnemonic builder
2021-08-24 01:28:05 +03:00
Matthias Seitz e6cd74cf1f
fix: add send + unpin to stream type (#402) 2021-08-23 17:55:36 +03:00
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
Matthias Seitz 8587b3e9b3
feat: add basic policy middleware (#400)
* feat: initial policy design

* docs: add some docs
2021-08-23 11:30:26 +03:00
Matthias Seitz bfbbee50cf
fix: drop WS server if work complete (#399)
* fix: drop WS server if work complete

* fix: remove closed subscriptions

* fix: handle error correctly

* style: better notification handling
2021-08-22 18:47: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
Georgios Konstantopoulos 6a0b74ec17
chore: disable all ethers features by default and expose them individually (#394) 2021-08-20 20:48:11 +03:00
James Prestwich e790429355
Refactor WS handling code (#397)
* refactor: simplify handle_text message

* refactor: rename 'TransportMessage' to 'Instruction'

* nit: update docstring on tick method

* refactor: rename dispatch to service

* nit: rename WsServer.requests to WsServer.instructions for consistency

* refactor: simplify handle_text, remove unwrap

* nit: fix misspelled comment
2021-08-20 20:23:39 +03:00
James Prestwich 0eee674ba0
feature: drop WS server on when WS connection closes (#396)
* feature: drop WS server on when WS connection closes

* feature: ready function on WS

* feature: ws now handles all message types

* bug: SubscriptionStream ends if its sender drops
2021-08-20 19:58:13 +03:00
Rohit Narurkar ab0e3ca0d6
fix: backwards compatibility for eth_feeHistory (#395)
* fix: backwards compatibility for eth_feeHistor

* fix: convenience for calling the fee_history method
2021-08-19 19:44:15 +03:00
Alex Lee f6412f87d7
add uncle related missing api (#385)
Co-authored-by: Alex <flashlee2@qq.com>
2021-08-19 17:04:11 +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
Georgios Konstantopoulos 635236f061
feat: improve gas oracles (#392)
* fix: re-enable ethgasstation tests and add new fields on response

* fix: re-enable etherchain tests and add new fields on response

* feat: add new etherscan response fields

* feat: use gasnow v3

* chore: derive more traits for response types
2021-08-19 11:38:12 +03:00
dependabot[bot] 5fdeba9c0d
chore(deps): bump tracing-subscriber from 0.2.19 to 0.2.20 (#389)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.19 to 0.2.20.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.19...tracing-subscriber-0.2.20)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  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-08-19 11:31:58 +03:00
Georgios Konstantopoulos c2c6c94524
chore: add explanation on `legacy` flag 2021-08-19 10:08:59 +03:00
James Prestwich 42aeeedcce
bug: log streams properly end when internal stream closes (#387) 2021-08-19 10:01:49 +03:00
Marc Enriquez 621882053c
sign_transaction_sync (#388) 2021-08-18 16:02:57 +03:00
Georgios Konstantopoulos 7d9dfcb53c
fix: skip 2930 tests in legacy mode / skip aws test if no id (#386)
* fix: skip 2930 tests in legacy mode

* test: skip aws signer test if no key id is set
2021-08-17 15:42:08 +03:00
James Prestwich f78edfeabb
feature: add legacy feature to ethers crate (#384) 2021-08-17 09:48:02 +03:00
James Prestwich e98288d0d5
bugfix: disable type serialization when legacy feature is set (#383) 2021-08-17 00:12:30 +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
Oliver Nordbjerg b38685c574
Add Flashbots middleware to projects section (#381) 2021-08-16 10:29:22 +03:00
Georgios Konstantopoulos 453504cb78 chore: remove default feature on futures-util from all crates 2021-08-15 20:25:11 +03:00
Rohit Narurkar 3c89c732b7
fix: signature fields should be U256 instead of H256 (#379)
* fix: signature fields should be U256 instead of H256

* fix: relevant changes for aws and ledger signer
2021-08-15 14:30:44 +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
Georgios Konstantopoulos 99e9a687ca
fix: make gasPrice optional (since Type 2 transactions) (#374)
* fix: make gasPrice optional (since Type 2 transactions)

* chore: use new pkey for testnet txs to avoid nonce conflicts
2021-08-12 19:01:52 +03:00
georgewhewell 4cae82849f
add impl_fixed_types!(18) (fixes opensea abigen) (#373) 2021-08-12 17:43:55 +03:00
Georgios Konstantopoulos 4d4436a894 fix(core): use async-await-macro to fix docs.rs publishing 2021-08-12 17:08:51 +03:00
Matthias Seitz 109a6b85ee
fix: only wrap single struct param in a tuple (#368) 2021-08-11 03:21:30 +03:00
dependabot[bot] d911e38c1f
chore(deps): bump coins-ledger from 0.1.0 to 0.3.0 (#334)
Bumps [coins-ledger](https://github.com/summa-tx/bitcoins-rs) from 0.1.0 to 0.3.0.
- [Release notes](https://github.com/summa-tx/bitcoins-rs/releases)
- [Changelog](https://github.com/summa-tx/bitcoins-rs/blob/main/release.toml)
- [Commits](https://github.com/summa-tx/bitcoins-rs/commits/v0.3.0)

---
updated-dependencies:
- dependency-name: coins-ledger
  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-08-09 04:07:49 +03:00
Georgios Konstantopoulos 1d79ec1360 chore: skip tx rlp test in celo 2021-08-09 04:01:17 +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 ccff9fc98f
feat: 1559/2930 txs (part 2) (#355)
* feat: add eip2930 tx type

* feat: add typed transaction enum

* chore: rlp_opt take reference to option

* feat: add eip-1559 tx type

* feat: add eip-1559 to the typed tx enum

* fix: references to rlp_opt / add access list setter

* chore: ignore etherchain and ethgasstation

Their APIs had a breaking change

* fix(1559/2930): serialize properly

1. The AccessList struct should have used RlpEncodableWrapper, otherwise we get extra bytes
2. The 1559/2930 types do not use eip-155-style replay protection

* feat: add helpers for operating on the txs enum

* chore: cargo fmt / lints
2021-08-09 01:59:07 +03:00
Georgios Konstantopoulos 09ff480f19
feat: eip2930/1559 response type adjustments (part 1) (#353)
* refactor: move tx types to subdirectory

* feat(receipt): add tx-type and effective gas price for eip1559

* feat: add base_fee_per_gas to Block

* feat(tx): add eip1559/2930/2718 ret values

* fix(middleware): return signed raw rlp from tx signer / adjust tests

* chore: remove unused vars

* chore(core): remove funty lock from Cargo.toml

* chore: rename json var / cargo fmt

* add more context on eip1559 fees
2021-08-09 01:49:23 +03:00
Eric Zhang f165c13009
feat: add support for `eth_getBlockReceipts` (#365)
* feat: add support for `eth_getBlockReceipts`

* Add comment to the `get_block_receipts` function

* Add `client_version()` function

* Refactor `Provider` into a proper struct
2021-08-09 00:10:40 +03:00
Georgios Konstantopoulos 746d8b7bf2
chore(abigen): allow clippy enum variant names (#364) 2021-08-06 15:47:57 +03:00