Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrokonrad committed Jul 26, 2023
1 parent 840db1f commit 126f61b
Show file tree
Hide file tree
Showing 41 changed files with 1,716 additions and 14,364 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ npm test

### Additional

[Wasm packages](./src/wasm/) commit hash: [0d513ff8b81a7bfac04fc06258731740c1b7a4d9](https://github.com/spacebudz/lucid)
[Wasm packages](./src/wasm/) commit hash: [9986d0532334c465bbe4aa00234968edb43575d6](https://github.com/spacebudz/lucid)

### Website

Expand Down
Binary file modified build.zip
Binary file not shown.
9 changes: 4 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
module.exports = {
moduleNameMapper: {
// mock out the browser version of WASM bindings with the nodejs bindings
'^(.*)@emurgo/cardano-multiplatform-lib-browser(.*)$':
'$1@emurgo/cardano-multiplatform-lib-nodejs$2',
'^(.*)@emurgo/cardano-message-signing-browser(.*)$':
'$1@emurgo/cardano-message-signing-nodejs$2',
'^(.*)../wasm/cardano_multiplatform_lib/cardano_multiplatform_lib.generated(.*)$':
'$1../wasm/cardano_multiplatform_lib/nodejs/cardano_multiplatform_lib.generated$2',
'^(.*)../wasm/cardano_message_signing/cardano_message_signing.generated(.*)$':
'$1../wasm/cardano_message_signing/nodejs/cardano_message_signing.generated$2',
// blockfrost keys
secrets: '../../secrets.testing.js',
},
modulePathIgnorePatterns: ['<rootDir>/temporary_modules'],
transform: {
'\\.[jt]sx?$': 'babel-jest',
},
Expand Down
11 changes: 3 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/api/extension/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ export const signDataCIP30 = async (
* @param {string} tx - cbor hex string
* @param {Array<string>} keyHashes
* @param {string} password
* @returns {string} witness set as hex string
* @returns {Promise<string>} witness set as hex string
*/
export const signTx = async (
tx,
Expand Down
54 changes: 0 additions & 54 deletions src/api/extension/ipfs.js

This file was deleted.

9 changes: 6 additions & 3 deletions src/api/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import * as wasm2 from '../wasm/cardano_message_signing/cardano_message_signing.
class Loader {
async load() {
if (this._wasm && this._wasm2) return;
await wasm.instantiate();
try {
await wasm.instantiate();
await wasm2.instantiate();
} catch (_e) {
// Only happens when running with Jest (Node.js)
}
/**
* @private
*/
this._wasm = wasm;

await wasm2.instantiate();
/**
* @private
*/
Expand Down
2 changes: 1 addition & 1 deletion src/api/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
CardanoPoolRelayType,
CardanoTxSigningMode,
} from 'trezor-connect';
import crc8 from 'crc/calculators/crc8';
import { crc8 } from 'crc';

export async function delay(delayInMs) {
return new Promise((resolve) => {
Expand Down
2 changes: 1 addition & 1 deletion src/config/provider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NODE, NETWORK_ID } from './config';
import { NODE } from './config';
import secrets from 'secrets';
import { version } from '../../package.json';

Expand Down
Loading

0 comments on commit 126f61b

Please sign in to comment.