diff --git a/README.md b/README.md index 9456985..bf98f7a 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ const identity = EthCrypto.createIdentity(); const rawTx = { from: identity.address, to: '0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0', - value: 1000000000000000000, + value: new BN('1000000000000000000'), gasPrice: 5000000000, nonce: 0, gasLimit: 21000 diff --git a/package.json b/package.json index 108d614..11cb9f0 100644 --- a/package.json +++ b/package.json @@ -95,10 +95,10 @@ }, "dependencies": { "@babel/runtime": "7.16.7", - "@ethereumjs/tx": "3.3.1", + "@ethereumjs/tx": "^3.4.0", "@types/bn.js": "5.1.0", "eccrypto": "1.1.6", - "ethereumjs-util": "7.1.1", + "ethereumjs-util": "^7.1.3", "ethers": "5.5.4", "secp256k1": "4.0.3" } diff --git a/test/integration.test.js b/test/integration.test.js index e86b8f1..56414d1 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -4,6 +4,7 @@ const path = require('path'); const AsyncTestUtil = require('async-test-util'); const SolidityCli = require('solidity-cli'); const assert = require('assert'); +const BN = require('bn.js'); const EthCrypto = require('../dist/lib/index'); // const web3 = EthCrypto.util.web3; @@ -109,7 +110,7 @@ describe('integration.test.js', () => { const rawTx = { from: identity.address, to: '0x63dcee1fd1d814858acd4172bb20e1aa0c947c0a', - value: parseInt(web3.utils.toWei('1', 'ether')), + value: new BN(web3.utils.toWei('1', 'ether')), nonce: 0, gasLimit: 60000, gasPrice: parseInt(gasPrice) diff --git a/test/tutorials/signed-data.test.js b/test/tutorials/signed-data.test.js index b7abf7b..2b1c759 100644 --- a/test/tutorials/signed-data.test.js +++ b/test/tutorials/signed-data.test.js @@ -6,6 +6,7 @@ const ganache = require('ganache-cli'); const Web3 = require('web3'); const assert = require('assert'); +const BN = require('bn.js'); const EthCrypto = require('../../dist/lib/index'); describe('signed-data.md', () => { @@ -86,7 +87,7 @@ describe('signed-data.md', () => { from: creatorIdentity.address, to: contractAddress, nonce: 1, - value: parseInt(web3.utils.toWei('3', 'ether')), + value: new BN(web3.utils.toWei('3', 'ether')), gasLimit: 600000, gasPrice: 20000000000 }; diff --git a/test/unit.test.js b/test/unit.test.js index 5c8952d..902e848 100644 --- a/test/unit.test.js +++ b/test/unit.test.js @@ -1,5 +1,6 @@ const AsyncTestUtil = require('async-test-util'); const assert = require('assert'); +const BN = require('bn.js'); const EthCrypto = require('../dist/lib/index'); const TEST_DATA = { @@ -331,7 +332,7 @@ describe('unit.test.js', () => { const rawTx = { from: ident.address, to: '0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0', - value: 1000000000000000000, + value: new BN('1000000000000000000'), gasPrice: 5000000000, gasLimit: 21000 }; @@ -348,7 +349,7 @@ describe('unit.test.js', () => { const rawTx = { from: ident.address, to: '0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0', - value: 1000000000000000000, + value: new BN('1000000000000000000'), gasPrice: 5000000000, gasLimit: 21000 }; diff --git a/typings/index.d.ts b/typings/index.d.ts index dc1083b..2d1aff8 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1,4 +1,4 @@ -import BigNumber = require('bn.js'); +import BigNumber from 'bn.js'; import { TxOptions } from '@ethereumjs/tx'; type createIdentityType = (entropy?: Buffer) => {