Commit Graph

182 Commits

Author SHA1 Message Date
Igor Żuk 18d40425ec
fix: accept ethlive as a chain name (#2268)
* fix: accept ethlive as a chain name

* Fix mainnet chain formatting

* Drop unnecessary chain formatting tests

---------

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-03-16 13:37:27 -07:00
DaniPopes 404422e883
feat(core): roundtrip serde + to/from strings (#2270)
* feat(core): roundtrip serde + to/from strings

* docs: update CHANGELOG.md
2023-03-16 13:28:40 -07:00
James Prestwich 73636a906e
RRR: Reconnection & Request Reissuance (#2181)
* wip: ws2

* ws2 backend compiles

* refactor: rename PubSubItem and BackendDriver

* feature: dispatch request to end subscription

* refactor: move ws2 to ws, fix reconnection and deser on subs

* chore: improve use of tracing in manager

* refactor: feature legacy_ws to enable backwards compatibility

* nit: mod file ordering

* docs: copy PR description to ws structs

* fixes: remove unused macros file, remove err formats

* docs: add comments to struct fields

* docs: comment client struct fields

* chore: changelog

* fix: unused imports in ws_errors test

* docs: missing comment

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

* fix: legacy-ws feature in root crate, hyphen not underscore

* fix: a couple bad imports/exports

---------

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-02-28 18:25:59 -07:00
OliverNChalk 34775178f9
feat: deseralize other fields on tx receipts (#2209) 2023-02-28 17:22:39 -07:00
James Prestwich cc3156db7a
Workaround for https://github.com/LedgerHQ/app-ethereum/issues/409 (#2192)
* fix: edge cases and workarounds for ledger signer

* feat: add tracing to ledger signer

* chore: Changelog
2023-02-27 13:13:55 -07:00
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
DaniPopes e55b8116f3
feat(contract): improve Multicall result handling (#2164)
* nits

* clippy

* ordering

* move

* chore: edition 2021

* chore: detokenize nit

* feat(contract): improve Multicall result handling

* docs: update CHANGELOG.md

* feat: make fields public

* chore: clippy
2023-02-20 18:50:28 -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
James Prestwich 0c16eb971d
Prestwich/event no lifetime (#2105)
* refactor(breaking): remove lifetime from Event

* fix: example updated to use new event
2023-02-13 17:14:38 -08:00
bsh98 1b08a94a85
feat(examples): add basic event filtering example (#2137) 2023-02-10 16:29:10 -08:00
James Prestwich 2607c67ca0
Refactor factories to use `Borrow<M>` (#2103)
* refactor: abstract factories over Borrow

* chore: changelog

* fix: docs for factory and type aliases
2023-02-07 10:51:34 -08:00
YuFei Wang 14be402f40
feat: add support for Geth built-in tracer and config (#2121)
* feat: add 4byteTracer

* feat: add prestateTracer

* feat: add noopTracer

* refactor: geth tracer layout

* feat: call tracer config

* fix: compatible with legacy call trace

* feat: pre state tracer config

* test: serialize/deserialize tracer

* refactor: deserialize type

* style: update refs

* chore: update CHANGELOG.md

* style: json string to object
2023-02-07 10:50:44 -08:00
James Prestwich e5e4da07c5
feature: allow signature to recover typed_data payloads (#2120)
* feature: allow signature to recover typed_data payloads

* fix: under feature flag and Changelog

* fix: undo accidental doc mangling
2023-02-06 13:27:35 -08:00
James Prestwich 0236de8d2a
refactor: make contract abstract over Borrow (#2082)
* refactor: contract abstract over Borrow

* refactor: preserve old connect usage

* nit: remove commented out modules

* chore: changelog

* test: add compile check to tests

* docs: add usage note to doc and make sure contractcall is visible

* fix: test compilation

* refactor: ContractCallInternal -> FunctionCall, ContractInternal -> ContractInstance

* fix: Send IntoFuture

* nit: must-use on connect

* docs: remove deprecation warning in docstrings for type aliases

* Update ethers-contract/src/call.rs

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

---------

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-02-06 13:27:01 -08:00
DaniPopes cabb15e346
feat(abi): packed encoding (#2104)
* feat(abi): packed encoding

* clippy

* fix: use least number of bits for int/uint

* docs: update CHANGELOG.md

* fix: doctest
2023-02-04 19:23:27 -08:00
Vid Kersic 7e7f9041b3
feat: add support for js tracer to geth trace, fix different return types (#2064)
* feat: add support for js tracer to geth trace, fix different return types

* chore: fix clippy

* chore: update geth structs
2023-01-31 09:58:06 -08:00
Guillaume Malette 83b12a80e3
Make ContractCall IntoFuture implement Send (#2083)
* fix(contracts): Add a failing test showing that ContractCall IntoFuture is not Send

* fix(contracts): Add Send bound for IntoFuture implementation of ContractCall

* chore: update CHAGELOG

* chore: fmt

---------

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-01-27 14:54:49 -05:00
Agost Biro 19a740db52
chore(deps): bump svm-rs (#2051)
* chore(deps): bump svm-rs

Earlier versions of `svm-rs` have transitive dependencies that conflict
with newer Rust Crypto packages.

* chore: update changelog
2023-01-13 10:19:47 -08:00
Yiannis M 0a7e7423e2
feat(signers): Allow parsing of private key that has `0x` prefix (#2037) 2023-01-11 19:41:41 -08:00
DaniPopes 015eeabea8
feat(contract): return multicall pending transaction (#2044)
* feat(contract): return multicall pending transaction

* fix: tests

* docs: update CHANGELOG.md
2023-01-11 19:30:56 -08:00
DaniPopes b4b153a364
perf(utils): avoid unnecessary allocations (#2046)
* perf(utils): avoid unnecessary allocations

* docs: add more to_checksum information

* docs

* use address
2023-01-11 19:20:35 -08:00
WillQ 4a8a6ad259
abigen adopt hardhat generated bytecode (#2012)
* abigen adopt hardhat generated bytecode

* update changelog
2023-01-05 11:46:32 +02:00
0xKitsune f94e6f549f
added `from_bytes` for `Wallet` type (#1983)
* added `from_bytes` for `Wallet` type

* added key_from_bytes test for Wallet::from_bytes

* updated changelog
2022-12-30 14:45:19 +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
Yiannis M 813600e6c9
fix: Add `openssl` and `rustls` feature flags in ethers-middleware (#1961)
* fix: ethers-middleware: Add `openssl` and `rustls` feature flags

* fix: ethers-contract-derive: Disable default features of ethers-contract-abigen

Without this fix, `rustls` was enabled by default even if user had `openssl` feature flag
2022-12-21 16:44:42 +02:00
Genysys 91cd6ccce8
feat: adds bscscan as abi source (#1955) 2022-12-19 17:54:24 +02:00
Andrey Kuznetsov 279aea6323
feat(contract): add_calls and call_array for multicall (#1941) 2022-12-18 13:05:02 +02:00
Andrey Kuznetsov 5bc9ee73b2
fix(contract): allow 16 calls in multicall (#1934) 2022-12-15 09:47:59 +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
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
Andrea Simeoni 16ab3d5820
Feat middleware stack builder (#1890)
* ProviderBuilder struct + docs

* README

* Docs typos

* Removed useless Arc
Rename module

* Unit tests

* cargo +nightly fmt

* CHANGELOG

* CHANGELOG typo

* ci: fix docs job

* review: Removed Option<M>. Builder functions directly consume self.

* feat: `with_signer` builder function

* feat: `nonce_manager` builder function

* feat: `gas_oracle` builder function

* Unit tests

* Docs

* fix: cargo +nightly fmt

* Update ethers-middleware/src/builder.rs

Typo

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

* Builder functions provided as a trait
Update docs
Update tests

* cargo +nightly fmt

* CHANGELOG

Co-authored-by: Andrea Simeoni <>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-28 12:16:21 -08:00
Andrea Simeoni 845aa4920f
feat: Instantiate an event builder without a contract instance (#1882)
* Build an `Event` without requiring a contract instance

* Contract unit test

* Function to set Event address

* Example

* Typo to improve readability

* CHANGELOG

* cargo +nightly fmt

* FIX conflict

* review: applied Address alias

Co-authored-by: Andrea Simeoni <>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-22 13:15:36 -08:00
Dave Belvedere a0fb1bf196
I256 parse support (#1863)
* Added support for I256 in format_units. Added two complement support for I256.

* Add I256 support into parse_units

Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-16 16:03:07 -08:00
Will Smith d47e34dc5b
fix: generated crate not using generated version (#1852)
* fix: generated crate not using generated version

* add docs

* wip: add base testcases

* fix: str formatting

* fix: add missing comma

* fix: tests and file loading

* fix: strip whitespaces

* fix: case where we are using specified crate

* linting: remove extra ref

* refactor: use toml parser over regex

* fix: add case for path and ethers-contract

* fix: add missing comma

* feat: don't check for path

* remove build-dep fallback
2022-11-15 13:00:12 -08:00
MouseLess.eth 936cecc3ad
Add `op` field to `VMOperation` to determine executed opcode (#1858)
* created opcode enum and added to VMOperation. Fixes #1857

* rebuild trace logs to include missing fields

* opcode descriptions for docs + changelog

* restore traces and indent trace

* opcode 0x20 should be SHA3
2022-11-15 11:36:52 -08:00
Dave Belvedere 5ae0a848c7
I256 asr doc (#1860)
* Update I256 documentation to call out diversions from standard numeric types on the right shift operator

* Update changelog

* Address review comment. Link changelog notes to PR

Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-15 11:33:54 -08:00
Dave Belvedere 5c9a048f73
Add Arithmetic Shift Left operation for I256. Minor update to the ASR tests to include coverage for a shift of 0, and move to 'I256::minus_one' over 'I256::from(-1i8)' syntax (#1452)
Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-08 16:10:53 -08: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
Roger So eb40392399
fix: get_logs_paginated fetches past latest block (#1818) 2022-11-07 12:43:11 -08:00
halo3mic ba9aa7838b
Fixes: #1822 (#1823)
* Fixes: #1822

* Fixes: gakonst#1822 :: update1

* Fixes: #1822 :: Add ParseOverflow err & rm rust_decimals from ethers-core

* update changelog
2022-11-07 12:28:43 -08:00
DaniPopes 5c762c44d7
fmt: all (#1751)
* fmt: all

* fmt: eol
2022-09-28 11:58:26 -07:00
Luke Tchang e034a8f979
docs: add comment about safety of u8 -> u64 cast in signature (#1704)
* docs: add comment about u8 -> u64 cast in signature

* fix: format

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-09-18 08:45:33 -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
Robin Molen-Grigull c9c22f4dfa
fix: geth trace types (#1682)
* fix: geth trace types

* update: changelog entry added
2022-09-09 16:20:25 -07:00
DaniPopes c341f31fc4
chore: add abigen to default features (#1684)
* chore: add abigen to default features

* docs: update CHANGELOG.md
2022-09-09 16:19:29 -07:00
Matthias Seitz 0e7f46b03d
feat(abigen): subsitute structs in event bindings (#1674)
* fix(abigen): handle event defaults

* feat(abigen): subsitute structs in event bindings

* update changelog

* chore: rustfmt

* fix broken tests

* chore(clippy): make clippy happy
2022-09-07 09:14:13 -07:00
Noah Citron a052ff8bd4
fix: legacy transaction rlp decoding (#1672)
* fix legacy tx rlp decoding

* add test for type 0 tx in 2718 envelopes

* update changelog

* refactor

* fmt
2022-09-06 09:08:05 -07:00
DaniPopes 72449c09e1
feat(contract): add extra Multicall helper methods (#1666)
* feat(contract): add extra Multicall helper methods

* docs: update CHANGELOG.md

* normalize helper methods' names
2022-09-05 09:54:49 -07:00