mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-21 01:37:15 +03:00
Expand upgrade validation testing (#19123)
* Remove duplication from tests * lint * lint * Simplify tests * lint * add more tests for dependency behaviour * track new test files * lint * add test for failure being only emitted in the module that originates it * fix stdout capture for rules_daml * lint * lint * Move CannotUpgradeView into own section * Fix more upgrades gen
This commit is contained in:
parent
b06a9e836e
commit
935c3fb10e
@ -446,10 +446,67 @@ da_haskell_test(
|
|||||||
da_haskell_test(
|
da_haskell_test(
|
||||||
name = "upgrades",
|
name = "upgrades",
|
||||||
srcs = ["src/DA/Test/DamlcUpgrades.hs"],
|
srcs = ["src/DA/Test/DamlcUpgrades.hs"],
|
||||||
|
compiler_flags = ["-Wno-unused-local-binds"],
|
||||||
data = [
|
data = [
|
||||||
"//compiler/damlc",
|
"//compiler/damlc",
|
||||||
"//daml-script/daml:daml-script.dar",
|
"//daml-script/daml:daml-script.dar",
|
||||||
"//daml-script/runner:daml-script-binary",
|
"//daml-script/runner:daml-script-binary",
|
||||||
|
"//test-common:upgrades-CannotUpgradeView-files",
|
||||||
|
"//test-common:upgrades-FailWhenATopLevelEnumChangesChangesTheOrderOfItsVariants-files",
|
||||||
|
"//test-common:upgrades-FailWhenATopLevelVariantChangesChangesTheOrderOfItsVariants-files",
|
||||||
|
"//test-common:upgrades-FailsOnlyInModuleNotInReexports-files",
|
||||||
|
"//test-common:upgrades-FailsWhenATopLevelRecordAddsANonOptionalField-files",
|
||||||
|
"//test-common:upgrades-FailsWhenATopLevelRecordAddsAnOptionalFieldBeforeTheEnd-files",
|
||||||
|
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAFieldToAVariantsType-files",
|
||||||
|
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAVariant-files",
|
||||||
|
"//test-common:upgrades-FailsWhenATopLevelVariantRemovesAVariant-files",
|
||||||
|
"//test-common:upgrades-FailsWhenAnInstanceIsDropped-files",
|
||||||
|
"//test-common:upgrades-FailsWhenAnInterfaceIsDefinedInAnUpgradingPackageWhenItWasAlreadyInThePriorPackage-files",
|
||||||
|
"//test-common:upgrades-FailsWhenExistingFieldInTemplateChoiceIsChanged-files",
|
||||||
|
"//test-common:upgrades-FailsWhenExistingFieldInTemplateIsChanged-files",
|
||||||
|
"//test-common:upgrades-FailsWhenNewFieldIsAddedToTemplateChoiceWithoutOptionalType-files",
|
||||||
|
"//test-common:upgrades-FailsWhenNewFieldIsAddedToTemplateWithoutOptionalType-files",
|
||||||
|
"//test-common:upgrades-FailsWhenOldFieldIsDeletedFromTemplate-files",
|
||||||
|
"//test-common:upgrades-FailsWhenOldFieldIsDeletedFromTemplateChoice-files",
|
||||||
|
"//test-common:upgrades-FailsWhenTemplateAddsKeyType-files",
|
||||||
|
"//test-common:upgrades-FailsWhenTemplateChangesKeyType-files",
|
||||||
|
"//test-common:upgrades-FailsWhenTemplateChoiceChangesItsReturnType-files",
|
||||||
|
"//test-common:upgrades-FailsWhenTemplateRemovesKeyType-files",
|
||||||
|
"//test-common:upgrades-FailsWhenTwoDeeplyNestedTypeSynonymsResolveToDifferentDatatypes-files",
|
||||||
|
"//test-common:upgrades-FailsWithSynonymReturnTypeChange-files",
|
||||||
|
"//test-common:upgrades-FailsWithSynonymReturnTypeChangeInSeparatePackage-files",
|
||||||
|
"//test-common:upgrades-MissingChoice-files",
|
||||||
|
"//test-common:upgrades-MissingDataCon-files",
|
||||||
|
"//test-common:upgrades-MissingModule-files",
|
||||||
|
"//test-common:upgrades-MissingTemplate-files",
|
||||||
|
"//test-common:upgrades-RecordFieldsNewNonOptional-files",
|
||||||
|
"//test-common:upgrades-SucceedWhenATopLevelEnumAddsAField-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenATopLevelEnumChanges-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenATopLevelRecordAddsAnOptionalFieldAtTheEnd-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenATopLevelTypeSynonymChanges-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenATopLevelVariantAddsAVariant-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenAnInstanceIsAddedSeparateDep-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenAnInstanceIsAddedUpgradedPackage-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenAnInterfaceIsOnlyDefinedInTheInitialPackage-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenNewFieldWithOptionalTypeIsAddedToTemplate-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenNewFieldWithOptionalTypeIsAddedToTemplateChoice-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenTemplateChoiceInputArgumentHasChanged-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenTemplateChoiceReturnsATemplateWhichHasChanged-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenTwoDeeplyNestedTypeSynonymsResolveToTheSameDatatypes-files",
|
||||||
|
"//test-common:upgrades-SucceedsWhenUpgradingADependency-files",
|
||||||
|
"//test-common:upgrades-TemplateChangedKeyType-files",
|
||||||
|
"//test-common:upgrades-ValidUpgrade-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenAnInterfaceAndATemplateAreDefinedInTheSamePackage-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenAnInterfaceIsDefinedAndThenUsedInAPackageThatUpgradesIt-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenAnInterfaceIsUsedInThePackageThatItsDefinedIn-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenControllersOfTemplateChoiceAreChanged-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenObserversOfTemplateChoiceAreChanged-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenTemplateChangesEnsure-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenTemplateChangesKeyExpression-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenTemplateChangesKeyMaintainers-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenTemplateChangesObservers-files",
|
||||||
|
"//test-common:upgrades-WarnsWhenTemplateChangesSignatories-files",
|
||||||
],
|
],
|
||||||
hackage_deps = [
|
hackage_deps = [
|
||||||
"base",
|
"base",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -189,16 +189,16 @@ da_scala_test_suite(
|
|||||||
"//test-common:upgrades-FailsWhenUpgradingV3ThenV2-v3.dar",
|
"//test-common:upgrades-FailsWhenUpgradingV3ThenV2-v3.dar",
|
||||||
|
|
||||||
# More tests ported from DamlcUpgrades.hs
|
# More tests ported from DamlcUpgrades.hs
|
||||||
"//test-common:upgrades-FailsWhenATopLevelEnumChanges-v1.dar",
|
"//test-common:upgrades-SucceedsWhenATopLevelEnumChanges-v1.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelEnumChanges-v2.dar",
|
"//test-common:upgrades-SucceedsWhenATopLevelEnumChanges-v2.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelRecordAddsANonOptionalField-v1.dar",
|
"//test-common:upgrades-FailsWhenATopLevelRecordAddsANonOptionalField-v1.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelRecordAddsANonOptionalField-v2.dar",
|
"//test-common:upgrades-FailsWhenATopLevelRecordAddsANonOptionalField-v2.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelRecordAddsAnOptionalFieldBeforeTheEnd-v1.dar",
|
"//test-common:upgrades-FailsWhenATopLevelRecordAddsAnOptionalFieldBeforeTheEnd-v1.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelRecordAddsAnOptionalFieldBeforeTheEnd-v2.dar",
|
"//test-common:upgrades-FailsWhenATopLevelRecordAddsAnOptionalFieldBeforeTheEnd-v2.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAFieldToAVariantsType-v1.dar",
|
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAFieldToAVariantsType-v1.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAFieldToAVariantsType-v2.dar",
|
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAFieldToAVariantsType-v2.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-v1.dar",
|
"//test-common:upgrades-SucceedsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-v1.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-v2.dar",
|
"//test-common:upgrades-SucceedsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-v2.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAVariant-v1.dar",
|
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAVariant-v1.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAVariant-v2.dar",
|
"//test-common:upgrades-FailsWhenATopLevelVariantAddsAVariant-v2.dar",
|
||||||
"//test-common:upgrades-FailsWhenATopLevelVariantRemovesAVariant-v1.dar",
|
"//test-common:upgrades-FailsWhenATopLevelVariantRemovesAVariant-v1.dar",
|
||||||
@ -231,6 +231,8 @@ da_scala_test_suite(
|
|||||||
"//test-common:upgrades-SucceedsWhenAnInstanceIsAddedSeparateDep-v2.dar",
|
"//test-common:upgrades-SucceedsWhenAnInstanceIsAddedSeparateDep-v2.dar",
|
||||||
"//test-common:upgrades-SucceedsWhenAnInstanceIsAddedUpgradedPackage-v1.dar",
|
"//test-common:upgrades-SucceedsWhenAnInstanceIsAddedUpgradedPackage-v1.dar",
|
||||||
"//test-common:upgrades-SucceedsWhenAnInstanceIsAddedUpgradedPackage-v2.dar",
|
"//test-common:upgrades-SucceedsWhenAnInstanceIsAddedUpgradedPackage-v2.dar",
|
||||||
|
"//test-common:upgrades-SucceedsWhenATopLevelVariantAddsAVariant-v1.dar",
|
||||||
|
"//test-common:upgrades-SucceedsWhenATopLevelVariantAddsAVariant-v2.dar",
|
||||||
],
|
],
|
||||||
flaky = True,
|
flaky = True,
|
||||||
scala_deps = [
|
scala_deps = [
|
||||||
|
@ -411,8 +411,8 @@ trait LongTests { this: UpgradesSpec =>
|
|||||||
|
|
||||||
"Succeeds when a top-level variant adds a variant" in {
|
"Succeeds when a top-level variant adds a variant" in {
|
||||||
testPackagePair(
|
testPackagePair(
|
||||||
"test-common/upgrades-FailsWhenATopLevelVariantAddsAVariant-v1.dar",
|
"test-common/upgrades-SucceedsWhenATopLevelVariantAddsAVariant-v1.dar",
|
||||||
"test-common/upgrades-FailsWhenATopLevelVariantAddsAVariant-v2.dar",
|
"test-common/upgrades-SucceedsWhenATopLevelVariantAddsAVariant-v2.dar",
|
||||||
assertPackageUpgradeCheck(None),
|
assertPackageUpgradeCheck(None),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -453,16 +453,16 @@ trait LongTests { this: UpgradesSpec =>
|
|||||||
|
|
||||||
"Succeeds when a top-level variant adds an optional field to a variant's type" in {
|
"Succeeds when a top-level variant adds an optional field to a variant's type" in {
|
||||||
testPackagePair(
|
testPackagePair(
|
||||||
"test-common/upgrades-FailsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-v1.dar",
|
"test-common/upgrades-SucceedsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-v1.dar",
|
||||||
"test-common/upgrades-FailsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-v2.dar",
|
"test-common/upgrades-SucceedsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType-v2.dar",
|
||||||
assertPackageUpgradeCheck(None),
|
assertPackageUpgradeCheck(None),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
"Succeeds when a top-level enum changes" in {
|
"Succeeds when a top-level enum changes" in {
|
||||||
testPackagePair(
|
testPackagePair(
|
||||||
"test-common/upgrades-FailsWhenATopLevelEnumChanges-v1.dar",
|
"test-common/upgrades-SucceedsWhenATopLevelEnumChanges-v1.dar",
|
||||||
"test-common/upgrades-FailsWhenATopLevelEnumChanges-v2.dar",
|
"test-common/upgrades-SucceedsWhenATopLevelEnumChanges-v2.dar",
|
||||||
assertPackageUpgradeCheck(None),
|
assertPackageUpgradeCheck(None),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -113,12 +113,13 @@ def _daml_build_impl(ctx):
|
|||||||
damlc = ctx.executable.damlc
|
damlc = ctx.executable.damlc
|
||||||
input_dars = [file_of_target(k) for k in dar_dict.keys()]
|
input_dars = [file_of_target(k) for k in dar_dict.keys()]
|
||||||
output_dar = ctx.outputs.dar
|
output_dar = ctx.outputs.dar
|
||||||
|
output_stdout = ctx.outputs.stdout
|
||||||
posix = ctx.toolchains["@rules_sh//sh/posix:toolchain_type"]
|
posix = ctx.toolchains["@rules_sh//sh/posix:toolchain_type"]
|
||||||
ghc_opts = ctx.attr.ghc_options
|
ghc_opts = ctx.attr.ghc_options
|
||||||
ctx.actions.run_shell(
|
ctx.actions.run_shell(
|
||||||
tools = [damlc],
|
tools = [damlc],
|
||||||
inputs = [daml_yaml] + srcs + input_dars,
|
inputs = [daml_yaml] + srcs + input_dars,
|
||||||
outputs = [output_dar],
|
outputs = [output_dar] + ([output_stdout] if output_stdout != None else []),
|
||||||
progress_message = "Building Daml project %s" % name,
|
progress_message = "Building Daml project %s" % name,
|
||||||
command = """
|
command = """
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
@ -131,7 +132,7 @@ def _daml_build_impl(ctx):
|
|||||||
{sed} -i 's/daml-script$/daml-script.dar/;s/daml3-script$/daml3-script.dar/;s/daml-trigger$/daml-trigger.dar/' $tmpdir/daml.yaml
|
{sed} -i 's/daml-script$/daml-script.dar/;s/daml3-script$/daml3-script.dar/;s/daml-trigger$/daml-trigger.dar/' $tmpdir/daml.yaml
|
||||||
{cp_srcs}
|
{cp_srcs}
|
||||||
{cp_dars}
|
{cp_dars}
|
||||||
{damlc} build --project-root $tmpdir {ghc_opts} -o $PWD/{output_dar}
|
{damlc} build --project-root $tmpdir {ghc_opts} -o $PWD/{output_dar} 2>&1 | {output_stdout_command}
|
||||||
""".format(
|
""".format(
|
||||||
config = daml_yaml.path,
|
config = daml_yaml.path,
|
||||||
cp_srcs = "\n".join([
|
cp_srcs = "\n".join([
|
||||||
@ -152,6 +153,7 @@ def _daml_build_impl(ctx):
|
|||||||
sed = posix.commands["sed"],
|
sed = posix.commands["sed"],
|
||||||
damlc = damlc.path,
|
damlc = damlc.path,
|
||||||
output_dar = output_dar.path,
|
output_dar = output_dar.path,
|
||||||
|
output_stdout_command = "tee " + output_stdout.path if output_stdout != None else "cat",
|
||||||
sdk_version = sdk_version,
|
sdk_version = sdk_version,
|
||||||
ghc_opts = " ".join(ghc_opts),
|
ghc_opts = " ".join(ghc_opts),
|
||||||
),
|
),
|
||||||
@ -179,6 +181,9 @@ _daml_build = rule(
|
|||||||
mandatory = True,
|
mandatory = True,
|
||||||
doc = "The generated DAR file.",
|
doc = "The generated DAR file.",
|
||||||
),
|
),
|
||||||
|
"stdout": attr.output(
|
||||||
|
doc = "The standard output of the build command.",
|
||||||
|
),
|
||||||
"ghc_options": attr.string_list(
|
"ghc_options": attr.string_list(
|
||||||
doc = "Options passed to GHC.",
|
doc = "Options passed to GHC.",
|
||||||
default = ["--ghc-option=-Werror", "--log-level=WARNING"],
|
default = ["--ghc-option=-Werror", "--log-level=WARNING"],
|
||||||
@ -348,6 +353,7 @@ def daml_compile(
|
|||||||
dar_dict =
|
dar_dict =
|
||||||
{dar: path_to_dar(dar) for dar in (dependencies + data_dependencies + ([upgrades] if upgrades else []))},
|
{dar: path_to_dar(dar) for dar in (dependencies + data_dependencies + ([upgrades] if upgrades else []))},
|
||||||
dar = name + ".dar",
|
dar = name + ".dar",
|
||||||
|
stdout = name + ".stdout",
|
||||||
ghc_options =
|
ghc_options =
|
||||||
ghc_options +
|
ghc_options +
|
||||||
(["--enable-scenarios=yes"] if enable_scenarios and (target == None or _supports_scenarios(target)) else []) +
|
(["--enable-scenarios=yes"] if enable_scenarios and (target == None or _supports_scenarios(target)) else []) +
|
||||||
|
@ -69,6 +69,11 @@ da_scala_dar_resources_library(
|
|||||||
|
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
filegroup(
|
||||||
|
name = "upgrades-{}-files".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/*/*.daml".format(identifier)]),
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
daml_compile(
|
daml_compile(
|
||||||
name = "upgrades-{}-v1".format(identifier),
|
name = "upgrades-{}-v1".format(identifier),
|
||||||
srcs = glob(["src/main/daml/upgrades/{}/v1/*.daml".format(identifier)]),
|
srcs = glob(["src/main/daml/upgrades/{}/v1/*.daml".format(identifier)]),
|
||||||
@ -122,11 +127,10 @@ da_scala_dar_resources_library(
|
|||||||
"SucceedsWhenTemplateChoiceReturnsATemplateWhichHasChanged",
|
"SucceedsWhenTemplateChoiceReturnsATemplateWhichHasChanged",
|
||||||
|
|
||||||
# More tests ported from DamlcUpgrades.hs
|
# More tests ported from DamlcUpgrades.hs
|
||||||
"FailsWhenATopLevelEnumChanges",
|
"SucceedsWhenATopLevelEnumChanges",
|
||||||
"FailsWhenATopLevelRecordAddsANonOptionalField",
|
"FailsWhenATopLevelRecordAddsANonOptionalField",
|
||||||
"FailsWhenATopLevelRecordAddsAnOptionalFieldBeforeTheEnd",
|
"FailsWhenATopLevelRecordAddsAnOptionalFieldBeforeTheEnd",
|
||||||
"FailsWhenATopLevelVariantAddsAFieldToAVariantsType",
|
"FailsWhenATopLevelVariantAddsAFieldToAVariantsType",
|
||||||
"FailsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType",
|
|
||||||
"FailsWhenATopLevelVariantAddsAVariant",
|
"FailsWhenATopLevelVariantAddsAVariant",
|
||||||
"FailsWhenATopLevelVariantRemovesAVariant",
|
"FailsWhenATopLevelVariantRemovesAVariant",
|
||||||
"FailsWhenTwoDeeplyNestedTypeSynonymsResolveToDifferentDatatypes",
|
"FailsWhenTwoDeeplyNestedTypeSynonymsResolveToDifferentDatatypes",
|
||||||
@ -141,11 +145,30 @@ da_scala_dar_resources_library(
|
|||||||
# More more more tests ported from DamlcUpgrades.hs
|
# More more more tests ported from DamlcUpgrades.hs
|
||||||
"FailsWhenAnInterfaceIsDefinedInAnUpgradingPackageWhenItWasAlreadyInThePriorPackage",
|
"FailsWhenAnInterfaceIsDefinedInAnUpgradingPackageWhenItWasAlreadyInThePriorPackage",
|
||||||
"SucceedsWhenAnInterfaceIsOnlyDefinedInTheInitialPackage",
|
"SucceedsWhenAnInterfaceIsOnlyDefinedInTheInitialPackage",
|
||||||
|
"SucceedWhenATopLevelEnumAddsAField",
|
||||||
|
"SucceedsWhenATopLevelVariantAddsAVariant",
|
||||||
|
"SucceedsWhenATopLevelVariantAddsAnOptionalFieldToAVariantsType",
|
||||||
|
"WarnsWhenAnInterfaceAndATemplateAreDefinedInTheSamePackage",
|
||||||
|
"WarnsWhenAnInterfaceIsUsedInThePackageThatItsDefinedIn",
|
||||||
|
"WarnsWhenControllersOfTemplateChoiceAreChanged",
|
||||||
|
"WarnsWhenObserversOfTemplateChoiceAreChanged",
|
||||||
|
"WarnsWhenTemplateChangesEnsure",
|
||||||
|
"WarnsWhenTemplateChangesKeyExpression",
|
||||||
|
"WarnsWhenTemplateChangesKeyMaintainers",
|
||||||
|
"WarnsWhenTemplateChangesObservers",
|
||||||
|
"WarnsWhenTemplateChangesSignatories",
|
||||||
|
"FailsWithSynonymReturnTypeChange",
|
||||||
|
"FailsOnlyInModuleNotInReexports",
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
filegroup(
|
||||||
|
name = "upgrades-{}-files".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/*/*.daml".format(identifier)]),
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
daml_compile(
|
daml_compile(
|
||||||
name = "upgrades-{}-v1".format(identifier),
|
name = "upgrades-{}-v1".format(identifier),
|
||||||
srcs = glob(["src/main/daml/upgrades/{}/v1/*.daml".format(identifier)]),
|
srcs = glob(["src/main/daml/upgrades/{}/v1/*.daml".format(identifier)]),
|
||||||
@ -177,11 +200,99 @@ da_scala_dar_resources_library(
|
|||||||
for identifier in [
|
for identifier in [
|
||||||
# More more more tests ported from DamlcUpgrades.hs
|
# More more more tests ported from DamlcUpgrades.hs
|
||||||
"SucceedsWhenAnInstanceIsAddedUpgradedPackage",
|
"SucceedsWhenAnInstanceIsAddedUpgradedPackage",
|
||||||
|
"WarnsWhenAnInterfaceIsDefinedAndThenUsedInAPackageThatUpgradesIt",
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
filegroup(
|
||||||
|
name = "upgrades-{}-files".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/*/*.daml".format(identifier)]),
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
|
]
|
||||||
|
for identifier in [
|
||||||
|
"CannotUpgradeView",
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
[
|
||||||
|
[
|
||||||
|
filegroup(
|
||||||
|
name = "upgrades-{}-files".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/*/*.daml".format(identifier)]),
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
|
daml_compile(
|
||||||
|
name = "upgrades-{}-dep-v1".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/dep-v1/*.daml".format(identifier)]),
|
||||||
|
dependencies = ["//daml-script/daml:daml-script-2.dev.dar"],
|
||||||
|
enable_interfaces = True,
|
||||||
|
ghc_options = default_damlc_opts + ["--ghc-option=-Wno-unused-imports"],
|
||||||
|
project_name = "upgrades-example-{}-dep".format(identifier),
|
||||||
|
target = "2.dev",
|
||||||
|
version = "1.0.0",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
|
daml_compile(
|
||||||
|
name = "upgrades-{}-dep-v2".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/dep-v2/*.daml".format(identifier)]),
|
||||||
|
dependencies = ["//daml-script/daml:daml-script-2.dev.dar"],
|
||||||
|
enable_interfaces = True,
|
||||||
|
ghc_options = default_damlc_opts + ["--ghc-option=-Wno-unused-imports"],
|
||||||
|
project_name = "upgrades-example-{}-dep".format(identifier),
|
||||||
|
target = "2.dev",
|
||||||
|
# We want to check the validity of this upgrade on the ledger
|
||||||
|
# client, not during compilation
|
||||||
|
typecheck_upgrades = False,
|
||||||
|
upgrades = "//test-common:upgrades-{}-dep-v1.dar".format(identifier),
|
||||||
|
version = "2.0.0",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
|
daml_compile(
|
||||||
|
name = "upgrades-{}-v1".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/v1/*.daml".format(identifier)]),
|
||||||
|
data_dependencies = ["//test-common:upgrades-{}-dep-v1.dar".format(identifier)],
|
||||||
|
dependencies = ["//daml-script/daml:daml-script-2.dev.dar"],
|
||||||
|
enable_interfaces = True,
|
||||||
|
ghc_options = default_damlc_opts + ["--ghc-option=-Wno-unused-imports"],
|
||||||
|
project_name = "upgrades-example-{}".format(identifier),
|
||||||
|
target = "2.dev",
|
||||||
|
version = "1.0.0",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
|
daml_compile(
|
||||||
|
name = "upgrades-{}-v2".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/v2/*.daml".format(identifier)]),
|
||||||
|
data_dependencies = ["//test-common:upgrades-{}-dep-v2.dar".format(identifier)],
|
||||||
|
dependencies = ["//daml-script/daml:daml-script-2.dev.dar"],
|
||||||
|
enable_interfaces = True,
|
||||||
|
ghc_options = default_damlc_opts + ["--ghc-option=-Wno-unused-imports"],
|
||||||
|
project_name = "upgrades-example-{}".format(identifier),
|
||||||
|
target = "2.dev",
|
||||||
|
# We want to check the validity of this upgrade on the ledger
|
||||||
|
# client, not during compilation
|
||||||
|
typecheck_upgrades = False,
|
||||||
|
upgrades = "//test-common:upgrades-{}-v1.dar".format(identifier),
|
||||||
|
version = "2.0.0",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
|
]
|
||||||
|
for identifier in [
|
||||||
|
# More more more tests ported from DamlcUpgrades.hs
|
||||||
|
"FailsWithSynonymReturnTypeChangeInSeparatePackage",
|
||||||
|
"SucceedsWhenUpgradingADependency",
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
[
|
||||||
|
[
|
||||||
|
filegroup(
|
||||||
|
name = "upgrades-{}-files".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/*/*.daml".format(identifier)]),
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
daml_compile(
|
daml_compile(
|
||||||
name = "upgrades-{}-dep".format(identifier),
|
name = "upgrades-{}-dep".format(identifier),
|
||||||
srcs = glob(["src/main/daml/upgrades/{}/dep/*.daml".format(identifier)]),
|
srcs = glob(["src/main/daml/upgrades/{}/dep/*.daml".format(identifier)]),
|
||||||
@ -231,6 +342,11 @@ da_scala_dar_resources_library(
|
|||||||
|
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
filegroup(
|
||||||
|
name = "upgrades-{}-files".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/*/*.daml".format(identifier)]),
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
daml_compile(
|
daml_compile(
|
||||||
name = "upgrades-{}-v1a".format(identifier),
|
name = "upgrades-{}-v1a".format(identifier),
|
||||||
srcs = glob(["src/main/daml/upgrades/{}/v1a/*.daml".format(identifier)]),
|
srcs = glob(["src/main/daml/upgrades/{}/v1a/*.daml".format(identifier)]),
|
||||||
@ -257,6 +373,11 @@ da_scala_dar_resources_library(
|
|||||||
|
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
filegroup(
|
||||||
|
name = "upgrades-{}-files".format(identifier),
|
||||||
|
srcs = glob(["src/main/daml/upgrades/{}/*/*.daml".format(identifier)]),
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
),
|
||||||
daml_compile(
|
daml_compile(
|
||||||
name = "upgrades-{}-v1".format(identifier),
|
name = "upgrades-{}-v1".format(identifier),
|
||||||
srcs = glob(["src/main/daml/upgrades/{}/v1/*.daml".format(identifier)]),
|
srcs = glob(["src/main/daml/upgrades/{}/v1/*.daml".format(identifier)]),
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
data IView = IView { i : Text }
|
||||||
|
interface I where
|
||||||
|
viewtype IView
|
||||||
|
method1 : Int
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
import qualified "upgrades-example-CannotUpgradeView" Main as V1
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
interface instance V1.I for T where
|
||||||
|
view = IView "hi" None
|
||||||
|
method1 = 2
|
||||||
|
data IView = IView { i : Text, other : Optional Text }
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main (module Other) where
|
||||||
|
|
||||||
|
import Other
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Other where
|
||||||
|
|
||||||
|
data A = A
|
||||||
|
{ field1 : Text
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main (module Other) where
|
||||||
|
|
||||||
|
import Other
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Other where
|
||||||
|
|
||||||
|
data A = A
|
||||||
|
{ field1 : Text
|
||||||
|
, field2 : Text
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
data A = A { a : Text }
|
||||||
|
data B = B { b : Text }
|
||||||
|
|
||||||
|
type Synonym = A
|
||||||
|
|
||||||
|
template T with
|
||||||
|
p : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C : Synonym
|
||||||
|
controller p
|
||||||
|
do pure A { a = "a" }
|
||||||
|
|
@ -0,0 +1,19 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
data A = A { a : Text }
|
||||||
|
data B = B { b : Text }
|
||||||
|
|
||||||
|
type Synonym = B
|
||||||
|
|
||||||
|
template T with
|
||||||
|
p : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C : Synonym
|
||||||
|
controller p
|
||||||
|
do pure B { b = "b" }
|
||||||
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Dep where
|
||||||
|
|
||||||
|
data A = A { a : Text }
|
||||||
|
data B = B { b : Text }
|
||||||
|
|
||||||
|
type Synonym = A
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Dep where
|
||||||
|
|
||||||
|
data A = A { a : Text }
|
||||||
|
data B = B { b : Text }
|
||||||
|
|
||||||
|
type Synonym = B
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
import Dep
|
||||||
|
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C : Synonym
|
||||||
|
controller p
|
||||||
|
do pure $ A { a = "a" }
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
import Dep
|
||||||
|
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C : Synonym
|
||||||
|
controller p
|
||||||
|
do pure $ B { b = "b" }
|
||||||
|
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
template T with
|
template T with
|
||||||
p: Party
|
p: Party
|
||||||
where
|
where
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
template T with
|
template T with
|
||||||
p: Party
|
p: Party
|
||||||
where
|
where
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
data T = T with
|
data T = T with
|
||||||
x : Text
|
x : Text
|
||||||
deriving Show
|
deriving Show
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
data T = T with
|
data T = T with
|
||||||
x : Text
|
x : Text
|
||||||
deriving Show
|
deriving Show
|
||||||
|
@ -4,9 +4,3 @@
|
|||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import qualified Other
|
import qualified Other
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = do
|
|
||||||
Other.main
|
|
||||||
pure ()
|
|
||||||
|
@ -2,8 +2,3 @@
|
|||||||
-- SPDX-License-Identifier: Apache-2.0
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
module Other where
|
module Other where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
@ -2,8 +2,3 @@
|
|||||||
-- SPDX-License-Identifier: Apache-2.0
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
template T with
|
template T with
|
||||||
p: Party
|
p: Party
|
||||||
where
|
where
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
template T with
|
template T with
|
||||||
p: Party
|
p: Party
|
||||||
where
|
where
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
data Struct = Struct with
|
data Struct = Struct with
|
||||||
field1 : Int
|
field1 : Int
|
||||||
|
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
data Struct = Struct with
|
data Struct = Struct with
|
||||||
field1 : Int
|
field1 : Int
|
||||||
field2 : Text
|
field2 : Text
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
data A = X
|
||||||
|
|
@ -0,0 +1,6 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
data A = X | Y
|
||||||
|
|
@ -0,0 +1,6 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
data A = X { x : Int } | Y { y : Int } | Z { z : Int }
|
||||||
|
|
@ -0,0 +1,6 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
data A = X { x : Int } | Y { y : Int }
|
||||||
|
|
@ -0,0 +1,15 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Dep where
|
||||||
|
|
||||||
|
data D = D { field1 : Text }
|
||||||
|
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C1 : D
|
||||||
|
controller p
|
||||||
|
do pure $ D "field1"
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Dep where
|
||||||
|
|
||||||
|
data D = D { field1 : Text, field2 : Optional Text }
|
||||||
|
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C1 : D
|
||||||
|
controller p
|
||||||
|
do pure $ D "field1" (Some "field2")
|
||||||
|
choice C2 : D
|
||||||
|
controller p
|
||||||
|
do pure $ D "field1" None
|
||||||
|
|
@ -0,0 +1,23 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
import qualified Dep
|
||||||
|
|
||||||
|
data D = D { field1 : Text }
|
||||||
|
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
t: ContractId Dep.T
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C1 : D
|
||||||
|
controller p
|
||||||
|
do
|
||||||
|
depD <- exercise t Dep.C1
|
||||||
|
pure $ D "field1"
|
||||||
|
choice C2 : Dep.D
|
||||||
|
controller p
|
||||||
|
do exercise t Dep.C1
|
||||||
|
|
@ -0,0 +1,23 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
import qualified Dep
|
||||||
|
|
||||||
|
data D = D { field1 : Text, field2 : Optional Dep.D }
|
||||||
|
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
t: ContractId Dep.T
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C1 : D
|
||||||
|
controller p
|
||||||
|
do
|
||||||
|
depD <- exercise t Dep.C1 -- only works when party is same
|
||||||
|
pure $ D "field1" (Some depD)
|
||||||
|
choice C2 : Dep.D
|
||||||
|
controller p
|
||||||
|
do exercise t Dep.C2 -- only works when party is same
|
||||||
|
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
data TKey1 = TKey1 with p : Party
|
data TKey1 = TKey1 with p : Party
|
||||||
data TKey2 = TKey2 with p : Party
|
data TKey2 = TKey2 with p : Party
|
||||||
|
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
data TKey1 = TKey1 with p : Party
|
data TKey1 = TKey1 with p : Party
|
||||||
data TKey2 = TKey2 with p : Party
|
data TKey2 = TKey2 with p : Party
|
||||||
|
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
data TKey1 = TKey1 { p : Party }
|
data TKey1 = TKey1 { p : Party }
|
||||||
|
|
||||||
template T with
|
template T with
|
||||||
|
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Daml.Script
|
|
||||||
|
|
||||||
main : Script ()
|
|
||||||
main = pure ()
|
|
||||||
|
|
||||||
data TKey1 = TKey1 with
|
data TKey1 = TKey1 with
|
||||||
p : Party
|
p : Party
|
||||||
|
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
data IView = IView { i : Text }
|
||||||
|
interface I where
|
||||||
|
viewtype IView
|
||||||
|
method1 : Int
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
data IView = IView { i : Text }
|
||||||
|
interface I where
|
||||||
|
viewtype IView
|
||||||
|
method1 : Int
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
import qualified "upgrades-example-WarnsWhenAnInterfaceIsDefinedAndThenUsedInAPackageThatUpgradesIt" Main as V1
|
||||||
|
data IView = IView { i : Text }
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
interface instance V1.I for T where
|
||||||
|
view = V1.IView "hi"
|
||||||
|
method1 = 2
|
||||||
|
|
@ -0,0 +1,5 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
data IView = IView { i : Text }
|
||||||
|
interface I where
|
||||||
|
viewtype IView
|
||||||
|
method1 : Int
|
||||||
|
template T with
|
||||||
|
p: Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
interface instance I for T where
|
||||||
|
view = IView "hi"
|
||||||
|
method1 = 2
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C : ()
|
||||||
|
controller p
|
||||||
|
do pure ()
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C : ()
|
||||||
|
controller p, q
|
||||||
|
do pure ()
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C : ()
|
||||||
|
observer p
|
||||||
|
controller p
|
||||||
|
do pure ()
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
choice C : ()
|
||||||
|
observer p, q
|
||||||
|
controller p
|
||||||
|
do pure ()
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
ensure True
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
ensure True == True
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
key (p, "example") : (Party, Text)
|
||||||
|
maintainer (fst key)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
key (q, "example") : (Party, Text)
|
||||||
|
maintainer (fst key)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
key (p, q) : (Party, Party)
|
||||||
|
maintainer (fst key)
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
key (p, q) : (Party, Party)
|
||||||
|
maintainer (snd key)
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
observer p
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where
|
||||||
|
signatory p
|
||||||
|
observer p, q
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where signatory [p]
|
||||||
|
|
@ -0,0 +1,9 @@
|
|||||||
|
-- Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
||||||
|
-- SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
template A with
|
||||||
|
p : Party
|
||||||
|
q : Party
|
||||||
|
where signatory [p, q]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user