Commit Graph

13 Commits

Author SHA1 Message Date
Georgios Konstantopoulos bf1d1e098f
fix: replace FilterStream with concrete type (#69)
* fix: replace FilterStream with concrete type

* fix: use PinBoxFut type alias

* ci: fix CI error with ledger
2020-09-23 11:04:54 +03:00
Georgios Konstantopoulos a3fa77744e
fix(BREAKING): return Option for txs/receipts/blocks (#64)
* 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
2020-09-17 14:06:56 +03:00
Georgios Konstantopoulos cff6eb45a5
fix: make multicall work by reference (#58)
* fix: make multicall work by reference

* chore: update readme with solc / ganache requirements

* chore: cargo fmt

* chore: fix doctests

* fix: disable sparkpool gasnow test
2020-08-21 15:54:23 +03:00
Rohit Narurkar 237f011259
(feat) gas oracle support (#56)
* (feat) gas oracle support

* (refactor) make a separate module | fix clippy warning

* add gas oracle to client using dynamic dispatch

* fix doc build in multicall module

* gas oracle returns U256

* support gas price fetching from client

* avoid querying for unsupported gas categories

* changes based on PR review

* add support for gasnow API, refactor gwei to wei
2020-08-18 21:47:56 +03:00
Rohit Narurkar 516b431a48
add support for gas estimate and calldata from ContractCall (#53)
* add support for gas estimate and calldata from ContractCall

* fix celo tests for get_block and get_tx
2020-08-12 11:35:33 +03:00
Georgios Konstantopoulos 1cbd86dbd3
fix(block): add Randomness when using celo (#44)
* fix(block): add Randomness when using celo

Also do not compile the fields which were removed in https://github.com/celo-org/celo-blockchain/pull/913/

* test(block): add celo block test
2020-07-02 16:05:27 +03:00
Georgios Konstantopoulos bb1ac9c666
Improve Ganache Flexibility (#37)
* feat(core): add more features to ganache

* test(provider): choose endpoint dynamically

* test(signer): choose endpoint and accounts dynamically

* test(contract): choose endpoint and accounts dynamically

* fix: dynamic port / accounts in examples

* core(chore): fix doctest
2020-06-22 16:42:34 +03:00
Georgios Konstantopoulos 1cfbc7b3c3
Replace contract client references with Arc (#35)
* 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.
2020-06-22 11:44:08 +03:00
Georgios Konstantopoulos 9a0c97286b
feat(provider): introduce a pending tx polling delay so that we do not spam the chain (#31) 2020-06-21 11:09:19 +03:00
Georgios Konstantopoulos 0cfeadadf4
Websockets + TLS for Async-Std / Tokio (#30)
* fix: relax trait bounds on JsonRpcClient

* refactor(provider): move http client to separate dir

* feat(provider): add initial Websocket support over Stream/Sink + Tungstenite

* test(provider): add websocket test

* feat(provider): add convenience method using tokio/async-std behind a feature flag

* test(provider): add websocket ssl test

* feat(provider): add TLS websockets for tokio/async-std

* docs(provider): add websocket docs / examples

* fix(provider): make tokio an optional dep
2020-06-21 10:17:11 +03:00
Georgios Konstantopoulos 4fd656bce1
Provider Fixes on filters and gas estimation (#23)
* fix(provider): do not pass a param to estimate_gas

* fix(provider): pass correct number of args to new_filter

* test(signer): add test to ensure that the Pending block number works

* docs: fix links
2020-06-17 16:09:41 +03:00
Georgios Konstantopoulos ba5ae5a894
Add Celo support (#8)
* 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
2020-06-17 12:22:01 +03:00
Georgios Konstantopoulos 20493e0190
Fix Pending Transactions and EIP-155 (#22)
* fix(provider): ensure the Pending transaction calls the waker to get polled again

* feat(core): allow setting the blocktime in ganache

* test(provider): move pending txs test to integration tests + use block time

* fix(signers): make EIP-155 optional and fix sighash generation bug
2020-06-17 11:02:03 +03:00