Skip to content

Commit

Permalink
PLT-8827 - Update swap example
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Jan 17, 2024
1 parent c16bb11 commit d7f81d1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ adaDepositTimeout = TimeParam "Timeout for Ada deposit"
dollarDepositTimeout = TimeParam "Timeout for dollar deposit"
dollars :: Token
dollars = Token "85bb65" "dollar"
dollars = Token "85bb65085bb65085bb65085bb65085bb65085bb65085bb65085bb650" "dollar"
data SwapParty = SwapParty { party :: Party
, currency :: Token
Expand Down Expand Up @@ -606,4 +606,4 @@ cfd = initialDeposit party partyDeposit (TimeParam "Party deposit deadline") Clo
$ refundAfterDifference party partyDeposit counterparty counterpartyDeposit (UseValue increaseInPrice)
)
refundBoth
"""
"""
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ swap =
(When [
(Case
(Deposit (Role "Dollar provider") (Role "Dollar provider")
(Token "85bb65" "dollar")
(Token "85bb65085bb65085bb65085bb65085bb65085bb65085bb65085bb650" "dollar")
(ConstantParam "Amount of dollars"))
(Pay (Role "Ada provider")
(Party (Role "Dollar provider"))
Expand All @@ -220,7 +220,7 @@ swap =
(ConstantParam "Amount of Ada"))
(Pay (Role "Dollar provider")
(Party (Role "Ada provider"))
(Token "85bb65" "dollar")
(Token "85bb65085bb65085bb65085bb65085bb65085bb65085bb65085bb650" "dollar")
(ConstantParam "Amount of dollars") Close)))] (TimeParam "Timeout for dollar deposit") Close))] (TimeParam "Timeout for Ada deposit") Close"""

contractForDifferences :: String
Expand Down Expand Up @@ -357,4 +357,4 @@ contractForDifferencesWithOracle =
(UseValue "Increase in price")
(ConstantParam "Amount paid by party"))
(UseValue "Increase in price")
(ConstantParam "Amount paid by party")) Close)) Close))))] (TimeParam "Second window deadline") Close)))] (TimeParam "First window deadline") Close)))] (TimeParam "Counterparty deposit deadline") Close))] (TimeParam "Party deposit deadline") Close"""
(ConstantParam "Amount paid by party")) Close)) Close))))] (TimeParam "Second window deadline") Close)))] (TimeParam "First window deadline") Close)))] (TimeParam "Counterparty deposit deadline") Close))] (TimeParam "Party deposit deadline") Close"""
2 changes: 1 addition & 1 deletion marlowe-playground-client/src/Examples/JS/Contracts.purs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ swap =
const adaDepositTimeout: Timeout = TimeParam("Timeout for Ada deposit");
const dollarDepositTimeout: Timeout = TimeParam("Timeout for dollar deposit");
const dollars: Token = Token("85bb65", "dollar")
const dollars: Token = Token("85bb65085bb65085bb65085bb65085bb65085bb65085bb65085bb650", "dollar")
type SwapParty = {
party: Party;
Expand Down
2 changes: 1 addition & 1 deletion marlowe-playground-server/contracts/Swap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ adaDepositTimeout = TimeParam "Timeout for Ada deposit"
dollarDepositTimeout = TimeParam "Timeout for dollar deposit"

dollars :: Token
dollars = Token "85bb65" "dollar"
dollars = Token "85bb65085bb65085bb65085bb65085bb65085bb65085bb65085bb650" "dollar"

data SwapParty = SwapParty { party :: Party
, currency :: Token
Expand Down
4 changes: 3 additions & 1 deletion web-common-marlowe/src/Examples/PureScript/Swap.purs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ dollarDepositTimeout :: Timeout
dollarDepositTimeout = TimeParam "Timeout for dollar deposit"

dollars :: Token
dollars = Token "85bb65" "dollar"
dollars = Token
"85bb65085bb65085bb65085bb65085bb65085bb65085bb65085bb650"
"dollar"

type SwapParty =
{ party :: Party
Expand Down

0 comments on commit d7f81d1

Please sign in to comment.