Skip to content

Commit a70e35e

Browse files
committed
Daml: Add weight, kind to ValidatorLicense, and SV grant license support
PR reviewed in hyperledger-labs#2903 CI run hyperledger-labs#3093 Squash commit created by rebasing 5e8d90e7f over f47f017 Signed-off-by: Divam <[email protected]>
1 parent 46c0f58 commit a70e35e

File tree

42 files changed

+837
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+837
-149
lines changed

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/BootstrapPackageConfigIntegrationTest.scala

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,18 @@ class BootstrapPackageConfigIntegrationTest
168168
// This simulates an app vetting newer versions of their own DARs depending on newer splice-amulet versions
169169
// before the SVs do so. Topology aware package selection will then force the old splice-amulet and old splitwell versions
170170
// for composed transactions. Note that for this to work splitwell contracts must be downgradeable.
171+
172+
// Split into batches to avoid gRPC message size limit (10 MB)
173+
val batchSize = 12
174+
val versionBatches =
175+
DarResources.splitwell.all.map(_.metadata.version).distinct.grouped(batchSize).toSeq
176+
171177
Seq(aliceValidatorBackend, bobValidatorBackend, splitwellValidatorBackend).foreach { p =>
172-
p.participantClient.dars.upload_many(
173-
DarResources.splitwell.all
174-
.map(_.metadata.version)
175-
.distinct
176-
.map((v: PackageVersion) => s"daml/dars/splitwell-$v.dar")
177-
)
178+
versionBatches.foreach { batch =>
179+
p.participantClient.dars.upload_many(
180+
batch.map((v: PackageVersion) => s"daml/dars/splitwell-$v.dar")
181+
)
182+
}
178183
}
179184
}
180185

