Skip to content

Commit

Permalink
fix: use TypedArrayEncoder
Browse files Browse the repository at this point in the history
Signed-off-by: Ariel Gentile <[email protected]>
  • Loading branch information
genaris committed Feb 14, 2023
1 parent 2eb9c4f commit 8e37bac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/askar/src/wallet/AskarWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
TypedArrayEncoder,
FileSystem,
WalletNotFoundError,
utils,
} from '@aries-framework/core'
import {
StoreKeyMethod,
Expand Down Expand Up @@ -364,7 +363,7 @@ export class AskarWallet implements Wallet {
const key = seed ? AskarKey.fromSeed({ seed: Buffer.from(seed), algorithm }) : AskarKey.generate(algorithm)

// Store key
await this.session.insertKey({ key, name: utils.encodeToBase58(key.publicBytes) })
await this.session.insertKey({ key, name: TypedArrayEncoder.toBase58(key.publicBytes) })
return Key.fromPublicKey(key.publicBytes, keyType)
} else {
// Check if there is a signing key provider for the specified key type.
Expand Down Expand Up @@ -633,7 +632,7 @@ export class AskarWallet implements Wallet {
)
const sender_x = AskarKey.fromPublicBytes({
algorithm: KeyAlgs.Ed25519,
publicKey: utils.decodeFromBase58(senderKey),
publicKey: TypedArrayEncoder.fromBase58(senderKey),
}).convertkey({ algorithm: KeyAlgs.X25519 })

payloadKey = CryptoBox.open({
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,12 @@ export { encodeAttachment } from './utils/attachment'
export { Hasher } from './utils/Hasher'
export { MessageValidator } from './utils/MessageValidator'
export { LinkedAttachment, LinkedAttachmentOptions } from './utils/LinkedAttachment'
import { encodeToBase58, decodeFromBase58 } from './utils/base58'
import { parseInvitationUrl } from './utils/parseInvitation'
import { uuid } from './utils/uuid'

const utils = {
uuid,
parseInvitationUrl,
encodeToBase58,
decodeFromBase58,
}

export { utils }

0 comments on commit 8e37bac

Please sign in to comment.