diff --git a/waffle-cli/test/projects/getGanacheOptions/config.json b/waffle-cli/test/projects/getGanacheOptions/config.json deleted file mode 100644 index 7dfc903ec..000000000 --- a/waffle-cli/test/projects/getGanacheOptions/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ganacheOptions": { - "gasLimit": 50, - "gasPrice": 1 - } -} \ No newline at end of file diff --git a/waffle-cli/test/projects/getGanacheOptions/getGanacheOptions.ts b/waffle-cli/test/projects/getGanacheOptions/getGanacheOptions.ts deleted file mode 100644 index 46efcbf1e..000000000 --- a/waffle-cli/test/projects/getGanacheOptions/getGanacheOptions.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {expect} from 'chai'; -import {getGanacheOptions} from '../../../src'; -import path from 'path'; - -describe('INTEGRATION: getGanacheOptions', () => { - it('ganacheOptions as object', () => { - const ganacheOptions = {gasLimit: 50, gasPrice: '1'}; - expect(getGanacheOptions(ganacheOptions)).to.equal(ganacheOptions); - }); - - it('ganacheOptions as invalid path to config', () => { - const pathToConfig = ('./config.json'); - expect(() => getGanacheOptions(pathToConfig)).to.throw(Error, 'Cannot find module \'./config.json\''); - }); - - it('ganacheOptions as valid path to config', () => { - const pathToConfig = path.join(__dirname, 'config.json'); - const expectedGanacheOptions = require('./config.json').ganacheOptions; - expect(getGanacheOptions(pathToConfig)).to.equal(expectedGanacheOptions); - }); -}); diff --git a/waffle-provider/src/index.ts b/waffle-provider/src/index.ts index e1a204ba4..42553a2bd 100644 --- a/waffle-provider/src/index.ts +++ b/waffle-provider/src/index.ts @@ -1,4 +1,3 @@ -export * from './legacyApi'; export * from './MockProvider'; export * from './fixtures'; export * from './defaultAccounts'; diff --git a/waffle-provider/src/legacyApi.ts b/waffle-provider/src/legacyApi.ts deleted file mode 100644 index d99e2af05..000000000 --- a/waffle-provider/src/legacyApi.ts +++ /dev/null @@ -1,41 +0,0 @@ -import Ganache from 'ganache-core'; -import {providers, Wallet} from 'ethers'; -import {MockProvider} from './MockProvider'; -import {deprecate} from './deprecate'; - -/** - * @deprecated Use `new MockProvider(options?)` - */ -export function createMockProvider(ganacheOptionsOrPathToConfig: string | Ganache.IProviderOptions = {}) { - deprecate('createMockProvider', 'Use "new MockProvider(options?)" instead.'); - return new MockProvider(getGanacheOptions(ganacheOptionsOrPathToConfig)); -} - -/** - * @deprecated - */ -export function getGanacheOptions(ganacheOptionsOrPathToConfig: string | Ganache.IProviderOptions) { - deprecate('getGanacheOptions'); - if (typeof ganacheOptionsOrPathToConfig !== 'string') { - return ganacheOptionsOrPathToConfig; - } - // eslint-disable-next-line @typescript-eslint/no-var-requires - return require(ganacheOptionsOrPathToConfig).ganacheOptions; -} - -/** - * Enables third party providers to use the legacy `getWallets` api. - * @deprecated - */ -export interface MockProviderLike extends providers.Provider { - getWallets(): Wallet[]; - createEmptyWallet(): Wallet; -} - -/** - * @deprecated Use `mockProvider.getWallets()` - */ -export function getWallets(provider: MockProviderLike) { - deprecate('getWallets', 'Use "mockProvider.getWallets()" instead.'); - return provider.getWallets(); -}