-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
constitution: Add executable that creates json envelope (#6267)
Co-authored-by: Jamie Bertram <jamie.bertram@tweag.io>
- Loading branch information
Showing
13 changed files
with
1,874 additions
and
1,720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- editorconfig-checker-disable-file | ||
{-# LANGUAGE OverloadedStrings #-} | ||
module Main where | ||
|
||
import Cardano.Api (File (..), PlutusScriptV3, PlutusScriptVersion (PlutusScriptV3), | ||
Script (PlutusScript), writeFileTextEnvelope) | ||
import Cardano.Api.Shelley (PlutusScript (PlutusScriptSerialised)) | ||
import Cardano.Constitution.Validator.Sorted (defaultConstitutionCode) | ||
import PlutusLedgerApi.Common (serialiseCompiledCode) | ||
import System.Environment (getArgs) | ||
import System.Exit | ||
|
||
main :: IO () | ||
main = do | ||
args <- getArgs | ||
case args of | ||
[file] -> either (error . show) pure | ||
=<< writeFileTextEnvelope (File file) (Just "*BE CAREFUL* that this is compiled from a release commit of plutus and not from master") compiledScript | ||
_ -> die "USAGE: create-json-envelope OUT_FILE" | ||
|
||
compiledScript :: Script PlutusScriptV3 | ||
compiledScript = | ||
PlutusScript PlutusScriptV3 | ||
. PlutusScriptSerialised | ||
. serialiseCompiledCode | ||
$ defaultConstitutionCode |
2 changes: 1 addition & 1 deletion
2
cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.cbor.size.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2095 | ||
2117 |
2 changes: 1 addition & 1 deletion
2
...o-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.large.budget.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ExBudget {exBudgetCPU = ExCPU 584116400, exBudgetMemory = ExMemory 2883157} | ||
ExBudget {exBudgetCPU = ExCPU 592788400, exBudgetMemory = ExMemory 2937357} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...o-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.small.budget.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ExBudget {exBudgetCPU = ExCPU 85774882, exBudgetMemory = ExMemory 383294} | ||
ExBudget {exBudgetCPU = ExCPU 88974882, exBudgetMemory = ExMemory 403294} |
Oops, something went wrong.