Commit Graph

233 Commits

Author SHA1 Message Date
Matthias Seitz d509f7a7c6
fix(providers): handle zst params in retry provider correctly (#1481) 2022-07-14 10:56:35 -07:00
jole cfc5a004e6
fix unused warning (#1477)
* fix unused warning

* fmt
2022-07-13 17:46:47 -07:00
Matthias Seitz de1020c91e
chore: export quorum's JsonRpcClientWrapper (#1439) 2022-06-30 10:04:43 -07:00
Matthias Seitz 73d3d3f494
perf(providers): replace wake_by_ref with loop (#1428) 2022-06-29 15:26:37 -07:00
Matthias Seitz 7603731d87
feat(retry): more sensible backoff calc (#1413) 2022-06-23 19:18:33 -04:00
Matthias Seitz 7472e02577
perf: only fallback to old feeHistory request on error (#1399) 2022-06-22 13:11:45 -04:00
Matthias Seitz 40c304d939
chore: silence wasm warnings (#1404) 2022-06-22 13:09:25 -04:00
Matthias Seitz beffd96cc4
chore(providers): add traces to retry provider (#1382) 2022-06-15 11:47:01 -07:00
Matthias Seitz 05864ff9ed
fix: net_version returns string (#1376)
* fix: net_version returns string

* chore: update CHANGELOG
2022-06-14 13:00:46 -07:00
Resende c76f325b14
feat(provider): add option to create ws provider with auth (#1363)
Currently `Provider::<Ws>` only exposes `connect` from `Ws` module.
This pull request exposes the `connect_with_auth` function added on 829.
2022-06-09 00:45:33 -07:00
joshieDo ea1a87271c
feat(solc): add script/ to project paths (#1359)
* add script to ProjectPaths

* change default ProjectPaths scripts/ tests/ to script/ test/

* fmt

* chore: ignore ens avatar tests

we know we can decode them properly by this point, they are flaky
because people change their info

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-06-08 05:13:03 -07:00
Meet Mangukiya 6bddd53010
test: update test with changed state on forked tests (#1353) 2022-06-07 08:45:13 -07:00
Matthias Seitz 0197fe3fc4
test: set nonce for tx stream explicitly (#1354) 2022-06-07 08:44:02 -07:00
Gio a532eb4d29
Add call builder and eth_call state overrides (#1340)
* Add call builder and eth_call state overrides

* Fix <Caller as Future>::poll impl

* Move call overrides to ethers_provider::call_raw

* Add example for call_raw overrides

* Add support for contract call overrides

* Documentation and convenience impls for call_raw types

* Test for eth_call state overrides

* ci: install geth

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-06-04 14:18:25 -07:00
Matthias Seitz 89bc6420bb
test: replace ganache with anvil (#1286)
* ci: install anvil

* test: use anvil instead of ganache

* ci: fix anvil ver

* ci: re-enable example tests

* test: remove unnecessary assertions

* test: enable anvil launch test

* docs: typo

* test: fix anvil chain id

* ci: install ganache

Ganache is needed for the Ganache tests

* chore: remove legacy feature from some examples

* ci: correctly build examples

* test: use correct account balance for anvil

* chore: remove sub_id == 1 check

this was only possible in ganache because it gives serial
sub ids, but in every other reasonable client the ids are generated
randomly, so we cannot test for its value

* test: ensure txs are different

There is a bug in Ganache's mempool which accepts duplicate transactions (here with the same nonce), whereas here we pre-set all the nonces so that they end up having a different transaction hash.

* test: ignore ganache tests

* fix: terzor api changes

* ci(examples): install Anvil, remove geth/ganache

* test(provider): Anvil instead of Geth

some tests start to fail now

* fix: revert usage of Anvil in ipc tests

Anvil does not support IPC yet

* fix: update examples script

* ci: use anvil for wasm example

* replace last ganache usage

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-06-01 08:22:39 -07:00
Meet Mangukiya e0db2f0606
`get_paginated_logs` fixes and refactoring (#1328)
* fix(providers): do not load boundry blocks on every page

* refactor(providers): make get_paginated_logs TryStream
2022-05-31 09:43:03 -07:00
Meet Mangukiya e3ab2feada
feat(providers): add `RetryClient` (#1302)
* feat(providers): add RateAwareClient

* feat(providers): add RetryClient

* remove RateAwareClient

* feat(providers): add RetryPolicy, Backoff traits and some implementations

* remove backoff abstractions

* fix doc tests

* add helper methods for RetryClient Provider

* remove backoff wasm dependency

* remove conflicitng impl for TryFrom<&str>, etc.

* update docs and remove backoff crate dependency

* fix tests

* fix backoff formula

* use value, string is not leading to corerct serialization

* catch 429 error thrown as JsonRpcError

* fix requests_enqueued, make backoff and max retries configurable

* fix doc tests

* fix tests

* use match statement

* revert incorrect change

* ms precision backoffs, remove reduntant continue
2022-05-27 14:02:16 -07:00
Meet Mangukiya 266b1f4777
chore: fix wasm warnings (#1312) 2022-05-27 10:10:51 -04:00
Meet Mangukiya a150666d54
feat: add paginated logs (#1285)
* feat: add paginated logs

* docs: add paginated_logs example

* remove unpin
2022-05-23 14:23:35 -07:00
Georgios Konstantopoulos f237f85959 chore: log error on ws unexpected close 2022-05-23 11:58:49 -07:00
Bryan Stitt 9ed9395c2c
return instead of ignore error (#1287)
* return error instead of swallow error

* changelog

Co-authored-by: Bryan Stitt <bryan@satoshiandkin.com>
2022-05-23 11:58:41 -07:00
Matthias Seitz cffcc7bbec
chore(clippy): fix newest nightly lints (#1298) 2022-05-22 15:18:57 -07:00
Georgios Konstantopoulos 4c75e4ae19 test: expose test provider url 2022-05-18 13:41:11 -07:00
Matthias Seitz 7509e42d3b
fix: serialize eth_getStorageAt position param as quantity (#1281)
* fix: serialize eth_getStorageAt position param as quantity

* test: add quantity test
2022-05-18 07:49:32 -07:00
Meet Mangukiya b15d0f8643
feat(providers): load previous logs before subscribing (#1264)
* feat(providers): load previous logs before subscribing

Load previous logs and stream it back to the user before establishing
a new stream for streaming future logs.

Closes #988

* docs: add subscribe_logs example

* fix clippy errors

* refactor: use VecDeque and address review
2022-05-16 08:11:25 -07:00
oliver-giersch 3df1527cef
fix: all request ids start at 1 (#1265)
Co-authored-by: Oliver Giersch <oliver.giersch@gmail.com>
2022-05-14 16:31:40 -07:00
Matthias Seitz ce3ebaefa0
chore(clippy): make clippy happy (#1230) 2022-05-06 08:15:49 -07:00
James Prestwich c70cd81de0
feature: pending transaction retries repeatedly before assuming dropped (#1221) 2022-05-05 07:22:47 -07:00
oliver-giersch a115e957db
refactors ipc transport internals (#1174)
* refactors ipc transport internals

ran cargo +nightly fmt

fixes typo

remove some commented out code

* remove one unnecessary return stmt

Co-authored-by: Oliver Giersch <oliver.giersch@b-tu.de>
Co-authored-by: Oliver Giersch <oliver.giersch@gmail.com>
2022-04-24 16:09:56 +02:00
Matthias Seitz 35c29c82c6
chore: silence unused warnings (#1162) 2022-04-21 19:30:02 +02:00
Matthias Seitz 02ad93a1cf
feat(provider): add RwClient (#1016)
* feat(provider): add RwClient

* docs: fix failing doc test
2022-04-13 13:21:52 -07:00
oliver-giersch db1870c891
Fix IPC handling of jsonrpc errors (#1123)
* fixes ipc jsonrpc error handling, use json RawValue where sensible

* ran cargo +nightly fmt

Co-authored-by: Oliver Giersch <oliver.giersch@b-tu.de>
2022-04-08 19:11:53 -07:00
Matthias Seitz df855b045e
feat: add TryFrom String reference for http provider (#1084) 2022-03-27 14:37:15 -07:00
Matthias Seitz 916e9a7334
chore(clippy): add some deny lints (#1064)
* feat: add deny lints

* trim ethers core

* trim ethers eip712

* deny ethers contract derive

* deny ethers contract abigen

* deny ethers contract

* deny ethers providers

* chore: add denies and fix unused deps

* doc: fix links

* fix: wasm build

* doc: fix links

* doc: fix links

* doc: fix inline doc links

* docs: fix intra doc links
2022-03-19 10:05:39 -07:00
Meet Mangukiya cde52c7c20
fix(core/TypedTransaction): eip1559 gas price should be max_fee_per_gas (#1062)
* fix(core/TypedTransaction): eip1559 gas price should be max_fee_per_gas

* fix tests

* tests(nonce_manager): reduce flakiness
2022-03-19 09:41:03 -07:00
Georgios Konstantopoulos beffe32f15 fix: feature-gate TestProvider.ws fn 2022-03-13 11:29:11 -07:00
Georgios Konstantopoulos 4f37287859 feat: rotate infura keys for ws 2022-03-13 10:11:27 -07:00
Georgios Konstantopoulos ae125bcfc7
feat: rotating infura keys (#1017)
* feat: add providers which rotate api keys

* test: use rotating key in provider instead of hardcoded

* chore: fmt
2022-03-13 09:04:09 -07:00
oblique 367f3444ec
fix: Export `ethers_providers::IpcError` and `ethers_providers::QuorumError` (#1012) 2022-03-13 13:58:29 +02:00
th4s b05136e173
Fix websocket connection request (#1005)
In tungstenite 0.17 a change was introduced considering the logic of
`IntoClientRequest`. When using this trait on a `HttpRequest` it just
uses the request without any changes to inititate the websocket
connection.

This makes it necessary for the consumer of the api to supply the
correct http headers for initiating a websocket connection when using
`IntoClientRequest` on `HttpRequest`.

This commit adapts the logic in `connect_with_auth` to this new
behavior.
2022-03-10 13:36:42 -08:00
Simon Bihel 1641be7395
Enforce commutativity of reverse resolution (#996)
As specified in https://docs.ens.domains/dapp-developer-guide/resolving-names#reverse-resolution
2022-03-08 06:45:45 -08:00
wolflo a1accbf6ac
fix(providers): Propogate gas limit with access list (#901)
* fix(providers): Propogate gas price with access list

* Update CHANGELOG.md

* Fix clippy lint

* Clarify fill_transaction comments

* Fill tx gas price before gas limit

Updates Provider::fill_transaction() to fill the gas price of a
transaction before filling the gas limit. There are cases where the gas
used by a transaction may be dependent on the gas price. For example,
the following contract bytecode branches based on the result of the GASPRICE
opcode:
GASPRICE PUSH1 0xff GT PUSH1 {label} JUMPI

* Cleanup

* Propogate eth_estimateGas failure
2022-03-01 14:13:06 +02:00
dependabot[bot] a6999f377e
chore(deps): bump tokio-tungstenite from 0.16.1 to 0.17.1 (#945)
* chore(deps): bump tokio-tungstenite from 0.16.1 to 0.17.1

Bumps [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) from 0.16.1 to 0.17.1.
- [Release notes](https://github.com/snapview/tokio-tungstenite/releases)
- [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md)
- [Commits](https://github.com/snapview/tokio-tungstenite/compare/v0.16.1...v0.17.1)

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

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

* fix: no-op raw websocket frames

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-02-28 10:40:42 +02:00
Meet Mangukiya 133c32d64a
feat(ethers-providers): expose pending tx_hash with a getter (#968) 2022-02-26 16:36:29 +02:00
joshieDo 7afde0ca0a
handle case where the data from the resolver is empty (#963)
* handle case where the data from the resolver is empty

* is_empty instead of 0 comparison
2022-02-24 18:42:32 +02:00
Nicolas Trippar f9f466ef07
change visibility of the function request in Provider<JsonRpcClient> to public so one can implement Middleware's with custom call to the node (#919) 2022-02-17 14:30:03 +02:00
Simon Bihel cd8a9b5a97
Add ENS avatar and TXT records resolution (#889)
* Add ENS avatar resolution

As well as arbitrary fields.

* Use try_join

* Improve reqwest's error passing

* Split avatar resolution in ERC token parsing and resolution

* no_run examples

* Rename token to NFT

* A bit more documentation

* Nightly cargo fmt

* Use different ERC-721 test

* Update CHANGELOG

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-02-16 16:25:41 +02:00
wolflo 14551a90c1
fix(providers): PendingTransaction::log() missing deref (#886) 2022-02-09 08:48:03 +02:00
wolflo b657e47e6b
feat(providers): Log methods for PendingTransaction (#884)
* feat(providers): Log method for PendingTransaction

* feat(poviders): Add PendingTransaction inspect() method

* Apply suggestions from code review

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-02-09 00:55:35 +02:00
wolflo 885aa9c967
fix(providers): doc test for dev_rpc (#857) 2022-02-02 19:20:01 +02:00
rakita 24e7c471e4
add eth_syncing RPC (#848)
* add eth_syncing RPC

* Changelo updated

* small comments

* Intermediate SyncingStatus
2022-02-01 12:58:45 +02:00
Dan Cline 01544ec4b7
Implement RLP decoding for transactions (#805)
* Implement RLP decoding for transactions

* set chain_id in fill_transaction
2022-01-30 21:21:16 +02:00
th4s a97526d6fe
Add authorization for http and websocket (#829)
* Added  basic and bearer authentication for http and websocket transport

* Improved api for websocket `connect_with_auth`

* Bugfix in doc

* Moved use statement into non-wasm imports

* Adapted changelog

* Fixed doc test

* Added constructors for Authorization

* Improved code quality and implemented feedback

* Made bas64 crate for basic auth encoding non-optional

* Added `Display` for `Authorization` instead of `into_auth_string`
2022-01-27 12:04:53 +02:00
Erwan f9f77e829b
fix(ws): propagate deserialization errors upstream + infura quickfix (#827)
* fix(ws): propagate error when deserialization fails

* fix(ws): tolerate case-insensitive match on the jsonrpc field

Infura streams notifications with jsonrpc all capitalized. This fails to
deserialize on our end because serde expect a precise match ressembling
the Notification jsonrpc field.

Fixes #684.

* chore(fmt): use nightly rustfmt

* chore: fmt

* chore: fix failing celo test

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-01-24 15:38:00 +02:00
Matthias Seitz d2318d285d
chore(deps): bump solang (#796)
* chore(deps): bump solang

* fix: breaking test
2022-01-15 17:53:46 +02:00
Eugene cbfbd6052c
Implement trace_callMany (#792)
* Implement trace_callMany

* cargo fix and ignore flaky test for now

* Update ethers-providers/src/provider.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-01-15 12:41:43 +02:00
Matthias Seitz d2b59d7097
chore: silence unused ws macro (#788) 2022-01-13 02:59:02 +02:00
georgewhewell bb0cd7acdd
mark TransactionFut as Send (#723)
* mark TransactionFut as Send

* no send when wasm32
2021-12-23 16:29:51 +02:00
Matthias Seitz e24117a1e1
chore(clippy): make clippy happy (#705) 2021-12-19 06:28:38 +02:00
James Prestwich 060dd6033d
refactor: move fill_transaction impl to provider rather than default (#697)
* refactor: move fill_transaction impl to provider rather than default

* chore: changelog and docstring for fill_transaction
2021-12-16 01:09:09 +02:00
James Prestwich 3338cdead1
feature: set nonce in fill transaction (#687)
* feature: set nonce in fill transaction

* chore: update changelog

* refactor: remove nonce_setting in fill_transaction

* refactor: set nonce in send_escalating
2021-12-14 00:50:13 +02:00
James Prestwich 47e9e7d3c7
refactor: move FeeHistory to core types (#688) 2021-12-14 00:49:49 +02:00
Matthias Seitz f4c89c6cb1
ci: test on windows targets (#682)
* ci: test on windows targets

* make ipc optional

* fix: only activate ipc on unix families

* add cfg

* only check default members

* no parallel limits

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-12-13 23:25:10 +02:00
Nicholas Rodrigues Lordello 79f2e1d5ef
Serialize block count as quantity 2 (#669)
* Serialize eth_feeHistory block count as QUANTITY

* update changelog

* Make sure to first convert to U256 :face_palm:

* Fix issue with move of `block_count` value.

* fix merge issue

* Revert changelog
2021-12-10 09:16:20 -07:00
Nicholas Rodrigues Lordello 7bd42be0d8
Serialize `eth_feeHistory` block count as `QUANTITY` (#668)
* Serialize eth_feeHistory block count as QUANTITY

* update changelog
2021-12-10 08:49:27 -07:00
Daniil Naumetc fffb965f2f
fix: nonce too low for different providers (#655) 2021-12-07 01:15:51 +02:00
guanqun 8d07610e4a
fix(provider::ws): ignore the websocket response when the request has been cancelled. (#641) 2021-12-03 20:14:13 +02:00
Daniil Naumetc 9fc75ef245
Fix handling of `nonce too low` error (#643)
* fix: nonce too low from error as debug

* chore: cargo fmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-12-03 20:08:53 +02:00
wolflo bccc7b9b5e
Add dev-rpc middleware (#640)
* Add dev-rpc middleware

* Dont run dev-rpc tests with celo

* providers: clean up match statement

* providers: fix clippy lint

* doc(providers) doctest and changelog for DevRpcMiddleware
2021-12-03 19:11:09 +02:00
Georgios Konstantopoulos bb3a2fd27c
release: 0.6.0 (#611)
* release(core): 0.6.0

* release(providers): 0.6.0

* release(contract-abigen): 0.6.0

* release(contract-derive): 0.6.0

* release(derive-eip712): 0.2.0

* release(ethers-solc): 0.1.0

* release(contract): 0.6.0

* release(etherscan): 0.2.0

* release(signers): 0.6.0

* release(middleware): 0.6.0

* chore: update dev deps

* refactor(core): move docs to readme

* refactor(contract): move docs to readme

* refactor(providers): move docs to readme

* chore: bump ethers cargo toml

* refactor(signers): move docs to readme

* refactor(middleware): move docs to readme

* fix(ethers): adjust re-exports to allow searching internal packages

* docs: fix broken links

we cannot use relative crate imports because the readmes
are also imported by the parent crate

* alias readmes to be accessible to ethers crate
2021-11-23 21:23:12 +02:00
univerz ec00325aa2
revert: unify get_block_receipts for eth/parity RPCs (#601) 2021-11-21 18:14:35 +02:00
Georgios Konstantopoulos a28476dccc
fix: lowercase node client type (#600) 2021-11-21 18:12:40 +02:00
Rohit Narurkar ab60a5e738
add net_version call (#595)
* add net_version call

* add change log
2021-11-18 20:56:31 +02:00
Eduard S 8493451917
Fix/providers (#590)
* ethers-providers: Fix http Provider request id data race

* ethers-providers: Remove Serialize from JsonRpcClient Response

* Update changelog
2021-11-18 11:59:29 +02:00
James Prestwich 0f22afeb49
Prestwich/escalator fixes (#581)
* refactor: handle nonce-too-low cases indicating previous conf.

* feature: add sign_transaction to Middleware trait and fix escalation signing
2021-11-14 14:26:02 +02:00
James Prestwich 203b2e8ea3
Prestwich/super pending (#566)
* feature: pending_escalator

* feature: send_escalating in Middleware

* bug: don't drop unready futures in escalator.poll

* chore: docs and must_use

* chores: lints, clippies, wasm fixes, dedup pinboxfut

* chore: more lints

* refactor: use Delay in polling interval to ensure re-waking

* refactor: simplify Sleeping state transition as last will never be None again

* bug: properly set last when broadcasts resolve

* feature: debug implementation for EscalatingPending

* refactor: with_ setters and escalations argument

* refactor: use FuturesUnOrdered instead of a vec of futures

* chore: update CHANGELOG with recent PR info

* chore: update all comments on pending escalator

* chore: run rustfmt
2021-11-12 03:23:46 +02:00
James Prestwich e9d40120a7
chore: re-export http client error in providers transports (#570)
* chore: re-export http client error in providers transports

* chore: re-export we client error in providers transports
2021-11-10 18:53:07 +02:00
Matthias Seitz c08f8ba876
fix: failing test and check --all-targets in ci (#560)
* fix: update failing example

* ci: check all targets
2021-11-05 19:58:03 +02:00
Matthias Seitz 6bf45a0b5d
fix: send error back (#556) 2021-11-05 03:21:23 +02:00
Alexey Shekhirin dc3ac427f4
feat(providers): unify get_block_receipts for eth/parity RPCs (#541)
* feat(providers): unify get_block_receipts for eth/parity RPCs

* add besu

* impl tryfrom for nodeclient

* better node client storage

* fix lint

* tryfrom<&str> -> fromstr

* fix: remove nested Option

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-30 16:50:46 +03:00
Matthias Seitz dcf20022c6
chore: add rustfmt.toml (#537)
* chore: add rustfmt.toml

* rustfmt

* chore: Update readme with fmt info

* ci: update ci

* chore: rustfmt

* rustfmt

* rustfmt

* ci: install libudev

* chore(clippy): make clippy happy

* chore(clippy): make clippy happy

* revert ci

* ci: install libudev
2021-10-29 14:29:35 +02:00
Georgios Konstantopoulos ef9b3988ce
fix: ensure gas estimation includes the access list in 1559/2930 txs (#523)
* fix: ensure gas estimation includes the access list in 1559/2930 txs

* feat: add gas_price to typed tx

* feat: add access list to typed tx

* chore(providers): cleanup fill_transaction

* chore: fmt

* chore: enable 712 on ethers-contract at top level crate

* fix: do not error if eth_createAccessList is not available

* feat: only use access list if needed
2021-10-20 23:18:58 +03:00
Georgios Konstantopoulos 10843a774e chore: cargo fmt 2021-09-18 01:01:40 -05:00
drewstone 83e953bc2f
Add getProof to provider (#459)
* Add getProof to provider

* Format updates

* Add docs

* Remove fill_tx method, not sure how it got there

* Fix removed Trace type

* Remove test, eth_getProof not supported by ganache
2021-09-18 01:01:02 -05:00
Georgios Konstantopoulos 79bf896a2c
test: fix duplicate tx flakes by rotating through a list of wallets (#451)
* test: fix duplicate tx flakes by rotating through a list of wallets

* fix: make typed_txs test more robust

* fix: ensure wallets are loaded in a thread-safe way

without fetch_add, it's possible that 2 loads happen for the same id before the `store` mutex is acquired'
2021-09-14 16:40:15 +03:00
Alexis Sellier 2e195d91e1
Make 'ens' module public (#435) 2021-09-06 11:52:44 +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 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
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
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 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
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 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