ethers-rs/ethers-contract/ethers-contract-abigen/src
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
..
contract fix(abigen): tests (#2015) 2023-01-06 11:30:34 +02:00
test refactor: pull crates to root dir 2020-06-01 21:24:22 +03:00
contract.rs fix(abigen): ensure correct ABI in `From` impl (#2036) 2023-01-13 10:18:17 -08:00
filter.rs fix: rustdoc errors (#1808) 2022-11-07 15:43:23 -08:00
lib.rs docs(abigen): rename `event_derives` to `derives` (#2018) 2023-01-13 10:17:32 -08:00
multi.rs feat(abigen): use prettyplease (#2027) 2023-01-09 07:17:22 +02:00
source.rs feat: adds bscscan as abi source (#1955) 2022-12-19 17:54:24 +02:00
util.rs chore: clippy (#1812) 2022-11-07 15:43:11 -08:00