forked from IntersectMBO/plutus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for the
preserve-logging
flag. (IntersectMBO#6162)
- Loading branch information
Showing
4 changed files
with
65 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
plutus-tx-plugin/test/Plugin/NoTrace/WithPreservedLogging.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE NoImplicitPrelude #-} | ||
{-# LANGUAGE TypeApplications #-} | ||
{-# OPTIONS_GHC -fplugin PlutusTx.Plugin #-} | ||
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:no-conservative-optimisation #-} | ||
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:preserve-logging #-} | ||
|
||
module Plugin.NoTrace.WithPreservedLogging where | ||
|
||
import Data.Proxy (Proxy (..)) | ||
import Plugin.NoTrace.Lib qualified as Lib | ||
import PlutusTx.Bool (Bool) | ||
import PlutusTx.Builtins (BuiltinString, Integer) | ||
import PlutusTx.Code (CompiledCode) | ||
import PlutusTx.Plugin (plc) | ||
|
||
traceArgument :: CompiledCode (BuiltinString -> ()) | ||
traceArgument = plc (Proxy @"traceArgument") Lib.traceArgument | ||
|
||
traceShow :: CompiledCode () | ||
traceShow = plc (Proxy @"traceShow") Lib.traceShow | ||
|
||
traceDirect :: CompiledCode () | ||
traceDirect = plc (Proxy @"traceDirect") Lib.traceDirect | ||
|
||
traceNonConstant :: CompiledCode (BuiltinString -> BuiltinString) | ||
traceNonConstant = plc (Proxy @"traceNonConstant") Lib.traceNonConstant | ||
|
||
traceComplex :: CompiledCode (Bool -> ()) | ||
traceComplex = plc (Proxy @"traceComplex") Lib.traceComplex | ||
|
||
traceRepeatedly :: CompiledCode Integer | ||
traceRepeatedly = plc (Proxy @"traceRepeatedly") Lib.traceRepeatedly | ||
|
||
traceImpure :: CompiledCode () | ||
traceImpure = plc (Proxy @"traceImpure") Lib.traceImpure |