Skip to content

Commit 5a5606e

Browse files
committed
m
1 parent b287021 commit 5a5606e

File tree

3 files changed

+263
-263
lines changed

3 files changed

+263
-263
lines changed

TestVectors/dafny/DDBEncryption/src/JsonConfig.dfy

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ module {:options "-functionSyntax:4"} JsonConfig {
500500
var compoundBeacons : seq<Types.CompoundBeacon> := [];
501501
var virtualFields : seq<Types.VirtualField> := [];
502502
var keySource : Option<Types.BeaconKeySource> := None;
503-
var maximumNumberOfBuckets: Option<Types.BucketCount> := None;
504-
var defaultNumberOfBuckets: Option<Types.BucketCount> := None;
503+
var maximumNumberOfPartitions: Option<Types.PartitionCount> := None;
504+
var defaultNumberOfPartitions: Option<Types.PartitionCount> := None;
505505

506506
for i := 0 to |data.obj| {
507507
var obj := data.obj[i];
@@ -510,20 +510,20 @@ module {:options "-functionSyntax:4"} JsonConfig {
510510
case "standardBeacons" => standardBeacons :- GetStandardBeacons(obj.1);
511511
case "compoundBeacons" => compoundBeacons :- GetCompoundBeacons(obj.1);
512512
case "virtualFields" => virtualFields :- GetVirtualFields(obj.1);
513-
case "maximumNumberOfBuckets" =>
514-
:- Need(obj.1.Number?, "maximumNumberOfBuckets must be of type Number.");
513+
case "maximumNumberOfPartitions" =>
514+
:- Need(obj.1.Number?, "maximumNumberOfPartitions must be of type Number.");
515515
var num :- DecimalToNat(obj.1.num);
516516
expect 0 < num < INT32_MAX_LIMIT;
517517
var num2 := num as int32;
518-
expect Types.IsValid_BucketCount(num2);
519-
maximumNumberOfBuckets := Some(num as Types.BucketCount);
520-
case "defaultNumberOfBuckets" =>
521-
:- Need(obj.1.Number?, "defaultNumberOfBuckets must be of type Number.");
518+
expect Types.IsValid_PartitionCount(num2);
519+
maximumNumberOfPartitions := Some(num as Types.PartitionCount);
520+
case "defaultNumberOfPartitions" =>
521+
:- Need(obj.1.Number?, "defaultNumberOfPartitions must be of type Number.");
522522
var num :- DecimalToNat(obj.1.num);
523523
expect 0 < num < INT32_MAX_LIMIT;
524524
var num2 := num as int32;
525-
expect Types.IsValid_BucketCount(num2);
526-
defaultNumberOfBuckets := Some(num as Types.BucketCount);
525+
expect Types.IsValid_PartitionCount(num2);
526+
defaultNumberOfPartitions := Some(num as Types.PartitionCount);
527527
case _ => return Failure("Unexpected part of a beacon version : '" + obj.0 + "'");
528528
}
529529
}
@@ -547,8 +547,8 @@ module {:options "-functionSyntax:4"} JsonConfig {
547547
virtualFields := OptSeq(virtualFields),
548548
encryptedParts := None,
549549
signedParts := None,
550-
maximumNumberOfBuckets := maximumNumberOfBuckets,
551-
defaultNumberOfBuckets := defaultNumberOfBuckets
550+
maximumNumberOfPartitions := maximumNumberOfPartitions,
551+
defaultNumberOfPartitions := defaultNumberOfPartitions
552552
)
553553
);
554554
}
@@ -590,7 +590,7 @@ module {:options "-functionSyntax:4"} JsonConfig {
590590

591591
var src := SI.KeySource(client, store, SI.SingleLoc("foo"), cache, 100 as uint32, partitionIdBytes, logicalKeyStoreNameBytes);
592592

593-
var sel := new SearchConfigToInfo.DefaultBucketSelector();
593+
var sel := new SearchConfigToInfo.DefaultPartitionSelector();
594594
var bv :- expect SI.MakeBeaconVersion(1, src, map[], map[], map[], sel, 1);
595595
return Success(bv);
596596
}
@@ -1116,7 +1116,7 @@ module {:options "-functionSyntax:4"} JsonConfig {
11161116
var name : string := "";
11171117
var length : int := -1;
11181118
var loc : Option<Types.TerminalLocation> := None;
1119-
var numberOfBuckets: Option<Types.BucketCount> := None;
1119+
var numberOfPartitions: Option<Types.PartitionCount> := None;
11201120

11211121
for i := 0 to |data.obj| {
11221122
var obj := data.obj[i];
@@ -1131,19 +1131,19 @@ module {:options "-functionSyntax:4"} JsonConfig {
11311131
:- Need(obj.1.String?, "Standard Beacon Location must be a string");
11321132
:- Need(0 < |obj.1.str|, "Standard Beacon Location must not be an empty string.");
11331133
loc := Some(obj.1.str);
1134-
case "numberOfBuckets" =>
1135-
:- Need(obj.1.Number?, "numberOfBuckets must be of type Number.");
1134+
case "numberOfPartitions" =>
1135+
:- Need(obj.1.Number?, "numberOfPartitions must be of type Number.");
11361136
var num :- DecimalToNat(obj.1.num);
11371137
expect 0 < num < INT32_MAX_LIMIT;
11381138
var num2 := num as int32;
1139-
expect Types.IsValid_BucketCount(num2);
1140-
numberOfBuckets := Some(num as Types.BucketCount);
1139+
expect Types.IsValid_PartitionCount(num2);
1140+
numberOfPartitions := Some(num as Types.PartitionCount);
11411141
case _ => return Failure("Unexpected part of a standard beacon : '" + data.obj[i].0 + "'");
11421142
}
11431143
}
11441144
:- Need(0 < |name|, "Each Standard Beacon needs a name.");
11451145
:- Need(0 < length < 100 && Types.IsValid_BeaconBitLength(length as int32), "Each Standard Beacon needs a length between 1 and 63.");
1146-
return Success(Types.StandardBeacon(name := name, length := length as Types.BeaconBitLength, loc := loc, style := None, numberOfBuckets := numberOfBuckets));
1146+
return Success(Types.StandardBeacon(name := name, length := length as Types.BeaconBitLength, loc := loc, style := None, numberOfPartitions := numberOfPartitions));
11471147
}
11481148

11491149
method GetGSIs(data : JSON) returns (output : Result<seq<DDB.GlobalSecondaryIndex> , string>)

0 commit comments

Comments
 (0)