Skip to content

Commit

Permalink
Bug fixes (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel authored Apr 4, 2024
1 parent 2d760c3 commit 1746c38
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/devtool/src/app/_hooks/useAccountSignature.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const useAccountSignature = () => {
htm: 'POST',
uri: 'https://armory.narval.xyz/sign',
created: new Date().getTime(),
ath: hexToBase64Url(`0x${hash(accessToken)}`)
ath: hexToBase64Url(hash(accessToken))
}

const signature = await signJwsd(payload, jwsdHeader, signer).then((jws) => {
Expand Down
3 changes: 2 additions & 1 deletion apps/policy-engine/src/engine/__test__/e2e/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ describe('Client', () => {
.send(createClientPayload)

const actualClient = await clientRepository.findByClientId(clientId)
const actualPublicKey = secp256k1PrivateKeyToPublicJwk(privateKeyToHex(actualClient?.signer.key as PrivateKey))
const hex = await privateKeyToHex(actualClient?.signer.key as PrivateKey)
const actualPublicKey = secp256k1PrivateKeyToPublicJwk(hex)

expect(body).toEqual({
...actualClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ export class EngineSignerConfigService {

async getPublicJwkOrThrow(): Promise<PublicKey> {
const signerConfig = await this.getSignerConfigOrThrow()
const hex = await privateKeyToHex(signerConfig.key)

return secp256k1PrivateKeyToPublicJwk(privateKeyToHex(signerConfig.key))
return secp256k1PrivateKeyToPublicJwk(hex)
}

async getSignerConfigOrThrow(): Promise<SignerConfig> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export class ClientController {
updatedAt: now
})

const publicKey = secp256k1PrivateKeyToPublicJwk(privateKeyToHex(client.signer.key))
const hex = await privateKeyToHex(client.signer.key)

const publicKey = secp256k1PrivateKeyToPublicJwk(hex)

return {
...client,
Expand Down

0 comments on commit 1746c38

Please sign in to comment.