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

update deps #60

Merged
merged 6 commits into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"url": "git://github.com/f-o-a-m/purescript-web3-generator.git"
},
"dependencies": {
"purescript-argonaut": "^4.0.0",
"purescript-argonaut": "^6.0.0",
"purescript-ordered-collections": "^1.0.0",
"purescript-prelude": "^4.0.0",
"purescript-errors": "^4.0.0",
Expand All @@ -27,10 +27,10 @@
"purescript-node-fs-aff": "^6.0.0",
"purescript-console": "^4.0.0",
"purescript-string-parsers": "^4.0.0",
"purescript-web3": "^1.0.0",
"purescript-web3": "^2.0.0",
"purescript-mkdirp": "joshuahhh/purescript-mkdirp#48ecb4039d5fe3be82d0e82c3a9f2338d1af82d2",
"purescript-fixed-points": "^5.0.0",
"purescript-record-extra": "^1.0.0"
"purescript-record-extra": "^3.0.0"
},
"devDependencies": {
"purescript-spec": "^3.0.0",
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
"rlp": "^2.0.0",
"secp256k1": "^3.0.1",
"psc-package": "^0.2.4-rc1",
"purescript": "^0.12.0",
"pulp": "^12.2.0",
"purescript-psa": "^0.6.0",
"yargs": "^8.0.2"
},
"devDependencies": {
"purescript-psa": "^0.7.3",
"purescript": "^0.13.0",
"pulp": "^13.0.0"
}
}
34 changes: 17 additions & 17 deletions src/Data/AbiParser.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Control.Alternative ((<|>))
import Control.Error.Util (note)
import Data.Argonaut as A
import Data.Argonaut.Core (fromObject)
import Data.Argonaut.Decode ((.?))
import Data.Argonaut.Decode ((.:))
import Data.Argonaut.Decode.Class (class DecodeJson, decodeJson)
import Data.Array (fromFoldable, null)
import Data.Bifunctor (lmap)
Expand Down Expand Up @@ -140,7 +140,7 @@ parseSolidityType s = runParser (solidityTypeParser <* eof) s # lmap \err ->
instance decodeJsonSolidityType :: DecodeJson SolidityType where
decodeJson json = do
obj <- decodeJson json
t <- obj .? "type"
t <- obj .: "type"
parseSolidityType t

--------------------------------------------------------------------------------
Expand All @@ -163,8 +163,8 @@ instance formatInput :: Format FunctionInput where
instance decodeFunctionInput :: DecodeJson FunctionInput where
decodeJson json = do
obj <- decodeJson json
n <- obj .? "name"
t <- obj .? "type"
n <- obj .: "name"
t <- obj .: "type"
typ <- parseSolidityType t
pure $ FunctionInput {type: typ, name: n}

Expand All @@ -186,11 +186,11 @@ instance showSolidityFunction :: Show SolidityFunction where
instance decodeJsonSolidityFunction :: DecodeJson SolidityFunction where
decodeJson json = do
obj <- decodeJson json
nm <- obj .? "name"
is <- obj .? "inputs"
os <- obj .? "outputs"
c <- obj .? "constant"
p <- obj .? "payable"
nm <- obj .: "name"
is <- obj .: "inputs"
os <- obj .: "outputs"
c <- obj .: "constant"
p <- obj .: "payable"
pure $ SolidityFunction { name : nm
, inputs : is
, outputs : os
Expand Down Expand Up @@ -218,7 +218,7 @@ instance showSolidityConstructor :: Show SolidityConstructor where
instance decodeJsonSolidityConstructor :: DecodeJson SolidityConstructor where
decodeJson json = do
obj <- decodeJson json
is <- obj .? "inputs"
is <- obj .: "inputs"
pure $ SolidityConstructor { inputs : is
, isUnCurried: all (\(FunctionInput fi) -> fi.name /= "") is
&& not (null is)
Expand All @@ -245,10 +245,10 @@ instance formatIndexedSolidityValue :: Format IndexedSolidityValue where
instance decodeJsonIndexedSolidityValue :: DecodeJson IndexedSolidityValue where
decodeJson json = do
obj <- decodeJson json
nm <- obj .? "name"
ts <- obj .? "type"
nm <- obj .: "name"
ts <- obj .: "type"
t <- parseSolidityType ts
ixed <- obj .? "indexed"
ixed <- obj .: "indexed"
pure $ IndexedSolidityValue { name : nm
, type : t
, indexed : ixed
Expand All @@ -268,9 +268,9 @@ instance showSolidityEvent :: Show SolidityEvent where
instance decodeJsonSolidityEvent :: DecodeJson SolidityEvent where
decodeJson json = do
obj <- decodeJson json
nm <- obj .? "name"
is <- obj .? "inputs"
a <- obj .? "anonymous"
nm <- obj .: "name"
is <- obj .: "inputs"
a <- obj .: "anonymous"
pure $ SolidityEvent { name : nm
, inputs : is
, anonymous : a
Expand Down Expand Up @@ -305,7 +305,7 @@ instance showAbiType :: Show AbiType where
instance decodeJsonAbiType :: DecodeJson AbiType where
decodeJson json = do
obj <- decodeJson json
t <- obj .? "type"
t <- obj .: "type"
let json' = fromObject obj
case t of
"function" -> AbiFunction <$> decodeJson json'
Expand Down
8 changes: 4 additions & 4 deletions src/Data/Generator.purs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ data EventGenericInstance =
instance codeEventGenericInstance :: Code EventGenericInstance where
genCode (EventGenericInstance i) _ =
let headers = uncurry (\n t -> "instance " <> n <> " :: " <> t <> " where") <$> (zip i.instanceNames i.instanceTypes)
eventGenerics = (\d -> "\t" <> d) <$> i.genericDefs
eventGenerics = (\d -> " " <> d) <$> i.genericDefs
instances = zipWith (\h g -> h <> "\n" <> g) headers eventGenerics
in pure $ newLine2 $ i.genericDeriving : instances

Expand Down Expand Up @@ -515,7 +515,7 @@ instance codeEventFilterInstance :: Code EventFilterInstance where
import' "Network.Ethereum.Web3" [IClass "EventFilter"]
let
header = "instance " <> i.instanceName <> " :: EventFilter " <> i.instanceType <> " where"
eventFilter = "\t" <> i.filterDef
eventFilter = " " <> i.filterDef
pure $ newLine1 [header, eventFilter]

eventId :: SolidityEvent -> HexString
Expand Down Expand Up @@ -552,8 +552,8 @@ eventToEventFilterInstance ev@(SolidityEvent e) = do
pure $
fold
["defaultFilter"
, "\n\t\t"
, joinWith "\n\t\t"
, "\n "
, joinWith "\n "
[ "# _address .~ Just " <> addr
, "# _topics .~ Just [" <> eventIdStr <> indexedVals <> "]"
]
Expand Down