Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rflechtner committed Nov 29, 2023
1 parent 33b2589 commit cd2e05f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/credentials/V1/KiltAttestationProofV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ export async function issue(
)
}

/* eslint-disable @typescript-eslint/no-non-null-assertion -- we've checked the appropriate combination of parameters above, but typescript does not follow */
const didSigned = authorizeTx
? await authorizeTx(call)
: await didAuthorizeTx(
Expand All @@ -748,6 +749,7 @@ export async function issue(
const transactionPromise = submitTx
? submitTx(didSigned)
: defaultTxSubmit(didSigned, submitterAccount!, signers!, api)
/* eslint-enable @typescript-eslint/no-non-null-assertion */

const {
includedAt: { blockHash, blockTime },
Expand Down
5 changes: 4 additions & 1 deletion tests/testUtils/TestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ export async function makeStoreDidSigner(
signers,
Signers.select.verifiableOnChain()
)
return signer!
if (!signer) {
throw new Error('Failed to derive DID creation signer from keypair')
}
return signer
}

export interface KeyTool {
Expand Down
6 changes: 3 additions & 3 deletions tests/testUtils/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ const attestationPalletIndex = 62
mockedApi.once('ready', () => {
const idx = mockedApi.runtimeMetadata.asLatest.pallets.find((x) =>
x.name.match(/attestation/i)
)!.index
if (!idx.eqn(attestationPalletIndex)) {
)?.index
if (!idx?.eqn(attestationPalletIndex)) {
console.warn(
`The attestation pallet index is expected to be ${attestationPalletIndex}, but the metadata used lists it as ${idx.toNumber()}. This may lead to tests not behaving as expected!`
`The attestation pallet index is expected to be ${attestationPalletIndex}, but the metadata used lists it as ${idx?.toNumber()}. This may lead to tests not behaving as expected!`
)
}
})
Expand Down

0 comments on commit cd2e05f

Please sign in to comment.