@typeberry/lib 0.1.3-6edad4a → 0.1.3-af70ed0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +16 -0
- package/index.d.ts +20 -1
- package/index.js +16 -0
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -8731,6 +8731,10 @@ class DisputesRecords {
|
|
|
8731
8731
|
static create({ goodSet, badSet, wonkySet, punishSet }) {
|
|
8732
8732
|
return new DisputesRecords(goodSet, badSet, wonkySet, punishSet);
|
|
8733
8733
|
}
|
|
8734
|
+
goodSetDict;
|
|
8735
|
+
badSetDict;
|
|
8736
|
+
wonkySetDict;
|
|
8737
|
+
punishSetDict;
|
|
8734
8738
|
constructor(
|
|
8735
8739
|
/** `goodSet`: all work-reports hashes which were judged to be correct */
|
|
8736
8740
|
goodSet,
|
|
@@ -8744,6 +8748,18 @@ class DisputesRecords {
|
|
|
8744
8748
|
this.badSet = badSet;
|
|
8745
8749
|
this.wonkySet = wonkySet;
|
|
8746
8750
|
this.punishSet = punishSet;
|
|
8751
|
+
this.goodSetDict = HashSet.from(goodSet.array);
|
|
8752
|
+
this.badSetDict = HashSet.from(badSet.array);
|
|
8753
|
+
this.wonkySetDict = HashSet.from(wonkySet.array);
|
|
8754
|
+
this.punishSetDict = HashSet.from(punishSet.array);
|
|
8755
|
+
}
|
|
8756
|
+
asDictionaries() {
|
|
8757
|
+
return {
|
|
8758
|
+
goodSet: this.goodSetDict,
|
|
8759
|
+
badSet: this.badSetDict,
|
|
8760
|
+
wonkySet: this.wonkySetDict,
|
|
8761
|
+
punishSet: this.punishSetDict,
|
|
8762
|
+
};
|
|
8747
8763
|
}
|
|
8748
8764
|
static fromSortedArrays({ goodSet, badSet, wonkySet, punishSet, }) {
|
|
8749
8765
|
return new DisputesRecords(SortedSet.fromSortedArray(hashComparator, goodSet), SortedSet.fromSortedArray(hashComparator, badSet), SortedSet.fromSortedArray(hashComparator, wonkySet), SortedSet.fromSortedArray(hashComparator, punishSet));
|
package/index.d.ts
CHANGED
|
@@ -9196,6 +9196,11 @@ declare class DisputesRecords {
|
|
|
9196
9196
|
return new DisputesRecords(goodSet, badSet, wonkySet, punishSet);
|
|
9197
9197
|
}
|
|
9198
9198
|
|
|
9199
|
+
private readonly goodSetDict: ImmutableHashSet<WorkReportHash>;
|
|
9200
|
+
private readonly badSetDict: ImmutableHashSet<WorkReportHash>;
|
|
9201
|
+
private readonly wonkySetDict: ImmutableHashSet<WorkReportHash>;
|
|
9202
|
+
private readonly punishSetDict: ImmutableHashSet<Ed25519Key>;
|
|
9203
|
+
|
|
9199
9204
|
private constructor(
|
|
9200
9205
|
/** `goodSet`: all work-reports hashes which were judged to be correct */
|
|
9201
9206
|
public readonly goodSet: ImmutableSortedSet<WorkReportHash>,
|
|
@@ -9205,7 +9210,21 @@ declare class DisputesRecords {
|
|
|
9205
9210
|
public readonly wonkySet: ImmutableSortedSet<WorkReportHash>,
|
|
9206
9211
|
/** `punishSet`: set of Ed25519 keys representing validators which were found to have misjudged a work-report */
|
|
9207
9212
|
public readonly punishSet: ImmutableSortedSet<Ed25519Key>,
|
|
9208
|
-
) {
|
|
9213
|
+
) {
|
|
9214
|
+
this.goodSetDict = HashSet.from(goodSet.array);
|
|
9215
|
+
this.badSetDict = HashSet.from(badSet.array);
|
|
9216
|
+
this.wonkySetDict = HashSet.from(wonkySet.array);
|
|
9217
|
+
this.punishSetDict = HashSet.from(punishSet.array);
|
|
9218
|
+
}
|
|
9219
|
+
|
|
9220
|
+
public asDictionaries() {
|
|
9221
|
+
return {
|
|
9222
|
+
goodSet: this.goodSetDict,
|
|
9223
|
+
badSet: this.badSetDict,
|
|
9224
|
+
wonkySet: this.wonkySetDict,
|
|
9225
|
+
punishSet: this.punishSetDict,
|
|
9226
|
+
};
|
|
9227
|
+
}
|
|
9209
9228
|
|
|
9210
9229
|
static fromSortedArrays({
|
|
9211
9230
|
goodSet,
|
package/index.js
CHANGED
|
@@ -8728,6 +8728,10 @@ class DisputesRecords {
|
|
|
8728
8728
|
static create({ goodSet, badSet, wonkySet, punishSet }) {
|
|
8729
8729
|
return new DisputesRecords(goodSet, badSet, wonkySet, punishSet);
|
|
8730
8730
|
}
|
|
8731
|
+
goodSetDict;
|
|
8732
|
+
badSetDict;
|
|
8733
|
+
wonkySetDict;
|
|
8734
|
+
punishSetDict;
|
|
8731
8735
|
constructor(
|
|
8732
8736
|
/** `goodSet`: all work-reports hashes which were judged to be correct */
|
|
8733
8737
|
goodSet,
|
|
@@ -8741,6 +8745,18 @@ class DisputesRecords {
|
|
|
8741
8745
|
this.badSet = badSet;
|
|
8742
8746
|
this.wonkySet = wonkySet;
|
|
8743
8747
|
this.punishSet = punishSet;
|
|
8748
|
+
this.goodSetDict = HashSet.from(goodSet.array);
|
|
8749
|
+
this.badSetDict = HashSet.from(badSet.array);
|
|
8750
|
+
this.wonkySetDict = HashSet.from(wonkySet.array);
|
|
8751
|
+
this.punishSetDict = HashSet.from(punishSet.array);
|
|
8752
|
+
}
|
|
8753
|
+
asDictionaries() {
|
|
8754
|
+
return {
|
|
8755
|
+
goodSet: this.goodSetDict,
|
|
8756
|
+
badSet: this.badSetDict,
|
|
8757
|
+
wonkySet: this.wonkySetDict,
|
|
8758
|
+
punishSet: this.punishSetDict,
|
|
8759
|
+
};
|
|
8744
8760
|
}
|
|
8745
8761
|
static fromSortedArrays({ goodSet, badSet, wonkySet, punishSet, }) {
|
|
8746
8762
|
return new DisputesRecords(SortedSet.fromSortedArray(hashComparator, goodSet), SortedSet.fromSortedArray(hashComparator, badSet), SortedSet.fromSortedArray(hashComparator, wonkySet), SortedSet.fromSortedArray(hashComparator, punishSet));
|