Skip to content

Commit

Permalink
fix: cip14 lib
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirvolek committed Sep 19, 2023
1 parent 84f182f commit d5ea04b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/routes/assets/asset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,10 @@ async function route(fastify: FastifyInstance) {

// retrieve off-chain metadata
const metadata = await fetchAssetMetadata(request.params.asset);
// @ts-expect-error due to using ESM with vitest and some weirdness with cip14 lib we need to call .default
// otherwise unit test fails on ""...is not a function".
const fingerprint = AssetFingerprint.default
.fromParts(
Uint8Array.from(Buffer.from(rows[0].policy_id, 'hex')),
Uint8Array.from(Buffer.from(rows[0].asset_name ?? '', 'hex')),
)
.fingerprint();
const fingerprint = AssetFingerprint.fromParts(
Uint8Array.from(Buffer.from(rows[0].policy_id, 'hex')),
Uint8Array.from(Buffer.from(rows[0].asset_name ?? '', 'hex')),
).fingerprint();

return reply.send({
...rows[0],
Expand Down

0 comments on commit d5ea04b

Please sign in to comment.