diff --git a/examples/integration-scripts/witness.test.ts b/examples/integration-scripts/witness.test.ts index c5d45234..417012c1 100644 --- a/examples/integration-scripts/witness.test.ts +++ b/examples/integration-scripts/witness.test.ts @@ -31,10 +31,23 @@ test('test witness', async () => { await resolveOobi(client1, witnessUrls[0] + `/oobi/${WITNESS_AID}`, 'wit'); console.log('Witness OOBI resolved'); + // Create backer seal + const META_DATA = signify.Saider.saidify({ + d: "", + ledger: "CARDANO_PREVIEW", + })[1]; + + const REGISTRAR_SEAL = { + d: META_DATA['d'], + bi: WITNESS_AID + } + // Client 1 creates AID with 1 witness let icpResult1 = await client1.identifiers().create('aid1', { toad: 1, wits: [WITNESS_AID], + cnfg: ["RB"], + data: REGISTRAR_SEAL }); await waitOperation(client1, await icpResult1.op()); let aid1 = await client1.identifiers().get('aid1'); @@ -42,7 +55,9 @@ test('test witness', async () => { assert.equal(aid1.state.b.length, 1); assert.equal(aid1.state.b[0], WITNESS_AID); - icpResult1 = await client1.identifiers().rotate('aid1'); + icpResult1 = await client1.identifiers().rotate('aid1', { + data: REGISTRAR_SEAL + }); await waitOperation(client1, await icpResult1.op()); aid1 = await client1.identifiers().get('aid1'); assert.equal(aid1.state.b.length, 1); @@ -51,7 +66,10 @@ test('test witness', async () => { // Remove witness icpResult1 = await client1 .identifiers() - .rotate('aid1', { cuts: [WITNESS_AID] }); + .rotate('aid1', { + cuts: [WITNESS_AID], + data: REGISTRAR_SEAL + }); await waitOperation(client1, await icpResult1.op()); aid1 = await client1.identifiers().get('aid1'); assert.equal(aid1.state.b.length, 0); @@ -60,7 +78,10 @@ test('test witness', async () => { icpResult1 = await client1 .identifiers() - .rotate('aid1', { adds: [WITNESS_AID] }); + .rotate('aid1', { + adds: [WITNESS_AID], + data: REGISTRAR_SEAL + }); await waitOperation(client1, await icpResult1.op()); aid1 = await client1.identifiers().get('aid1'); diff --git a/src/keri/app/aiding.ts b/src/keri/app/aiding.ts index 8287db3a..a25f8b12 100644 --- a/src/keri/app/aiding.ts +++ b/src/keri/app/aiding.ts @@ -20,6 +20,7 @@ export interface CreateIdentiferArgs { delpre?: string; dcode?: string; data?: any; + cnfg?: any[]; algo?: Algos; pre?: string; states?: any[]; @@ -44,7 +45,7 @@ export interface RotateIdentifierArgs { toad?: number; cuts?: string[]; adds?: string[]; - data?: Array; + data?: any; ncode?: string; ncount?: number; ncodes?: string[]; @@ -163,6 +164,7 @@ export class Identifier { const proxy = kargs.proxy; const delpre = kargs.delpre; const data = kargs.data != undefined ? [kargs.data] : []; + const cnfg = kargs.cnfg != undefined ? kargs.cnfg : []; const pre = kargs.pre; const states = kargs.states; const rstates = kargs.rstates; @@ -223,7 +225,7 @@ export class Identifier { nsith: nsith, toad: toad, wits: wits, - cnfg: [], + cnfg: cnfg, data: data, version: Versionage, kind: Serials.JSON, @@ -238,7 +240,7 @@ export class Identifier { nsith: nsith, toad: toad, wits: wits, - cnfg: [], + cnfg: cnfg, data: data, version: Versionage, kind: Serials.JSON, diff --git a/src/keri/app/habery.ts b/src/keri/app/habery.ts index 3339a27b..12b769fe 100644 --- a/src/keri/app/habery.ts +++ b/src/keri/app/habery.ts @@ -10,6 +10,7 @@ export class TraitCodex { EstOnly: string = 'EO'; // Only allow establishment events DoNotDelegate: string = 'DND'; // Dot not allow delegated identifiers NoBackers: string = 'NB'; // Do not allow backers + RegistrarBackers: string = 'RB'; // Registrar backers } export const TraitDex = new TraitCodex(); diff --git a/src/keri/core/eventing.ts b/src/keri/core/eventing.ts index 3130b159..3f832823 100644 --- a/src/keri/core/eventing.ts +++ b/src/keri/core/eventing.ts @@ -9,6 +9,7 @@ import { Version, Versionage, } from './core'; +import { TraitDex } from '../app/habery'; import { Tholder } from './tholder'; import { CesrNumber } from './number'; import { Prefixer } from './prefixer';