1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 11:28:51 +01:00

json-rpc-engine@6.1.0 (#9922)

This commit is contained in:
Erik Marks 2020-12-02 11:41:24 -08:00 committed by GitHub
parent df209612d5
commit 1da9ad77a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 33 additions and 29 deletions

View File

@ -1,5 +1,4 @@
import mergeMiddleware from 'json-rpc-engine/src/mergeMiddleware' import { createScaffoldMiddleware, mergeMiddleware } from 'json-rpc-engine'
import createScaffoldMiddleware from 'json-rpc-engine/src/createScaffoldMiddleware'
import createBlockReRefMiddleware from 'eth-json-rpc-middleware/block-ref' import createBlockReRefMiddleware from 'eth-json-rpc-middleware/block-ref'
import createRetryOnEmptyMiddleware from 'eth-json-rpc-middleware/retryOnEmpty' import createRetryOnEmptyMiddleware from 'eth-json-rpc-middleware/retryOnEmpty'
import createBlockCacheMiddleware from 'eth-json-rpc-middleware/block-cache' import createBlockCacheMiddleware from 'eth-json-rpc-middleware/block-cache'

View File

@ -1,5 +1,4 @@
import createAsyncMiddleware from 'json-rpc-engine/src/createAsyncMiddleware' import { createAsyncMiddleware, mergeMiddleware } from 'json-rpc-engine'
import mergeMiddleware from 'json-rpc-engine/src/mergeMiddleware'
import createFetchMiddleware from 'eth-json-rpc-middleware/fetch' import createFetchMiddleware from 'eth-json-rpc-middleware/fetch'
import createBlockRefRewriteMiddleware from 'eth-json-rpc-middleware/block-ref-rewrite' import createBlockRefRewriteMiddleware from 'eth-json-rpc-middleware/block-ref-rewrite'
import createBlockCacheMiddleware from 'eth-json-rpc-middleware/block-cache' import createBlockCacheMiddleware from 'eth-json-rpc-middleware/block-cache'

View File

@ -1,5 +1,4 @@
import mergeMiddleware from 'json-rpc-engine/src/mergeMiddleware' import { createScaffoldMiddleware, mergeMiddleware } from 'json-rpc-engine'
import createScaffoldMiddleware from 'json-rpc-engine/src/createScaffoldMiddleware'
import createWalletSubprovider from 'eth-json-rpc-middleware/wallet' import createWalletSubprovider from 'eth-json-rpc-middleware/wallet'
import { import {
createPendingNonceMiddleware, createPendingNonceMiddleware,

View File

@ -1,4 +1,4 @@
import createAsyncMiddleware from 'json-rpc-engine/src/createAsyncMiddleware' import { createAsyncMiddleware } from 'json-rpc-engine'
import { formatTxMetaForRpcResult } from '../util' import { formatTxMetaForRpcResult } from '../util'
export function createPendingNonceMiddleware({ getPendingNonce }) { export function createPendingNonceMiddleware({ getPendingNonce }) {

View File

@ -2,7 +2,7 @@ import assert from 'assert'
import EventEmitter from 'events' import EventEmitter from 'events'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import ComposedStore from 'obs-store/lib/composed' import ComposedStore from 'obs-store/lib/composed'
import JsonRpcEngine from 'json-rpc-engine' import { JsonRpcEngine } from 'json-rpc-engine'
import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine' import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine'
import log from 'loglevel' import log from 'loglevel'
import { import {

View File

@ -1,6 +1,5 @@
import nanoid from 'nanoid' import nanoid from 'nanoid'
import JsonRpcEngine from 'json-rpc-engine' import { JsonRpcEngine } from 'json-rpc-engine'
import asMiddleware from 'json-rpc-engine/src/asMiddleware'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import log from 'loglevel' import log from 'loglevel'
import { CapabilitiesController as RpcCap } from 'rpc-cap' import { CapabilitiesController as RpcCap } from 'rpc-cap'
@ -109,7 +108,7 @@ export class PermissionsController {
}), }),
) )
return asMiddleware(engine) return engine.asMiddleware()
} }
/** /**

View File

@ -1,4 +1,4 @@
import createAsyncMiddleware from 'json-rpc-engine/src/createAsyncMiddleware' import { createAsyncMiddleware } from 'json-rpc-engine'
import { ethErrors } from 'eth-json-rpc-errors' import { ethErrors } from 'eth-json-rpc-errors'
/** /**

View File

@ -7,7 +7,7 @@ const Box = process.env.IN_TEST
/* eslint-enable import/order */ /* eslint-enable import/order */
import log from 'loglevel' import log from 'loglevel'
import JsonRpcEngine from 'json-rpc-engine' import { JsonRpcEngine } from 'json-rpc-engine'
import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine' import providerFromEngine from 'eth-json-rpc-middleware/providerFromEngine'
import Migrator from '../lib/migrator' import Migrator from '../lib/migrator'
import migrations from '../migrations' import migrations from '../migrations'

View File

