From 3d9f164881e4c7f18542c9ad2a9e6626e8f355c8 Mon Sep 17 00:00:00 2001 From: ilya-korotya Date: Tue, 29 Oct 2024 13:24:47 +0100 Subject: [PATCH] remove default value for allowed issuers --- test/utils/pack-utils.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/utils/pack-utils.ts b/test/utils/pack-utils.ts index 9080f6c..c556509 100644 --- a/test/utils/pack-utils.ts +++ b/test/utils/pack-utils.ts @@ -1,6 +1,7 @@ import Web3 from 'web3'; +import { DID } from '@iden3/js-iden3-core'; -export function packV2ValidatorParams(query: any, allowedIssuers: any[] = []) { +export function packV2ValidatorParams(query: any, allowedIssuers: any[]) { const web3 = new Web3(Web3.givenProvider || 'ws://localhost:8545'); return web3.eth.abi.encodeParameter( { @@ -32,7 +33,7 @@ export function packV2ValidatorParams(query: any, allowedIssuers: any[] = []) { ); } -export function packV3ValidatorParams(query: any, allowedIssuers: any[] = []) { +export function packV3ValidatorParams(query: any, allowedIssuers: any[]) { const web3 = new Web3(Web3.givenProvider || 'ws://localhost:8545'); return web3.eth.abi.encodeParameter( { @@ -114,3 +115,7 @@ export function unpackV2ValidatorParams(hex: string) { hex ); } + +export function didToString(did: string): string { + return DID.idFromDID(DID.parse(did)).bigInt().toString(); +}