Commit Graph

233 Commits

Author SHA1 Message Date
James Prestwich 2090bf560e
Expose contract revert errors in the ContractError struct (#2172)
* feature: spelunk for revert errors

* feature: bubble up revert to contract error

* feature: bubble up reverts to multicall

* fix: correctly remove signature when deserializing EthErrors

* chore: remove redundant test

* chore: clippy

* fix: allow empty revert string

* docs: add all missing rustdoc for ethers-contract

* chore: rustfmt

* chore: Changelog

* fix: danipope test comment
2023-02-22 14:52:25 -08:00
James Prestwich ef6e7f41a1
Refactor: organize ethers-providers (#2159)
* feature: bubble up jsonrpc error response via trait

* refactor: ClientError to TransportError

* refactor: FromErr to MiddlewareError

* tests: fix test with middlewareerror

* fix: doctest

* fix: fix custom middleware example

* feature: as_serde_error

* docs: for error traits

* fix: custom example and unnecessary ref

* refactor: in progress organization

* refactor: continue cleaning up

* refactor: finish changing crate layout

* refactor: fix test imports

* refactor: move convenience impl into toolbox

* chore: changelog

* docs: make them suck less

* fix: remove deprecation

* fix: DaniPopes's nits
2023-02-20 15:55:36 -08:00
Georgios Konstantopoulos 24163412f8 chore: fix ci 2023-02-02 11:12:40 -08:00
Dan Cline 08514ea986
fix(providers): use middleware associated err type (#2093) 2023-01-30 11:57:03 -08:00
wigy 7da559bbed
fix(provider): Add Send bound to return type of JsonRpcClient::request (#2072) 2023-01-27 16:57:08 -05:00
Georgios Konstantopoulos f2099a8eaa
chore: fix clippy (#2059) 2023-01-16 18:11:27 -08:00
DaniPopes a1d6b5e3f7
chore: clippy (#2032) 2023-01-11 19:05:39 -08:00
Andrea Simeoni 5917e842d7
ci: fix nonce manager test (#2014)
* Use Anvil instead of Goerli to test the nonce manager

* restore comment

* fix: explicitly assign `inner.max_priority_fee_per_gas`

Co-authored-by: Andrea Simeoni <>
2023-01-06 11:29:46 +02:00
Dan Cline c0e607da1e
feat(providers): support personal account apis (#2009)
* feat(providers): add personal key mgmt rpcs

 * add personal_importRawKey and personal_unlockAccount

* expose geth personal api

* do not prefix with 0x

* serialize privkey as string

* add allow-insecure-unlock option to Geth
2023-01-04 23:35:44 +02:00
Dan Cline 5f2476510b
feat(providers): add mining related apis (#2008)
* feat(providers): add miner_start endpoint

* add other mining related apis

 * add eth_mining
 * add miner_stop

* expose Geth miner rpc api
2023-01-04 23:30:03 +02:00
DaniPopes 4fd742f8ce
feat: windows ipc provider (named pipe) (#1976)
* fmt: imports

* fix: ipc tests

* fmt

* chore: move ws macros

* chore: gate ipc to unix family

* chore: make tokio optional

* feat: initial named_pipe

* feat: windows ipc

* chore: update Provider

* chore: clippy

* chore: use Path instead of OsStr

* chore: clippy

* fix: docs

* lf

* lf

* test: better subscription tests

* docs

* fix: ipc doctest

* chore: make winapi optional

* fix: optional tokio
2023-01-03 16:15:51 +02:00
DaniPopes fd4da49121
tests: use sepolia (#1989)
* tests: use sepolia

* update ci

* update sleep duration

* deprecate ropsten

* use goerli

* fmt

* keys
2022-12-31 12:47:53 +02:00
James Prestwich e26ede21f1
fix: don't override user-set 1559 attributes (#1980)
* fix: don't override user-set 1559 attributes

* fix: enforce cap on prioirity fee per gas
2022-12-29 03:05:08 +02:00
Vid Kersic b27c7b0773
feat: debug_traceCall (#1949)
* feat: debug_traceCall

* chore: update changelog

* fix: rebase to master and change tracer from string to enum
2022-12-25 13:33:05 +02:00
Sebastiano Faiella 253202f96a
docs(ethers-providers): fixed typos in rw client docs (#1957) 2022-12-22 20:59:20 +02:00
Matthias Seitz 3dfc04f9fe
chore(clippy): make clippy happy (#1923) 2022-12-05 22:05:33 -08:00
Matthias Seitz f886d379a4
feat: add infura error code to retry detection (#1921) 2022-12-02 13:30:56 -08:00
James Prestwich d6fea13d23
feature: providererror conversion to middleware error (#1920)
* feature: providererror conversion to middleware error

* chore: update changelog
2022-12-02 12:12:14 -08:00
Andrea Simeoni c4e09f261e
Fix: handle panic on Ws error (#1915)
* On Ws error close all active subscriptions and force clients to reconnect. the Websocket.

* Comment typos

* Unit tests
Lint
cargo +nightly fmt

* - Added CHANGELOG entry
- Added `#` prefix to issue IDs where missing

* ownership typo

Co-authored-by: Andrea Simeoni <>
2022-12-01 11:00:10 -08:00
Dan Cline 4b685621ed
feat(providers): add a subset of admin namespace (#1880)
* tell Geth to expose the admin namespace

* wip: add admin namespace support

 * add networking and peer related structs

* add rest of chain config fields

* add datadir to geth

* fix data dir ref

* add dev flag to geth

* set dev only if block_time is not set

* put mutually exclusive options in an enum

* make block_time use the devmode enum

* add p2p port to geth

* add basic impls for admin endpoints

* move from_int_or_hex to ethers-core utils

* fix nodeinfo protocol field

 * the type is better represented by a struct which can have either eth
   or snap

* add chain id and discovery toggle for Geth

* remove PeerEvent

 * should re-add when peer event endpoints are implemented

* simplify serde options for admin responses

* change signature for peer modification apis

 * these admin apis accept an enode, which _may_ be an enr, but could
   also be a legacy enode "v4" url.

* add note on where `ChainConfig` fields come from

* add note on PeerInfo about the source of fields

* add admin namespace support to CHANGELOG

* update pr number in changelog

* cargo fmt

* move chainconfig to genesis in utils

* accept genesis file in geth

* add genesis writing to geth spawn

* finally get geth nodes to connect

* import io::Read in provider tests

* fix PeerInfo and use enode id for provider test

* make clippy happy

* improve documentation for genesis module

* remove not(wasm) attributes on genesis module

* remove debugging printlns

* remove io::Read from provider tests

* add failing post merge test case

* add full mainnet nodeinfo for testing

* support deserializing json bignums to U256

 * the serde_json arbitrary_precision feature is necessary so the
   serde_json::Number variant of `IntOrHexOrBigNum` can be converted
   into a string and fed into U256::from_dec_string

* fix from_int_or_hex_opt doc string

* remove third variant from IntOrHex

 * unnecessary since serde_json::Number handles smaller ints as well

* add comments for ids

* fix enode id type in admin_peers provider test

* fix admin typo in Cargo.toml

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

* add method to wait on a gethinstance adding a peer

* fix dial loop and wait_to_add_peer doc comments

* update geth

 * the build can be updated by changing the GETH_BUILD env var

* wait for geth to exit on drop

* remove unnecessary wait

* fix mid-handshake PeerInfo deserialization

* remove println

* make tests less flaky

* handle discovery with the rest of the non dev opts

* dump geth stderr to debug failing ci test

 * add method which dumps the unread stderr of the geth instance into a
   string

* remove call_raw debug println

 * bug is due to authrpc endpoint being in use

* use unused port when authrpc port is not specified

* remove dump_stderr from GethInstance

 * did not work properly anyways

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-30 13:22:44 -08:00
Matthias Seitz d48187ac0d
feat(provider): check for serde error with missing req id (#1910) 2022-11-29 07:48:58 -08:00
Noah Citron fa0ce0c750
feat: retry client wasm support (#1877)
* wasm support for retry client

* fix conection err check

* fix lockfile

* remove unused comment
2022-11-22 13:16:23 -08:00
Matthias Seitz 49dc487676
feat: add another rate limit retry check (#1881) 2022-11-22 13:08:04 -08:00
Noah Citron 921dfa6b1c
fix: better retry timing (#1855)
* fix retries

* increase default backoff to 1s

* remove comment

* fmt
2022-11-13 07:50:00 -05:00
Georgios Konstantopoulos 960d89fccc
Revert "fix: get_logs_paginated fetches past latest block (#1818)" (#1845)
This reverts commit eb40392399.
2022-11-08 16:05:28 -08:00
DaniPopes debd6fec3d
chore: clippy (#1812)
* chore: clippy

* fmt
2022-11-07 15:43:11 -08:00
Roger So eb40392399
fix: get_logs_paginated fetches past latest block (#1818) 2022-11-07 12:43:11 -08:00
Matthias Seitz 0645f4502c
chore: replace rinkeby with goerli (#1768)
* chore: replace rinkeby with goerli

* ignore example
2022-10-07 08:58:32 -07:00
DaniPopes db75e3628e
feat(core): add utility methods to NameOrAddress (#1720)
* feat: NameOrAddress impls

* feat: add to_addr to TypedTransaction

* fix: use NameOrAddress for ens

* chore: clippy

* dont clone
2022-09-19 10:51:04 -07:00
Matthias Seitz f208fb9cd3
feat: detect requested backoff (#1711) 2022-09-17 12:06:29 -07:00
Trevor Porter c568fd3934
fix(providers): don't default to "latest" block ID for `eth_estimateGas` (#1657)
* Don't default to 'latest' block ID for eth_estimateGas

* Add changelog entry

* Amend comment
2022-09-16 11:23:34 -07:00
Matthias Seitz 9773a76dd4
feat: retry infura's header not found (#1706) 2022-09-15 16:51:57 -07:00
Matthias Seitz 6a86d4ff22
chore(clippy): make clippy happy (#1659) 2022-09-04 10:57:52 -07:00
Georgios Konstantopoulos c8e9d46cfa chore: fmt 2022-08-22 16:33:00 -07:00
Mattie Conover 8218c96205
fix(providers): QuorumProvider zero-parameter json Value handling (#1613)
* Correction to QuorumProvider json Value handling with zero-parameter cases

* Update to properly pass through when no parameters are specified
2022-08-22 16:32:47 -07:00
Matthias Seitz 10f74f818a
fix: handle provider error correctly (#1630)
* fix: handle provider error correctly

* chore(clippy): make clippy happy

* chore: rustfmt

* convert http error
2022-08-22 13:47:43 -07:00
Matthias Seitz 98174863c9
feat: support retrying connection errors (#1629) 2022-08-22 09:47:26 -07:00
Matthias Seitz da8c70ab7f
chore: add some traces (#1622)
* chore: add some traces

* Update ethers-providers/src/transports/ws.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-08-20 15:32:10 -07:00
Matthias Seitz 8abb9d86e2
fix: extend eth_syncing response type and serde (#1624) 2022-08-20 15:30:53 -07:00
Nicolas Gotchac 68fba606c2
Don't auto-generate an AccessList when sending/filling a tx (#1619)
Add an optionnal `block` parameter to the gas estimation method
2022-08-19 14:33:12 -07:00
Remco Bloemen afb6808ddb
Export LogQueryError (#1615) 2022-08-19 08:18:26 -07:00
joshieDo d22ab5de0a
fix(providers): validate address resolver (#1605)
* validate address resolver

* use Selector type instead

* specify which ens_name on resolver error

* pad supportsInterface argument
2022-08-17 14:13:51 -07:00
Matthias Seitz 3040edf2ad
feat: add ProviderExt trait (#1559) 2022-08-03 09:21:55 -07:00
joshieDo 8026904c3d
take provider interval on PendingTransaction (#1558) 2022-08-03 09:19:10 -07:00
Matthias Seitz 555cbb16e6
feat(provider): expose url for http (#1550) 2022-08-02 12:35:28 -07:00
Matthias Seitz e2754dee4f
feat: add set_interval helper function (#1551) 2022-08-02 12:14:03 -07:00
Matthias Seitz c75608eda1
ci: rm pinned nightly (#1541)
* ci: rm pinned nightly

* chore(clippy): make clippy happy
2022-07-31 19:00:31 -07:00
Matthias Seitz e855676afc
perf(providers): get response as bytes (#1536) 2022-07-30 12:41:44 -07:00
Matthias Seitz 35e68dac6e
docs: some additional retry docs (#1537) 2022-07-30 12:41:06 -07:00
wren cb7e586645
feat(debug_traceTransaction): initial commit (#1469)
* feat(debug_traceTransaction): initial commit

* chore(changelog): updated changelog

* feat(debug_traceTransaction): type adjusments

* feat(debug_traceTransaction): type adjusments

* Update ethers-providers/src/provider.rs

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* Update ethers-providers/src/provider.rs

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore(format): cargo +nightly fmt

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-07-24 14:46:38 -07:00