Skip to content

Commit

Permalink
test(blockfrost): add e2e test for big number metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mkazlauskas committed Nov 22, 2021
1 parent 565182e commit 090947c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/blockfrost/src/blockfrostWalletProvider.ts
Expand Up @@ -256,7 +256,6 @@ export const blockfrostWalletProvider = (options: Options, logger = dummyLogger)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const { json_metadata, label } = metadatum as any;
if (!json_metadata || !label) return map;
// not sure how Blockfrost represents integer metadatum. Might need to convert to bigint here.
map[label] = json_metadata;
return map;
}, {} as Cardano.MetadatumMap);
Expand Down
14 changes: 14 additions & 0 deletions packages/blockfrost/test/e2e/queryTransactions.test.ts
@@ -0,0 +1,14 @@
import { walletProvider } from './config';

describe('blockfrostWalletProvider', () => {
describe('queryTransactionsByHashes', () => {
it('parses metadata correctly', async () => {
const [tx] = await walletProvider.queryTransactionsByHashes([
'84801fb64a9c5078c406ead24017ba0b069ef6ac6446fef8bdb8f97bade3cfa5'
]);
expect(tx.auxiliaryData!.body.blob!['9223372036854775707']).toEqual(
'9223372036854775707922337203685477570792233720368547757079223372'
);
});
});
});
7 changes: 0 additions & 7 deletions packages/blockfrost/test/e2e/tx-metadata.test.ts

This file was deleted.

0 comments on commit 090947c

Please sign in to comment.