Closed iostat closed 1 year ago
also I'm getting some warnings on a clean build
[24/27 HiddenConstructors] src/Network/Ethereum/Web3/Types/Types.purs:1:1
v
1 module Network.Ethereum.Web3.Types.Types
2 ( BlockNumber(..)
3 , ChainCursor(..)
...
683 NullError -> writeImpl { result: _null }
684 RemoteError _remoteError -> writeImpl { _remoteError }
685 ParserError _parserError -> writeImpl { _parserError }
^
An export for Filter hides data constructors but the type declares an instance of Data.Generic.Rep.Generic.
Such instance allows to match and construct values of this type, effectively making the constructors public.
[25/27 HiddenConstructors] src/Network/Ethereum/Web3/Types/Types.purs:1:1
v
1 module Network.Ethereum.Web3.Types.Types
2 ( BlockNumber(..)
3 , ChainCursor(..)
...
683 NullError -> writeImpl { result: _null }
684 RemoteError _remoteError -> writeImpl { _remoteError }
685 ParserError _parserError -> writeImpl { _parserError }
^
An export for Filter hides data constructors but the type declares an instance of Data.Newtype.Newtype.
Such instance allows to match and construct values of this type, effectively making the constructors public.
[26/27 HiddenConstructors] src/Network/Ethereum/Web3/Types/Types.purs:1:1
v
1 module Network.Ethereum.Web3.Types.Types
2 ( BlockNumber(..)
3 , ChainCursor(..)
...
683 NullError -> writeImpl { result: _null }
684 RemoteError _remoteError -> writeImpl { _remoteError }
685 ParserError _parserError -> writeImpl { _parserError }
^
An export for FilterId hides data constructors but the type declares an instance of Data.Generic.Rep.Generic.
Such instance allows to match and construct values of this type, effectively making the constructors public.
[27/27 HiddenConstructors] src/Network/Ethereum/Web3/Types/Types.purs:1:1
v
1 module Network.Ethereum.Web3.Types.Types
2 ( BlockNumber(..)
3 , ChainCursor(..)
...
683 NullError -> writeImpl { result: _null }
684 RemoteError _remoteError -> writeImpl { _remoteError }
685 ParserError _parserError -> writeImpl { _parserError }
^
An export for Request hides data constructors but the type declares an instance of Data.Generic.Rep.Generic.
Such instance allows to match and construct values of this type, effectively making the constructors public.
NOTE: Before merging this, merge https://github.com/f-o-a-m/purescript-eth-core/pull/32 and tag it with a proper version so that packages.dhall doesn't have to refer to some arbitrary commit -- then update packages.dhall
Prior to merging this PR, there's another PR which is simply this one + the result of running purs-tidy on it. Due to the massive amount of changes introduced by code formatting, I've separated it to make reviewing this PR a bit easier -- but it should be merged into this branch first That can be found at https://github.com/f-o-a-m/purescript-web3/pull/162
This one was similarly rote to eth-core:
foreign-generic
in favor ofSimple.JSON (class ReadForeign, class WriteForeign)
Additionally, some other goodies came out of this:
TUProxy
,DLProxy
,etcProxy
)foreign-generic
just allowed us to mostlyderive newtype Read-/WriteForeign
on most types. So, now that we haveWriteForeign
impls on most Response types we might even able to use this to write a Web3 RPC server (in theory).The bad/ugly:
foreign-generic
, we can't generically encode/decodeWeb3Error
(which was used to get around the fact that exceptions in Node are basically Strings). So I had to hand-write a Read-/WriteForeign impl for Web3Error to handle theRemoteError
andParserError
cases.