Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Regenerate purescript.
Browse files Browse the repository at this point in the history
  • Loading branch information
zmrocze committed Jun 26, 2022
1 parent 14cc8d4 commit f61e2d7
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype, unwrap)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Type.Proxy (Proxy(Proxy))
import Data.Argonaut.Decode.Aeson as D
import Data.Argonaut.Encode.Aeson as E
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Data.Set (Set)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Address (PaymentPubKeyHash)
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Ledger.Typed.Tx (ConnectionError)
import Plutus.V1.Ledger.Interval (Interval)
import Plutus.V1.Ledger.Scripts (DatumHash)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Crypto (PubKey, Signature)
import Ledger.Slot (Slot)
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Plutus.V1.Ledger.Crypto (PubKeyHash)
import Plutus.V1.Ledger.Scripts (DatumHash, ScriptError, Validator)
import Plutus.V1.Ledger.Tx (RedeemerPtr, TxIn, TxOut, TxOutRef)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import Data.Lens (Iso', Lens', Prism', iso, prism')
import Data.Lens.Iso.Newtype (_Newtype)
import Data.Lens.Record (prop)
import Data.Maybe (Maybe(..))
import Data.Newtype (unwrap)
import Data.Newtype (class Newtype, unwrap)
import Data.RawJson (RawJson)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Plutus.V1.Ledger.Address (Address)
import Plutus.V1.Ledger.Scripts (DatumHash, Validator)
import Plutus.V1.Ledger.Tx (TxOut)
import Plutus.V1.Ledger.Value (Value)
import Type.Proxy (Proxy(Proxy))
import Data.Argonaut.Decode.Aeson as D
Expand Down Expand Up @@ -139,3 +140,40 @@ _ScriptChainIndexTxOut :: Prism' ChainIndexTxOut { _ciTxOutAddress :: Address, _
_ScriptChainIndexTxOut = prism' ScriptChainIndexTxOut case _ of
(ScriptChainIndexTxOut a) -> Just a
_ -> Nothing

--------------------------------------------------------------------------------

newtype TxOutTx = TxOutTx
{ txOutTxTx :: Tx
, txOutTxOut :: TxOut
}

derive instance Eq TxOutTx

instance Show TxOutTx where
show a = genericShow a

instance EncodeJson TxOutTx where
encodeJson = defer \_ -> E.encode $ unwrap >$<
( E.record
{ txOutTxTx: E.value :: _ Tx
, txOutTxOut: E.value :: _ TxOut
}
)

instance DecodeJson TxOutTx where
decodeJson = defer \_ -> D.decode $
( TxOutTx <$> D.record "TxOutTx"
{ txOutTxTx: D.value :: _ Tx
, txOutTxOut: D.value :: _ TxOut
}
)

derive instance Generic TxOutTx _

derive instance Newtype TxOutTx _

--------------------------------------------------------------------------------

_TxOutTx :: Iso' TxOutTx { txOutTxTx :: Tx, txOutTxOut :: TxOut }
_TxOutTx = _Newtype
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Data.Maybe (Maybe(..))
import Data.Newtype (unwrap)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Plutus.V1.Ledger.Tx (ScriptTag)
import Type.Proxy (Proxy(Proxy))
import Data.Argonaut.Decode.Aeson as D
import Data.Argonaut.Encode.Aeson as E
Expand Down Expand Up @@ -66,10 +65,10 @@ data ToCardanoError
| OutputHasZeroAda
| StakingPointersNotSupported
| SimpleScriptsNotSupportedToCardano
| MissingTxInType
| MissingMintingPolicyRedeemer
| MissingInputValidator
| MissingDatum
| MissingMintingPolicy
| ScriptPurposeNotSupported ScriptTag
| MissingStakeValidator
| Tag String ToCardanoError

