Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/alpha' into update-auth-ap-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ErnoW committed Jul 25, 2022
2 parents b7e16b0 + 61b8759 commit 9a0e9eb
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 20 deletions.
9 changes: 2 additions & 7 deletions packages/evmUtils/src/config/EvmUtilsConfigSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import { EvmUtilsConfig } from './EvmUtilsConfig';

export class EvmUtilsConfigSetup {
public static register(config: Config) {
if (!config.hasKey(EvmUtilsConfig.formatEvmAddress)) {
config.registerKey(EvmUtilsConfig.formatEvmAddress);
}

if (!config.hasKey(EvmUtilsConfig.formatEvmChainId)) {
config.registerKey(EvmUtilsConfig.formatEvmChainId);
}
config.registerKey(EvmUtilsConfig.formatEvmAddress);
config.registerKey(EvmUtilsConfig.formatEvmChainId);
}
}
4 changes: 2 additions & 2 deletions packages/evmUtils/src/dataTypes/EvmAddress/EvmAddress.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MoralisCore } from '@moralisweb3/core';
import { EvmAddress } from './EvmAddress';
import { setupEvm } from '../../test/setup';
import { setupEvmUtils } from '../../test/setup';

const TEST_ADDRESS_CHECKSUM = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045';
const TEST_ADDRESS_CHECKSUM2 = '0x766fd99F7D249E275b4CF9baE422D50cC3223869';
Expand All @@ -11,7 +11,7 @@ describe('EvmAddress', () => {
let core: MoralisCore;

beforeAll(() => {
core = setupEvm();
core = setupEvmUtils();
});

beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/evmUtils/src/dataTypes/EvmChain/EvmChain.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { MoralisCore } from '@moralisweb3/core';
import { setupEvm } from '../../test/setup';
import { setupEvmUtils } from '../../test/setup';
import { EvmChain } from './EvmChain';

describe('EvmChain', () => {
let core: MoralisCore;

beforeAll(() => {
core = setupEvm();
core = setupEvmUtils();
});

beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/evmUtils/src/dataTypes/EvmNative/EvmNative.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { setupEvm } from '../../test/setup';
import { setupEvmUtils } from '../../test/setup';
import { EvmNative, EvmNativeUnit } from './EvmNative';

describe('EvmNative', () => {
beforeAll(() => {
setupEvm();
setupEvmUtils();
});

function testUnit(unit: EvmNativeUnit, wei: string, gwei: string, ether: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EvmTransaction } from './EvmTransaction';
import { EvmTransactionInput } from './EvmTransactionTypes';
import { EvmTransactionResponse } from '../EvmTransactionResponse';
import { setupEvm } from '../../test/setup';
import { setupEvmUtils } from '../../test/setup';

const DATA =
'0x00000000000000000000000000000000000000000000213ba4fc56e2e24648b200000000000000000000000000000000000000000000002e9e527eb8ff21faf7';
Expand All @@ -25,7 +25,7 @@ const inputWithAllData: EvmTransactionInput = {

describe('EvmTransaction', () => {
beforeAll(() => {
setupEvm();
setupEvmUtils();
});

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setupEvm } from '../../test/setup';
import { setupEvmUtils } from '../../test/setup';
import { EvmTransactionLog } from './EvmTransactionLog';

// Set variables
Expand Down Expand Up @@ -50,7 +50,7 @@ const inputWithInvalidData = {

describe('EvmTransactionLog', () => {
beforeAll(() => {
setupEvm();
setupEvmUtils();
});

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BigNumber } from '@ethersproject/bignumber';
import { setupEvm } from '../../test/setup';
import { setupEvmUtils } from '../../test/setup';
import { EvmTransactionLogInput } from '../EvmTransactionLog';
import { EvmTransactionResponse, EvmTransactionResponseInput } from '../EvmTransactionResponse';
import { EvmTransactionReceipt } from './EvmTransactionReceipt';
Expand Down Expand Up @@ -87,7 +87,7 @@ const expectedTotalGas = BigNumber.from(inputWithAllData.cumulativeGasUsed).mul(

describe('EvmTransactionReceipt', () => {
beforeAll(() => {
setupEvm();
setupEvmUtils();
});

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/evmUtils/src/test/setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MoralisCoreProvider } from '@moralisweb3/core';
import { MoralisEvmUtils } from '../MoralisEvmUtils';

export const setupEvm = () => {
export const setupEvmUtils = () => {
const core = MoralisCoreProvider.getDefault();
const evmUtils = MoralisEvmUtils.create();

Expand Down

0 comments on commit 9a0e9eb

Please sign in to comment.