Skip to content

Commit ebb80e8

Browse files
authored
Merge pull request #5992 from BitGo/WIN-5231
fix(sdk-coin-icp): update cbor-x import to use index-no-eval
2 parents b0d8d45 + 6c3f6af commit ebb80e8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/sdk-coin-icp/src/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
CurveType,
2222
} from './iface';
2323
import { KeyPair as IcpKeyPair } from './keyPair';
24-
import { decode, encode } from 'cbor-x'; // The "cbor-x" library is used here because it supports modern features like BigInt. do not replace it with "cbor as "cbor" is not compatible with Rust's serde_cbor when handling big numbers.
24+
const { encode, decode } = require('cbor-x/index-no-eval'); // The "cbor-x" library is used here because it supports modern features like BigInt. do not replace it with "cbor as "cbor" is not compatible with Rust's serde_cbor when handling big numbers.
2525
import js_sha256 from 'js-sha256';
2626
import BigNumber from 'bignumber.js';
2727
import { secp256k1 } from '@noble/curves/secp256k1';

modules/sdk-coin-icp/test/unit/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import should from 'should';
22
import utils from '../../src/lib/utils';
33
import { accounts, IcpTransactionData, blockHashes, TransactionHashes } from '../resources/icp';
4-
import { encode } from 'cbor-x';
4+
const { encode } = require('cbor-x/index-no-eval');
55
import { randomBytes } from 'crypto';
66

77
describe('utils', () => {

0 commit comments

Comments
 (0)