derive instance Eq ToCardanoError
Expand All @@ -86,10 +85,10 @@ instance EncodeJson ToCardanoError where
OutputHasZeroAda -> encodeJson { tag: "OutputHasZeroAda", contents: jsonNull }
StakingPointersNotSupported -> encodeJson { tag: "StakingPointersNotSupported", contents: jsonNull }
SimpleScriptsNotSupportedToCardano -> encodeJson { tag: "SimpleScriptsNotSupportedToCardano", contents: jsonNull }
MissingTxInType -> encodeJson { tag: "MissingTxInType", contents: jsonNull }
MissingMintingPolicyRedeemer -> encodeJson { tag: "MissingMintingPolicyRedeemer", contents: jsonNull }
MissingInputValidator -> encodeJson { tag: "MissingInputValidator", contents: jsonNull }
MissingDatum -> encodeJson { tag: "MissingDatum", contents: jsonNull }
MissingMintingPolicy -> encodeJson { tag: "MissingMintingPolicy", contents: jsonNull }
ScriptPurposeNotSupported a -> E.encodeTagged "ScriptPurposeNotSupported" a E.value
MissingStakeValidator -> encodeJson { tag: "MissingStakeValidator", contents: jsonNull }
Tag a b -> E.encodeTagged "Tag" (a /\ b) (E.tuple (E.value >/\< E.value))

