Skip to content

Commit 31359e5

Browse files
author
Wes Biggs
committed
Update schemaIds against mainnet. One open item.
1 parent b4271bf commit 31359e5

File tree

3 files changed

+691
-1079
lines changed

3 files changed

+691
-1079
lines changed

dsnp/index.ts

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const reaction = descriptorForAnnouncementType(AnnouncementType.Reaction).parque
1818
const reply = descriptorForAnnouncementType(AnnouncementType.Reply).parquetSchema;
1919
const tombstone = descriptorForAnnouncementType(AnnouncementType.Tombstone).parquetSchema;
2020
const update = descriptorForAnnouncementType(AnnouncementType.Update).parquetSchema;
21-
const userAttributeSet = descriptorForAnnouncementType(AnnouncementType.Update).parquetSchema;
21+
const userAttributeSet = descriptorForAnnouncementType(AnnouncementType.UserAttributeSet).parquetSchema;
2222
const dsnpContentAttributeSet = descriptorForAnnouncementType(AnnouncementType.DSNPContentAttributeSet).parquetSchema;
2323
const externalContentAttributeSet = descriptorForAnnouncementType(
2424
AnnouncementType.ExternalContentAttributeSet,
@@ -104,7 +104,7 @@ export const schemas = new Map<SchemaName, Deploy>([
104104
modelType: "Parquet",
105105
payloadLocation: "IPFS",
106106
settings: [],
107-
dsnpVersion: "1.2",
107+
dsnpVersion: "1.3",
108108
},
109109
],
110110
[
@@ -114,7 +114,7 @@ export const schemas = new Map<SchemaName, Deploy>([
114114
modelType: "Parquet",
115115
payloadLocation: "IPFS",
116116
settings: [],
117-
dsnpVersion: "1.2",
117+
dsnpVersion: "1.3",
118118
},
119119
],
120120
[
@@ -124,7 +124,7 @@ export const schemas = new Map<SchemaName, Deploy>([
124124
modelType: "Parquet",
125125
payloadLocation: "IPFS",
126126
settings: [],
127-
dsnpVersion: "1.2",
127+
dsnpVersion: "1.3",
128128
},
129129
],
130130
[
@@ -144,7 +144,7 @@ export const schemas = new Map<SchemaName, Deploy>([
144144
modelType: "Parquet",
145145
payloadLocation: "IPFS",
146146
settings: [],
147-
dsnpVersion: "1.2",
147+
dsnpVersion: "1.3",
148148
},
149149
],
150150
[
@@ -250,45 +250,37 @@ const chainMapping: { [genesisHash: string]: SchemaMapping } = {};
250250
export const GENESIS_HASH_TESTNET_PASEO = "0x203c6838fc78ea3660a2f298a58d859519c72a5efdc0f194abd6f0d5ce1838e0";
251251
export const GENESIS_HASH_MAINNET = "0x4a587bf17a404e3572747add7aab7bbe56e805a5479c6c436f07f36fcc8d3ae1";
252252

253-
chainMapping[GENESIS_HASH_TESTNET_PASEO] = {
254-
tombstone: { "1.2": 1 },
255-
broadcast: { "1.2": 2 },
256-
reply: { "1.2": 3 },
257-
reaction: { "1.1": 4 },
258-
update: { "1.2": 6 },
259-
"public-key-key-agreement": { "1.2": 7 },
260-
"public-follows": { "1.2": 8 },
261-
"private-follows": { "1.2": 9 },
262-
"private-connections": { "1.2": 10 },
263-
"public-key-assertion-method": { "1.3": 11 },
264-
"profile-resources": { "1.3": 570 },
265-
"user-attribute-set": { "1.3": 579 },
266-
"dsnp-content-attribute-set": { "1.3": 580 },
267-
"ext-content-attribute-set": { "1.3": 581 },
268-
};
253+
/*
254+
* As schemas are approved on mainnet they will be added to the Frequency source code in
255+
* https://github.com/frequency-chain/frequency/blob/main/resources/genesis-schemas.json
256+
* and also backported so that testnet contains all approved schemas.
257+
*/
269258
chainMapping[GENESIS_HASH_MAINNET] = {
270-
tombstone: { "1.2": 1 },
271-
broadcast: { "1.2": 2 },
272-
reply: { "1.2": 3 },
259+
tombstone: { "1.2": 1, "1.3": 16 },
260+
broadcast: { "1.2": 2, "1.3": 17 },
261+
reply: { "1.2": 3, "1.3": 18 },
273262
reaction: { "1.1": 4 },
274-
update: { "1.2": 5 },
263+
update: { "1.2": 5, "1.3": 19 },
275264
"public-key-key-agreement": { "1.2": 7 },
276265
"public-follows": { "1.2": 8 },
277266
"private-follows": { "1.2": 9 },
278267
"private-connections": { "1.2": 10 },
279-
// "public-key-assertion-method": { "1.3": TBD },
280-
// "profile-resources": { "1.3": TBD },
281-
// "user-attribute-set": { "1.3": TBD },
282-
// "dsnp-content-attribute-set": { "1.3": TBD },
283-
// "ext-content-attribute-set": { "1.3": TBD },
268+
"user-attribute-set": { "1.3": 11 }, // this will become 20
269+
"dsnp-content-attribute-set": { "1.3": 12 },
270+
"ext-content-attribute-set": { "1.3": 13 },
271+
"public-key-assertion-method": { "1.3": 14 },
272+
"profile-resources": { "1.3": 15 },
273+
};
274+
275+
// Schemas that exist on testnet but not yet on mainnet should be appended here
276+
chainMapping[GENESIS_HASH_TESTNET_PASEO] = {
277+
...chainMapping[GENESIS_HASH_MAINNET],
278+
};
279+
280+
// Schemas that exist only on a local/development chain should be appended here
281+
chainMapping["default"] = {
282+
...chainMapping[GENESIS_HASH_MAINNET],
284283
};
285-
/*
286-
* Schemas in "default" deployments (e.g. to a clean local node) are
287-
* generally the same as mainnet. As schemas are approved on mainnet
288-
* they will be added to the Frequency source code in
289-
* https://github.com/frequency-chain/frequency/blob/main/resources/genesis-schemas.json.
290-
*/
291-
chainMapping["default"] = JSON.parse(JSON.stringify(chainMapping[GENESIS_HASH_MAINNET]));
292284

293285
/**
294286
* Gets the schemaId from the Frequency instance configured for

0 commit comments

Comments
 (0)