Skip to content

Commit

Permalink
devDeps: replace ganache-core v2 with ganache-cli v6 (#99)
Browse files Browse the repository at this point in the history
* devDeps: replache ganache-core v2 with ganache-cli v6
  * update allow-scripts configuration
  • Loading branch information
legobeat authored Nov 21, 2023
1 parent 29546fb commit 2c495fd
Show file tree
Hide file tree
Showing 3 changed files with 311 additions and 4,779 deletions.
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@metamask/auto-changelog": "^3.3.0",
"@metamask/eth-json-rpc-middleware": "^12.0.0",
"eth-block-tracker": "^8.0.0",
"ganache-core": "^2.13.2",
"ganache-cli": "^6.12.2",
"sinon": "^15.2.0",
"tape": "^5.7.0"
},
Expand All @@ -51,14 +51,8 @@
"ethereumjs-util>ethereum-cryptography>keccak": false,
"ethereumjs-util>ethereum-cryptography>secp256k1": false,
"ethjs-query>babel-runtime>core-js": false,
"ganache-core>ethereumjs-vm>core-js-pure": false,
"ganache-core>keccak": false,
"ganache-core>web3": false,
"ganache-core>websocket>bufferutil": false,
"ganache-core>websocket>utf-8-validate": false,
"ganache-core>ethereumjs-util>ethereum-cryptography>keccak": false,
"ganache-core>ethereumjs-util>ethereum-cryptography>secp256k1": false,
"ganache-core>web3-provider-engine>eth-block-tracker>json-rpc-engine>babelify>babel-core>babel-runtime>core-js": false
"ganache-cli>ethereumjs-util>ethereum-cryptography>keccak": false,
"ganache-cli>ethereumjs-util>ethereum-cryptography>secp256k1": false
}
}
}
12 changes: 6 additions & 6 deletions test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ const EthQuery = require('@metamask/eth-query')
const { JsonRpcEngine } = require('@metamask/json-rpc-engine')
const { providerAsMiddleware } = require('@metamask/eth-json-rpc-middleware')
const { providerFromEngine } = require('@metamask/eth-json-rpc-provider')
const GanacheCore = require('ganache-core')
const Ganache = require('ganache-cli')
const pify = require('pify')
const createFilterMiddleware = require('../index.js')
const createSubscriptionMiddleware = require('../subscriptionManager.js')

module.exports = {
createPayload,
createEngineFromGanacheCore,
createEngineFromGanache,
createEngineFromTestBlockMiddleware,
createTestSetup,
asyncTest,
Expand All @@ -21,7 +21,7 @@ module.exports = {

function createTestSetup() {
// raw data source
const { ganacheProvider, forceNextBlock } = createEngineFromGanacheCore()
const { ganacheProvider, forceNextBlock } = createEngineFromGanache()
// create block trackerfilterId
const blockTracker = new PollingBlockTracker({
provider: ganacheProvider,
Expand Down Expand Up @@ -99,12 +99,12 @@ function createNewSub({ id, provider }) {
}
}

function createEngineFromGanacheCore() {
const ganacheProvider = GanacheCore.provider()
function createEngineFromGanache () {
const ganacheProvider = Ganache.provider()
return { ganacheProvider, forceNextBlock }

async function forceNextBlock() {
// custom ganache-core method
// custom ganache method
await pify(ganacheProvider.sendAsync).call(ganacheProvider, createPayload({ method: 'evm_mine' }))
}
}
Expand Down
Loading

0 comments on commit 2c495fd

Please sign in to comment.