Commit Graph

411 Commits

Author SHA1 Message Date
DaniPopes c9a7b4acaf
refactor(abigen): keep and use parsed spans (#2247)
* order

* refactor(abigen): keep and use spans

* chore: use getters instead of making fields public

* fix: tests

* docs: update abigen documentation

* chore: clippy
2023-03-13 12:49:32 -07:00
Georgios Konstantopoulos 941d3908d9 (cargo-release) version 2.0.0 2023-03-13 12:38:25 -07:00
DaniPopes f9086e703c
fix: docsrs builds final (#2235)
* fix

* fix: middleware

* fix: update rustc flags

* docs: add comment
2023-03-08 14:58:44 -08:00
DaniPopes 86a9e7c3af
fix: docs.rs build (#2221)
* fix: docs.rs build

* fix: test
2023-03-05 12:16:40 -08:00
James Prestwich 1c90e1b76a
fix: parse_log in public interface (#2228) 2023-03-04 14:55:41 -07:00
DaniPopes da743fc8b2
ci/test: improve CI jobs and tests (#2189)
* ci: move to scripts directory

* nits

* ci: improve main CI jobs

* fix: install script

* fix

* fix: use curl for windows installation

* fix: wasm typo

* tests: move to single binary

* chore: clippy

* chore: clippy

* chore: clippy

* fix: test command

* fix: quote tests

* update script

* fix: action exclude

* fix: dev deps

* fix: only run wasm in own job

* ci: add aarch64 targets

* test: rm useless test

* ci: update security audit

* ci: add deny CI

* chore: rm unused audit.toml

* chore: update geth.rs

* ci: remove unusable targets

* fix: install script path

* fix: wasm

* improve script

* fix: failing ci

* fix: contract tests

* ci: improve install script

* update middleware tests

* move integration etherscan tests to tests/ dir

* fix: eip2930 access_list field name

* add pendingtransaction must_use

* add random anvil comment

* ci: add miri job

* ci: simplify

* fixci

* Revert "add pendingtransaction must_use"

This reverts commit 770b21b4a3.

* fix: macos script

* fix: use curl in script

* unused ci

* update script

* fix wasm

* rm_miri

* fix: signer test

* fix: wasm ci

* fix: ipc test

* fix: live celo tests

* fix: abi online source test

* fix: windows paths in test

* chore: update serial_test

* ci: run live tests separately

* fix: provider tests

* fix: unused var

* fix: feature

* fix merge

* fix: etherscan key tests

* ci: rm duplicate audit

* fix: split etherscan test ci

* fix: etherscan test

* fix: generate multiple unused ports

* fix: source test

* fix: udeps

* rm unused
2023-02-28 17:26:27 -07:00
James Prestwich ded611e714
feature: contract revert trait (#2182)
* feature: contract revert trait

* fix: proper link to abigen in docs

* fix: don't borrow Bytes, better valid_slector

* fix: mattsse's nits

* opt: hardcode selector for Error(string)

* fix: add docstring to RevertString

* docs: enhance docs on ContractRevert

* chore: add doc on decoding error reverts as strings

* docs: more docstring on ContractRevert

* fix: fix try_into invocation

---------

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-02-28 00:59:32 -07:00
DaniPopes 319b86a643
chore: replace rpc urls with generic ones (#2199) 2023-02-27 15:16:33 -07:00
DaniPopes 1861b98896
chore: move etherscan api key env var matching to Chain enum (#2204)
* fix: mainnet, optimism blocktimes

* chore: move etherscan api key env var matching to Chain enum

* docs: missing exhaustiveness comment
2023-02-27 13:14:36 -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 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
DaniPopes 3732de844c
fix(abigen): builtin trait derives (#2170)
* fix(abigen): builtin trait derives

* refactor: EthDisplay

* feat(derive): improve type detection

* chore: cleanup

* chore: edition 2021

* chore: clippy

* chore: use unreachable
2023-02-20 16:27:43 -08:00
Mathis c21362b696
Make order of types in shared_types deterministic (#2169)
* Add missing development dependencies to flake.nix

* Use BTreeMap/Set for deterministic shared types

Fixes an issue where the order of types in the generated shared_types is
not always deterministic.
2023-02-20 16:18:31 -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
DaniPopes 6336e96995
refactor(abigen): derives, struct expansion (#2160)
* refactor: abigen derives

* refactor: struct expansion

* refactor: structs 2

* chore: abigen derives and visibility

* refactor: abigen docs

* refactor: structs 3

* chore: doc

* chore: structs conditional default

* refactor: method expansion

* refactor: final doc

* refactor: expansions, add docs, extra From impl

* refactor: final struct expansion

* feat(types): implement bytes::Bytes static methods

* feat: use static Bytes for bytecode

* merge artifact

* refactor: event input expansion

* refactor: common expand params

* refactor: method params expansion

* refactor: struct fields expansion

* refactor: types array expansion

* mergings

* cleanup

* flatten

* selector fmt

* chore: clippy

* refactor: common, imports
2023-02-19 16:53:29 -08:00
Georgios Konstantopoulos 8d511dbd64 chore: fmt 2023-02-18 13:22:58 -08:00
frankie 9733b16afc
Include deployed bytecode in abigen output (#2163)
* test

* sanity check
2023-02-18 12:53:39 -08:00
dependabot[bot] 69edf3b49e
chore(deps): bump once_cell from 1.17.0 to 1.17.1 (#2156)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.17.0 to 1.17.1.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.17.0...v1.17.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-15 10:55:04 -08:00
DaniPopes d8597202ed
refactor(contract): derive procedural macros (#2152)
* refactor: use Result<_, Error>

* fix: report both errors during parsing

* refactor: abigen derive results

* update Event derive

* refactor: derive utils

* fmt Display derive

* fmt Codec derive

* refactor: derives

* fix artifacts

* chore: clippy
2023-02-13 19:54:00 -08:00
DaniPopes f9ced12fee
refactor(abigen): solidity types expansion (#2131)
* refactor: event input expansion

* refactor: common expand params

* refactor: method params expansion

* refactor: struct fields expansion

* refactor: types array expansion

* clippy
2023-02-13 17:15:28 -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
Matthias Seitz e970f58a8a
fix(abigen): use event name from abi attribute (#2144)
* fix(abigen): use event name from abi attribute

* rustfmt
2023-02-13 17:11:13 -08:00
Yiannis M 3141bebd78
abigen: Add human readable ABI example in documentation (#2148) 2023-02-13 17:09:25 -08:00
DaniPopes fefaf7433f
fix(contract): report all errors during parsing (#2149)
* refactor: use Result<_, Error>

* fix: report both errors during parsing
2023-02-13 17:08:46 -08:00
Paul Lange bfe3ba9d5f
contracts: allow upper case acronyms lint (#2128) 2023-02-10 11:52:55 -08:00
Jacob Turner b08c1e29b8
[fix]: Use pascal casing for type names in structs generated by abigen (#2130)
* [fix]: Use pascal casing for type names in structs generated by abigen

* [fix]: Revert the downversioning changes
2023-02-10 11:50:09 -08:00
georgewhewell c0fd8326f0
chore(clippy): fix bare urls in abigen (#2133) 2023-02-10 11:49:27 -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
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 fd02bbc418
refactor(abigen): inline docs (#2090)
* refactor: abigen docs

* chore: doc

* refactor: final doc

* mergings

* fix: unremove Default
2023-01-30 21:28:57 -08:00
DaniPopes 93e1850646
refactor/feat(abigen,types): add bytes::Bytes static methods, refactor struct declaration (#2089)
* refactor: final struct expansion

* feat(types): implement bytes::Bytes static methods

* feat: use static Bytes for bytecode

* chore: add rustfmt skip directive

* clippy
2023-01-30 12:12:35 -08:00
Matthias Seitz 60e1779626
fix: add cfg to IntoFuture preventing Send (#2086) 2023-01-30 12:06:34 -08:00
wigy 7da559bbed
fix(provider): Add Send bound to return type of JsonRpcClient::request (#2072) 2023-01-27 16:57:08 -05: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
Matthias Seitz d3ad5478ae
feat(abi): add helper functions to access solidity types (#2081) 2023-01-27 13:12:32 -05:00
Matthias Seitz 8ecd566930
fix: add missing pub for tuple structs (#2080) 2023-01-27 13:07:27 -05:00
WillQ c60990d7b6
remove EthAbiType derive generated unwrap (#2056)
* remove EthAbiType derive generated unwrap

* use simply expect
2023-01-17 11:15:59 -08:00
Georgios Konstantopoulos f2099a8eaa
chore: fix clippy (#2059) 2023-01-16 18:11:27 -08:00
Georgios Konstantopoulos 10b18e0d58 chore: do not expose util module 2023-01-13 11:10:31 -08:00
Georgios Konstantopoulos 219004efcb fix(abigen): add back mod util 2023-01-13 11:09:13 -08:00
DaniPopes c2d7b8321f
refactor(abigen): source (#2016)
* rm parse_address

* refactor: sources

* add comments, support <chain>:<address>

* fix doc

* chore: clippy

* fmt

* fix

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-01-13 10:59:44 -08:00
DaniPopes d1e934791d
refactor(abigen): Abigen, ContractBindings (#2019)
* use format_ident

* lib.rs

* refactor: ContractBindings

* refactor: from_file

* add write_fmt

* mv

* error msg

* revert mod docs
2023-01-13 10:23:59 -08:00
DaniPopes 5edcd3765c
feat(contract): use u64 and add more chains to multicall (#2042)
* feat: add new chains and use u64

* chore: manually implement Clone and Debug to avoid trait bounds.

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-01-13 10:18:55 -08:00
Nick 9e559aefeb
fix(abigen): ensure correct ABI in `From` impl (#2036)
* fix(abigen): ensure correct ABI in `From` impl

`new` creates a `Contract` with the correct ABI, but the `From` impl
simply wraps the source `Contract`, which could have a completely
different ABI. In effect this was an unsafe cast, and indeed was
observed to trigger a "method not found (this should never happen)"
panic for subsequent method lookups. Implementing `From` in terms of
`new` fixes this, at the cost of an extra `Arc::clone()` (which I can't
see how to eliminate without piercing the `ethers::contract::Contract`
public API).

* Remove unnecessary `async` from test

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

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
2023-01-13 10:18:17 -08:00
DaniPopes 79f27e2366
docs(abigen): rename `event_derives` to `derives` (#2018)
* chore: rename event_derives to derives

Misleading name, `event_derives` implies that only Solidity events'
structs would apply, while this is not true

* last derive

* mv

* docs

* docs

* last doc
2023-01-13 10:17:32 -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 0187bedd11
feat(abigen): use prettyplease (#2027) 2023-01-09 07:17:22 +02:00
DaniPopes 96f4723c13
fix(abigen): tests (#2015)
* fix: methods tests

* fix: remaining paths in tests
2023-01-06 11:30:34 +02:00
DaniPopes 24b9ae2404
fix(contract): doctests (#2007) 2023-01-04 13:29:10 +02:00