Skip to content

Commit

Permalink
upgrade (#115)
Browse files Browse the repository at this point in the history
* remove and update deps

* ps update to 0.13
  • Loading branch information
safareli authored Oct 1, 2019
1 parent 46092f8 commit f315d39
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 27 deletions.
18 changes: 7 additions & 11 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,18 @@
],
"dependencies": {
"purescript-prelude": "^4.0.0",
"purescript-web3": "f-o-a-m/purescript-web3#dependency-bump",
"purescript-web3-generator": "f-o-a-m/purescript-web3-generator#dependency-bump",
"purescript-solc": "f-o-a-m/purescript-solc",
"purescript-web3": "^2.0.0",
"purescript-web3-generator": "^2.0.0",
"purescript-solc": "^1.0.0",
"purescript-console": "^4.0.0",
"purescript-errors": "^4.0.0",
"purescript-node-process": "^6.0.0",
"purescript-debug": "^4.0.0",
"purescript-optparse": "^2.0.0",
"purescript-mkdirp": "joshuahhh/purescript-mkdirp#48ecb4039d5fe3be82d0e82c3a9f2338d1af82d2",
"purescript-node-process": "^7.0.0",
"purescript-optparse": "^3.0.0",
"purescript-logging": "^3.0.0",
"purescript-validation": "^4.0.0",
"purescript-random": "^4.0.0",
"purescript-foreign-object": "^1.1.0",
"purescript-numbers": ">=4.1.0"
"purescript-foreign-object": "^2.0.0"
},
"devDependencies": {
"purescript-debug": "^4.0.0",
"purescript-psci-support": "^4.0.0",
"purescript-spec": "^3.0.0"
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"postinstall": "echo 'If you are installing chanterelle to use globally, you likely want to run `chanterelle global-postinstall`.'"
},
"dependencies": {
"purescript": "^0.12.0",
"pulp": "^12.2.0",
"purescript-psa": "^0.6.0",
"purescript": "^0.13.0",
"pulp": "^13.0.0",
"purescript-psa": "^0.7.3",
"bn.js": "^4.11.0",
"ethjs-provider-http": "^0.1.6",
"mkdirp": "^0.5.1",
Expand Down
3 changes: 1 addition & 2 deletions src/Chanterelle/Internal/Codegen.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Chanterelle.Internal.Logging (LogLevel(..), log)
import Chanterelle.Internal.Types.Compile (CompileError(..))
import Chanterelle.Internal.Types.Project (ChanterelleProject(..), ChanterelleProjectSpec(..), ChanterelleModule(..))
import Chanterelle.Internal.Utils.FS (assertDirectory')
import Control.Error.Util (note)
import Control.Monad.Error.Class (class MonadThrow, throwError)
import Control.Monad.Reader (class MonadAsk, ask)
import Data.AbiParser (Abi(Abi), AbiDecodeError(..), AbiWithErrors) as PSWeb3Gen
Expand All @@ -17,7 +16,7 @@ import Data.Argonaut.Parser (jsonParser)
import Data.Argonaut.Prisms (_Object)
import Data.Array (mapMaybe)
import Data.CodeGen (GeneratorOptions, generateCodeFromAbi, generatePS, ABIError(..)) as PSWeb3Gen
import Data.Either (Either(..), either)
import Data.Either (Either(..), either, note)
import Data.Identity (Identity(..))
import Data.Lens ((^?))
import Data.Lens.Index (ix)
Expand Down
3 changes: 1 addition & 2 deletions src/Chanterelle/Internal/Compile.purs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ import Chanterelle.Internal.Types.Compile (CompileError(..), resolveSolidityCont
import Chanterelle.Internal.Types.Project (ChanterelleModule(..), ChanterelleProject(..), ChanterelleProjectSpec(..), Dependency(..), getSolc, partitionSelectionSpecs)
import Chanterelle.Internal.Utils.Error (withExceptM', withExceptT')
import Chanterelle.Internal.Utils.FS (assertDirectory', fileIsDirty)
import Control.Error.Util (hush)
import Control.Monad.Error.Class (class MonadThrow, throwError)
import Control.Monad.Reader (class MonadAsk, ask)
import Data.Argonaut as A
import Data.Argonaut.Parser as AP
import Data.Array (catMaybes, partition)
import Data.Either (Either(..))
import Data.Either (Either(..), hush)
import Data.Lens ((^?))
import Data.Lens.Index (ix)
import Data.Maybe (Maybe(..), fromMaybe)
Expand Down
4 changes: 2 additions & 2 deletions src/Chanterelle/Internal/Deploy.purs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ deployLibrary
-> m (DeployReceipt LibraryMeta)
deployLibrary txo ccfg@{filepath, name} = do
DeployConfig { provider } <- ask
nbc@ArtifactBytecode { bytecode: bc } <- getContractBytecode ccfg
nbc@(ArtifactBytecode { bytecode: bc }) <- getContractBytecode ccfg
case bc of
BCUnlinked _ -> throwError $ DeployingUnlinkedBytecodeError { name, libs: CBC.unlinkedLibraryNames bc }
BCLinked { bytecode } -> do
Expand Down Expand Up @@ -195,7 +195,7 @@ deployContract
-> m (DeployReceipt args)
deployContract txOptions ccfg@{name, constructor} = do
DeployConfig { provider } <- ask
nbc@ArtifactBytecode { bytecode: bc } <- getContractBytecode ccfg
nbc@(ArtifactBytecode { bytecode: bc }) <- getContractBytecode ccfg
case bc of
BCUnlinked _ -> throwError $ DeployingUnlinkedBytecodeError { name, libs: CBC.unlinkedLibraryNames bc }
BCLinked { bytecode } -> do
Expand Down
6 changes: 2 additions & 4 deletions src/Chanterelle/Internal/Types/Artifact.purs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import Prelude

import Chanterelle.Internal.Types.Bytecode (Bytecode, emptyBytecode, fromSolidityBytecodeOutput)
import Control.Alt ((<|>))
import Control.Error.Util (note)
import Data.Argonaut (class DecodeJson, class EncodeJson, Json, decodeJson, encodeJson)
import Data.Either (Either)
import Data.Either (Either, note)
import Data.Lens (Lens', Getter', lens', to)
import Data.Lens.At (at)
import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype)
import Data.Number (infinity)
import Data.Tuple (Tuple(..))
import Foreign.Object as M
import Language.Solidity.Compiler.Types as ST
Expand Down Expand Up @@ -73,7 +71,7 @@ fromSolidityContractLevelOutput (ST.ContractLevelOutput clo) = do
bytecode <- fromSolidityBytecodeOutput bytecode'
deployedBytecode' <- note "Solidity contract output did not have an \"evm.deployedBytecode\" field" evm.deployedBytecode
deployedBytecode <- fromSolidityBytecodeOutput deployedBytecode'
let lastModified = infinity
let lastModified = top
pure $ Artifact { abi, code: { bytecode, deployedBytecode }, lastModified, networks: M.empty }

_abi :: Lens' Artifact (Array Json)
Expand Down
9 changes: 9 additions & 0 deletions src/Chanterelle/Internal/Utils/FS.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";

var mkdirp = require("mkdirp");

exports.mkdirp = function (dir) {
return function() {
return mkdirp.sync(dir);
};
};
4 changes: 3 additions & 1 deletion src/Chanterelle/Internal/Utils/FS.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import Chanterelle.Internal.Types.Compile (CompileError(..))
import Chanterelle.Internal.Utils.Error (catchingAff, withExceptT')
import Control.Monad.Error.Class (class MonadThrow, throwError)
import Data.DateTime.Instant (fromDateTime, unInstant)
import Effect (Effect)
import Effect.Aff (Milliseconds)
import Effect.Aff.Class (class MonadAff, liftAff)
import Effect.Class (liftEffect)
import Node.Encoding (Encoding(UTF8))
import Node.FS.Aff as FS
import Node.FS.Stats as Stats
import Node.FS.Sync.Mkdirp (mkdirp)
import Node.Path (FilePath)
import Node.Path as Path

Expand Down Expand Up @@ -43,6 +43,8 @@ assertDirectory dn = do
then throwError ("Path " <> dn <> " exists but is not a directory!")
else log Debug ("path " <> dn <> " exists and is a directory")

foreign import mkdirp ::String -> Effect Unit

assertDirectory'
:: forall m
. MonadAff m
Expand Down
3 changes: 1 addition & 2 deletions src/Chanterelle/Internal/Utils/Json.purs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import Prelude

import Chanterelle.Internal.Utils.Error (except')
import Control.Alt ((<|>))
import Control.Error.Util (note)
import Control.Monad.Error.Class (class MonadThrow)
import Data.Argonaut (class DecodeJson, Json, decodeJson, encodeJson, jsonParser, (.:), (.:!))
import Data.Either (Either(..))
import Data.Either (Either(..), note)
import Data.Maybe (Maybe(..), maybe)
import Foreign.Object (Object)
import Network.Ethereum.Core.BigNumber (hexadecimal, parseBigNumber, toString, unsafeToInt)
Expand Down

0 comments on commit f315d39

Please sign in to comment.