diff options
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r-- | packages/web3-wrapper/src/web3_wrapper.ts | 26 | ||||
-rw-r--r-- | packages/web3-wrapper/test/web3_wrapper_test.ts | 19 |
2 files changed, 0 insertions, 45 deletions
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts index ed2d0a119..a19253449 100644 --- a/packages/web3-wrapper/src/web3_wrapper.ts +++ b/packages/web3-wrapper/src/web3_wrapper.ts @@ -407,32 +407,6 @@ export class Web3Wrapper { return receipt; } /** - * Start the CPU mining process with the given number of threads and - * generate a new DAG if need be. - * @param threads The number of threads to mine on. - */ - public async minerStartAsync(threads: number = 1): Promise<void> { - await this._sendRawPayloadAsync<boolean>({ - method: 'miner_start', - params: [threads], - }); - } - /** - * Stop the CPU mining process. - * @param threads The number of threads to mine on. - */ - public async minerStopAsync(): Promise<void> { - await this._sendRawPayloadAsync<boolean>({ method: 'miner_stop', params: [] }); - } - /** - * Returns true if client is actively mining new blocks. - * @returns A boolean indicating whether the node is currently mining. - */ - public async isMiningAsync(): Promise<boolean> { - const isMining = await promisify<boolean>(this._web3.eth.getMining)(); - return isMining; - } - /** * Sets the current head of the local chain by block number. Note, this is a * destructive action and may severely damage your chain. Use with extreme * caution. diff --git a/packages/web3-wrapper/test/web3_wrapper_test.ts b/packages/web3-wrapper/test/web3_wrapper_test.ts index 1843bcf2c..326efe654 100644 --- a/packages/web3-wrapper/test/web3_wrapper_test.ts +++ b/packages/web3-wrapper/test/web3_wrapper_test.ts @@ -2,7 +2,6 @@ import * as chai from 'chai'; import * as Ganache from 'ganache-core'; import 'make-promises-safe'; import 'mocha'; -import * as Web3 from 'web3'; import { Web3Wrapper } from '../src'; @@ -38,22 +37,4 @@ describe('Web3Wrapper tests', () => { expect(networkId).to.be.equal(NETWORK_ID); }); }); - describe('mining functions', () => { - it('starts and stops the miner', async () => { - // Note: depending on our provider, the miner may or may not already - // be mining. To account for both conditions, we have what might - // look like too many stops and starts here, but it is necessary. - await web3Wrapper.minerStopAsync(); - let isMining = await web3Wrapper.isMiningAsync(); - expect(isMining).to.be.false(); - await web3Wrapper.minerStartAsync(1); - isMining = await web3Wrapper.isMiningAsync(); - expect(isMining).to.be.true(); - isMining = await web3Wrapper.isMiningAsync(); - expect(isMining).to.be.true(); - await web3Wrapper.minerStopAsync(); - isMining = await web3Wrapper.isMiningAsync(); - expect(isMining).to.be.false(); - }); - }); }); |