Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
devDeps: ganache-core@2.13.2->ganache@^7.9.2 (#473)
Browse files Browse the repository at this point in the history
* devDeps: ganache-core@2.13.2->ganache@^7.9.2

* update testcases
  • Loading branch information
legobeat committed Apr 17, 2024
1 parent 5400086 commit 0e45c90
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 4,092 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
"util"
],
"license": "MIT",
"resolutions": {
"ganache-core/**/elliptic": "^6.5.2"
},
"dependencies": {
"@cypress/request": "^3.0.1",
"@ethereumjs/statemanager": "^1.1.0",
Expand Down Expand Up @@ -59,7 +56,7 @@
"browserify": "^17.0.0",
"eslint": "^6.2.0",
"ethereum-cryptography": "^2.1.2",
"ganache-core": "^2.13.2",
"ganache": "^7.9.2",
"tape": "^5.7.1"
},
"browser": {
Expand Down
2 changes: 1 addition & 1 deletion test/cache.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const test = require('tape')
const series = require('async/series')
const createGanacheProvider = require('ganache-core').provider
const createGanacheProvider = require('ganache').provider
const ProviderEngine = require('../index.js')
const FixtureProvider = require('../subproviders/fixture.js')
const CacheProvider = require('../subproviders/cache.js')
Expand Down
18 changes: 13 additions & 5 deletions test/inflight-cache.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const test = require('tape')
const asyncParallel = require('async/parallel')
const asyncSeries = require('async/series')
const createGanacheProvider = require('ganache-core').provider
const createGanacheProvider = require('ganache').provider
const ProviderEngine = require('../index.js')
const FixtureProvider = require('../subproviders/fixture.js')
const InflightCacheProvider = require('../subproviders/inflight-cache.js')
Expand All @@ -14,10 +14,16 @@ inflightTest('getBalance for latest', {
params: ['0xabcd', 'latest'],
}, true)

inflightTest('getBlock by number (0)', {
method: 'eth_getBlockByNumber',
params: ['0x0', false],
}, true)

// latest is always forwarded for eth_getBlockByNumber
inflightTest('getBlock for latest', {
method: 'eth_getBlockByNumber',
params: ['latest', false],
}, true)
}, false)

inflightTest('getBlock for latest (1) then 0', [{
method: 'eth_getBlockByNumber',
Expand Down Expand Up @@ -51,7 +57,9 @@ function inflightTest(label, payloads, shouldHitCacheOnSecondRequest){
eth_getBalance: '0xdeadbeef',
}))
// handle dummy block
const ganacheProvider = createGanacheProvider()
const ganacheProvider = createGanacheProvider({
vmErrorsOnRpcResponse: true,
})
var blockProvider = injectMetrics(new ProviderSubprovider(ganacheProvider))

var engine = new ProviderEngine()
Expand Down Expand Up @@ -102,7 +110,7 @@ function inflightTest(label, payloads, shouldHitCacheOnSecondRequest){

t.equal(handlingProvider.getWitnessed(method).length, 1, 'handlingProvider did see "'+method+'"')
t.equal(handlingProvider.getHandled(method).length, 1, 'handlingProvider did handle "'+method+'"')

} else {

t.equal(cacheProvider.getWitnessed(method).length, 2, 'cacheProvider did see "'+method+'"')
Expand Down Expand Up @@ -136,4 +144,4 @@ function inflightTest(label, payloads, shouldHitCacheOnSecondRequest){

}

function noop(){}
function noop(){}
2 changes: 1 addition & 1 deletion test/util/ganache.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { provider } = require('ganache-core')
const { provider } = require('ganache')
const ProviderSubprovider = require('../../subproviders/provider')


Expand Down
Loading

0 comments on commit 0e45c90

Please sign in to comment.