Skip to content

Commit

Permalink
chore: remove broken CTxInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
euonymos committed Dec 16, 2024
1 parent 0b866c9 commit a8e0cda
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions src/Cardano/CEM/DSL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import Plutarch.Prelude (
)
import PlutusLedgerApi.V1 (PubKeyHash)
import PlutusLedgerApi.V2 (ToData (..), Value)
import PlutusLedgerApi.V2.Contexts (TxInfo)
import PlutusTx qualified
import Prelude

Expand All @@ -39,8 +38,6 @@ data CVar
CTransition
| -- | Optional custom computation, see 'transitionComp'
CComp
| -- | Plutus transaction context FIXME: how do we use it? Only debugging?
CTxInfo
deriving stock (Show)

genSingletons [''CVar]
Expand All @@ -51,7 +48,6 @@ type family CVarType (cvar :: CVar) script where
CVarType CState script = State script
CVarType CTransition script = Transition script
CVarType CComp script = TransitionComp script
CVarType CTxInfo script = TxInfo

{- | During the initial stage of compilation DSL Values
move from unresolved state where they are represented
Expand Down
1 change: 0 additions & 1 deletion src/Cardano/CEM/OffChain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ compileDsl datum@(params, state) transition dsl = case dsl of
SCComp -> case transitionComp @script of
Just go -> Right $ go params state transition
Nothing -> error "Unreachable"
SCTxInfo -> raiseOnchainErrorMessage ("TxInfo reference" :: String)
IsOnChain -> Right False
GetField @label @datatype @_ @value recordDsl _ -> do
recordValue <- recur recordDsl
Expand Down
3 changes: 1 addition & 2 deletions src/Cardano/CEM/OnChain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Cardano.CEM.DSL (
ConstraintDSL (..),
RecordLabel (MkRecordLabel),
RecordSetter ((::=)),
SCVar (SCComp, SCParams, SCState, SCTransition, SCTxInfo),
SCVar (SCComp, SCParams, SCState, SCTransition),
SameScriptArg (MkSameScriptArg),
TxConstraint (
Error,
Expand Down Expand Up @@ -327,7 +327,6 @@ genericPlutarchScript spec code =
SCTransition -> transition
-- FIXME: is this force good?
SCComp -> pforce comp
SCTxInfo -> pforgetData txInfo
GetField @_ @y @_ @value valueDsl proxyLabel ->
getRecordField
(fieldNum @y proxyLabel)
Expand Down

0 comments on commit a8e0cda

Please sign in to comment.