forked from f-o-a-m/hs-web3
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pull upstream #1
Open
charlescrain
wants to merge
239
commits into
charlescrain:master
Choose a base branch
from
airalab:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These cause errors of the form Illegal data constructor name: ‘_fooData’ When splicing a TH declaration:
* Network.Ethereum.ABI -> Data.Solidity * Network.Ethereum.Web3 -> Network.Ethereum.Api * Added package.yaml instead web3.cabal * Introduced HexString datatype * Cleanup API types from Solidity-like types * Export from/to hexstring in Address module * Bump stackage version
* Added IsString instance for HexString * Fixed module names in unit tests
* Added solidity prim types instances import into TH generator * Fixed Show instance for Address type
* Added instance for default account * Added instance for 'personal' accounts * Added function for sending transaction with confirmations * Removed 'convert' function from Unit typeclass as useless
* Added transaction gas estimation before sending * Added 'new' function for creating contracts * Added 'Network.Ethereum.Chain' module that collects chain ids
Not all primitive types have `Generic` instance (`Bytes` for example). For this reason in some cases (indexed bytes) event cannot be decoded. But all primitive types have `AbiGet` instance and for TH generated types instance created via default generic based implementation.
* Using 'secp256k1-haskell' instead of deprecated * Fix bound of all dependencies according to LTS-9 -> LTS-12
* Add MonadFail import * Add MonadFail import * Add monadFil import
* Return `Maybe Block` from `getBlockBy*` methods Problem: Infura docs¹ say that `getBlockByNumber` and its friend return "A block object, or null when no block was found". `getBlockByHash` and `getBlockByNumber` do not account for that and throw `ParsingException` with auto-generated message when null is received. That's quite inconvenient to handle because you need to depend on this auto-generated message. Solution: return `Maybe Block` instead of just `Block`. `instance FromJSON (Maybe a)` is defined in such a way that null is parsed as `Nothing` and everything else is parsed using `a` parser, which is exactly what we want. Note that `getTransactionByHash` for example already returns `Maybe Transaction` and was inconsistent with `getBlockByHash`. ¹ https://infura.io/docs/ethereum/json-rpc/eth-getBlockByHash * Rename blockReceiptsRoot Problem: in Infura docs¹ there is a field called `receiptsRoot`, but in code it's called `blockReceiptRoot`, so apparently it's always parsed as `Nothing` because parser is auto-generated from the field name. Solution: rename the field. ¹ https://infura.io/docs/ethereum/json-rpc/eth-getBlockByHash * Add methods to download blocks without tx bodies Problem: `eth_getBlockByHash` accepts a boolean argument that determines whether full transaction objects will be included in the response or only transaction hashes. The existing API hardcodes this argument to True, but sometimes passing False is desired (at least for performance reasons). Solution: 1. Generalize `Block` to have a type parameter. Alternatively we could define another type very similar to the existing `Block`, but it would be some duplication of code. 2. Add `getBlockByHashLite` and `getBlockByNumberLite` methods that pass False and return `BlockT HexString`.
* Bump upper bound for `random` Changelog: https://hackage.haskell.org/package/random-1.2.1/changelog * Bump upper bound for `cryptonite` Changelog: https://hackage.haskell.org/package/cryptonite-0.29/changelog
* Added .cabal files to repo See: https://docs.haskellstack.org/en/stable/stack_yaml_vs_cabal_package_file/#should-i-check-in-generated-cabal-files commercialhaskell/stack#5210 * Fix haddock build
* Add support for Solidity error declarations. * Throw an error when the type of a tuple is neither "tuple" not "tuple[]" Co-authored-by: Stephen Blackheath <[email protected]>
* Implement transaction timeouts. * Remove the redundant getTimeout. * Make send return an Either instead of throwing TransactionTimeout. * Fix a name shadowing.
* Relax upper bounds for GHC9 compatibility * Update Tuple.hs * fix up a bit * remove cabals
* Add ToJSON instances for IntN and UIntN * Add ToJSON instances to generated data types
* Fix ABI encoding for fixed length lists The ABI encoding for fixed length Solidity lists `T[k]` was wrong in the case that `T` is dynamic. If T is dynamic, then according to the [spec](https://docs.soliditylang.org/en/v0.5.3/abi-spec.html#formal-specification-of-the-encoding), > The following types are called “dynamic”: > `T[k]` for any dynamic `T` and any `k >= 0` This PR ensures this is the case and handles encoding for dynamic `T` similar to how it is handled in the variable length array case for `T[]` which was fixed in #126. * unneccessary fromInteger
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.