Skip to content
This repository was archived by the owner on Apr 13, 2022. It is now read-only.

Commit 32f0822

Browse files
airvinnwaywood
andcommitted
Added some TODOs for next time
Co-authored-by: Nick Waywood <n.waywood@gmail.com> Signed-off-by: Allison Irvin <allison.irvin2@gmail.com>
1 parent 8717fdb commit 32f0822

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

examples/Marbles.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ generateResultBytes sqi text = do
188188
hasNextBool <- hasNext sqi
189189
if hasNextBool then do
190190
eeKV <- next sqi
191+
-- TODO: We need to check that the Either Error KV returned from next
192+
-- is correct and append the showable version of KVs instead of "abc".
191193
generateResultBytes sqi (append text "abc")
192194
else pure $ Right $ TSE.encodeUtf8 text
193195

src/Interfaces.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ class ChaincodeStubInterface ccs where
3737
-- setStateValidationParameter :: ccs -> String -> [ByteString] -> Maybe Error
3838
-- getStateValiationParameter :: ccs -> String -> Either Error [ByteString]
3939
getStateByRange :: ccs -> Text -> Text -> IO (Either Error StateQueryIterator)
40+
41+
-- TODO: We need to implement this so we can test the fetchNextQueryResult functionality
4042
-- getStateByRangeWithPagination :: ccs -> String -> String -> Int32 -> String -> Either Error (StateQueryIterator, Pb.QueryResponseMetadata)
43+
4144
-- getStateByPartialCompositeKey :: ccs -> String -> [String] -> Either Error StateQueryIterator
4245
-- getStateByPartialCompositeKeyWithPagination :: ccs -> String -> [String] -> Int32 -> String -> Either Error (StateQueryIterator, Pb.QueryResponseMetadata)
4346
-- createCompositeKey :: ccs -> String -> [String] -> Either Error String
@@ -72,6 +75,8 @@ class StateQueryIteratorInterface sqi where
7275
-- -- close terminantes the iteration.
7376
close :: sqi -> IO (Maybe Error)
7477
-- -- Provides the next key-value pair pointed by the iterator
78+
-- TODO: Change this to an ExceptT type to make handling the next function
79+
-- easier on the user chaincode side
7580
next :: sqi -> IO (Either Error Pb.KV)
7681

7782
-- The type class HistoryQueryIterator defines the behaviour of the types that expose functionalities

0 commit comments

Comments
 (0)