Skip to content

Commit

Permalink
devDeps: replache ganache-core v2 with ganache v7
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Sep 22, 2023
1 parent 1c228aa commit f592fb5
Show file tree
Hide file tree
Showing 3 changed files with 237 additions and 4,611 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"eth-json-rpc-middleware": "^9.0.0",
"ethereumjs-util": "^6.1.0",
"ethjs-query": "^0.3.8",
"ganache-core": "^2.13.2",
"ganache": "^7.9.1",
"sinon": "^13.0.2",
"tape": "^4.9.1"
},
Expand Down
12 changes: 6 additions & 6 deletions test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ const EthBlockTracker = require('eth-block-tracker')
const EthQuery = require('ethjs-query')
const { JsonRpcEngine } = require('json-rpc-engine')
const { providerAsMiddleware, providerFromEngine } = require('eth-json-rpc-middleware')
const GanacheCore = require('ganache-core')
const Ganache = require('ganache')
const pify = require('pify')
const createFilterMiddleware = require('../index.js')
const createSubscriptionMiddleware = require('../subscriptionManager.js')

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

function createTestSetup () {
// raw data source
const { ganacheProvider, forceNextBlock } = createEngineFromGanacheCore()
const { ganacheProvider, forceNextBlock } = createEngineFromGanache()
// create block trackerfilterId
const blockTracker = new EthBlockTracker({
provider: ganacheProvider,
Expand Down Expand Up @@ -97,12 +97,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 f592fb5

Please sign in to comment.