Skip to content
Permalink
Browse files

Use Text as ValueId

  • Loading branch information...
nau committed Sep 11, 2019
1 parent 9c93cf0 commit f43b1393bc0c55771327500b3521da160d229456
Showing with 8 additions and 4 deletions.
  1. +4 −4 semantics-3.0/src/Language/Marlowe/Semantics.hs
  2. +4 −0 semantics-3.0/src/Language/Marlowe/Util.hs
@@ -35,9 +35,9 @@ newtype PubKey = PubKey Text
deriving (Eq,Ord)

instance Show PubKey where
show (PubKey txt) = show (T.unpack txt)
show (PubKey txt) = show (T.unpack txt)

type Party = PubKey
type Party = PubKey
type ChoiceName = Text -- Needs to be updated in playground.
type NumAccount = Integer
type Timeout = Slot
@@ -53,7 +53,7 @@ accountOwner (AccountId _ party) = party
data ChoiceId = ChoiceId ChoiceName Party
deriving (Eq,Ord,Show)

newtype ValueId = ValueId Integer
newtype ValueId = ValueId Text
deriving (Eq,Ord,Show)

data Value = AvailableMoney AccountId
@@ -151,7 +151,7 @@ fixInterval interval state = let
-- newLow is both new "low" and new "minSlot" (the lower bound for slotNum)
newLow = max low curMinSlot
-- We know high is greater or equal than newLow (prove)
curInterval = SlotInterval newLow high
curInterval = SlotInterval newLow high
env = Environment { slotInterval = curInterval }
newState = state { minSlot = newLow }
in if high < low then IntervalError (InvalidInterval interval)
@@ -14,6 +14,10 @@ instance IsString PubKey where
instance IsString AccountId where
fromString s = AccountId 0 (PubKey (T.pack s))

instance IsString ValueId where
fromString s = ValueId (T.pack s)


alicePubKey :: PubKey
alicePubKey = PubKey "Alice"

0 comments on commit f43b139

Please sign in to comment.
You can’t perform that action at this time.