Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type of isith and nsith to include array of string #103

Merged
merged 3 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/keri/app/signify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ export class SignifyClient {
/** Arguments required to create an identfier */
export interface CreateIdentiferArgs {
transferable?: boolean,
isith?: string | number,
nsith?: string | number,
isith?: string | number | string[],
nsith?: string | number | string[],
wits?: string[],
toad?: number,
proxy?: string,
Expand All @@ -467,7 +467,7 @@ export interface CreateIdentiferArgs {
/** Arguments required to rotate an identfier */
export interface RotateIdentifierArgs {
transferable?: boolean,
nsith?: string | number,
nsith?: string | number | string[],
toad?: number,
cuts?: string[],
adds?: string[],
Expand Down
31 changes: 31 additions & 0 deletions test/app/apping.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {strict as assert} from "assert";
import {randomPasscode, randomNonce} from '../../src/keri/app/apping'
import libsodium from "libsodium-wrappers-sumo"
import {CreateIdentiferArgs, RotateIdentifierArgs} from "../../src/keri/app/signify";

describe('Controller', () => {
it('Random passcode', async () => {
Expand All @@ -15,6 +16,36 @@ describe('Controller', () => {
assert.equal(nonce.length, 44)
})

it('CreateIdentiferArgs', () => {
let args: CreateIdentiferArgs;
args = {
isith: 1,
nsith: 1
};
args = {
isith: "1",
nsith: "1"
};
args = {
isith: ["1"],
nsith: ["1"]
};
args !== null; // avoids TS6133
})

it('RotateIdentifierArgs', () => {
let args: RotateIdentifierArgs;
args = {
nsith: 1
};
args = {
nsith: "1"
};
args = {
nsith: ["1"]
};
args !== null; // avoids TS6133
})


})
Loading