Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-korotya committed Oct 3, 2023
1 parent 08afebc commit 150936d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
11 changes: 10 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@typescript-eslint/eslint-plugin": "^5.41.0",
"chai": "^4.3.7",
"chai-as-promised": "^7.1.1",
"chai-spies": "^1.0.0",
"chokidar": "^3.5.3",
"esbuild": "^0.15.15",
"eslint-config-prettier": "^8.8.0",
Expand All @@ -79,7 +80,6 @@
"ajv-formats": "^2.1.1",
"base58-js": "^1.0.4",
"buffer-browserify": "^0.2.5",
"chai-spies": "^1.0.0",
"cross-sha256": "^1.2.0",
"crypto-browserify": "^3.12.0",
"did-jwt": "^6.11.6",
Expand Down
6 changes: 3 additions & 3 deletions src/credentials/status/on-chain-revocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class OnChainResolver implements CredentialStatusResolver {
*
* Creates an instance of OnChainIssuer.
* @public
* @param {Array<EthConnectionConfig>} - list of ethereum network connections
* @param {Array<EthConnectionConfig>} _configs - list of ethereum network connections
*/
constructor(private readonly _configs: EthConnectionConfig[]) {}

Expand Down Expand Up @@ -77,13 +77,13 @@ export class OnChainResolver implements CredentialStatusResolver {

if (!stateHex) {
throw new Error(
'latest state not found and state prameter is not present in credentialStatus.id'
'latest state not found and state parameter is not present in credentialStatus.id'
);
}
const stateBigInt = newHashFromHex(stateHex).bigInt();
if (!isGenesisState(issuer, stateBigInt)) {
throw new Error(
`latest state not found and state prameter ${stateHex} is not genesis state`
`latest state not found and state parameter ${stateHex} is not genesis state`
);
}
latestIssuerState = stateBigInt;
Expand Down
2 changes: 1 addition & 1 deletion src/credentials/status/reverse-sparse-merkle-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class RHSResolver implements CredentialStatusResolver {
const currentStateBigInt = newHashFromHex(stateHex).bigInt();
if (!isGenesisState(issuerDID, currentStateBigInt)) {
throw new Error(
`latest state not found and state prameter ${stateHex} is not genesis state`
`latest state not found and state parameter ${stateHex} is not genesis state`
);
}
latestState = currentStateBigInt;
Expand Down
2 changes: 1 addition & 1 deletion src/identity/identity-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,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
4 changes: 3 additions & 1 deletion src/storage/interfaces/onchain-revocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export interface IOnchainRevocationStore {
/**
* gets latest state of identity
*
* @param {bigint} id - id to check
* @param {bigint} issuerID - issuer id
* @param {bigint} state - issuer state
* @param {number} nonce - revocation nonce
* @returns `Promise<StateInfo>`
*/
getRevocationStatusByIdAndState(
Expand Down

0 comments on commit 150936d

Please sign in to comment.