Skip to content

Commit

Permalink
Merge pull request #105 from roots-id/scripts_adjust
Browse files Browse the repository at this point in the history
Coordinated multisig interaction and rotation
  • Loading branch information
AlexAndrei98 authored Sep 11, 2023
2 parents 51db099 + 2530a0d commit be60697
Show file tree
Hide file tree
Showing 11 changed files with 476 additions and 205 deletions.
25 changes: 8 additions & 17 deletions examples/integration-scripts/challenge.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import { strict as assert } from "assert";
import { strict as assert } from "assert"
import signify from "signify-ts"

let signify: any;
const url = "http://127.0.0.1:3901"
const boot_url = "http://127.0.0.1:3903"

// @ts-ignore
import('signify-ts').then(
(module) => {
signify = module
signify.ready().then(() => {
console.log("*** Starting CHALLENGE test ***");
run().then(() => {
console.log("*** Test complete ***")
});
});
}
)
await run()

async function run() {

await signify.ready()
// Boot two clients
const bran1 = signify.randomPasscode()
const bran2 = signify.randomPasscode()
Expand All @@ -40,13 +29,14 @@ async function run() {
assert.equal(challenge1_big.words.length, 24)

// Create two identifiers, one for each client
let op1 = await client1.identifiers().create('alice', {
let icpResult1 = await client1.identifiers().create('alice', {
toad: 3,
wits: [
"BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha",
"BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM",
"BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX"]
})
let op1 = await icpResult1.op()
while (!op1["done"] ) {
op1 = await client1.operations().get(op1.name);
await new Promise(resolve => setTimeout(resolve, 1000));
Expand All @@ -55,13 +45,14 @@ async function run() {
await client1.identifiers().addEndRole("alice", 'agent', client1!.agent!.pre)
console.log("Alice's AID:", aid1.i)

let op2 = await client2.identifiers().create('bob', {
let icpResult2 = await client2.identifiers().create('bob', {
toad: 3,
wits: [
"BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha",
"BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM",
"BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX"]
})
let op2 = await icpResult2.op()
while (!op2["done"] ) {
op2 = await client2.operations().get(op2.name);
await new Promise(resolve => setTimeout(resolve, 1000));
Expand Down
19 changes: 4 additions & 15 deletions examples/integration-scripts/credentials.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import { strict as assert } from "assert";
import { strict as assert } from "assert"
import signify from "signify-ts"

let signify: any;
const url = "http://127.0.0.1:3901"
const boot_url = "http://127.0.0.1:3903"

// @ts-ignore
import('signify-ts').then(
(module) => {
signify = module
signify.ready().then(() => {
console.log("*** Starting CREDENTIALS test ***");
run().then(() => {
console.log("*** Test complete ***")
});
});
}
)
await run()

async function run() {

await signify.ready()
// Boot three clients
const bran1 = signify.randomPasscode()
const bran2 = signify.randomPasscode()
Expand Down
19 changes: 4 additions & 15 deletions examples/integration-scripts/delegation.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import { strict as assert } from "assert";
import { strict as assert } from "assert"
import signify from "signify-ts"

let signify: any;
const url = "http://127.0.0.1:3901"
const boot_url = "http://127.0.0.1:3903"

// @ts-ignore
import('signify-ts').then(
(module) => {
signify = module
signify.ready().then(() => {
console.log("*** Starting DELEGATION test ***");
run().then(() => {
console.log("*** Test complete ***")
});
});
}
)
await run()

async function run() {

await signify.ready()
// Boot two clients
const bran1 = signify.randomPasscode()
const bran2 = signify.randomPasscode()
Expand Down
Loading

0 comments on commit be60697

Please sign in to comment.