mirror of https://github.com/status-im/js-waku.git
chore: add autosharding test vectors
This commit is contained in:
parent
1ffa5db7e7
commit
7e88d3b565
|
@ -63,7 +63,9 @@ describe("ensureValidContentTopic", () => {
|
||||||
"/1/myapp/1/mytopic/cbor",
|
"/1/myapp/1/mytopic/cbor",
|
||||||
"/2/myapp/1/mytopic/cbor",
|
"/2/myapp/1/mytopic/cbor",
|
||||||
"/3/myapp/1/mytopic/cbor",
|
"/3/myapp/1/mytopic/cbor",
|
||||||
"/1000/myapp/1/mytopic/cbor"
|
"/1000/myapp/1/mytopic/cbor",
|
||||||
|
"/1/toychat/2/huilong/proto",
|
||||||
|
"/1/statusim/1/community/cbor"
|
||||||
],
|
],
|
||||||
"Generation greater than 0 is not supported"
|
"Generation greater than 0 is not supported"
|
||||||
);
|
);
|
||||||
|
@ -97,7 +99,11 @@ describe("contentTopicToShardIndex", () => {
|
||||||
const contentTopics: [string, number][] = [
|
const contentTopics: [string, number][] = [
|
||||||
["/toychat/2/huilong/proto", 3],
|
["/toychat/2/huilong/proto", 3],
|
||||||
["/myapp/1/latest/proto", 0],
|
["/myapp/1/latest/proto", 0],
|
||||||
["/waku/2/content/test.js", 1]
|
["/waku/2/content/test.js", 1],
|
||||||
|
["/toychat/2/huilong/proto", 3],
|
||||||
|
["/0/toychat/2/huilong/proto", 3],
|
||||||
|
["/statusim/1/community/cbor", 4],
|
||||||
|
["/0/statusim/1/community/cbor", 4]
|
||||||
];
|
];
|
||||||
for (const [topic, shard] of contentTopics) {
|
for (const [topic, shard] of contentTopics) {
|
||||||
expect(contentTopicToShardIndex(topic)).to.eq(shard);
|
expect(contentTopicToShardIndex(topic)).to.eq(shard);
|
||||||
|
|
Loading…
Reference in New Issue