mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 14:15:06 +01:00
1112277cd6
`seedWords` used to be stored on the metamask state temporarily at certain points. This hasn't been the case since #5994, but references to this state remained. All of the logic remained for correctly updating these `seedWords`, handling them during navigation, and scrubbing them from the state. However the state was never updated in practice. The `seedWords` are still returned by `verifySeedPhrase`, and they're still stored in component state in a few places. But they aren't ever set in the Redux metadata state or the Preferences controller. All references to this state have been removed, along with any logic for interacting with this state. A few unused actions were removed as well.
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
var assert = require('assert')
|
|
var path = require('path')
|
|
|
|
import configureMockStore from 'redux-mock-store'
|
|
import thunk from 'redux-thunk'
|
|
|
|
const actions = require(path.join(__dirname, '../../../ui/app/store/actions.js'))
|
|
|
|
const middlewares = [thunk]
|
|
const mockStore = configureMockStore(middlewares)
|
|
|
|
describe('tx confirmation screen', function () {
|
|
const txId = 1457634084250832
|
|
const initialState = {
|
|
appState: {
|
|
currentView: {
|
|
name: 'confTx',
|
|
},
|
|
},
|
|
metamask: {
|
|
unapprovedTxs: {
|
|
[txId]: {
|
|
id: txId,
|
|
status: 'unconfirmed',
|
|
time: 1457634084250,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
const store = mockStore(initialState)
|
|
|
|
describe('cancelTx', function () {
|
|
before(function (done) {
|
|
actions._setBackgroundConnection({
|
|
approveTransaction (_, cb) { cb('An error!') },
|
|
cancelTransaction (_, cb) { cb() },
|
|
getState (cb) { cb() },
|
|
})
|
|
done()
|
|
})
|
|
|
|
it('creates COMPLETED_TX with the cancelled transaction ID', function (done) {
|
|
store.dispatch(actions.cancelTx({ id: txId }))
|
|
.then(() => {
|
|
const storeActions = store.getActions()
|
|
const completedTxAction = storeActions.find(({ type }) => type === actions.COMPLETED_TX)
|
|
assert.equal(completedTxAction.value, txId)
|
|
done()
|
|
})
|
|
})
|
|
})
|
|
})
|