on master help sign in
Add rift to keyfile and bump feed version number
f6af024Santeri Hannula
src/lib/keys.js+4−2
@@ -83,10 +83,11 @@ export const compileNetworkKey = (pair, point, revision) => {
83
83
84/**
84/**
85 * @param {number} point
85 * @param {number} point
86+ * @param {number} continuityNumber
86 * @param {array<{revision: number, pair: object}>} keys
87 * @param {array<{revision: number, pair: object}>} keys
87 * @return {string}
88 * @return {string}
88 */
89 */
89−export const compileMultiKey = (point, keys) => {
90+export const compileMultiKey = (point, continuityNumber, keys) => {
90 const kyz = keys.map(k => {
91 const kyz = keys.map(k => {
91 const bnsec = new BN(createRing(k.pair), 'hex');
92 const bnsec = new BN(createRing(k.pair), 'hex');
92 return noun.dwim(
93 return noun.dwim(
@@ -97,8 +98,9 @@ export const compileMultiKey = (point, keys) => {
97 kyz.push(noun.Atom.fromInt(0));
98 kyz.push(noun.Atom.fromInt(0));
98
99
99 const fed = noun.dwim(
100 const fed = noun.dwim(
100− noun.dwim(noun.Atom.fromInt(1), noun.Atom.fromInt(0)), // version
101+ noun.dwim(noun.Atom.fromInt(2), noun.Atom.fromInt(0)), // version
101 noun.Atom.fromInt(point), // ship
102 noun.Atom.fromInt(point), // ship
103+ noun.Atom.fromInt(continuityNumber),
102 noun.dwim(kyz) // keys
104 noun.dwim(kyz) // keys
103 );
105 );
104
106
src/lib/useKeyfileGenerator.ts+1
@@ -96,6 +96,7 @@ function useKeyfileGenerator({ point, seeds }: useKeyfileGeneratorArgs) {
96 setKeyfile(
96 setKeyfile(
97 compileMultiKey(
97 compileMultiKey(
98 resolvedPoint.value,
98 resolvedPoint.value,
99+ resolvedPoint.continuityNumber,
99 pairs.map((pair, k) => {
100 pairs.map((pair, k) => {
100 return { revision: networkRevision + k, pair };
101 return { revision: networkRevision + k, pair };
101 })
102 })