[fix] examples dependencies

@types
neeboo 6 years ago
parent 13559162ea
commit a66bfe3503
  1. 15
      examples/testContract.js
  2. 6
      examples/testGanache.js
  3. 2
      examples/testNode.js
  4. 2
      examples/testWallet.js
  5. 3
      packages/harmony-core/__test__/blockchain.test.ts
  6. 1
      packages/harmony-network/src/providers/emitter.ts

@ -3,13 +3,20 @@
// Then we can use `Contract.methods.call()` to call a method
// Import Main Class
const { Harmony } = require('@harmony-js/core');
const { Harmony } = require('../packages/harmony-core/dist');
// You can import BN from `@harmony-js/crypto` or use `Harmony.utils.BN`instead
const { BN } = require('@harmony-js/crypto');
const { BN } = require('../packages/harmony-crypto/dist');
// import more utils
const { isArray, ChainType, ChainID } = require('@harmony-js/utils');
const {
isArray,
ChainType,
ChainID,
} = require('../packages/harmony-utils/dist');
// contract specific utils
const { toUtf8String, toUtf8Bytes } = require('@harmony-js/contract');
const {
toUtf8String,
toUtf8Bytes,
} = require('../packages/harmony-contract/dist');
// we import `fs` and `solc` to complile the contract. you can do it in another js file
// but we show it here anyway.

@ -1,6 +1,6 @@
const { Harmony } = require('@harmony-js/core');
const { ChainID, ChainType } = require('@harmony-js/utils');
const { SubscribeBlockTracker } = require('@harmony-js/network');
const { Harmony } = require('../packages/harmony-core/dist');
const { ChainID, ChainType } = require('../packages/harmony-utils/dist');
const { SubscribeBlockTracker } = require('../packages/harmony-network/dist');
const ganache = require('ganache-cli');

@ -1,4 +1,4 @@
const { Harmony } = require('@harmony-js/core');
const { Harmony } = require('../packages/harmony-core/dist');
// const ganache = require('ganache-cli');
var port = 9015;

@ -1,4 +1,4 @@
const { Harmony } = require('@harmony-js/core');
const { Harmony } = require('../packages/harmony-core/dist');
const harmony = new Harmony('https://localhost:9015');

@ -21,10 +21,9 @@ describe('test Blockchain', () => {
fetch.resetMocks();
});
it('should test get block methods', async () => {
const chainType = 0;
// test constructors
const bc = new Blockchain(messenger);
const bc2 = new Blockchain(messenger, chainType);
const bc2 = new Blockchain(messenger);
// test setMessenger
bc2.setMessenger(messenger);

@ -19,6 +19,7 @@ class Emitter {
this.reject = reject;
});
this.then = this.promise.then.bind(this.promise);
this.emit('newListener', 'newListener');
}
resetHandlers() {

Loading…
Cancel
Save