Skip to content

Commit

Permalink
matching request and witness
Browse files Browse the repository at this point in the history
  • Loading branch information
nanocryk committed Nov 18, 2024
1 parent aa12233 commit 8d1c96c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/suites/smoke-test-dancebox/test-data-preservers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,35 @@ describeSuite({
}
},
});

it({
id: "C02",
title: "all assigned profile have assignement witness corresponding to request and whished para id",
test: async function () {
const entries = await paraApi.query.dataPreservers.profiles.entries();

for (const [key, entry] of entries) {

Check failure on line 43 in test/suites/smoke-test-dancebox/test-data-preservers.ts

View workflow job for this annotation

GitHub Actions / typescript-linting

'key' is assigned a value but never used
console.log(JSON.stringify(entry));

if (entry.assignment == null) {
continue;
}

const [para_id, witness] = entry.assignment;

if (entry.profile.paraIds.whitelist != null) {
expect(entry.profile.paraIds.whitelist.includes(para_id));
} else if (entry.profile.paraIds.blacklist != null) {
expect(!entry.profile.paraIds.blacklist.includes(para_id));
}

if (entry.profile.assignmentRequest == "Free") {
expect(witness).to.be.eq("Free");
} else if (entry.profile.assignmentRequest.streamPayment != null) {
expect(witness.streamPayment).to.not.be.undefined();
}
}
},
});
},
});

0 comments on commit 8d1c96c

Please sign in to comment.