Commit Graph

72 Commits

Author SHA1 Message Date
Georgios Konstantopoulos 1cb2fe0247
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>
2021-07-27 23:55:55 +03:00
Matthias Seitz 985509ac1c
feat: support additional ganache arguments (#347)
* feat: support additional ganache arguments

* feat: add fork argument option
2021-07-25 17:37:38 +03:00
Matthias Seitz ed83223b93
cargo clippy --fix (#346) 2021-07-24 21:53:40 +03:00
Jonathan LEI 4afa1c9517
Add util functions for bytes32 string encoding/decoding (#337) 2021-07-12 11:20:38 +03:00
Zaki Manian 371b7d1576
Update crypto deps for ethers (#333)
* Update crypto deps for ethers

* Update version 0.4.0

* Missed a version

* Fix internal version dependencies

* chore: use published eth-keystore-rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-07-07 20:18:14 +03:00
Georgios Konstantopoulos 0453ea84df
chore: fix lints (#329) 2021-07-05 14:03:38 +03:00
Matthias Seitz 1dda336a78
feat: add filter utility function (#316)
* feat: add filter utility function

* chore: typo

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* chore: typo

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-06-13 20:39:36 +03:00
guanqun 01cc80769c
feat: make I256::from_raw() as const (#305)
* feat: make I256::from_raw() as const

* misc: fix 'cargo fmt' issue
2021-06-01 17:36:02 +03:00
Matthias Seitz 4690f8effc
feat: support parsing solc contract abi output in string and array form (#301) 2021-05-28 10:46:44 +03:00
guanqun 28c5c4febd
docs: typo fix (#292) 2021-05-13 13:51:43 +03:00
Gabriel Coutinho de Paula 6ec8312b8c
Expose `LogMeta` type and add more fields, and expose FilterBlockOption (#294)
* Expose `LogMeta` and add more fields

* Add tests for `query_with_meta`

* Expose `FilterBlockOption`

* Run rustfmt
2021-05-13 13:51:27 +03:00
James Prestwich b014ac9f27
feature: Signature derives Copy trait (#288)
* feature: Signature derives Copy trait

* drive-by: set Celo chain ID in tests
2021-05-09 12:47:21 +03:00
Austin Abell 42b10cca9a
feat: implement IPC transport support (#260)
* Initial IPC setup

* Cleanup

* Oops

* change futures dependency reference

* Document, add prints, cleanup

* Fix logic

* Make result type consistent with crate

* Setup geth ipc config and tests

* Cleanup subscription test

* Switch hash function to siphash

* Update dep usage for ordering

* Use tempfile for better cleanup (and OS support)

* Replace prints with tracing logs

* Ignore test with Celo feat

* chore: remove debug logs and use default geth ipc path

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-04-08 09:52:31 +03:00
Rohit Narurkar 79862ffda5
feat: mnemonic phrase support for wallet (#256)
* feat: mnemonic phrase support for wallet

* refactor: better error handling and clippy linting

* fix: derive from path and tests

* chore: renamed package coins-bip39

* refactor: convenient builder API to setup mnemonic wallet

* refactor: re-export coins-bip39 for convenience

* clippy: fix warnings for multiple complex types in provider

* feat: randomly generated mnemonic phrase can be written to storage
2021-04-05 10:44:58 +03:00
Georgios Konstantopoulos 5eb31ceae9
chore: use latest ethabi (#253)
* chore: use latest ethabi

* chore: use re-exported ethereum types
2021-04-01 20:02:34 +03:00
Georgios Konstantopoulos 5dbed7cbd2
chore: use upstream ethabi (#248)
* chore: use upstream ethabi

* chore: make clippy happy
2021-03-31 11:20:08 +03:00
Matthias Seitz 109337f138
feat: add async setup utility functions (#241)
* feat: add async compile and launch functions

* chore: update examples with new setup functions

* chore: disable setup for wasm32
2021-03-22 13:09:12 +02:00
Matthias Seitz c525c71d96
style: remove token instead cloning them (#236) 2021-03-18 07:31:49 +02:00
Gabriel Coutinho de Paula 530bfe2b71
feat: add support for EIP-234 and EIP-1898 (#231)
* Add support for EIP-234

* Add support for EIP-1898

* Remove redundant field names

* Remove useless conversion

* Change `unwrap_or` to `unwrap_or_else`
2021-03-16 21:46:07 +02:00
Matthias Seitz 57010c1c60
feat(abigen): include ethevent proc macro in abigen code gen workflow (#232)
* 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
2021-03-16 21:37:19 +02:00
Matthias Seitz 7b10b76e20
feat: add EthEvent proc macro derive support (#227)
* refactor: extract error module and use error macros

* feat: add solidity struct parser

* refactor: add AbiParse and support struct parsing

* test: add more struct parsing tests

* feat: add EthAbiType proc macro derive for deriving Tokenizable trait

* test: add EthAbiType derive tests

* refactor: extract tokenizeable implementation in separate method

* chore(test): use EthAbiType derive instead implementing Detokenizeable

* feat: introduce EthEvent trait

* feat: add EthEvent proc macro derive support

* test: add proc macro derive tests

* chore: rustfmt

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-03-15 13:59:52 +02:00
Matthias Seitz cf8e2391c8
feat: add struct parsing support for human readable ABI (#226)
* refactor: extract error module and use error macros

* feat: add solidity struct parser

* refactor: add AbiParse and support struct parsing

* test: add more struct parsing tests
2021-03-15 13:49:28 +02:00
Matthias Seitz f599ae66f4
refactor: make human readable abi parsing more robust (#225)
* refactor: event parser

* refactor: function parser

* refactor: add constructor parser

* refactor: replace parsers

* style: extract event arg parsing into separate method

* fix: add missing returns statement

* chore(clippy): make clippy happy

* fix: support unnamed event argument parsing
2021-03-12 16:57:46 +02:00
Rohit Narurkar 4c8d3c81e7
Feat/is middleware signer (#182)
* feat: signature from_str can handle 0x-prefixed strings

* feat: add is_signer method to the middleware trait

* fix: eth_sign Signature deserialisation

* chore: refactor for cleaner decoding of Signature
2021-01-28 08:51:53 +02:00
James Prestwich 1048652a8c
doc: note EIP-658 in TransactionReceipt (#178) 2021-01-23 10:38:21 +02:00
Rohit Narurkar 3105431007
feat: Transformer middleware with DsProxy impl (#165)
* feat: basic structure of proxy wallet middleware with DsProxy

* feat: build DsProxy contract, minor fixes, naming convention changes

* fix: add provider error in contract error

* fix: left pad storage value

* fix: delete gnosis safe for now

* feat(ds_proxy): execute code or target

* test(ds_proxy): transformer middleware tests

* fix: clippy should be happy

* fix(tests): ds proxy execute code

* chore: add documentation

* chore: formatting
2021-01-22 11:25:22 +02:00
Georgios Konstantopoulos 1b12fd8aff
I256 implementation (#175)
* Resolve: add I256 implementation

* Resolve: add I256 implementation - Untracked files

* fix: make i256 tests work

Co-authored-by: 1saf <me@ansaf.net>
2021-01-19 14:21:46 +02:00
Georgios Konstantopoulos 0b9375688e
fix: switch between units correctly (#170) 2021-01-17 14:10:30 +02:00
Rohit Narurkar b1461cc48d
Support for encrypted JSON keystore (#138)
* feat: add support for encrypted json keystores

* fix: ignore gitkeep file from keystore tests

* feat: use tempfile crate for temporary test dir/files
2021-01-11 11:39:14 +02:00
Georgios Konstantopoulos 29a3a16085
chore: upgrade to latest ethtypes (#137)
* chore: upgrade to latest ethtypes

* chore: fix doctests
2021-01-10 14:03:37 +02:00
Georgios Konstantopoulos 5c1f8f532a
Upgrade to Tokio 1.0 and remove async-std (#120)
* 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
2020-12-31 19:19:14 +02:00
Georgios Konstantopoulos dc4c2a807e
feat(providers): add tracing (#113)
* feat(provider): add async tracing

* feat(middleware): add tracing to gas escalator

* chore: make clippy happy
2020-12-24 22:23:05 +02:00
Georgios Konstantopoulos e9204ac72d chore: remove dead code 2020-12-24 17:47:32 +02:00
Georgios Konstantopoulos ca1283b23a docs: fix broken links 2020-12-24 17:44:26 +02:00
Georgios Konstantopoulos b0bfd550fb
fix: reschedule waker if receipt is immediately available (#103)
* fix: reschedule waker if receipt is immediately available

* chore: update minor deps

`cargo update`

* chore: make clippy happy
2020-12-16 14:05:16 +02:00
Georgios Konstantopoulos 1ece5d2020
Contract & Provider eth_subscribe support (#100)
* 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
2020-11-30 11:33:06 +02:00
Georgios Konstantopoulos 84aafbbd1f
Misc Fixes (#97)
* fix: use generic instead of impl Trait

* fix: do not skip first 4 bytes when decoding outputs
2020-11-12 12:08:20 +02:00
Georgios Konstantopoulos c30f45fc72
feat: port over tracing from rust-web3 (#93) 2020-10-31 12:44:08 +02:00
Rohit Narurkar d67efc9190
fix: default param name if not found following memory/calldata (#91) 2020-10-30 12:15:34 +02:00
Georgios Konstantopoulos eb26915081
feat: allow encoding/decoding function data (#90)
* feat: allow encoding/decoding function data

* feat: allow decoding event data

* feat: human readable abi

inspired from https://blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917

* test: add event / fn decoding tests

* chore: fix clippy

* feat(abigen): allow providing args in human readable format
2020-10-29 09:48:24 +02:00
Georgios Konstantopoulos a22f1f9aa0
Geth TxPool API Support (#86)
* feat: support for txpool API

* feat: add a geth spawner test helper

* fix(txpool): use TxRequest instead of new data struct

The `raw` field is no longer present in latest geth's response.

* fix(txpool): use proper api response format

ref: https://github.com/ethereum/go-ethereum/pull/21720

Also add a Geth test

* ci: install geth 1.9.23

Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
2020-10-24 11:13:13 +03:00
Georgios Konstantopoulos 938972e9cc
Address checksum (#85)
* feat: addr checksum encoding

* fix: replace format! with encode to hex

* chore: Fix celo tests

* perf(checksum): convert loop to iterator

Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
2020-10-18 13:22:10 +03:00
Georgios Konstantopoulos ac93c0bc65
fix: update signature error 2020-10-14 14:59:31 +03:00
Georgios Konstantopoulos aa37f74c4b
feat: generalize wallet/private key + yubihsm2 (#75)
* feat: generalize wallet/private key

* fix: adjust celo tests

* YubiHSM2 Support (#76)

* feat: support YubiHSM2
2020-10-02 11:41:16 +03:00
Georgios Konstantopoulos c65497543e
feat: convert signing to k256 (#72)
* feat: convert signing to k256

* fix: pass pre-hashed message to sig verification

* feat: wrap the hash to a Digest implementation

* refactor: cleanup and move digest impl to separate file

* chore: adjust abigen tests due to rust update

* test: add byte equality test between ethers-rs / web3.js signatures

* fix(keys): use 512 blocks for sha256

Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
Co-authored-by: Alex Vlasov <alex.m.vlasov@gmail.com>
2020-10-01 11:02:21 +03:00
Georgios Konstantopoulos 2d51c523ba
feature: Middleware Architecture (#65)
* feat: convert Provider to Middleware trait

* feat: move gas oracle to middleware crate

* feat: move signer to middleware crate

* feat: add nonce manager middleware and test stacking

* refactor: convert generic middleware jsonrpc type to associated type

* feat: move ethers-contract to middleware arch

* test(provider): make tests pass

* test(middleware): move middleware tests from signer

* test: fix ethers examples

* fix(contract): make tests compile

* chore: fix clippy

* feat: deduplicate trait delegation

* refactor(signer): deduplicate tx signing logic across signers

* fix doctests

* fix: examples, celo tests and ci
2020-09-25 00:33:09 +03:00
Georgios Konstantopoulos 95fcbe5240
feat: ledger support (#66)
* feat: ledger support

Adds support for Ledger Nano S Eth app (v1.3.7)

- sign message
- sign transaction
- get addresses
- get app version

* fix: fix eth docstring

* fix: take into account EIP155

* feat: convert Signer to async

* feat: implement Signer for Ledger

* ci: run celo-only tests explicitly

This is done to avoid using --all-features

* fix: remove async from with_signer

* chore: fix doctests

* fix: add Send/Sync to SignerError

* ci: update etherscan key

* test: disable etherscan abigen tests temporarily
2020-09-20 18:17:02 +03:00
Georgios Konstantopoulos 6197d8bb12
fix(core): serialize filters properly and always rewake (#61)
* fix: serialize filters properly

* test: add filter log tests

* fix(stream): always re-wake
2020-08-31 23:40:49 +03:00
Georgios Konstantopoulos d0f1752db0
feat(core/block): add epochSnarkData to the celo block (#46)
* feat(core/block): add epochSnarkData to the celo block

* test(block): add celo celo snark data test
2020-07-09 10:07:44 +03:00
Rohit Narurkar a9bb98b5a7
Implement Multicall functionality for batched calls (#43)
* 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>
2020-07-03 19:52:09 +03:00