Hi All,
Going through one of the IOU samples… just wanted to know if, “===” is this some kind of equality operator ? If yes, what is the use of this operator ?
module IouTrade where
import DA.Assert
import Iou
template IouTrade
with
buyer : Party
seller : Party
baseIouCid : IouCid
baseIssuer : Party
baseCurrency : Text
baseAmount : Decimal
quoteIssuer : Party
quoteCurrency : Text
quoteAmount : Decimal
where
signatory buyer
observer seller
-- BEGIN_IOU_COMPOSITE_CHOICE
choice IouTrade_Accept : (IouCid, IouCid)
with
quoteIouCid : IouCid
controller seller
do
baseIou <- fetch baseIouCid
baseIssuer === baseIou.issuer
baseCurrency === baseIou.currency
baseAmount === baseIou.amount
buyer === baseIou.owner
quoteIou <- fetch quoteIouCid
quoteIssuer === quoteIou.issuer
quoteCurrency === quoteIou.currency
quoteAmount === quoteIou.amount
seller === quoteIou.owner
quoteIouTransferCid <- exercise quoteIouCid Iou_Transfer with
newOwner = buyer
transferredQuoteIouCid <- exercise quoteIouTransferCid IouTransfer_Accept
baseIouTransferCid <- exercise baseIouCid Iou_Transfer with
newOwner = seller
transferredBaseIouCid <- exercise baseIouTransferCid IouTransfer_Accept
return (transferredQuoteIouCid, transferredBaseIouCid)
-- END_IOU_COMPOSITE_CHOICE
choice TradeProposal_Reject : ()
controller seller
do return ()