instance DecodeJson ToCardanoError where
Expand All @@ -103,10 +102,10 @@ instance DecodeJson ToCardanoError where
, "OutputHasZeroAda" /\ pure OutputHasZeroAda
, "StakingPointersNotSupported" /\ pure StakingPointersNotSupported
, "SimpleScriptsNotSupportedToCardano" /\ pure SimpleScriptsNotSupportedToCardano
, "MissingTxInType" /\ pure MissingTxInType
, "MissingMintingPolicyRedeemer" /\ pure MissingMintingPolicyRedeemer
, "MissingInputValidator" /\ pure MissingInputValidator
, "MissingDatum" /\ pure MissingDatum
, "MissingMintingPolicy" /\ pure MissingMintingPolicy
, "ScriptPurposeNotSupported" /\ D.content (ScriptPurposeNotSupported <$> D.value)
, "MissingStakeValidator" /\ pure MissingStakeValidator
, "Tag" /\ D.content (D.tuple $ Tag </$\> D.value </*\> D.value)
]

Expand Down Expand Up @@ -149,24 +148,24 @@ _SimpleScriptsNotSupportedToCardano = prism' (const SimpleScriptsNotSupportedToC
SimpleScriptsNotSupportedToCardano -> Just unit
_ -> Nothing

_MissingTxInType :: Prism' ToCardanoError Unit
_MissingTxInType = prism' (const MissingTxInType) case _ of
MissingTxInType -> Just unit
_MissingInputValidator :: Prism' ToCardanoError Unit
_MissingInputValidator = prism' (const MissingInputValidator) case _ of
MissingInputValidator -> Just unit
_ -> Nothing

_MissingMintingPolicyRedeemer :: Prism' ToCardanoError Unit
_MissingMintingPolicyRedeemer = prism' (const MissingMintingPolicyRedeemer) case _ of
MissingMintingPolicyRedeemer -> Just unit
_MissingDatum :: Prism' ToCardanoError Unit
_MissingDatum = prism' (const MissingDatum) case _ of
MissingDatum -> Just unit
_ -> Nothing

_MissingMintingPolicy :: Prism' ToCardanoError Unit
_MissingMintingPolicy = prism' (const MissingMintingPolicy) case _ of
MissingMintingPolicy -> Just unit
_ -> Nothing

_ScriptPurposeNotSupported :: Prism' ToCardanoError ScriptTag
_ScriptPurposeNotSupported = prism' ScriptPurposeNotSupported case _ of
(ScriptPurposeNotSupported a) -> Just a
_MissingStakeValidator :: Prism' ToCardanoError Unit
_MissingStakeValidator = prism' (const MissingStakeValidator) case _ of
MissingStakeValidator -> Just unit
_ -> Nothing

_Tag :: Prism' ToCardanoError { a :: String, b :: ToCardanoError }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Data.Tuple (Tuple)
import Data.Tuple.Nested ((/\))
import Ledger.Index.Internal (UtxoIndex)
import Ledger.Slot (Slot)
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Playground.Types (FunctionSchema)
import Plutus.Contract.Effects (ActiveEndpoint, PABReq)
import Plutus.PAB.Events.ContractInstanceState (PartiallyDecodedResponse)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Data.Newtype (class Newtype, unwrap)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Address (PaymentPubKeyHash)
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Plutus.V1.Ledger.Tx (TxId, TxIn, TxOut)
import Plutus.V1.Ledger.Value (Value)
import Type.Proxy (Proxy(Proxy))
Expand Down
2 changes: 1 addition & 1 deletion plutus-playground-client/generated/Ledger/Blockchain.purs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Data.Maybe (Maybe(..))
import Data.Newtype (class Newtype, unwrap)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Type.Proxy (Proxy(Proxy))
import Data.Argonaut.Decode.Aeson as D
import Data.Argonaut.Encode.Aeson as E
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Data.Set (Set)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Address (PaymentPubKeyHash)
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Ledger.Typed.Tx (ConnectionError)
import Plutus.V1.Ledger.Interval (Interval)
import Plutus.V1.Ledger.Scripts (DatumHash)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Crypto (PubKey, Signature)
import Ledger.Slot (Slot)
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Plutus.V1.Ledger.Crypto (PubKeyHash)
import Plutus.V1.Ledger.Scripts (DatumHash, ScriptError, Validator)
import Plutus.V1.Ledger.Tx (RedeemerPtr, TxIn, TxOut, TxOutRef)
Expand Down
42 changes: 40 additions & 2 deletions plutus-playground-client/generated/Ledger/Tx.purs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import Data.Lens (Iso', Lens', Prism', iso, prism')
import Data.Lens.Iso.Newtype (_Newtype)
import Data.Lens.Record (prop)
import Data.Maybe (Maybe(..))
import Data.Newtype (unwrap)
import Data.Newtype (class Newtype, unwrap)
import Data.RawJson (RawJson)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Ledger.Tx.Internal (Tx)
import Ledger.Tx.Types.Tx (Tx)
import Plutus.V1.Ledger.Address (Address)
import Plutus.V1.Ledger.Scripts (DatumHash, Validator)
import Plutus.V1.Ledger.Tx (TxOut)
import Plutus.V1.Ledger.Value (Value)
import Type.Proxy (Proxy(Proxy))
import Data.Argonaut.Decode.Aeson as D
Expand Down Expand Up @@ -139,3 +140,40 @@ _ScriptChainIndexTxOut :: Prism' ChainIndexTxOut { _ciTxOutAddress :: Address, _
_ScriptChainIndexTxOut = prism' ScriptChainIndexTxOut case _ of
(ScriptChainIndexTxOut a) -> Just a
_ -> Nothing

--------------------------------------------------------------------------------

newtype TxOutTx = TxOutTx
{ txOutTxTx :: Tx
, txOutTxOut :: TxOut
}

derive instance Eq TxOutTx

instance Show TxOutTx where
show a = genericShow a

instance EncodeJson TxOutTx where
encodeJson = defer \_ -> E.encode $ unwrap >$<
( E.record
{ txOutTxTx: E.value :: _ Tx
, txOutTxOut: E.value :: _ TxOut
}
)

instance DecodeJson TxOutTx where
decodeJson = defer \_ -> D.decode $
( TxOutTx <$> D.record "TxOutTx"
{ txOutTxTx: D.value :: _ Tx
, txOutTxOut: D.value :: _ TxOut
}
)

derive instance Generic TxOutTx _

derive instance Newtype TxOutTx _

--------------------------------------------------------------------------------

_TxOutTx :: Iso' TxOutTx { txOutTxTx :: Tx, txOutTxOut :: TxOut }
_TxOutTx = _Newtype
37 changes: 18 additions & 19 deletions plutus-playground-client/generated/Ledger/Tx/CardanoAPI.purs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Data.Maybe (Maybe(..))
import Data.Newtype (unwrap)
import Data.Show.Generic (genericShow)
import Data.Tuple.Nested ((/\))
import Plutus.V1.Ledger.Tx (ScriptTag)
import Type.Proxy (Proxy(Proxy))
import Data.Argonaut.Decode.Aeson as D
import Data.Argonaut.Encode.Aeson as E
Expand Down Expand Up @@ -66,10 +65,10 @@ data ToCardanoError
| OutputHasZeroAda
| StakingPointersNotSupported
| SimpleScriptsNotSupportedToCardano
| MissingTxInType
| MissingMintingPolicyRedeemer
| MissingInputValidator
| MissingDatum
| MissingMintingPolicy
| ScriptPurposeNotSupported ScriptTag
| MissingStakeValidator
| Tag String ToCardanoError

derive instance Eq ToCardanoError
Expand All @@ -86,10 +85,10 @@ instance EncodeJson ToCardanoError where
OutputHasZeroAda -> encodeJson { tag: "OutputHasZeroAda", contents: jsonNull }
StakingPointersNotSupported -> encodeJson { tag: "StakingPointersNotSupported", contents: jsonNull }
SimpleScriptsNotSupportedToCardano -> encodeJson { tag: "SimpleScriptsNotSupportedToCardano", contents: jsonNull }
MissingTxInType -> encodeJson { tag: "MissingTxInType", contents: jsonNull }
MissingMintingPolicyRedeemer -> encodeJson { tag: "MissingMintingPolicyRedeemer", contents: jsonNull }
MissingInputValidator -> encodeJson { tag: "MissingInputValidator", contents: jsonNull }
MissingDatum -> encodeJson { tag: "MissingDatum", contents: jsonNull }
MissingMintingPolicy -> encodeJson { tag: "MissingMintingPolicy", contents: jsonNull }
ScriptPurposeNotSupported a -> E.encodeTagged "ScriptPurposeNotSupported" a E.value
MissingStakeValidator -> encodeJson { tag: "MissingStakeValidator", contents: jsonNull }
Tag a b -> E.encodeTagged "Tag" (a /\ b) (E.tuple (E.value >/\< E.value))

instance DecodeJson ToCardanoError where
Expand All @@ -103,10 +102,10 @@ instance DecodeJson ToCardanoError where
, "OutputHasZeroAda" /\ pure OutputHasZeroAda
, "StakingPointersNotSupported" /\ pure StakingPointersNotSupported
, "SimpleScriptsNotSupportedToCardano" /\ pure SimpleScriptsNotSupportedToCardano
, "MissingTxInType" /\ pure MissingTxInType
, "MissingMintingPolicyRedeemer" /\ pure MissingMintingPolicyRedeemer
, "MissingInputValidator" /\ pure MissingInputValidator
, "MissingDatum" /\ pure MissingDatum
, "MissingMintingPolicy" /\ pure MissingMintingPolicy
, "ScriptPurposeNotSupported" /\ D.content (ScriptPurposeNotSupported <$> D.value)
, "MissingStakeValidator" /\ pure MissingStakeValidator
, "Tag" /\ D.content (D.tuple $ Tag </$\> D.value </*\> D.value)
]

Expand Down Expand Up @@ -149,24 +148,24 @@ _SimpleScriptsNotSupportedToCardano = prism' (const SimpleScriptsNotSupportedToC
SimpleScriptsNotSupportedToCardano -> Just unit
_ -> Nothing

_MissingTxInType :: Prism' ToCardanoError Unit
_MissingTxInType = prism' (const MissingTxInType) case _ of
MissingTxInType -> Just unit
_MissingInputValidator :: Prism' ToCardanoError Unit
_MissingInputValidator = prism' (const MissingInputValidator) case _ of
MissingInputValidator -> Just unit
_ -> Nothing

_MissingMintingPolicyRedeemer :: Prism' ToCardanoError Unit
_MissingMintingPolicyRedeemer = prism' (const MissingMintingPolicyRedeemer) case _ of
MissingMintingPolicyRedeemer -> Just unit
_MissingDatum :: Prism' ToCardanoError Unit
_MissingDatum = prism' (const MissingDatum) case _ of
MissingDatum -> Just unit
_ -> Nothing

_MissingMintingPolicy :: Prism' ToCardanoError Unit
_MissingMintingPolicy = prism' (const MissingMintingPolicy) case _ of
MissingMintingPolicy -> Just unit
_ -> Nothing

_ScriptPurposeNotSupported :: Prism' ToCardanoError ScriptTag
_ScriptPurposeNotSupported = prism' ScriptPurposeNotSupported case _ of
(ScriptPurposeNotSupported a) -> Just a
_MissingStakeValidator :: Prism' ToCardanoError Unit
_MissingStakeValidator = prism' (const MissingStakeValidator) case _ of
MissingStakeValidator -> Just unit
_ -> Nothing

_Tag :: Prism' ToCardanoError { a :: String, b :: ToCardanoError }
Expand Down
Loading

0 comments on commit f61e2d7

Please sign in to comment.