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

[chain-index]: add inline datums support #488

Merged
30 commits merged into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 33 additions & 18 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Bump this if you need newer packages.
index-state: 2022-02-22T20:47:03Z
index-state: 2022-05-18T00:00:00Z

packages: doc
freer-extras
Expand Down Expand Up @@ -90,7 +90,7 @@ package cardano-wallet-core-integration
source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: eb7854d1337637b8672af1227b276aa33a658f47
tag: 066f7002aac5a0efc20e49643fea45454f226caa
subdir:
contra-tracer
iohk-monitoring
Expand All @@ -101,13 +101,12 @@ source-repository-package
plugins/backend-trace-forwarder

-- Should follow cardano-node.
-- Normally, it should follow "ccf5bcb99ffe054dc8cd5626723f64e02708dbae", but
-- there were bug fixes that we actually need in order to make everything work.
-- This actually follows the release/1.0.0 branch.
-- But in case there are failures with the plutus version, update to the latest
-- commit hash of the release/1.0.0 plutus branch.
source-repository-package
type: git
location: https://github.com/input-output-hk/plutus
tag: 5cc518f1202930ad52b8ba838af32af084c0e754
tag: d24a7540e4659b57ce2ab25dadb968991e232191
subdir:
plutus-core
plutus-ledger-api
Expand Down Expand Up @@ -149,8 +148,8 @@ source-repository-package
-- And it is indeed nice for plutus-apps to track stable releases of the node too.
source-repository-package
type: git
location: https://github.com/ak3n/cw
tag: 538375cb3efa0c66604ff0b13b6ecc0c4a694d64
location: https://github.com/input-output-hk/cardano-wallet
tag: 0cdd1b72a16b2f287b5f1bf137b5eba15bc7f300
subdir:
lib/cli
lib/core
Expand All @@ -165,11 +164,12 @@ source-repository-package

-- Should follow cardano-wallet.
-- More precisally, this should be a version compatible with the current
-- Cardano mainnet (>=1.35)
-- Cardano mainnet (>=1.35).
-- Current version is dated to 2022/05/24.
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-node
tag: 65422ff373f2f88a563afa746a9a16d211ffdc7c
tag: 95c3692cfbd4cdb82071495d771b23e51840fb0e
subdir:
cardano-api
cardano-cli
Expand All @@ -184,7 +184,7 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-config
tag: e9de7a2cf70796f6ff26eac9f9540184ded0e4e6
tag: 1646e9167fab36c0bff82317743b96efa2d3adaa

-- Using a fork until our patches can be merged upstream
source-repository-package
Expand All @@ -201,7 +201,7 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger
tag: 1db68a3ec0a2dcb5751004beb22b906162474f23
tag: e290bf8d0ea272a51e9acd10adc96b4e12e00d37
subdir:
eras/alonzo/impl
eras/babbage/impl
Expand All @@ -218,7 +218,7 @@ source-repository-package
libs/cardano-ledger-core
libs/cardano-ledger-pretty
libs/cardano-protocol-tpraos
libs/compact-map
libs/vector-map
libs/non-integral
libs/set-algebra
libs/small-steps
Expand All @@ -228,10 +228,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-network
tag: ad47441e9e399495579d7dd05ccaf96b46a487b2
tag: 04245dbd69387da98d3a37de9f400965e922bb0e
subdir:
io-classes
io-sim
monoidal-synchronisation
network-mux
ntp-client
Expand All @@ -243,7 +241,23 @@ source-repository-package
ouroboros-network
ouroboros-network-framework
ouroboros-network-testing

-- Should follow cardano-node.
source-repository-package
type: git
location: https://github.com/input-output-hk/io-sim
tag: 57e888b1894829056cb00b7b5785fdf6a74c3271
subdir:
io-classes
io-sim
strict-stm

