allow disabling tracing in script export

This commit is contained in:
Emily Martins 2022-08-30 13:42:54 +02:00
parent 156a73212c
commit e572516918
2 changed files with 18 additions and 18 deletions

View file

@ -6,6 +6,13 @@ This format is based on [Keep A Changelog](https://keepachangelog.com/en/1.0.0).
### Modified
- `tracing` flag in `ScriptParams` of `agora-scripts` to enable/disable tracing in exported scripts.
NOTE: This changes the representation of `ScriptParams`. In order to preserve old behavior, the flag
must be set to `True`.
Included by [#167](https://github.com/Liqwid-Labs/agora/pull/167).
- `effects` of `Proposaldatum` is now required to be sorted in ascending order. The uniqueness of result tags is also guaranteed.
`ProposalVotes` should be sorted the same way as a result.

View file

@ -20,7 +20,7 @@ import Data.Tagged (Tagged)
import Data.Text (Text)
import Development.GitRev (gitBranch, gitHash)
import GHC.Generics qualified as GHC
import Plutarch (Config (Config, tracingMode), TracingMode (DoTracing))
import Plutarch (Config (Config, tracingMode), TracingMode (DoTracing, NoTracing))
import PlutusLedgerApi.V1 (
MintingPolicy (getMintingPolicy),
TxOutRef,
@ -97,17 +97,19 @@ agoraScripts params =
scripts = Bootstrap.agoraScripts plutarchConfig governor
plutarchConfig :: Config
plutarchConfig = Config {tracingMode = if params.tracing then DoTracing else NoTracing}
{- | Params required for creating script export.
@since 0.2.0
@since 1.0.0
-}
data ScriptParams where
ScriptParams ::
{ governorInitialSpend :: TxOutRef
, gtClassRef :: Tagged GTTag AssetClass
, maximumCosigners :: Integer
} ->
ScriptParams
data ScriptParams = ScriptParams
{ governorInitialSpend :: TxOutRef
, gtClassRef :: Tagged GTTag AssetClass
, maximumCosigners :: Integer
, tracing :: Bool
}
deriving anyclass (Aeson.ToJSON, Aeson.FromJSON)
deriving stock (Show, Eq, GHC.Generic, Ord)
@ -140,15 +142,6 @@ data AgoraScripts = AgoraScripts
GHC.Generic
)
{- | Default plutarch configuration for compiling scripts.
TODO: we should have an option to control this.
@since 0.2.0
-}
plutarchConfig :: Config
plutarchConfig = Config {tracingMode = DoTracing}
{- | Turn a precompiled minting policy to a 'ScriptInfo'.
@since 0.2.0