Skip to content

Commit f041478

Browse files
committed
[#360] [stbx-protocol, stbx-service-rest] updates after review
1 parent ad50d27 commit f041478

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

Diff for: stbx-protocol/src/Statebox/Protocol/Store/Handler.purs renamed to stbx-protocol/src/Statebox/Protocol/Store/TransactionExecutionStateHandler.purs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Statebox.Protocol.Store.Handler where
1+
module Statebox.Protocol.Store.TransactionExecutionStateHandler where
22

33
import Prelude
44
import Control.Monad.Free (Free, hoistFree, runFreeM)
@@ -27,6 +27,8 @@ hoistToMultipleStores = hoistFree (case _ of
2727
GetExecutionState key next -> ExecutionState (next <$> Store.get key)
2828
UpdateExecutionState key value next -> ExecutionState (next <$ Store.put key value))
2929

30+
-- | This typeclass describes a natural transformation between `ma` and `m` (if they are functors).
31+
-- | It allows us to transform naturally instances of `ma` to instances of `m`
3032
class Embeddable ma m where
3133
embed :: a. ma a -> m a
3234

Diff for: stbx-service-rest/src/Statebox/Service/Error.purs

+7-7
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ instance decodeJsonTxError :: DecodeJson TxError where
168168

169169
processErrorToTxError :: ProcessError -> TxError
170170
processErrorToTxError = case _ of
171-
NoUberRoot -> TxNoTxField -- TODO: wrong!
171+
NoUberRoot -> TxNoTxField -- TODO: wrong, not the correct error message!
172172
InitialPreviousShouldBeUberRoot txId -> RootNonexistPrev {previous: txId}
173-
WiringPreviousShouldBeInitial txId -> TxNoTxField -- TODO: wrong!
173+
WiringPreviousShouldBeInitial txId -> TxNoTxField -- TODO: wrong, not the correct error message!
174174
FiringInitialShouldBeCreatedOnlyOnce txId -> InitExecExists
175175
FiringInitialShouldHavePrevious txId -> InitNonexistPrev {previous: txId}
176-
FiringInitialPreviousShouldBeWiring txId -> InitNonexistPrev {previous: txId} -- TODO: wrong!
177-
FiringInitialTransitionShouldBeInitial txId -> InitNonexistPrev {previous: txId} -- TODO: wrong!
178-
FiringNormalShouldHaveExistingExecution txId executionId -> InvalidState -- TODO: wrong!
176+
FiringInitialPreviousShouldBeWiring txId -> InitNonexistPrev {previous: txId} -- TODO: wrong, not the correct error message!
177+
FiringInitialTransitionShouldBeInitial txId -> InitNonexistPrev {previous: txId} -- TODO: wrong, not the correct error message!
178+
FiringNormalShouldHaveExistingExecution txId executionId -> InvalidState -- TODO: wrong, not the correct error message!
179179
FiringNormalPreviousShouldMatchCurrentState txId executionId -> InvalidState
180-
FiringNormalExecutionShouldPointToExistingWiring txId executionId -> InvalidState -- TODO: wrong!
181-
FiringNormalExecutionWiringShouldBeAWiring txId executionId -> InvalidState -- TODO: wrong!
180+
FiringNormalExecutionShouldPointToExistingWiring txId executionId -> InvalidState -- TODO: wrong, not the correct error message!
181+
FiringNormalExecutionWiringShouldBeAWiring txId executionId -> InvalidState -- TODO: wrong, not the correct error message!
182182
FiringNormalTransitionShouldBeEnabled txId executionId -> TxNotEnabled
183183

184184

Diff for: stbx-service-rest/src/Statebox/Service/Main.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import Statebox.Core.Transaction (TxId, Tx, TxSum(..), uberRootHash)
3636
import Statebox.Core.Transaction.Codec (encodeTxWith, encodeTxSum)
3737
import Statebox.Protocol (ProcessError, processTxSum)
3838
import Statebox.Protocol.ExecutionState (ExecutionState)
39-
import Statebox.Protocol.Store.Handler (eval) as Store
39+
import Statebox.Protocol.Store.TransactionExecutionStateHandler (eval) as Store
4040
import Statebox.Service.Codec (parseBodyToJson, jsonBodyToTxString, txStringToTxJsonString', txJsonStringToTxData', txDataToTxSum')
4141
import Statebox.Service.Error (ResponseError, TxError(..), processErrorToTxError, responseErrorToTxError, toTxErrorResponseBody)
4242
import Statebox.Service.Status (Status(..))

0 commit comments

Comments
 (0)