Skip to content

Commit

Permalink
compile
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mueller committed Feb 14, 2019
1 parent 7f61526 commit 66fe9d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import GHC.Generics (Generic)
import qualified Language.Haskell.TH.Syntax as TH
import Ledger.Ada (Ada)
import Ledger.Types (Blockchain, PubKey)
import qualified Ledger.Types as Ledger
import Servant.API ((:<|>), (:>), JSON, Post, ReqBody)
import Text.Read (readMaybe)
import Wallet.Emulator.Types (EmulatorEvent, Wallet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ runTrace wallets actions =
blockchain = _chainNewestFirst newState
emulatorLog = _emulatorLog newState
fundsDistribution =
Map.map (foldl' Ada.plus Ada.zero . fmap (Ada.fromValue . txOutValue) . view ownFunds) .
Map.map (foldl' (+) 0 . fmap (Ada.fromValue . txOutValue) . view ownFunds) .
view walletStates $
newState
in case eRes of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import qualified Data.Text as Text
import qualified Data.Text.Internal.Search as Text
import qualified Data.Text.IO as Text
import Ledger.Types (Blockchain, Value)
import Ledger.Ada (Ada)
import Playground.API (CompilationResult (CompilationResult), Evaluation (sourceCode),
Expression (Action, Wait), Fn (Fn), FunctionSchema (FunctionSchema),
FunctionSchema,
Expand Down Expand Up @@ -104,7 +105,7 @@ compile source = do
runFunction ::
(MonadMask m, MonadIO m, MonadError PlaygroundError m)
=> Evaluation
-> m (Blockchain, [EmulatorEvent], [(Wallet, Value)])
-> m (Blockchain, [EmulatorEvent], [(Wallet, Ada)])
runFunction evaluation = do
let source = sourceCode evaluation
avoidUnsafe source
Expand All @@ -121,7 +122,7 @@ runFunction evaluation = do
JSON.eitherDecodeStrict . BS8.pack $ result :: Either String (Either PlaygroundError ( Blockchain
, [EmulatorEvent]
, [( Wallet
, Value)]))
, Ada)]))
case decodeResult of
Left err ->
throwError . OtherError $
Expand Down

0 comments on commit 66fe9d4

Please sign in to comment.