Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirvolek committed Oct 27, 2023
1 parent 011fc5b commit e2d4ffb
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 81 deletions.
12 changes: 8 additions & 4 deletions src/routes/assets/asset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ async function route(fastify: FastifyInstance) {

// retrieve off-chain metadata
const metadata = await fetchAssetMetadata(request.params.asset);
const fingerprint = AssetFingerprint.fromParts(
Uint8Array.from(Buffer.from(rows[0].policy_id, 'hex')),
Uint8Array.from(Buffer.from(rows[0].asset_name ?? '', 'hex')),
).fingerprint();
// @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();

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

0 comments on commit e2d4ffb

Please sign in to comment.