Commit Graph

94 Commits

Author SHA1 Message Date
DaniPopes 16f9fab75c
fix: enable doc_cfg feature for docsrs (#2294) 2023-03-22 16:29:10 -07:00
DaniPopes 203e350940
docs: fix broken links, update documentation (#2203)
* docs: fix broken links

* docs: update READMEs and module-level documentation
2023-02-27 13:03:17 -07: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
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
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
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
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 0645f4502c
chore: replace rinkeby with goerli (#1768)
* chore: replace rinkeby with goerli

* ignore example
2022-10-07 08:58:32 -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
Matthias Seitz 3040edf2ad
feat: add ProviderExt trait (#1559) 2022-08-03 09:21:55 -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
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
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
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 4c75e4ae19 test: expose test provider url 2022-05-18 13:41:11 -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
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
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
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
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
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
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
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
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
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
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
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 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
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