Skip to content

Commit

Permalink
Pass libraries correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kejace committed Apr 11, 2018
1 parent b337677 commit ed78c79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Chanterelle/Internal/Compile.purs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ compileModule (Tuple m@(ChanterelleModule mod) solcInput) = do
log Info ("compiling " <> mod.moduleName)
output <- liftEff $ runFn2 _compile (A.stringify $ A.encodeJson solcInput) (loadSolcCallback project.root project.spec)
case AP.jsonParser output >>= parseSolcOutput of
Left err -> throwError $ CompileParseError ("Solc output not valid Json: " <> err)
Left err -> throwError $ CompileParseError ("solc output not valid Json: " <> err)
Right output' -> do
writeBuildArtifact mod.solContractName mod.jsonPath output' mod.solContractName
pure $ Tuple mod.moduleName (Tuple m output')
Expand Down Expand Up @@ -120,7 +120,7 @@ makeSolcInput moduleName sourcePath = do
sourceDirMapping = [":g" <> (Path.concat [project.root, spec.sourceDir])]
remappings = sourceDirMapping <> depMappings
settings = SolcSettings { outputSelection, remappings, libraries }
libraries = spec.libraries
libraries = M.singleton (moduleName <> ".sol") spec.libraries
pure $ SolcInput { language, sources, settings }

--------------------------------------------------------------------------------
Expand Down Expand Up @@ -193,9 +193,9 @@ instance encodeSolcInput :: A.EncodeJson SolcInput where
type ContractName = String

newtype SolcSettings =
SolcSettings { outputSelection :: (M.StrMap (M.StrMap (Array String)))
SolcSettings { outputSelection :: M.StrMap (M.StrMap (Array String))
, remappings :: Array String
, libraries :: Libraries
, libraries :: M.StrMap Libraries
}

instance encodeSolcSettings :: A.EncodeJson SolcSettings where
Expand Down

0 comments on commit ed78c79

Please sign in to comment.