mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
@metamask/obs-store@5.0.0 (#10092)
This commit is contained in:
parent
ce70c86774
commit
e05be40d92
@ -16,8 +16,7 @@ import pump from 'pump'
|
|||||||
import debounce from 'debounce-stream'
|
import debounce from 'debounce-stream'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import extension from 'extensionizer'
|
import extension from 'extensionizer'
|
||||||
import storeTransform from 'obs-store/lib/transform'
|
import { storeAsStream, storeTransformStream } from '@metamask/obs-store'
|
||||||
import asStream from 'obs-store/lib/asStream'
|
|
||||||
import PortStream from 'extension-port-stream'
|
import PortStream from 'extension-port-stream'
|
||||||
import { captureException } from '@sentry/browser'
|
import { captureException } from '@sentry/browser'
|
||||||
import migrations from './migrations'
|
import migrations from './migrations'
|
||||||
@ -250,9 +249,9 @@ function setupController(initState, initLangCode) {
|
|||||||
|
|
||||||
// setup state persistence
|
// setup state persistence
|
||||||
pump(
|
pump(
|
||||||
asStream(controller.store),
|
storeAsStream(controller.store),
|
||||||
debounce(1000),
|
debounce(1000),
|
||||||
storeTransform(versionifyData),
|
storeTransformStream(versionifyData),
|
||||||
createStreamSink(persistData),
|
createStreamSink(persistData),
|
||||||
(error) => {
|
(error) => {
|
||||||
log.error('MetaMask - Persistence pipeline failed', error)
|
log.error('MetaMask - Persistence pipeline failed', error)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import {
|
import {
|
||||||
TOGGLEABLE_ALERT_TYPES,
|
TOGGLEABLE_ALERT_TYPES,
|
||||||
WEB3_SHIM_USAGE_ALERT_STATES,
|
WEB3_SHIM_USAGE_ALERT_STATES,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
|
|
||||||
export default class AppStateController extends EventEmitter {
|
export default class AppStateController extends EventEmitter {
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} CachedBalancesOptions
|
* @typedef {Object} CachedBalancesOptions
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import punycode from 'punycode/punycode'
|
import punycode from 'punycode/punycode'
|
||||||
import ethUtil from 'ethereumjs-util'
|
import ethUtil from 'ethereumjs-util'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import Ens from './ens'
|
import Ens from './ens'
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import BN from 'bn.js'
|
import BN from 'bn.js'
|
||||||
import createId from '../lib/random-id'
|
import createId from '../lib/random-id'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { merge, omit } from 'lodash'
|
import { merge, omit } from 'lodash'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import { bufferToHex, sha3 } from 'ethereumjs-util'
|
import { bufferToHex, sha3 } from 'ethereumjs-util'
|
||||||
import { ENVIRONMENT_TYPE_BACKGROUND } from '../lib/enums'
|
import { ENVIRONMENT_TYPE_BACKGROUND } from '../lib/enums'
|
||||||
import {
|
import {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import ObservableStore from 'obs-store'
|
import { ComposedStore, ObservableStore } from '@metamask/obs-store'
|
||||||
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'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import nanoid from 'nanoid'
|
import nanoid from 'nanoid'
|
||||||
import { JsonRpcEngine } from 'json-rpc-engine'
|
import { JsonRpcEngine } from 'json-rpc-engine'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import { CapabilitiesController as RpcCap } from 'rpc-cap'
|
import { CapabilitiesController as RpcCap } from 'rpc-cap'
|
||||||
import { ethErrors } from 'eth-json-rpc-errors'
|
import { ethErrors } from 'eth-json-rpc-errors'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { strict as assert } from 'assert'
|
import { strict as assert } from 'assert'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import { ethErrors } from 'eth-json-rpc-errors'
|
import { ethErrors } from 'eth-json-rpc-errors'
|
||||||
import { normalize as normalizeAddress } from 'eth-sig-util'
|
import { normalize as normalizeAddress } from 'eth-sig-util'
|
||||||
import { isValidAddress } from 'ethereumjs-util'
|
import { isValidAddress } from 'ethereumjs-util'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { ethers } from 'ethers'
|
import { ethers } from 'ethers'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import { mapValues, cloneDeep } from 'lodash'
|
import { mapValues, cloneDeep } from 'lodash'
|
||||||
import abi from 'human-standard-token-abi'
|
import abi from 'human-standard-token-abi'
|
||||||
import { calcTokenAmount } from '../../../ui/app/helpers/utils/token-util'
|
import { calcTokenAmount } from '../../../ui/app/helpers/utils/token-util'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
|
|
||||||
/* eslint-disable import/first,import/order */
|
/* eslint-disable import/first,import/order */
|
||||||
const Box = process.env.IN_TEST
|
const Box = process.env.IN_TEST
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import { normalize as normalizeAddress } from 'eth-sig-util'
|
import { normalize as normalizeAddress } from 'eth-sig-util'
|
||||||
import ethUtil from 'ethereumjs-util'
|
import ethUtil from 'ethereumjs-util'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'safe-event-emitter'
|
import EventEmitter from 'safe-event-emitter'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import ethUtil from 'ethereumjs-util'
|
import ethUtil from 'ethereumjs-util'
|
||||||
import Transaction from 'ethereumjs-tx'
|
import Transaction from 'ethereumjs-tx'
|
||||||
import EthQuery from 'ethjs-query'
|
import EthQuery from 'ethjs-query'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'safe-event-emitter'
|
import EventEmitter from 'safe-event-emitter'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import createId from '../../lib/random-id'
|
import createId from '../../lib/random-id'
|
||||||
import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction'
|
import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An ObservableStore that can composes a flat
|
* An ObservableStore that can composes a flat
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
import EthQuery from 'eth-query'
|
import EthQuery from 'eth-query'
|
||||||
|
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import pify from 'pify'
|
import pify from 'pify'
|
||||||
import Web3 from 'web3'
|
import Web3 from 'web3'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import ethUtil from 'ethereumjs-util'
|
import ethUtil from 'ethereumjs-util'
|
||||||
import { ethErrors } from 'eth-json-rpc-errors'
|
import { ethErrors } from 'eth-json-rpc-errors'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import { ethErrors } from 'eth-json-rpc-errors'
|
import { ethErrors } from 'eth-json-rpc-errors'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
import createId from './random-id'
|
import createId from './random-id'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import ethUtil from 'ethereumjs-util'
|
import ethUtil from 'ethereumjs-util'
|
||||||
import { ethErrors } from 'eth-json-rpc-errors'
|
import { ethErrors } from 'eth-json-rpc-errors'
|
||||||
import createId from './random-id'
|
import createId from './random-id'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import ethUtil from 'ethereumjs-util'
|
import ethUtil from 'ethereumjs-util'
|
||||||
import { ethErrors } from 'eth-json-rpc-errors'
|
import { ethErrors } from 'eth-json-rpc-errors'
|
||||||
import log from 'loglevel'
|
import log from 'loglevel'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import { ethErrors } from 'eth-json-rpc-errors'
|
import { ethErrors } from 'eth-json-rpc-errors'
|
||||||
import { typedSignatureHash, TYPED_MESSAGE_SCHEMA } from 'eth-sig-util'
|
import { typedSignatureHash, TYPED_MESSAGE_SCHEMA } from 'eth-sig-util'
|
||||||
import { isValidAddress } from 'ethereumjs-util'
|
import { isValidAddress } from 'ethereumjs-util'
|
||||||
|
@ -83,6 +83,7 @@
|
|||||||
"@metamask/inpage-provider": "^8.0.1",
|
"@metamask/inpage-provider": "^8.0.1",
|
||||||
"@metamask/jazzicon": "^2.0.0",
|
"@metamask/jazzicon": "^2.0.0",
|
||||||
"@metamask/logo": "^2.5.0",
|
"@metamask/logo": "^2.5.0",
|
||||||
|
"@metamask/obs-store": "^5.0.0",
|
||||||
"@popperjs/core": "^2.4.0",
|
"@popperjs/core": "^2.4.0",
|
||||||
"@reduxjs/toolkit": "^1.3.2",
|
"@reduxjs/toolkit": "^1.3.2",
|
||||||
"@sentry/browser": "^5.26.0",
|
"@sentry/browser": "^5.26.0",
|
||||||
@ -140,7 +141,6 @@
|
|||||||
"nanoid": "^2.1.6",
|
"nanoid": "^2.1.6",
|
||||||
"nonce-tracker": "^1.0.0",
|
"nonce-tracker": "^1.0.0",
|
||||||
"obj-multiplex": "^1.0.0",
|
"obj-multiplex": "^1.0.0",
|
||||||
"obs-store": "^4.0.3",
|
|
||||||
"pify": "^5.0.0",
|
"pify": "^5.0.0",
|
||||||
"post-message-stream": "^3.0.0",
|
"post-message-stream": "^3.0.0",
|
||||||
"promise-to-callback": "^1.0.0",
|
"promise-to-callback": "^1.0.0",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import ComposableObservableStore from '../../../app/scripts/lib/ComposableObservableStore'
|
import ComposableObservableStore from '../../../app/scripts/lib/ComposableObservableStore'
|
||||||
|
|
||||||
describe('ComposableObservableStore', function () {
|
describe('ComposableObservableStore', function () {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import contracts from '@metamask/contract-metadata'
|
import contracts from '@metamask/contract-metadata'
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import EnsController from '../../../../app/scripts/controllers/ens'
|
import EnsController from '../../../../app/scripts/controllers/ens'
|
||||||
|
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { strict as assert } from 'assert'
|
import { strict as assert } from 'assert'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import nanoid from 'nanoid'
|
import nanoid from 'nanoid'
|
||||||
import { useFakeTimers } from 'sinon'
|
import { useFakeTimers } from 'sinon'
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import PreferencesController from '../../../../app/scripts/controllers/preferences'
|
import PreferencesController from '../../../../app/scripts/controllers/preferences'
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import sinon from 'sinon'
|
|||||||
import { ethers } from 'ethers'
|
import { ethers } from 'ethers'
|
||||||
import { mapValues } from 'lodash'
|
import { mapValues } from 'lodash'
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import {
|
import {
|
||||||
ROPSTEN_NETWORK_ID,
|
ROPSTEN_NETWORK_ID,
|
||||||
MAINNET_NETWORK_ID,
|
MAINNET_NETWORK_ID,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import assert from 'assert'
|
import assert from 'assert'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import TokenRatesController from '../../../../app/scripts/controllers/token-rates'
|
import TokenRatesController from '../../../../app/scripts/controllers/token-rates'
|
||||||
|
|
||||||
describe('TokenRatesController', function () {
|
describe('TokenRatesController', function () {
|
||||||
|
@ -2,7 +2,7 @@ import { strict as assert } from 'assert'
|
|||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import ethUtil from 'ethereumjs-util'
|
import ethUtil from 'ethereumjs-util'
|
||||||
import EthTx from 'ethereumjs-tx'
|
import EthTx from 'ethereumjs-tx'
|
||||||
import ObservableStore from 'obs-store'
|
import { ObservableStore } from '@metamask/obs-store'
|
||||||
import sinon from 'sinon'
|
import sinon from 'sinon'
|
||||||
import TransactionController from '../../../../../app/scripts/controllers/transactions'
|
import TransactionController from '../../../../../app/scripts/controllers/transactions'
|
||||||
|
|
||||||
|
@ -2145,6 +2145,15 @@
|
|||||||
gl-mat4 "1.1.4"
|
gl-mat4 "1.1.4"
|
||||||
gl-vec3 "1.0.3"
|
gl-vec3 "1.0.3"
|
||||||
|
|
||||||
|
"@metamask/obs-store@^5.0.0":
|
||||||
|
version "5.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@metamask/obs-store/-/obs-store-5.0.0.tgz#cf2213874c62186a8a4c80f0c402af62a0a877a9"
|
||||||
|
integrity sha512-9Az33hULCDVUVpBzNAdjPPgNTfs6paC38LYZv4xazt03mJt4jwWFFTP79TtF4grXfiAtUs/UZOktW4Vp+r37rw==
|
||||||
|
dependencies:
|
||||||
|
"@metamask/safe-event-emitter" "^2.0.0"
|
||||||
|
readable-stream "^2.2.2"
|
||||||
|
through2 "^2.0.3"
|
||||||
|
|
||||||
"@metamask/safe-event-emitter@^2.0.0":
|
"@metamask/safe-event-emitter@^2.0.0":
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-2.0.0.tgz#af577b477c683fad17c619a78208cede06f9605c"
|
resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-2.0.0.tgz#af577b477c683fad17c619a78208cede06f9605c"
|
||||||
|
Loading…
Reference in New Issue
Block a user