File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
app/Commands/Dev/Nockma/Run
src/Juvix/Compiler/Nockma Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ runCommand opts = do
2222 t@ (TermCell {}) -> do
2323 let formula = anomaCallTuple parsedArgs
2424 storageJammedTerms = map Encoding. atomToByteString' . mapMaybe getAtom $ maybe [] unfoldList parsedStorage
25- storage = foldr insertJammedStorage emptyStorage storageJammedTerms
25+ storage <- runAppError @ SimpleError $ foldrM insertJammedStorage emptyStorage storageJammedTerms
2626 (counts, res) <-
2727 runOpCounts
2828 . runReader defaultEvalOptions
Original file line number Diff line number Diff line change @@ -259,7 +259,10 @@ evalProfile inistack initerm =
259259 TermAtom a -> do
260260 r <- Encoding. cueEither a
261261 either (throwDecodingFailed args') return r
262- TermCell {} -> throwDecodingFailed args' DecodingErrorExpectedAtom
262+ TermCell {} ->
263+ -- In the simulated storage, we allow already decoded cells
264+ -- for efficiency. Decoding these should then be a no-op.
265+ return args'
263266 StdlibVerifyDetached -> case args' of
264267 TCell (TermAtom sig) (TCell (TermAtom message) (TermAtom pubKey)) -> goVerifyDetached sig message pubKey
265268 _ -> error " expected a term of the form [signature (atom) message (encoded term) public_key (atom)]"
Original file line number Diff line number Diff line change @@ -90,14 +90,11 @@ mkModuleStorage mtab =
9090 fromJust (md' ^. moduleInfoTable . infoCode)
9191 )
9292
93- insertJammedStorage :: ByteString -> Storage Natural -> Storage Natural
94- insertJammedStorage jammedTerm storage =
95- over storageKeyValueData (HashMap. insert (StorageKey sha256) jammedAtom) storage
93+ insertJammedStorage :: (Member (Error SimpleError ) r ) => ByteString -> Storage Natural -> Sem r (Storage Natural )
94+ insertJammedStorage jammedTerm storage = do
95+ term <- decodeCue jammedTerm
96+ return $ over storageKeyValueData (HashMap. insert (StorageKey sha256) term) storage
9697 where
97- jammedAtom =
98- TermAtom
99- . byteStringToAtom'
100- $ jammedTerm
10198 sha256 =
10299 TermAtom
103100 . byteStringToAtom'
You can’t perform that action at this time.
0 commit comments