Skip to content

Commit

Permalink
Add POSIX time in addition to real time in minTime
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Mar 16, 2023
1 parent 0217fb3 commit e89bfe2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
22 changes: 13 additions & 9 deletions src/Explorer/Web/ContractView.hs
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,19 @@ renderTime =

renderMState :: Maybe State -> Html
renderMState Nothing = string "Contract closed"
renderMState (Just st) = table $ do
tr $ do td $ b "accounts"
td . renderMAccounts . accounts $ st
tr $ do td $ b "bound values"
td . string . renderBoundValues . boundValues $ st
tr $ do td $ b "choices"
td . string . renderChoices . choices $ st
tr $ do td $ b "minTime"
td . renderTime . minTime $ st
renderMState (Just (State { accounts = accs
, choices = chos
, boundValues = boundVals
, minTime = mtime })) =
table $ do tr $ do td $ b "accounts"
td $ renderMAccounts accs
tr $ do td $ b "bound values"
td $ string $ renderBoundValues boundVals
tr $ do td $ b "choices"
td $ string $ renderChoices chos
tr $ do td $ b "minTime"
td $ do renderTime mtime
string $ " (POSIX: " ++ show mtime ++ ")"

renderMContract :: Maybe Contract -> Html
renderMContract Nothing = string "Contract closed"
Expand Down
1 change: 0 additions & 1 deletion src/Explorer/Web/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ stringToHtml str = mconcat $ map processLine $ lines str
generateLink :: String -> [(String, String)] -> String
generateLink path params = path ++ unpack (renderSimpleQuery True (map (bimap pack pack) params))


prettyPrintAmount :: Int -> Integer -> String
prettyPrintAmount decimalPositions amount = if decimals /= [] then integers ++ '.':decimals else integers
where (revDecimals, revIntegers) = splitAt decimalPositions $ reverse (show amount)
Expand Down

0 comments on commit e89bfe2

Please sign in to comment.