@@ -5,6 +5,8 @@ import Prelude
55import Control.Monad.Trans (MonadIO (.. ))
66import PlutusLedgerApi.V1.Value (assetClassValue )
77
8+ import Cardano.Api.NetworkId (toShelleyNetwork )
9+
810import Cardano.CEM
911import Cardano.CEM.Examples.Auction
1012import Cardano.CEM.Examples.Compilation ()
@@ -17,6 +19,9 @@ import Test.Hspec (describe, it, shouldBe)
1719import TestNFT (testNftAssetClass )
1820import Utils (execClb , mintTestTokens , submitAndCheck , submitCheckReturn )
1921
22+ import Data.Aeson (encode )
23+ import OuraFilters.Mock (extractEvent , resolvedTxToOura )
24+
2025auctionSpec = describe " Auction" $ do
2126 it " Wrong transition resolution error" $ execClb $ do
2227 seller <- (!! 0 ) <$> getTestWalletSks
@@ -202,7 +207,7 @@ auctionSpec = describe "Auction" $ do
202207 Just (CurrentBid currentBid) <- queryScriptState auctionParams
203208 liftIO $ currentBid `shouldBe` bid1
204209
205- (tx, txInMode, utxo) <-
210+ (preBody, tx, txInMode, utxo) <-
206211 submitCheckReturn $
207212 MkTxSpec
208213 { actions =
@@ -215,9 +220,20 @@ auctionSpec = describe "Auction" $ do
215220 , specSigner = bidder1
216221 }
217222
218- -- liftIO $ print tx
223+ liftIO $ print tx
224+ liftIO $ putStrLn " ---"
225+
219226 -- liftIO $ print txInMode
220227 liftIO $ print utxo
228+ liftIO $ putStrLn " ---"
229+
230+ let otx = resolvedTxToOura preBody utxo
231+ liftIO $ print $ encode otx
232+ liftIO $ putStrLn " ---"
233+
234+ network <- toShelleyNetwork <$> askNetworkId
235+ mEvent <- liftIO $ extractEvent @ SimpleAuction otx network
236+ liftIO $ print mEvent
221237
222238 submitAndCheck $
223239 MkTxSpec
0 commit comments