@hardkas/testing 0.7.1-alpha → 0.7.4-alpha
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/dist/adversarial-fixtures.js +1 -1
- package/dist/{chunk-IRVMANZV.js → chunk-J7YJZ3SC.js} +3 -1
- package/dist/{chunk-HH4OIGEG.js → chunk-QO3ONDVW.js} +20 -4
- package/dist/{chunk-SIJI3FRM.js → chunk-WJNTOLTB.js} +14 -3
- package/dist/index.js +925 -255
- package/dist/reproducibility.js +1 -1
- package/dist/setup.js +1 -1
- package/package.json +9 -9
|
@@ -68,7 +68,9 @@ var hardKasMatchers = {
|
|
|
68
68
|
};
|
|
69
69
|
},
|
|
70
70
|
toHaveNoRedBlocks(received) {
|
|
71
|
-
const redBlocks = Object.values(received?.blocks || {}).filter(
|
|
71
|
+
const redBlocks = Object.values(received?.blocks || {}).filter(
|
|
72
|
+
(b) => b.isBlue === false
|
|
73
|
+
);
|
|
72
74
|
const pass = redBlocks.length === 0;
|
|
73
75
|
return {
|
|
74
76
|
pass,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// src/adversarial-fixtures.ts
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
calculateContentHash,
|
|
4
|
+
CURRENT_HASH_VERSION,
|
|
5
|
+
ARTIFACT_VERSION
|
|
6
|
+
} from "@hardkas/artifacts";
|
|
3
7
|
var AdversarialFixtures = {
|
|
4
8
|
/**
|
|
5
9
|
* Circular lineage: A -> B -> A
|
|
@@ -109,9 +113,21 @@ var AdversarialFixtures = {
|
|
|
109
113
|
mode: "simulated"
|
|
110
114
|
};
|
|
111
115
|
return [
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
{
|
|
117
|
+
...common,
|
|
118
|
+
artifactId: "art-1",
|
|
119
|
+
lineage: { sequenceId: 1, contentHash: "hash-1" }
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
...common,
|
|
123
|
+
artifactId: "art-2",
|
|
124
|
+
lineage: { sequenceId: 2, contentHash: "hash-2", parentArtifactId: "art-1" }
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
...common,
|
|
128
|
+
artifactId: "art-3",
|
|
129
|
+
lineage: { sequenceId: 2, contentHash: "hash-3-BAD", parentArtifactId: "art-1" }
|
|
130
|
+
}
|
|
115
131
|
// Duplicate sequenceId 2
|
|
116
132
|
];
|
|
117
133
|
},
|
|
@@ -17,8 +17,14 @@ function generateReproducibilityReport() {
|
|
|
17
17
|
{ outpoint: { transactionId: "a".repeat(64), index: 0 }, amountSompi: "200000000" }
|
|
18
18
|
],
|
|
19
19
|
outputs: [
|
|
20
|
-
{
|
|
21
|
-
|
|
20
|
+
{
|
|
21
|
+
address: "kaspatest:qq0d6h0prjm5mpdld5pncst3adu0yam6xch9fkr6eg",
|
|
22
|
+
amountSompi: "100000000"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
address: "kaspatest:qz0s9xrz5y5e8dq5azmpg756aeepm6fesq82ye7wv",
|
|
26
|
+
amountSompi: "99998000"
|
|
27
|
+
}
|
|
22
28
|
],
|
|
23
29
|
estimatedMass: "2000",
|
|
24
30
|
estimatedFeeSompi: "2000"
|
|
@@ -53,7 +59,12 @@ function generateReproducibilityReport() {
|
|
|
53
59
|
const linearRedPpm = linearTotal > 0 ? Math.trunc(linearResult.metrics.redBlocks * 1e6 / linearTotal) : 0;
|
|
54
60
|
const wideTotal = wideResult.metrics.blueBlocks + wideResult.metrics.redBlocks;
|
|
55
61
|
const wideRedPpm = wideTotal > 0 ? Math.trunc(wideResult.metrics.redBlocks * 1e6 / wideTotal) : 0;
|
|
56
|
-
const massResult = profileMass({
|
|
62
|
+
const massResult = profileMass({
|
|
63
|
+
inputCount: 3,
|
|
64
|
+
outputCount: 2,
|
|
65
|
+
payloadBytes: 0,
|
|
66
|
+
feeRate: 1n
|
|
67
|
+
});
|
|
57
68
|
const nestedObj = {
|
|
58
69
|
z: { b: 2, a: 1 },
|
|
59
70
|
y: [3, 1, 2],
|