apps/common/frontend-test-handlers/src/mocks/handlers/validator-licenses-handler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export function validatorLicensesHandler(baseUrl: string): RestHandler {
2121
},
2222
metadata: { version: '1', lastUpdatedAt: aTimestamp, contactPoint: 'nowhere' },
2323
lastActiveAt: aTimestamp,
24+
weight: null,
25+
kind: null,
2426
};
2527
return {
2628
contract_id: id,

apps/common/src/main/scala/org/lfdecentralizedtrust/splice/environment/DarResources.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ object DarResources {
7575
val amulet_0_1_12 = DarResource("splice-amulet-0.1.12.dar")
7676
val amulet_0_1_13 = DarResource("splice-amulet-0.1.13.dar")
7777
val amulet_0_1_14 = DarResource("splice-amulet-0.1.14.dar")
78+
val amulet_0_1_15 = DarResource("splice-amulet-0.1.15.dar")
7879
val amulet_current = DarResource("splice-amulet-current.dar")
7980
val amulet = PackageResource(
8081
amulet_current,
@@ -95,6 +96,7 @@ object DarResources {
9596
amulet_0_1_12,
9697
amulet_0_1_13,
9798
amulet_0_1_14,
99+
amulet_0_1_15,
98100
),
99101
)
100102

@@ -119,6 +121,7 @@ object DarResources {
119121
val dsoGovernance_0_1_18 = DarResource("splice-dso-governance-0.1.18.dar")
120122
val dsoGovernance_0_1_19 = DarResource("splice-dso-governance-0.1.19.dar")
121123
val dsoGovernance_0_1_20 = DarResource("splice-dso-governance-0.1.20.dar")
124+
val dsoGovernance_0_1_21 = DarResource("splice-dso-governance-0.1.21.dar")
122125
val dsoGovernance_current = DarResource("splice-dso-governance-current.dar")
123126
val dsoGovernance = PackageResource(
124127
dsoGovernance_current,
@@ -145,6 +148,7 @@ object DarResources {
145148
dsoGovernance_0_1_18,
146149
dsoGovernance_0_1_19,
147150
dsoGovernance_0_1_20,
151+
dsoGovernance_0_1_21,
148152
),
149153
)
150154

@@ -164,6 +168,7 @@ object DarResources {
164168
val amuletNameService_0_1_13 = DarResource("splice-amulet-name-service-0.1.13.dar")
165169
val amuletNameService_0_1_14 = DarResource("splice-amulet-name-service-0.1.14.dar")
166170
val amuletNameService_0_1_15 = DarResource("splice-amulet-name-service-0.1.15.dar")
171+
val amuletNameService_0_1_16 = DarResource("splice-amulet-name-service-0.1.16.dar")
167172
val amuletNameService_current = DarResource("splice-amulet-name-service-current.dar")
168173
val amuletNameService = PackageResource(
169174
amuletNameService_current,
@@ -185,6 +190,7 @@ object DarResources {
185190
amuletNameService_0_1_13,
186191
amuletNameService_0_1_14,
187192
amuletNameService_0_1_15,
193+
amuletNameService_0_1_16,
188194
),
189195
)
190196

@@ -203,6 +209,7 @@ object DarResources {
203209
val splitwell_0_1_12 = DarResource("splitwell-0.1.12.dar")
204210
val splitwell_0_1_13 = DarResource("splitwell-0.1.13.dar")
205211
val splitwell_0_1_14 = DarResource("splitwell-0.1.14.dar")
212+
val splitwell_0_1_15 = DarResource("splitwell-0.1.15.dar")
206213
val splitwell_current = DarResource("splitwell-current.dar")
207214
val splitwell = PackageResource(
208215
splitwell_current,
@@ -223,6 +230,7 @@ object DarResources {
223230
splitwell_0_1_12,
224231
splitwell_0_1_13,
225232
splitwell_0_1_14,
233+
splitwell_0_1_15,
226234
),
227235
)
228236

@@ -241,6 +249,7 @@ object DarResources {
241249
val wallet_0_1_12 = DarResource("splice-wallet-0.1.12.dar")
242250
val wallet_0_1_13 = DarResource("splice-wallet-0.1.13.dar")
243251
val wallet_0_1_14 = DarResource("splice-wallet-0.1.14.dar")
252+
val wallet_0_1_15 = DarResource("splice-wallet-0.1.15.dar")
244253
val wallet_current = DarResource("splice-wallet-current.dar")
245254
val wallet = PackageResource(
246255
wallet_current,
@@ -261,6 +270,7 @@ object DarResources {
261270
wallet_0_1_12,
262271
wallet_0_1_13,
263272
wallet_0_1_14,
273+
wallet_0_1_15,
264274
),
265275
)
266276

@@ -279,6 +289,7 @@ object DarResources {
279289
val walletPayments_0_1_12 = DarResource("splice-wallet-payments-0.1.12.dar")
280290
val walletPayments_0_1_13 = DarResource("splice-wallet-payments-0.1.13.dar")
281291
val walletPayments_0_1_14 = DarResource("splice-wallet-payments-0.1.14.dar")
292+
val walletPayments_0_1_15 = DarResource("splice-wallet-payments-0.1.15.dar")
282293
val walletPayments_current = DarResource("splice-wallet-payments-current.dar")
283294
val walletPayments = PackageResource(
284295
walletPayments_current,
@@ -299,6 +310,7 @@ object DarResources {
299310
walletPayments_0_1_12,
300311
walletPayments_0_1_13,
301312
walletPayments_0_1_14,
313+
walletPayments_0_1_15,
302314
),
303315
)
304316

apps/common/src/test/scala/org/lfdecentralizedtrust/splice/store/StoreTest.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,8 @@ abstract class StoreTest extends AsyncWordSpec with BaseTest {
411411
)
412412
).toJava,
413413
Some(defaultEffectiveAt).toJava,
414+
Optional.empty(),
415+
Optional.empty(),
414416
)
415417
contract(
416418
identifier = templateId,
@@ -460,6 +462,7 @@ abstract class StoreTest extends AsyncWordSpec with BaseTest {
460462
dsoParty.toProtoPrimitive,
461463
validator.toProtoPrimitive,
462464
new Round(round),
465+
Optional.empty(),
463466
),
464467
)
465468
}

apps/common/src/test/scala/org/lfdecentralizedtrust/splice/util/ValueJsonCodecCodegenTest.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ class ValueJsonCodecCodegenTest extends StoreTest with StoreErrors {
6464
Optional.empty(),
6565
Optional.empty(),
6666
Optional.empty(),
67+
Optional.empty(),
68+
Optional.empty(),
6769
)
6870
// with (one) optional field set
6971
val decodedOptionalSet: JavaApi.DamlRecord = ValueJsonCodecCodegen
@@ -81,6 +83,8 @@ class ValueJsonCodecCodegenTest extends StoreTest with StoreErrors {
8183
Optional.empty(),
8284
Optional.empty(),
8385
Optional.of(java.time.Instant.EPOCH),
86+
Optional.empty(),
87+
Optional.empty(),
8488
)
8589
}
8690

0 commit comments

Comments
 (0)