* feat(providers): load previous logs before subscribing
Load previous logs and stream it back to the user before establishing
a new stream for streaming future logs.
Closes#988
* docs: add subscribe_logs example
* fix clippy errors
* refactor: use VecDeque and address review
* Adds From<H160> trait to ValueOrArray<H160>
The trait From<H160> for ValueOrArray<H160> was not implemented which
prevented compilation when using
pub fn address<T: Into<ValueOrArray<Address>>>(self, address: T)
for ethers_core::types::Filter.
Fixes: #1199
* update CHANGELOG.md
* Adds From<Vec<H160>> trait to ValueOrArray<H160> and documentation
The trait From<Vec<H160>> for ValueOrArray<H160> was not implemented which
prevented compilation when passing a Vec<H160> into
pub fn address<T: Into<ValueOrArray<Address>>>(self, address: T)
for ethers_core::types::Filter.
This commit also includes documentation on how to use fn address for
ethers_core::types::Filter.
Fixes: #1199
* fix(core): add eip1559 prefix for sighash
- add a test which properly tests the `from` address decoding, which
was incorrect due to the tx type not being hashed before recovery
* fix(core): decode from for EIP2930 transactions
- add test which checks signed decoding for an EIP2930 transaction
* ignore decoding tests for celo
* remove type constant and use typed sighash
* update CHANGELOG
The optional access list on `Transaction` was being incorrectly encoded
as an empty string (0x80) when omitted, when it should be encoded as an
empty list (0xc0).
Fixes#1134.
* feat(middleware): fetch chainid from middleware
Require SignerMiddleware to fetch the inner middleware's to set for the
signer. SignerMiddleware now requires an instantiated middleware with
an accessible get_chainid method.
* ci: update ganache
newer ganache version is needed to specify the ganache provider chain id
in tests
* set SignerMiddleware constructor return to result
* create new method for pulling chainid
* add consistent chainid CHANGELOG entry
* remove awaits
* switch test_derive_eip712 to use consistent signer
* remove gas estimation equality assert in deploy_and_call_contract -
updated version of ganache no longer returns the same value for gas
estimation and gas_used
* revert with_signer to non-async non-result
* cargo fmt
* expand SignerMiddleware::new comment
* remove doc indent
* doc(core/Signature): methods are all using normalized v, dont need to be 0 or 1 only
* feat(core/Transaction): make from optional, add method to recover from
* fix recovery
* add recover_from_mut
* update changelog
* fix(providers): Propogate gas price with access list
* Update CHANGELOG.md
* Fix clippy lint
* Clarify fill_transaction comments
* Fill tx gas price before gas limit
Updates Provider::fill_transaction() to fill the gas price of a
transaction before filling the gas limit. There are cases where the gas
used by a transaction may be dependent on the gas price. For example,
the following contract bytecode branches based on the result of the GASPRICE
opcode:
GASPRICE PUSH1 0xff GT PUSH1 {label} JUMPI
* Cleanup
* Propogate eth_estimateGas failure
* 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>
* feat: add getter to `ProjectCompileOutput`
Add a function `compiled_contracts_by_compiler_version`
to the `ProjectCompileOutput` that returns a `BTreeMap`
that maps the compiler version to a vector of the contract
names and contract structs.
* changelog: update
* chore(solc): remove &mut
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* feat(ethers-contract): add `send_with_receipt` to `Deployer`
The `Deployer` is used to deploy contracts and its `send`
function returns an attached instance of a `Contract`.
There is no way to know the transaction hash of the
deployment transaction, so this commit adds another
method `send_with_receipt` that returns an attached
`Contract` as well as a `TransactionReceipt`.
* changelog: update
* tests: call `send_with_receipt` in tests
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* Public function added "initialize_nonce"
Initialize the nonce manager with the current nonce
* Update CHANGELOG.md
* return generic
* Added current nonce as return value
Will now compile.
* Load nonce to return, fixes compile.
* chore: fmt
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
The U256 priority fees were being coerced into u32, which was not big
enough for actual values. The overflow was happening but not checked.
This led to a possible divide-by-zero panic in this code as well.
This change does the math as I256 -- overkill, but it works.
* Added basic and bearer authentication for http and websocket transport
* Improved api for websocket `connect_with_auth`
* Bugfix in doc
* Moved use statement into non-wasm imports
* Adapted changelog
* Fixed doc test
* Added constructors for Authorization
* Improved code quality and implemented feedback
* Made bas64 crate for basic auth encoding non-optional
* Added `Display` for `Authorization` instead of `into_auth_string`