* feat: fee estimation with custom/default fn
* fix: clippy and percentage calc fix
* calculate priority fee only if base fee above threshold
* chore: some comments
* fix: use legacy tx for ganache
* test: test a few cases for fee estimation using utils
* add raw abi model
* feat: simplify struct representation
* feat: add struct generation
* use structs as function input
* fix: failing test
* add example
* rustfmt
* feat: support multiple addresses in filters
To support filtering of 1..n addresses we had to add the ValueOrArray
enum to the log types and refactor some ethers-contract code
Fixes: #240
Signed-off-by: Sebastian Martinez <sebastinez@me.com>
* chore: fmt
* fix: use legacy tx in unit test due to Ganache
Co-authored-by: Sebastian Martinez <sebastinez@me.com>
* feat(contract): use eip-1559 txs by default
This may break any tests which use Ganache, since it only supports legacy transactions.
We should replace Ganache with hardhat where possible
* fix(providers): always try setting default_sender
* chore: make all test transactions legacy
* feat(multicall): allow submitting legacy txs
* chore: default to legacy txs via feature flag
This is useful for chains like Celo that do not support the Typed Envelope
* fix: use legacy txs in ds proxy deployment / tests
* chore: fix review comments
* chore: update deps (#352)
* chore(deps): bump elliptic-curve from 0.10.4 to 0.10.5
Bumps [elliptic-curve](https://github.com/RustCrypto/traits) from 0.10.4 to 0.10.5.
- [Release notes](https://github.com/RustCrypto/traits/releases)
- [Commits](https://github.com/RustCrypto/traits/compare/elliptic-curve-v0.10.4...elliptic-curve-v0.10.5)
---
updated-dependencies:
- dependency-name: elliptic-curve
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
* chore: bump deps
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix(core): make chain id mandatory
* fix(signers): make chain id mandatory
* test: make chain id mandatory
* test: add missing chain id
* fix: add missing chain id
* chore(wallet): set chain_id by default to 1
* ci: run CI on master
* fix(yubi): add missing chain id
* chore: skip ganache test with celo features
* ci: run only on push to master
* fix: add missing chain id
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add support for EIP-234
* Add support for EIP-1898
* Remove redundant field names
* Remove useless conversion
* Change `unwrap_or` to `unwrap_or_else`
* fix: make EthEvent name method a trait method
* refactor: make expand methods members of Context
* fix: make AbiParser parsing non consumeable
* feat: add struct expanding
* feat: use derive(EthEvent) in abigen workflow
* test: check EthEvent in abigen macro
* test: make test compile again
* refactor: simplify and optimize abi parsing from single str
* test: add human readable abigen tests
* feat(providers): tokio 1.0
BREAKING: This removes async-std as a compatibility option
* feat: tokio 1.0 in rest of crates
* fix: patch Cargo.toml until deps are released
* fix(contract): load ws deps
* feat: bytes 1.0 (#121)
* feat(core): move to bytes::Bytes
* feat: adjust rest of crates to Bytes
* chore: bump deps
CI fails due to:
https://github.com/snapview/tokio-tungstenite/pull/142#discussion_r550445144
* chore: use latest tokio-tungstenite
* ci: split tests into jobs (#129)
* Switch to `hex` (#128)
* fix(core): replace rustc_hex with hex
* fix(providers): replace rustc_hex with hex
* chore: replace rustc-hex with hex
* chore: cargo fmt
* fix(ledger): copy address from string correctly
* chore: fix flaky tests
Fixes#105
* feat(providers): return a PendingTransaction from send_tx calls
* feat(providers): expose the internal provider to all middlewares
* fix(middleware): use the returned PendingTx instead of using a hash
* fix(contract): use the pending tx returned value
Note1: To support that, we need to clone the tx when sending in order to make lifetimes work out
Note2: Multicall does not support that feature
* fix(ethers): adjust examples
* chore: fix provider test
* chore: fix celo test
BREAKING CHANGE
* fix(block): fix block decoding from ws
* feat(pubsub): add pubsub traits and sub stream
Also use DeserializeOwned alias
* feat(transports): add notification type
* feat(ws): rewrite Ws for subscription support
* feat(provider): add eth_subscribe
* fix(celo): disable some celo tests due to ganache incompatibilities
* test(rinkeby): fix flaky test
* feat(contract): WS subscription bindings (#101)
* feat(middleware): add subscriptions to middleware methods
* feat(contract): add subscribe method to contracts
* refactor: extract minimal features of Contract into BaseContract
* refactor: move BaseContract to own file
* chore: ensure celo test passes
* chore: fix clippy
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* fix(signers): make Signer send by blocking on Ledger calls
* fix(providers): use Arc in WS impl to allow cloning
* feat(middleware): add geometric gas price escalator
* test(middleware): ensure that we can still stack everything up
* fix(middleware): default to tokio/async-std
* chore: fix clippy
* docs(middleware): add docs and rename middlewares
* chore: fix doctests
* feat: add linear gas escalator
https://github.com/makerdao/pymaker/blob/master/tests/test_gas.py\#L107https://github.com/makerdao/pymaker/blob/master/pymaker/gas.py\#L129
* feat: add constructors to gas escalators
* fix(BREAKING): return Option for txs/receipts/blocks
Otherwise if a user asks for a transaction hash or block that does not exist yet they'll get an Error
* test: ensure that unmined txs return None receipts
* test: fix remaining tests
* chore: re-enable sparkpool gas oracle
* chore: fix celo tests
* fix: run the non-existing data against infura
* fix: fix etherscan gas oracle tests
* Implement Multicall functionality for batched calls
* Documentation, some modifications as suggested in the review
* (Abigen) handle single input arg and set output irrespective of mutability
* implement send functionality and allow clearing calls
* Fix detokenization, dont require pre-processing anymore
* panic when more than supported number of calls are pushed
* add doc for panics in case of add_call
* (multicall) eth_balance support, update bindings
* refactor: move multicall to its own directory
* fix: add infura api key
* ci: ensure CI runs on PRs from forks
* test(multicall): re-use aggregate call
* contract: make multicall docs compile and remove redundant clones
* ci: add public etherscan API key so that forks don't get rate limited
* chore: adjust test contract naming
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* test(tokens): ensure nested tuples tokenize properly
* test(contract): add failing test with 2 args
This happens because the args are serialized as Token::Tuple, while instead they should be just a vector
* fix(tokens): add token flattening method to fix non-nested tuples
* fix: do not export the flatten function
* feat(provider): allow specifying a default polling interval param
This parameter is going to be used for all subsequent client calls by default. It can still be overriden with the internal
`interval` calls
* feat(contract): replace reference to Client with Arc
* feat(abigen): adjusts codegen to use Arcs
* fix(ethers): adjust examples to new apis
* fix(provider): return TxHash instead of PendingTransaction on tx submission
Returning a PendingTransaction allowed us to have nice ethers.js-like syntax where you submit
a transaction and then can immediately await it. Unfortunately, now that we use Arcs and not lifetimes
this meant that we would need to bind the function call in a variable, and then await on it, which is pretty
bad UX.
To fix this, we revert back to returning a TxHash and introduce a convenience method on the provider and the
contract which takes a tx_hash and returns a PendingTransaction object. The syntax ends up being slightly
more verbose (although more explicit), but the issue is fixed.
* feat(types): add optional Celo support
* feat: add Celo feature flags to all crates
* test(provider): add get_transaction celo test
* test(signer): add send_transaction celo test
* test(contract): add deploy and call contract function celo test
* feat(provider): implement Streamed logs
This utilizes eth_getFilterChanges. The stream struct must be instantiated with a factory that yields logs/hashes.
Consumers are expected to use the `FilterStream` trait in order to simplify their type definitions
* feat(provider): expose streaming methods
* test(provider): add new blocks/pending txs test
* feat(contract): allow events to be streamed
* test(contract): add integration test for streaming event logs
* perf(contract-factory): take abi and bytecode by value instead of reference
The abi, bytecode and the factory's deploy method now consume the structs instead of being passed by reference. While this means that
consumers might need to clone before using them, this gives us some more flexiblity around factories inside helper functions
* refactor(contract): use test helpers to reduce code dup
* chore: make clippy happy