ts-mls
Version:
[](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [](https://badge.fury.io/js/ts-mls) [,
epoch: 0n,
treeHash: new Uint8Array([4, 5]),
confirmedTranscriptHash: new Uint8Array([6]),
extensions: [],
};
const dummyExtension = { extensionType: "ratchet_tree", extensionData: new Uint8Array([8, 9]) };
const minimalTBS = {
groupContext: dummyGroupContext,
extensions: [],
confirmationTag: new Uint8Array([]),
signer: 0,
};
const nontrivialTBS = {
groupContext: dummyGroupContext,
extensions: [dummyExtension],
confirmationTag: new Uint8Array([1, 2, 3]),
signer: 42,
};
describe("GroupInfoTBS roundtrip", () => {
const roundtrip = createRoundtripTest(encodeGroupInfoTBS, decodeGroupInfoTBS);
test("roundtrips minimal", () => {
roundtrip(minimalTBS);
});
test("roundtrips nontrivial", () => {
roundtrip(nontrivialTBS);
});
});
describe("GroupInfo roundtrip", () => {
const roundtrip = createRoundtripTest(encodeGroupInfo, decodeGroupInfo);
test("roundtrips minimal", () => {
const g = { ...minimalTBS, signature: new Uint8Array([]) };
roundtrip(g);
});
test("roundtrips nontrivial", () => {
const g = { ...nontrivialTBS, signature: new Uint8Array([9, 8, 7]) };
roundtrip(g);
});
});
//# sourceMappingURL=groupInfo.test.js.map