Milestone 3: RPC server, ZIP-320 #104

Merged
pitmutt merged 152 commits from milestone3 into master 2024-11-21 15:39:19 +00:00
2 changed files with 14 additions and 5 deletions
Showing only changes of commit 73ad2f0eb3 - Show all commits

View file

@ -20,7 +20,7 @@ import Data.Maybe (fromJust, fromMaybe, isJust, isNothing)
import qualified Data.Text as T import qualified Data.Text as T
import qualified Data.Text.Encoding as E import qualified Data.Text.Encoding as E
import Data.Time.Clock.POSIX (posixSecondsToUTCTime) import Data.Time.Clock.POSIX (posixSecondsToUTCTime)
import Database.Esqueleto.Experimental (ConnectionPool) import Database.Esqueleto.Experimental (ConnectionPool, fromSqlKey)
import Database.Persist import Database.Persist
import Lens.Micro ((&), (+~), (.~), (?~), (^.), set) import Lens.Micro ((&), (+~), (.~), (?~), (^.), set)
import Lens.Micro.TH import Lens.Micro.TH
@ -60,6 +60,7 @@ import Zenith.Utils
, validBarValue , validBarValue
, validateAddressBool , validateAddressBool
, isValidString , isValidString
, padWithZero
) )
data AppEvent data AppEvent
@ -805,7 +806,10 @@ buildUI wenv model = widgetTree
[onClick $ ShowTx idx, alignLeft] [onClick $ ShowTx idx, alignLeft]
(hstack (hstack
[ [
(label "Descr: ") `styleBasic` [textFont "Bold"] label
(T.pack $
padWithZero 3 $
show (fromSqlKey (entityKey ab))) `styleBasic` [textFont "Bold"]
, spacer , spacer
, label , label
(T.pack $ (T.pack $

View file

@ -153,3 +153,8 @@ isValidString c = do
let a = T.unpack c let a = T.unpack c
isValidContent a isValidContent a
padWithZero :: Int -> String -> String
padWithZero n s
| (length s) >= n = s
| otherwise = padWithZero n ("0" ++ s)