-- Should follow cardano-node.
source-repository-package
type: git
location: https://github.com/input-output-hk/typed-protocols
tag: 181601bc3d9e9d21a671ce01e0b481348b3ca104
subdir:
typed-protocols
typed-protocols-cborg
typed-protocols-examples
Expand All @@ -252,13 +266,14 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-base
tag: 394c4637c24d82325bd04ceb99c8e8df5617e663
tag: 631cb6cf1fa01ab346233b610a38b3b4cba6e6ab
subdir:
base-deriving-via
binary
binary/test
cardano-crypto-class
cardano-crypto-praos
cardano-crypto-tests
measures
orphans-deriving-via
slotting
Expand All @@ -283,7 +298,7 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-addresses
tag: 56746f558d57a6b1d66d20eaac8a83dc4455cb4f
tag: b9f424cc64459a95a2f190a1839ec9bc94cc778c
subdir:
command-line
core
Expand Down
54 changes: 27 additions & 27 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions nix/pkgs/haskell/sha256map.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"https://github.com/input-output-hk/ekg-forward"."297cd9db5074339a2fb2e5ae7d0780debb670c63" = "1zcwry3y5rmd9lgxy89wsb3k4kpffqji35dc7ghzbz603y1gy24g";
"https://github.com/input-output-hk/cardano-addresses"."56746f558d57a6b1d66d20eaac8a83dc4455cb4f" = "sha256-zo+XJJsIiSkUlcxuPhRQRCxcWYOkDXnAApBF9Pj5Tls=";
"https://github.com/input-output-hk/cardano-base"."394c4637c24d82325bd04ceb99c8e8df5617e663" = "02q8y69za5b0vsnj9qga1364vkmfc1kh35d0yshw1lf7nw9bls8m";
"https://github.com/input-output-hk/cardano-config"."e9de7a2cf70796f6ff26eac9f9540184ded0e4e6" = "1wm1c99r5zvz22pdl8nhkp13falvqmj8dgkm8fxskwa9ydqz01ld";
"https://github.com/input-output-hk/cardano-addresses"."b9f424cc64459a95a2f190a1839ec9bc94cc778c" = "sha256-aXnrl0iGi+eqJQNxcgj6DnmHE40dNF/KtbiHhfG9H0c=";
"https://github.com/input-output-hk/cardano-base"."631cb6cf1fa01ab346233b610a38b3b4cba6e6ab" = "0944wg2nqazmhlmsynwgdwxxj6ay0hb9qig9l128isb2cjia0hlp";
"https://github.com/input-output-hk/cardano-config"."1646e9167fab36c0bff82317743b96efa2d3adaa" = "sha256-TNbpnR7llUgBN2WY7CryMxNVupBIUH01h1hRNHoxboY=";
"https://github.com/input-output-hk/cardano-crypto"."f73079303f663e028288f9f4a9e08bcca39a923e" = "1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q";
"https://github.com/input-output-hk/cardano-ledger"."1db68a3ec0a2dcb5751004beb22b906162474f23" = "03pv2jvskbi65dwaddp6a8bxbbcw674csjxhg8xbqd6q1kfpc41a";
"https://github.com/input-output-hk/cardano-node"."65422ff373f2f88a563afa746a9a16d211ffdc7c" = "0rvwf2nmfn8yad0004qfp1racygriqrd7fd0z2wgbjgh18dfnin2";
"https://github.com/input-output-hk/cardano-ledger"."e290bf8d0ea272a51e9acd10adc96b4e12e00d37" = "sha256-rrxY/hm+lWXL7glNIPOSFQnTZVKG3AXbwzlHpAB6rd4=";
"https://github.com/input-output-hk/cardano-node"."95c3692cfbd4cdb82071495d771b23e51840fb0e" = "sha256-Jc8gFJ3owQ+ArnjTj2YGsDO2j4KNmnEpea2g8PWUkug=";
"https://github.com/input-output-hk/cardano-prelude"."bb4ed71ba8e587f672d06edf9d2e376f4b055555" = "sha256-kgX3DKyfjBb8/XcDEd+/adlETsFlp5sCSurHWgsFAQI=";
"https://github.com/ak3n/cw"."538375cb3efa0c66604ff0b13b6ecc0c4a694d64" = "sha256-rCVX42d2nM67aWBPUu2wdMAGQ6s25VJcrEZwUUYa800=";
"https://github.com/input-output-hk/cardano-wallet"."0cdd1b72a16b2f287b5f1bf137b5eba15bc7f300" = "sha256-fR+HgAjaenaklt9ChhD9c+aWSOeriYZtXxVHf1pg8uQ=";
"https://github.com/input-output-hk/goblins"."cde90a2b27f79187ca8310b6549331e59595e7ba" = "sha256-z9ut0y6umDIjJIRjz9KSvKgotuw06/S8QDwOtVdGiJ0=";
"https://github.com/input-output-hk/hedgehog-extras"."967d79533c21e33387d0227a5f6cc185203fe658" = "0rbqb7a64aya1qizlr3im06hdydg9zr6sl3i8bvqqlf7kpa647sd";
"https://github.com/input-output-hk/iohk-monitoring-framework"."eb7854d1337637b8672af1227b276aa33a658f47" = "1ll81hlhkhj96f5v6lswjkq2h8f7zcmdrj2azqhi4ylzafn026r3";
"https://github.com/input-output-hk/iohk-monitoring-framework"."066f7002aac5a0efc20e49643fea45454f226caa" = "sha256-0ia5UflYEmBYepj2gkJy9msknklI0UPtUavMEGwk3Wg=";
"https://github.com/input-output-hk/io-sim"."57e888b1894829056cb00b7b5785fdf6a74c3271" = "sha256-TviSvCBEYtlKEo9qJmE8pCE25nMjDi8HeIAFniunaM8=";
"https://github.com/input-output-hk/optparse-applicative"."7497a29cb998721a9068d5725d49461f2bba0e7a" = "1gvsrg925vynwgqwplgjmp53vj953qyh3wbdf34pw21c8r47w35r";
"https://github.com/input-output-hk/ouroboros-network"."ad47441e9e399495579d7dd05ccaf96b46a487b2" = "1a54yfc4m9n5j699cn8ln524h28043dyrlzn34wmnhsgqnxhavr4";
"https://github.com/input-output-hk/plutus"."5cc518f1202930ad52b8ba838af32af084c0e754" = "sha256-bmkP98dcMdDDmAk5UsceYh0Wme19Z0squHWJnY8FO3E=";
"https://github.com/input-output-hk/ouroboros-network"."04245dbd69387da98d3a37de9f400965e922bb0e" = "sha256-V7D5R7ouqih57R+VQSTUJkeH7UkmmZ8wb4EQeBhl7i0=";
"https://github.com/input-output-hk/plutus"."d24a7540e4659b57ce2ab25dadb968991e232191" = "sha256-SlH4qKV5PxDEqvR+V2cpaWA8oZKCT+dVgLMoNeFT9JU=";
"https://github.com/input-output-hk/purescript-bridge"."47a1f11825a0f9445e0f98792f79172efef66c00" = "0da1vn2l6iyfxcjk58qal1l4755v92zi6yppmjmqvxf1gacyf9px";
"https://github.com/input-output-hk/servant-purescript"."44e7cacf109f84984cd99cd3faf185d161826963" = "10pb0yfp80jhb9ryn65a4rha2lxzsn2vlhcc6xphrrkf4x5lhzqc";
"https://github.com/input-output-hk/typed-protocols"."181601bc3d9e9d21a671ce01e0b481348b3ca104" = "sha256-5Wof5yTKb12EPY6B8LfapX18xNZZpF+rvhnQ88U6KdM=";
"https://github.com/input-output-hk/Win32-network"."3825d3abf75f83f406c1f7161883c438dac7277d" = "19wahfv726fa3mqajpqdqhnl9ica3xmf68i254q45iyjcpj1psqx";
"https://github.com/Quid2/flat"."ee59880f47ab835dbd73bea0847dab7869fc20d8" = "1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm";
"https://github.com/vshabanov/ekg-json"."00ebe7211c981686e65730b7144fbf5350462608" = "sha256-VT8Ur585TCn03P2TVi6t92v2Z6tl8vKijICjse6ocv8=";
Expand Down
31 changes: 29 additions & 2 deletions playground-common/src/PSGenerator/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import Control.Monad.Freer.Extras.Beam (BeamError, BeamLog)
import Control.Monad.Freer.Extras.Pagination (Page, PageQuery, PageSize)
import Control.Monad.Reader (MonadReader)
import Gist (Gist, GistFile, GistId, NewGist, NewGistFile, Owner)
import Language.PureScript.Bridge (BridgePart, Language (Haskell), PSType, SumType, TypeInfo (TypeInfo), argonaut,
import Language.PureScript.Bridge (BridgePart, DataConstructor (DataConstructor, _sigConstructor, _sigValues),
DataConstructorArgs (Nullary), Instance (Eq, Generic, GenericShow, Json, Ord),
Language (Haskell), PSType, SumType (SumType),
TypeInfo (TypeInfo, _typeModule, _typeName, _typePackage, _typeParameters), argonaut,
equal, equal1, functor, genericShow, mkSumType, order, psTypeParameters, typeModule,
typeName, (^==))
import Language.PureScript.Bridge.Builder (BridgeData)
Expand All @@ -37,7 +40,8 @@ import Playground.Types (ContractCall, FunctionSchema, KnownCurrency)
import Plutus.ChainIndex.Api (IsUtxoResponse, TxosResponse, UtxosResponse)
import Plutus.ChainIndex.ChainIndexError (ChainIndexError)
import Plutus.ChainIndex.ChainIndexLog (ChainIndexLog)
import Plutus.ChainIndex.Tx (ChainIndexTx, ChainIndexTxOutputs)
import Plutus.ChainIndex.Tx (ChainIndexTx, ChainIndexTxOutputs, ReferenceScript)
import Plutus.ChainIndex.Tx qualified as ChainIndex
import Plutus.ChainIndex.Types (BlockNumber, Depth, Point, RollbackState, Tip, TxOutState, TxValidity)
import Plutus.ChainIndex.UtxoState (InsertUtxoFailed, InsertUtxoPosition, RollbackFailed)
import Plutus.Contract.Checkpoint (CheckpointError)
Expand All @@ -50,6 +54,7 @@ import Plutus.Trace.Emulator.Types (ContractInstanceLog, ContractInstanceMsg, Co
import Plutus.Trace.Scheduler (Priority, SchedulerLog, StopReason, ThreadEvent, ThreadId)
import Plutus.Trace.Tag (Tag)
import Plutus.V1.Ledger.Api (DatumHash, MintingPolicy, StakeValidator, Validator)
import Plutus.V2.Ledger.Tx qualified as PV2
import Schema (FormArgumentF, FormSchema)
import Wallet.API (WalletAPIError)
import Wallet.Emulator.Types qualified as EM
Expand Down Expand Up @@ -303,6 +308,22 @@ headerBridge = do
servantBridge :: BridgePart
servantBridge = headersBridge <|> headerBridge

-- TODO: implement a proper SumType, this is a stub to make purescript compile
scriptAnyLangType :: SumType 'Haskell
scriptAnyLangType = SumType (
TypeInfo {
_typePackage = "crdn-p-1.33.0-c62ffc00"
, _typeModule = "Cardano.Api.Script"
, _typeName = "ScriptInAnyLang"
, _typeParameters = []
}
) [
DataConstructor {_sigConstructor = "SimpleScriptLanguageV1", _sigValues = Nullary}
, DataConstructor {_sigConstructor = "SimpleScriptLanguageV2", _sigValues = Nullary}
, DataConstructor {_sigConstructor = "PlutusScriptLanguageV1", _sigValues = Nullary}
, DataConstructor {_sigConstructor = "PlutusScriptLanguageV2", _sigValues = Nullary}
] [Eq,GenericShow,Json,Ord,Generic]

------------------------------------------------------------
ledgerTypes :: [SumType 'Haskell]
ledgerTypes =
Expand All @@ -320,6 +341,11 @@ ledgerTypes =
, equal . genericShow . argonaut $ mkSumType @OnChainTx
, equal . genericShow . argonaut $ mkSumType @UtxoIndex
, equal . genericShow . argonaut $ mkSumType @Value
-- v2
, equal . genericShow . argonaut $ mkSumType @PV2.OutputDatum
, equal . genericShow . argonaut $ mkSumType @ReferenceScript
, scriptAnyLangType
-- v2-end
, functor . equal . genericShow . argonaut $ mkSumType @(Extended A)
, functor . equal . genericShow . argonaut $ mkSumType @(Interval A)
, functor . equal . genericShow . argonaut $ mkSumType @(LowerBound A)
Expand Down Expand Up @@ -387,6 +413,7 @@ ledgerTypes =
, equal . genericShow . argonaut $ mkSumType @TxosResponse
, equal . genericShow . argonaut $ mkSumType @UtxosResponse
, equal . genericShow . argonaut $ mkSumType @ChainIndexTx
, equal . genericShow . argonaut $ mkSumType @ChainIndex.ChainIndexTxOut
, equal . genericShow . argonaut $ mkSumType @ChainIndexTxOutputs
, equal . genericShow . argonaut $ mkSumType @ChainIndexTxOut
, equal . genericShow . argonaut $ mkSumType @ChainIndexLog
Expand Down
Loading