Skip to content

Commit

Permalink
remove retrieve-able information from the events
Browse files Browse the repository at this point in the history
  • Loading branch information
ggobugi27 committed May 23, 2024
1 parent a534ac0 commit 915cd41
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 27 deletions.
24 changes: 10 additions & 14 deletions pact/sale-contracts/conventional-auction/conventional-auction.pact
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
(defcap AUCTION_CREATED:bool
( sale-id:string
token-id:string
escrow:string
)
@event
true
Expand All @@ -49,6 +48,14 @@
true
)

(defcap BID_PLACED:bool
( bid-id:string
sale-id:string
)
@event
true
)

(defcap MANAGE_AUCTION:bool (sale-id:string token-id:string)
(let* (
(quote-info:object{quote-schema} (get-quote-info sale-id))
Expand All @@ -57,17 +64,6 @@
)
)

(defcap BID_PLACED:bool
( bid-id:string
bidder:string
bidder-guard:guard
bid:decimal
token-id:string
)
@event
true
)

(defcap PLACE_BID:bool (bidder-guard:guard)
(enforce-guard bidder-guard)
)
Expand Down Expand Up @@ -168,7 +164,7 @@
,"highest-bid-id": ""
,"reserve-price": reserve-price
})
(emit-event (AUCTION_CREATED sale-id token-id (escrow-account sale-id)))
(emit-event (AUCTION_CREATED sale-id token-id))
)
)

Expand Down Expand Up @@ -272,7 +268,7 @@
)
)
(update auctions sale-id { 'highest-bid: bid, 'highest-bid-id: bid-id })
(emit-event (BID_PLACED bid-id bidder bidder-guard bid token-id))
(emit-event (BID_PLACED bid-id sale-id))
))
true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@

(expect "create-auction events"
[
{"name": "marmalade-sale.conventional-auction.AUCTION_CREATED","params": ["_vS1Y4nXQavtHxQAUCNDeRzG5Jc8Se22Ocg4RNP5B2Y" (read-msg "token1-id") "u:util.guards1.enforce-guard-any:8iBtcNCfjArejHvxJ0rde1DsWxuhHqOzd1w40jsDPV4"]}
{"name": "marmalade-sale.conventional-auction.AUCTION_CREATED","params": ["_vS1Y4nXQavtHxQAUCNDeRzG5Jc8Se22Ocg4RNP5B2Y" (read-msg "token1-id")]}
]
(map (remove "module-hash") (env-events true))
)
Expand Down
21 changes: 9 additions & 12 deletions pact/sale-contracts/dutch-auction/dutch-auction.pact
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
@event
true
)

(defcap PRICE_ACCEPTED:bool
( sale-id:string
token-id:string
)
@event
true
)

(defcap MANAGE_AUCTION:bool (sale-id:string token-id:string)
(let* (
Expand All @@ -51,17 +59,6 @@
)
)

(defcap PRICE_ACCEPTED:bool
( sale-id:string
buyer:string
buyer-guard:guard
price:decimal
token-id:string
)
@event
true
)

(defcap DUMMY:bool () true)
(defconst DUMMY_GUARD:guard (create-capability-guard (DUMMY)))

Expand Down Expand Up @@ -91,7 +88,7 @@
,"buyer-guard": buyer-guard
})

(emit-event (PRICE_ACCEPTED sale-id buyer buyer-guard current-price token-id))
(emit-event (PRICE_ACCEPTED sale-id token-id))
)
)
true
Expand Down

0 comments on commit 915cd41

Please sign in to comment.