Skip to content

Commit

Permalink
plutus-playground: Fix the display of contract instance log messages (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mueller committed Jan 11, 2021
1 parent 3da9481 commit 82faf62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plutus-playground-client/src/Chain.purs
Expand Up @@ -27,11 +27,11 @@ import Halogen.HTML.Events (onClick)
import Halogen.HTML.Properties (class_, classes)
import Icons (Icon(..), icon)
import Language.PlutusTx.AssocMap as AssocMap
import Plutus.Trace.Emulator.Types (ContractInstanceLog(..))
import Plutus.Trace.Emulator.Types (ContractInstanceLog(..), _ContractInstanceTag)
import Ledger.Slot (Slot(..))
import Ledger.TxId (TxId(TxId))
import Ledger.Value (CurrencySymbol, TokenName)
import Playground.Lenses (_tokenName)
import Playground.Lenses (_tokenName, _contractInstanceTag)
import Playground.Types (EvaluationResult(EvaluationResult), SimulatorWallet)
import Prelude (const, map, show, unit, ($), (<$>), (<<<), (<>))
import Types (ChildSlots, HAction(..), View(..), _balancesChartSlot, _simulatorWalletBalance, _simulatorWalletWallet, _walletId)
Expand Down Expand Up @@ -132,7 +132,7 @@ emulatorEventPane (WalletEvent (Wallet walletId) logMessage) =

emulatorEventPane (InstanceEvent (ContractInstanceLog { _cilMessage, _cilTag })) =
div_
[ text $ show _cilMessage <> ": " <> show _cilMessage ]
[ text $ (view _contractInstanceTag _cilTag) <> ": " <> show _cilMessage ]

-- TODO: Figure out which of the remaining log messages we want to display.
-- (Note that most of the remaining log messages aren't produced at the
Expand Down
3 changes: 3 additions & 0 deletions web-common/src/Playground/Lenses.purs
Expand Up @@ -40,6 +40,9 @@ _schema = prop (SProxy :: SProxy "schema")
_txConfirmed :: forall s r a. Newtype s { unTxConfirmed :: a | r } => Lens' s a
_txConfirmed = _Newtype <<< prop (SProxy :: SProxy "unTxConfirmed")

_contractInstanceTag :: forall s r a. Newtype s { unContractInstanceTag :: a | r } => Lens' s a
_contractInstanceTag = _Newtype <<< prop (SProxy :: SProxy "unContractInstanceTag")

_txId :: Lens' TxId String
_txId = _Newtype <<< prop (SProxy :: SProxy "getTxId")

Expand Down

0 comments on commit 82faf62

Please sign in to comment.