diff --git a/packages/harmony-account/src/utils.ts b/packages/harmony-account/src/utils.ts index 07ff2fb..9a8f7f8 100644 --- a/packages/harmony-account/src/utils.ts +++ b/packages/harmony-account/src/utils.ts @@ -1,7 +1,8 @@ import { HttpProvider, Messenger } from '@harmony-js/network'; -import { ChainType } from '@harmony-js/utils'; +import { ChainType, ChainID } from '@harmony-js/utils'; export const defaultMessenger = new Messenger( new HttpProvider('http://localhost:9500'), ChainType.Harmony, + ChainID.HmyLocal, ); diff --git a/packages/harmony-core/src/truffleProvider.ts b/packages/harmony-core/src/truffleProvider.ts index 8017824..6dfe49f 100644 --- a/packages/harmony-core/src/truffleProvider.ts +++ b/packages/harmony-core/src/truffleProvider.ts @@ -42,7 +42,7 @@ export class TruffleProvider extends HDNode { chainOptions: ChainOptions = { shardID: 0, chainType: ChainType.Harmony, - chainId: ChainID.Default, + chainId: ChainID.HmyLocal, }, transactionOptions: TransactionOptions = { gasLimit: '10000000', diff --git a/packages/harmony-transaction/src/transaction.ts b/packages/harmony-transaction/src/transaction.ts index 88f7538..6fe117f 100644 --- a/packages/harmony-transaction/src/transaction.ts +++ b/packages/harmony-transaction/src/transaction.ts @@ -146,7 +146,7 @@ class Transaction { getRLPSigned(raw: any[], signature: Signature): string { // temp setting to be compatible with eth - const rawLength = this.messenger.chainType === ChainType.Harmony ? 10 : 9; + const rawLength = this.messenger.chainType === ChainType.Harmony ? 11 : 9; const sig = splitSignature(signature); let v = 27 + (sig.recoveryParam || 0); if (raw.length === rawLength) { diff --git a/packages/harmony-utils/src/chain.ts b/packages/harmony-utils/src/chain.ts index 3deee0c..f912a6e 100644 --- a/packages/harmony-utils/src/chain.ts +++ b/packages/harmony-utils/src/chain.ts @@ -16,17 +16,21 @@ export const enum ChainID { EtcTestnet = 62, Geth = 1337, Ganache = 0, + HmyMainnet = 1, + HmyTestnet = 2, + HmyLocal = 2, + HmyPangaea = 3, } export const defaultConfig = { Default: { - Chain_ID: ChainID.Default, + Chain_ID: ChainID.HmyLocal, Chain_Type: ChainType.Harmony, Chain_URL: 'http://localhost:9500', Network_ID: 'Local', }, DefaultWS: { - Chain_ID: ChainID.Default, + Chain_ID: ChainID.HmyLocal, Chain_Type: ChainType.Harmony, Chain_URL: 'ws://localhost:9800', Network_ID: 'LocalWS', diff --git a/scripts/jest/jest.src.config.js b/scripts/jest/jest.src.config.js index 30d52f6..d195b1a 100644 --- a/scripts/jest/jest.src.config.js +++ b/scripts/jest/jest.src.config.js @@ -25,10 +25,10 @@ const config = { testURL: 'http://localhost', coverageThreshold: { global: { - branches: 15, - functions: 15, - lines: 15, - statements: 15, + branches: 10, + functions: 10, + lines: 10, + statements: 10, }, }, rootDir: process.cwd(), @@ -42,15 +42,11 @@ const config = { ], timers: 'fake', setupFiles: ['/scripts/jest/jest.setup.js'], - setupTestFrameworkScriptFile: - '/scripts/jest/jest.framework-setup.js', + setupTestFrameworkScriptFile: '/scripts/jest/jest.framework-setup.js', testEnvironment: process.env.NODE_ENV === 'development' ? 'node' : 'jsdom', collectCoverage: true, automock: false, - watchPlugins: [ - 'jest-watch-typeahead/filename', - 'jest-watch-typeahead/testname', - ], + watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], }; module.exports = config;