Commit Graph

1865 Commits

Author SHA1 Message Date
Franfran d553111906
fix: rebase to master for onbjerg's ast (#1943) 2022-12-22 15:22:57 +02:00
DaniPopes e007ea01b1
feat(core): chain macros and impls (#1958) 2022-12-22 14:44:51 +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
DaniPopes bb4af1c134
fix(middleware): oracles, tests (#1944)
* fix(middleware): oracles, tests

* fix: use util

* fix: make blocknative api key optional

* make response fields public

* import orders

* docs: oracle trait

* fix: make response fns public

* chore: clippy

* fix: doc tests
2022-12-18 13:45:47 +02:00
DaniPopes 022f082cee
fix(msrv): bump in .clippy.toml and add a comment in root Cargo.toml (#1945) 2022-12-18 13:41:11 +02:00
Dan Cline 6efa7ca85f
fix(core): decode to correctly in Transaction (#1946)
* would not correctly decode a create transaction because 0x80 was not
   properly decoded
2022-12-18 13:40:43 +02:00
Matthias Seitz e86183e935
feat: make geth executable configurable (#1947)
* feat: make geth executable configurable

* Update ethers-core/src/utils/geth.rs

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>

* Update ethers-core/src/utils/geth.rs

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>

Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
2022-12-18 13:33:40 +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
dependabot[bot] cd19d1a691
chore(deps): bump base64 from 0.13.1 to 0.20.0 (#1935)
Bumps [base64](https://github.com/marshallpierce/rust-base64) from 0.13.1 to 0.20.0.
- [Release notes](https://github.com/marshallpierce/rust-base64/releases)
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.13.1...v0.20.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-15 09:46:21 +02:00
dependabot[bot] ed4fb21343
chore(deps): bump rayon from 1.6.0 to 1.6.1 (#1936)
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.6.0...rayon-core-v1.6.1)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-15 09:46:11 +02:00
Andrea Simeoni 4fd5bbb676
Added new checkbox to the PR checklist (#1937)
Co-authored-by: Andrea Simeoni <>
2022-12-14 10:06:02 +02:00
Dan Cline ea10f4b4df
fix(core): set `GethInstance` p2p_port in spawn (#1933)
* fix(core): set GethInstance p2p_port in spawn

 * previously, spawning Geth with disabled discovery would not actually
   set the p2p port in the returned GethInstance. This is because it
   would only pass the port to the geth command. If the value started as
   None, it would remain to be None in the GethInstance even though a
   port was passed to the command.
 * adds tests for the existence of ports in GethInstance

* remove rpc port test

* rpc port test doesn't make sense because it will always be set, it is
  not an Option

* use sigterm instead of sigkill

* use sigint instead of sigterm

* run tests in different directories

 * prevents flaky behavior because cargo runs tests in parallel, if the
   default directory were used, each GethInstance would fight for geth's
   file system lock.

* remove nix as a dep

 * sigkill works for now
2022-12-09 09:42:23 -08:00
dependabot[bot] c044dc8287
chore(deps): bump futures-locks from 0.7.0 to 0.7.1 (#1930)
Bumps [futures-locks](https://github.com/asomers/futures-locks) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/asomers/futures-locks/releases)
- [Changelog](https://github.com/asomers/futures-locks/blob/master/CHANGELOG.md)
- [Commits](https://github.com/asomers/futures-locks/compare/v0.7.0...v0.7.1)

---
updated-dependencies:
- dependency-name: futures-locks
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 12:31:05 -08:00
joshieDo 92e726921a
chore: add celo chain (#1932)
* add celo chain

* add missing chain case

* clippy & fmt
2022-12-07 21:37:11 -08:00
Matthias Seitz 3dfc04f9fe
chore(clippy): make clippy happy (#1923) 2022-12-05 22:05:33 -08:00
Matthias Seitz 556821f077
chore: generate selector as hex in docs (#1924) 2022-12-05 22:05:24 -08:00
Andrea Simeoni 59dd541f2a
added new line were missing (#1928)
Co-authored-by: Andrea Simeoni <>
2022-12-05 22:05:02 -08:00
Dan Cline 80d887b67e
docs: update MRSV to 1.64 (#1926)
* IntoFuture was implemented in #1826, which means the MSRV should now
   be 1.64
2022-12-05 22:04:48 -08:00
christn c35e6e2fd3
Fix Dead Link to abigen test in README (#1929) 2022-12-05 20:46:00 -08:00
Jared Tokuz a88d2d03e3
refac: change awsSigner to own kmsclient (#1922) 2022-12-02 19:06:06 -08:00
Matthias Seitz f886d379a4
feat: add infura error code to retry detection (#1921) 2022-12-02 13:30:56 -08:00
Andrea Simeoni e5aa4518d7
Docs: Middleware library (#1912)
* Updated the middleware README heading

* fix docs CI

* Added heading description for the main middlewares

* Restructure README examples

* Fix docs CI

* Fix MiddlewareBuilder function docs

* Typos inside the middleware README

Co-authored-by: Andrea Simeoni <>
2022-12-02 12:57:59 -08:00
MouseLess.eth 913f15dc84
fix: remove `OpCode` enum and update `VMOperation`'s `op` field type (#1904)
* remove OpCode enum and update VMOperation's op field

* restore opcodes + update 0x20 to keccak256

* enum to deserialize opcodes into known or unknown

* Update ethers-core/src/types/trace/mod.rs

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

* fix typo: ExecutedInstruction

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-12-02 12:51:16 -08:00
dependabot[bot] 4e98c4a5f0
chore(deps): bump syn from 1.0.104 to 1.0.105 (#1918)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.104 to 1.0.105.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.104...1.0.105)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-02 12:12:50 -08:00
odysseas.eth 3bf9025d2f
feat: impl Serialize for Chain (#1917)
* feat: impl Serialize for Chain

* fix: add deps
2022-12-02 12:12:34 -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
Dan Cline 5af2800f15
fix(core): always set p2p port in non-dev mode (#1919)
* if geth is in non-dev mode, it has been explicitly set by either
   disabling discovery or setting a p2p port. To prevent geth from
   crashing if another process is using the default p2p port, always set
   the p2p port if geth is in non-dev mode.
2022-12-02 12:11:31 -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
Matthias Seitz 0ce6b107d6
fix: make version detection infallible (#1916) 2022-12-01 06:14:51 -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
DaniPopes 2d793edc94
fix(contract): multicall decode error (#1907)
* wip

* use empty bytes for reverts

* minor improvements

* fix test

* use is_empty

* docs

* clippy

* fix: rust-analyzer bug

* revert rename
2022-11-30 13:20:22 -08:00
dependabot[bot] bbe53bfa2a
chore(deps): bump tokio-tungstenite from 0.17.2 to 0.18.0 (#1908)
Bumps [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) from 0.17.2 to 0.18.0.
- [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.17.2...v0.18.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 13:20:04 -08:00
DaniPopes 866d30593a
feat(core): Chain impls and refactoring (#1909)
* sort

* derive Default

* use u64 for conversions and add impl

* one impl block and comments
2022-11-30 13:19:05 -08:00
Matthias Seitz 17addcfd91
fix(abigen): rm wrong brackets (#1914) 2022-11-30 13:14:40 -08:00
MouseLess.eth 82f19e0789
fix: txpool_inspect unable to parse contract creations (#1905)
* Fixes #1899

* replace match with if let some() else

* fix error: number too large to fit in target type

* Apply suggestions from code review

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
2022-11-29 13:18:18 -08:00
Matthias Seitz d48187ac0d
feat(provider): check for serde error with missing req id (#1910) 2022-11-29 07:48:58 -08:00
dependabot[bot] 79e64a8378
chore(deps): bump chrono from 0.4.20 to 0.4.23 (#1900)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.20 to 0.4.23.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.20...v0.4.23)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 12:20:56 -08:00
dependabot[bot] 4d5e032129
chore(deps): bump syn from 1.0.103 to 1.0.104 (#1901)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.103 to 1.0.104.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.103...1.0.104)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 12:20:47 -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
Georgios Konstantopoulos ed47eaadad chore: pin env-logger 2022-11-27 12:32:57 -08:00
Georgios Konstantopoulos f2ebb16372 (cargo-release) version 1.0.2 2022-11-27 12:27:58 -08:00
Georgios Konstantopoulos 93b2723d74 (cargo-release) version 1.0.2 2022-11-27 12:27:58 -08:00
Georgios Konstantopoulos 3e29aaa82d (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos 71e2727ae3 (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos f6f150ca28 (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos 78e89f8efa (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos 8034fd0e91 (cargo-release) version 1.0.2 2022-11-27 12:27:56 -08:00
Georgios Konstantopoulos c627765871 (cargo-release) version 1.0.2 2022-11-27 12:27:56 -08:00