Skip to content
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
wants to merge 239 commits into
base: master
Choose a base branch
from
Open

pull upstream #1

wants to merge 239 commits into from

Conversation

charlescrain
Copy link
Owner

No description provided.

akru and others added 30 commits May 22, 2018 17:37
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
akru and others added 30 commits August 9, 2021 07:24
* 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`.
* 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.