Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Oct 3, 2023
1 parent 35ffd74 commit 6ab80f6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/iden3comm/handlers/contract-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface IContractRequestHandler {
*
* Allows to process ContractInvokeRequest protocol message
*
* @beta
* @public
* @class ContractRequestHandler
* @implements implements IContractRequestHandler interface
Expand Down Expand Up @@ -129,7 +129,7 @@ export class ContractRequestHandler implements IContractRequestHandler {
did,
{
skipRevocation: query.skipClaimRevocationCheck ?? false,
challenge: opts.challange
challenge: opts.challenge
}
);

Expand Down
2 changes: 1 addition & 1 deletion src/iden3comm/types/protocol/contract-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ export type ContractInvokeTransactionData = {
/** ContractInvokeHandlerOptions represents contract invoke handler options */
export type ContractInvokeHandlerOptions = {
ethSigner: Signer;
challange?: bigint;
challenge?: bigint;
};
2 changes: 1 addition & 1 deletion src/identity/identity-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ export class IdentityWallet implements IIdentityWallet {

await this._storage.identity.saveIdentity({
did: issuerDID.string(),
state: treeState ? treeState.state : latestTreeState.state,
state: treeState?.state ?? latestTreeState.state,
isStatePublished: published,
isStateGenesis: false
});
Expand Down
10 changes: 3 additions & 7 deletions src/storage/blockchain/zkp-verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ import { ZeroKnowledgeProofResponse } from '../../iden3comm';
* @class ZKPVerifier
*/
export class ZKPVerifier implements IZKPVerifier {
private readonly config: EthConnectionConfig;

/**
* Creates an instance of ZKPVerifier.
* @public
* @param {EthConnectionConfig} config - eth connection config
*/
constructor(config: EthConnectionConfig) {
this.config = config;
}
constructor(private readonly _config: EthConnectionConfig) {}

/**
* Submit ZKP Responses to ZKPVerifier contract.
Expand All @@ -38,9 +34,9 @@ export class ZKPVerifier implements IZKPVerifier {
ethSigner: Signer,
zkProofResponses: ZeroKnowledgeProofResponse[]
): Promise<Map<string, ZeroKnowledgeProofResponse>> {
this.config.chainId = chain_id;
this._config.chainId = chain_id;

const provider = new ethers.providers.JsonRpcProvider(this.config);
const provider = new ethers.providers.JsonRpcProvider(this._config);
const verifierContract: ethers.Contract = new ethers.Contract(address, abi, provider);
const contract = verifierContract.connect(ethSigner);

Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/contract-request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ describe('contact-request', () => {

const options: ContractInvokeHandlerOptions = {
ethSigner,
challange: BigInt(112312)
challenge: BigInt(112312)
};
const msgBytes = byteEncoder.encode(JSON.stringify(ciRequest));
const ciResponse = await contractRequest.handleContractInvokeRequest(
Expand Down

0 comments on commit 6ab80f6

Please sign in to comment.