File tree 3 files changed +9
-9
lines changed
app/Commands/Dev/Nockma/Run
src/Juvix/Compiler/Nockma
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ runCommand opts = do
22
22
t@ (TermCell {}) -> do
23
23
let formula = anomaCallTuple parsedArgs
24
24
storageJammedTerms = map Encoding. atomToByteString' . mapMaybe getAtom $ maybe [] unfoldList parsedStorage
25
- storage = foldr insertJammedStorage emptyStorage storageJammedTerms
25
+ storage <- runAppError @ SimpleError $ foldrM insertJammedStorage emptyStorage storageJammedTerms
26
26
(counts, res) <-
27
27
runOpCounts
28
28
. runReader defaultEvalOptions
Original file line number Diff line number Diff line change @@ -259,7 +259,10 @@ evalProfile inistack initerm =
259
259
TermAtom a -> do
260
260
r <- Encoding. cueEither a
261
261
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'
263
266
StdlibVerifyDetached -> case args' of
264
267
TCell (TermAtom sig) (TCell (TermAtom message) (TermAtom pubKey)) -> goVerifyDetached sig message pubKey
265
268
_ -> 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 =
90
90
fromJust (md' ^. moduleInfoTable . infoCode)
91
91
)
92
92
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
96
97
where
97
- jammedAtom =
98
- TermAtom
99
- . byteStringToAtom'
100
- $ jammedTerm
101
98
sha256 =
102
99
TermAtom
103
100
. byteStringToAtom'
You can’t perform that action at this time.
0 commit comments