@ -4,7 +4,7 @@ import pump from 'pump'
import Dnode from 'dnode' import Dnode from 'dnode'
import ObservableStore from 'obs-store' import ObservableStore from 'obs-store'
import asStream from 'obs-store/lib/asStream' import asStream from 'obs-store/lib/asStream'
import RpcEngine from 'json-rpc-engine' import { JsonRpcEngine } from 'json-rpc-engine'
import { debounce } from 'lodash' import { debounce } from 'lodash'
import createEngineStream from 'json-rpc-middleware-stream/engineStream' import createEngineStream from 'json-rpc-middleware-stream/engineStream'
import createFilterMiddleware from 'eth-json-rpc-filters' import createFilterMiddleware from 'eth-json-rpc-filters'
@ -1935,7 +1935,7 @@ export default class MetamaskController extends EventEmitter {
isInternal = false, isInternal = false,
}) { }) {
// setup json rpc engine stack // setup json rpc engine stack
const engine = new RpcEngine() const engine = new JsonRpcEngine()
const { provider, blockTracker } = this const { provider, blockTracker } = this
// create filter polyfill middleware // create filter polyfill middleware

View File

@ -131,7 +131,7 @@
"fast-json-patch": "^2.0.4", "fast-json-patch": "^2.0.4",
"fuse.js": "^3.2.0", "fuse.js": "^3.2.0",
"human-standard-token-abi": "^2.0.0", "human-standard-token-abi": "^2.0.0",
"json-rpc-engine": "^5.3.0", "json-rpc-engine": "^6.1.0",
"json-rpc-middleware-stream": "^2.1.1", "json-rpc-middleware-stream": "^2.1.1",
"jsonschema": "^1.2.4", "jsonschema": "^1.2.4",
"localforage": "^1.9.0", "localforage": "^1.9.0",

View File

@ -1,4 +1,4 @@
import JsonRpcEngine from 'json-rpc-engine' import { JsonRpcEngine } from 'json-rpc-engine'
import scaffoldMiddleware from 'eth-json-rpc-middleware/scaffold' import scaffoldMiddleware from 'eth-json-rpc-middleware/scaffold'
import providerAsMiddleware from 'eth-json-rpc-middleware/providerAsMiddleware' import providerAsMiddleware from 'eth-json-rpc-middleware/providerAsMiddleware'
import GanacheCore from 'ganache-core' import GanacheCore from 'ganache-core'

View File

@ -1290,12 +1290,6 @@ describe('permissions controller', function () {
}, 'should not throw') }, 'should not throw')
assert.equal(typeof middleware, 'function', 'should return function') assert.equal(typeof middleware, 'function', 'should return function')
assert.equal(
middleware.name,
'engineAsMiddleware',
'function name should be "engineAsMiddleware"',
)
}) })
it('should create a middleware with extensionId', function () { it('should create a middleware with extensionId', function () {
@ -1311,12 +1305,6 @@ describe('permissions controller', function () {
assert.equal(typeof middleware, 'function', 'should return function') assert.equal(typeof middleware, 'function', 'should return function')
assert.equal(
middleware.name,
'engineAsMiddleware',
'function name should be "engineAsMiddleware"',
)
const metadataStore = permController.store.getState()[METADATA_STORE_KEY] const metadataStore = permController.store.getState()[METADATA_STORE_KEY]
assert.deepEqual( assert.deepEqual(

View File

@ -2146,6 +2146,11 @@
gl-mat4 "1.1.4" gl-mat4 "1.1.4"
gl-vec3 "1.0.3" gl-vec3 "1.0.3"
"@metamask/safe-event-emitter@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-2.0.0.tgz#af577b477c683fad17c619a78208cede06f9605c"
integrity sha512-/kSXhY692qiV1MXu6EeOZvg5nECLclxNXcKCxJ3cXQgYuRymRHpdx/t7JXfsK+JLjwA1e1c1/SBrlQYpusC29Q==
"@metamask/test-dapp@^4.0.1": "@metamask/test-dapp@^4.0.1":
version "4.0.1" version "4.0.1"
resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-4.0.1.tgz#fbc66069687f0502ebb4c6ac0fa7c9862ea6563c" resolved "https://registry.yarnpkg.com/@metamask/test-dapp/-/test-dapp-4.0.1.tgz#fbc66069687f0502ebb4c6ac0fa7c9862ea6563c"
@ -10160,6 +10165,13 @@ eth-rpc-errors@^4.0.0:
dependencies: dependencies:
fast-safe-stringify "^2.0.6" fast-safe-stringify "^2.0.6"
eth-rpc-errors@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/eth-rpc-errors/-/eth-rpc-errors-4.0.2.tgz#11bc164e25237a679061ac05b7da7537b673d3b7"
integrity sha512-n+Re6Gu8XGyfFy1it0AwbD1x0MUzspQs0D5UiPs1fFPCr6WAwZM+vbIhXheBFrpgosqN9bs5PqlB4Q61U/QytQ==
dependencies:
fast-safe-stringify "^2.0.6"
eth-sig-util@^1.4.0, eth-sig-util@^1.4.2: eth-sig-util@^1.4.0, eth-sig-util@^1.4.2:
version "1.4.2" version "1.4.2"
resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210"
@ -15472,6 +15484,14 @@ json-rpc-engine@^5.2.0, json-rpc-engine@^5.3.0:
eth-rpc-errors "^3.0.0" eth-rpc-errors "^3.0.0"
safe-event-emitter "^1.0.1" safe-event-emitter "^1.0.1"
json-rpc-engine@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-6.1.0.tgz#bf5ff7d029e1c1bf20cb6c0e9f348dcd8be5a393"
integrity sha512-NEdLrtrq1jUZyfjkr9OCz9EzCNhnRyWtt1PAnvnhwy6e8XETS0Dtc+ZNCO2gvuAoKsIn2+vCSowXTYE4CkgnAQ==
dependencies:
"@metamask/safe-event-emitter" "^2.0.0"
eth-rpc-errors "^4.0.2"
json-rpc-error@^2.0.0: json-rpc-error@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02"