bump plutarch to staging rev
This commit is contained in:
parent
93dcd14847
commit
7003c4556e
7 changed files with 120 additions and 74 deletions
|
|
@ -4,39 +4,11 @@ import Prelude
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
import Plutus.V1.Ledger.Value qualified as Value
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
import Plutarch.Benchmark
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
import Agora.AuthorityToken (
|
|
||||||
AuthorityToken (AuthorityToken),
|
|
||||||
authorityTokenPolicy,
|
|
||||||
)
|
|
||||||
import Agora.SafeMoney (LQ)
|
|
||||||
import Agora.Stake (
|
|
||||||
Stake (Stake),
|
|
||||||
stakePolicy,
|
|
||||||
stakeValidator,
|
|
||||||
)
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = pure ()
|
||||||
benchMain benchmarks
|
|
||||||
|
|
||||||
benchmarks :: [NamedBenchmark]
|
|
||||||
benchmarks =
|
|
||||||
benchGroup
|
|
||||||
"full_scripts"
|
|
||||||
[ bench "authorityTokenPolicy" $ authorityTokenPolicy authorityToken
|
|
||||||
, bench "stakePolicy" $ stakePolicy (Stake @LQ)
|
|
||||||
, bench "stakeValidator" $ stakeValidator (Stake @LQ)
|
|
||||||
]
|
|
||||||
|
|
||||||
authorityToken :: AuthorityToken
|
|
||||||
authorityToken = AuthorityToken (Value.assetClass "" "")
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import Plutarch.Api.V1 (
|
||||||
mkValidator,
|
mkValidator,
|
||||||
validatorHash,
|
validatorHash,
|
||||||
)
|
)
|
||||||
import Plutus.V1.Ledger.Ada (adaValueOf)
|
|
||||||
import Plutus.V1.Ledger.Api (
|
import Plutus.V1.Ledger.Api (
|
||||||
Address (Address),
|
Address (Address),
|
||||||
Credential (ScriptCredential),
|
Credential (ScriptCredential),
|
||||||
|
|
@ -84,7 +83,7 @@ stakeCreation =
|
||||||
, txOutDatumHash = Just (DatumHash "")
|
, txOutDatumHash = Just (DatumHash "")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
, txInfoFee = adaValueOf 2
|
, txInfoFee = Value.singleton "" "" 2
|
||||||
, txInfoMint = st
|
, txInfoMint = st
|
||||||
, txInfoDCert = []
|
, txInfoDCert = []
|
||||||
, txInfoWdrl = []
|
, txInfoWdrl = []
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import Test.Tasty.HUnit (assertFailure, testCase)
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
import Plutarch (compile)
|
import Plutarch (compile)
|
||||||
import Plutarch.Evaluate (evaluateScript)
|
import Plutarch.Evaluate (evalScript)
|
||||||
import Plutus.V1.Ledger.Scripts (Script)
|
import Plutus.V1.Ledger.Scripts (Script)
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
@ -34,6 +34,8 @@ tests =
|
||||||
|
|
||||||
scriptTest :: String -> Script -> TestTree
|
scriptTest :: String -> Script -> TestTree
|
||||||
scriptTest name script = testCase name $ do
|
scriptTest name script = testCase name $ do
|
||||||
case evaluateScript script of
|
let (res, _budget, traces) = evalScript script
|
||||||
Left e -> assertFailure (show e)
|
case res of
|
||||||
|
Left e -> do
|
||||||
|
assertFailure (show e <> " Traces: " <> show traces)
|
||||||
Right _v -> pure ()
|
Right _v -> pure ()
|
||||||
|
|
|
||||||
|
|
@ -162,4 +162,3 @@ benchmark agora-bench
|
||||||
type: exitcode-stdio-1.0
|
type: exitcode-stdio-1.0
|
||||||
build-depends:
|
build-depends:
|
||||||
, agora
|
, agora
|
||||||
, plutarch-benchmark
|
|
||||||
|
|
|
||||||
|
|
@ -202,8 +202,8 @@ stakePolicy _stake =
|
||||||
|
|
||||||
-- TODO: Needs to be >=, rather than ==
|
-- TODO: Needs to be >=, rather than ==
|
||||||
let valueCorrect = pdata value #== pdata expectedValue
|
let valueCorrect = pdata value #== pdata expectedValue
|
||||||
ptraceIfFalse "ownerSignsTransaction" ownerSignsTransaction
|
ownerSignsTransaction
|
||||||
#&& ptraceIfFalse "valueCorrect" valueCorrect
|
#&& valueCorrect
|
||||||
popaque (pconstant ())
|
popaque (pconstant ())
|
||||||
|
|
||||||
pif (0 #< mintedST) minting burning
|
pif (0 #< mintedST) minting burning
|
||||||
|
|
|
||||||
140
flake.lock
generated
140
flake.lock
generated
|
|
@ -48,23 +48,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Win32-network": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1636063162,
|
|
||||||
"narHash": "sha256-uvYEWalN62ETpH45/O7lNHo4rAIaJtYpLWdIcAkq3dA=",
|
|
||||||
"owner": "input-output-hk",
|
|
||||||
"repo": "Win32-network",
|
|
||||||
"rev": "2d1a01c7cbb9f68a1aefe2934aad6c70644ebfea",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "input-output-hk",
|
|
||||||
"repo": "Win32-network",
|
|
||||||
"rev": "2d1a01c7cbb9f68a1aefe2934aad6c70644ebfea",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"apropos-tx": {
|
"apropos-tx": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
|
|
@ -92,6 +75,23 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"autodocodec": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1644358110,
|
||||||
|
"narHash": "sha256-X1TNZlmO2qDFk3OL4Z1v/gzvd3ouoACAiMweutsYek4=",
|
||||||
|
"owner": "srid",
|
||||||
|
"repo": "autodocodec",
|
||||||
|
"rev": "42b42a7407f33c6c74fa4e8c84906aebfed28daf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "srid",
|
||||||
|
"ref": "ghc921",
|
||||||
|
"repo": "autodocodec",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"cabal-32": {
|
"cabal-32": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
@ -650,16 +650,16 @@
|
||||||
"haskell-language-server_3": {
|
"haskell-language-server_3": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1638136578,
|
"lastModified": 1643835246,
|
||||||
"narHash": "sha256-Reo9BQ12O+OX7tuRfaDPZPBpJW4jnxZetm63BxYncoM=",
|
"narHash": "sha256-5LQHcQmi3mUGRgJu+X/m3jeM3kdkYjLD+KwgnxBlbeU=",
|
||||||
"owner": "haskell",
|
"owner": "haskell",
|
||||||
"repo": "haskell-language-server",
|
"repo": "haskell-language-server",
|
||||||
"rev": "745ef26f406dbdd5e4a538585f8519af9f1ccb09",
|
"rev": "024ddc8b3904f8b8e8fe67ba6b9ebd8a4bd7ce76",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "haskell",
|
"owner": "haskell",
|
||||||
"ref": "1.5.1",
|
"ref": "1.6.1.1",
|
||||||
"repo": "haskell-language-server",
|
"repo": "haskell-language-server",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
@ -881,6 +881,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"iohk-nix_2": {
|
"iohk-nix_2": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1646330344,
|
||||||
|
"narHash": "sha256-EbhMDeneH26wDi+x5kz8nfru/dE9JZ241hJed4a8lz8=",
|
||||||
|
"owner": "input-output-hk",
|
||||||
|
"repo": "iohk-nix",
|
||||||
|
"rev": "0a0126d8fb1bdc61ce1fd2ef61cf396de800fdad",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "input-output-hk",
|
||||||
|
"repo": "iohk-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"iohk-nix_3": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1626953580,
|
"lastModified": 1626953580,
|
||||||
|
|
@ -1077,11 +1093,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-2111_2": {
|
"nixpkgs-2111_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1646416052,
|
"lastModified": 1646844010,
|
||||||
"narHash": "sha256-bfV62gYQGYjb/Gvw6MdMuEvWCcC838mI1Dzi1efjqTA=",
|
"narHash": "sha256-NRDLmpjmBMNBRr/BiztSsGht5wJYl8WZFzj+b+6LhLk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c78fc23f108b9a3bea9bf8693d2943ee0269c804",
|
"rev": "d59edd3833597be12763f1f017c7ad666cf1b810",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -1239,7 +1255,7 @@
|
||||||
"plutarch": {
|
"plutarch": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"Shrinker": "Shrinker",
|
"Shrinker": "Shrinker",
|
||||||
"Win32-network": "Win32-network",
|
"autodocodec": "autodocodec",
|
||||||
"cardano-base": "cardano-base",
|
"cardano-base": "cardano-base",
|
||||||
"cardano-crypto": "cardano-crypto",
|
"cardano-crypto": "cardano-crypto",
|
||||||
"cardano-prelude": "cardano-prelude",
|
"cardano-prelude": "cardano-prelude",
|
||||||
|
|
@ -1252,6 +1268,7 @@
|
||||||
"haskell-nix": "haskell-nix_3",
|
"haskell-nix": "haskell-nix_3",
|
||||||
"hercules-ci-effects": "hercules-ci-effects",
|
"hercules-ci-effects": "hercules-ci-effects",
|
||||||
"hs-memory": "hs-memory",
|
"hs-memory": "hs-memory",
|
||||||
|
"iohk-nix": "iohk-nix_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"plutarch",
|
"plutarch",
|
||||||
"haskell-nix",
|
"haskell-nix",
|
||||||
|
|
@ -1259,20 +1276,24 @@
|
||||||
],
|
],
|
||||||
"plutus": "plutus_2",
|
"plutus": "plutus_2",
|
||||||
"protolude": "protolude",
|
"protolude": "protolude",
|
||||||
|
"safe-coloured-text": "safe-coloured-text",
|
||||||
"sized-functors": "sized-functors",
|
"sized-functors": "sized-functors",
|
||||||
"th-extras": "th-extras"
|
"sydtest": "sydtest",
|
||||||
|
"th-extras": "th-extras",
|
||||||
|
"validity": "validity"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1646730784,
|
"lastModified": 1646941827,
|
||||||
"narHash": "sha256-pVvSa4fBoKXCdCu/NGduoKhr1/gGESCmj/Tr9Y5l9B4=",
|
"narHash": "sha256-/TmkSDVOYD0Nsf6/tsyCSWhFUIeefwPn0Lz1oeZ7lyQ=",
|
||||||
"owner": "Plutonomicon",
|
"owner": "Plutonomicon",
|
||||||
"repo": "plutarch",
|
"repo": "plutarch",
|
||||||
"rev": "aecc2050eb63ff0041576473aa3193070fe91314",
|
"rev": "cb29ca64df4ed193d94a062e3fe26aa37e59b7bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "Plutonomicon",
|
"owner": "Plutonomicon",
|
||||||
"repo": "plutarch",
|
"repo": "plutarch",
|
||||||
|
"rev": "cb29ca64df4ed193d94a062e3fe26aa37e59b7bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1310,23 +1331,23 @@
|
||||||
"hackage-nix": "hackage-nix_2",
|
"hackage-nix": "hackage-nix_2",
|
||||||
"haskell-language-server": "haskell-language-server_3",
|
"haskell-language-server": "haskell-language-server_3",
|
||||||
"haskell-nix": "haskell-nix_4",
|
"haskell-nix": "haskell-nix_4",
|
||||||
"iohk-nix": "iohk-nix_2",
|
"iohk-nix": "iohk-nix_3",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"pre-commit-hooks-nix": "pre-commit-hooks-nix_3",
|
"pre-commit-hooks-nix": "pre-commit-hooks-nix_3",
|
||||||
"sphinxcontrib-haddock": "sphinxcontrib-haddock_2",
|
"sphinxcontrib-haddock": "sphinxcontrib-haddock_2",
|
||||||
"stackage-nix": "stackage-nix_2"
|
"stackage-nix": "stackage-nix_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1642004499,
|
"lastModified": 1645203653,
|
||||||
"narHash": "sha256-LMAMixBJRYZ5wgINjp4rb8hifEGkXptX8Z5e2Ip8HeM=",
|
"narHash": "sha256-HAi60mSkyMXzu1Wg3h6KdYZg+ufNMvX6obfcLo0ArL0=",
|
||||||
"owner": "L-as",
|
"owner": "L-as",
|
||||||
"repo": "plutus",
|
"repo": "plutus",
|
||||||
"rev": "6cceda4793ee125dc700c63ff780593e387696b0",
|
"rev": "5ec17953aae3ac9546f6d923201eb1dbb4e058bb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "L-as",
|
"owner": "L-as",
|
||||||
"ref": "master",
|
"ref": "ghc9",
|
||||||
"repo": "plutus",
|
"repo": "plutus",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
@ -1411,6 +1432,23 @@
|
||||||
"plutarch": "plutarch"
|
"plutarch": "plutarch"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"safe-coloured-text": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1644357337,
|
||||||
|
"narHash": "sha256-sXSKw8m6O9K/H2BBiYqO5e4sJIo+9UP+UvEukRn28d8=",
|
||||||
|
"owner": "srid",
|
||||||
|
"repo": "safe-coloured-text",
|
||||||
|
"rev": "034f3612525568b422e0c62b52417d77b7cf31c2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "srid",
|
||||||
|
"ref": "ghc921",
|
||||||
|
"repo": "safe-coloured-text",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sized-functors": {
|
"sized-functors": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
@ -1524,6 +1562,23 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"sydtest": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1645114028,
|
||||||
|
"narHash": "sha256-P6ZwwfFeN8fpi3fziz9yERTn7BfxdE/j/OofUu+4GdA=",
|
||||||
|
"owner": "srid",
|
||||||
|
"repo": "sydtest",
|
||||||
|
"rev": "9c6c7678f7aabe22e075aab810a6a2e304591d24",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "srid",
|
||||||
|
"ref": "ghc921",
|
||||||
|
"repo": "sydtest",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"th-extras": {
|
"th-extras": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
@ -1540,6 +1595,23 @@
|
||||||
"rev": "787ed752c1e5d41b5903b74e171ed087de38bffa",
|
"rev": "787ed752c1e5d41b5903b74e171ed087de38bffa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"validity": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1644358698,
|
||||||
|
"narHash": "sha256-dpMIu08qXMzy8Kilk/2VWpuwIsfqFtpg/3mkwt5pdjA=",
|
||||||
|
"owner": "srid",
|
||||||
|
"repo": "validity",
|
||||||
|
"rev": "f7982549b95d0ab727950dc876ca06b1862135ba",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "srid",
|
||||||
|
"ref": "ghc921",
|
||||||
|
"repo": "validity",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@
|
||||||
# see https://github.com/NixOS/nix/issues/6013
|
# see https://github.com/NixOS/nix/issues/6013
|
||||||
inputs.nixpkgs-2111 = { url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; };
|
inputs.nixpkgs-2111 = { url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; };
|
||||||
|
|
||||||
inputs.plutarch.url = "github:Plutonomicon/plutarch";
|
inputs.plutarch.url =
|
||||||
|
"github:Plutonomicon/plutarch?rev=cb29ca64df4ed193d94a062e3fe26aa37e59b7bc";
|
||||||
inputs.plutarch.inputs.nixpkgs.follows =
|
inputs.plutarch.inputs.nixpkgs.follows =
|
||||||
"plutarch/haskell-nix/nixpkgs-unstable";
|
"plutarch/haskell-nix/nixpkgs-unstable";
|
||||||
|
|
||||||
|
|
@ -49,7 +50,7 @@
|
||||||
extraSources = plutarch.extraSources ++ [
|
extraSources = plutarch.extraSources ++ [
|
||||||
{
|
{
|
||||||
src = inputs.plutarch;
|
src = inputs.plutarch;
|
||||||
subdirs = [ "." "plutarch-benchmark" ];
|
subdirs = [ "." "plutarch-test" "plutarch-extra" ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
src = inputs.apropos-tx;
|
src = inputs.apropos-tx;
|
||||||
|
|
@ -79,8 +80,9 @@
|
||||||
|
|
||||||
additional = ps: [
|
additional = ps: [
|
||||||
ps.plutarch
|
ps.plutarch
|
||||||
ps.plutarch-benchmark
|
ps.plutarch-test
|
||||||
ps.apropos-tx
|
ps.apropos-tx
|
||||||
|
ps.plutarch-extra
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue