diff options
Diffstat (limited to 'development')
-rw-r--r-- | development/announcer.js | 2 | ||||
-rw-r--r-- | development/backGroundConnectionModifiers.js | 26 | ||||
-rw-r--r-- | development/genStates.js | 31 | ||||
-rw-r--r-- | development/mock-dev.js | 145 | ||||
-rw-r--r-- | development/mockExtension.js | 5 | ||||
-rw-r--r-- | development/run-version-bump.js | 43 | ||||
-rw-r--r-- | development/selector.js | 11 | ||||
-rw-r--r-- | development/states/add-token.json | 132 | ||||
-rw-r--r-- | development/states/confirm-new-ui.json | 154 | ||||
-rw-r--r-- | development/states/confirm-sig-requests.json | 175 | ||||
-rw-r--r-- | development/states/first-time.json | 11 | ||||
-rw-r--r-- | development/states/pending-tx.json | 739 | ||||
-rw-r--r-- | development/states/send-edit.json | 154 | ||||
-rw-r--r-- | development/states/send-new-ui.json | 133 | ||||
-rw-r--r-- | development/ui-dev.js | 97 | ||||
-rw-r--r-- | development/version-bump.js | 52 |
16 files changed, 1892 insertions, 18 deletions
diff --git a/development/announcer.js b/development/announcer.js index 43ae60acb..e97ea65b6 100644 --- a/development/announcer.js +++ b/development/announcer.js @@ -7,6 +7,6 @@ var changelog = fs.readFileSync(path.join(__dirname, '..', 'CHANGELOG.md')).toSt var log = changelog.split(version)[1].split('##')[0].trim() -let msg = `*MetaMask ${version}* now published to the Chrome Store! It should auto-update soon!\n${log}` +let msg = `*MetaMask ${version}* now published! It should auto-update soon!\n${log}` console.log(msg) diff --git a/development/backGroundConnectionModifiers.js b/development/backGroundConnectionModifiers.js new file mode 100644 index 000000000..ffbe49d4d --- /dev/null +++ b/development/backGroundConnectionModifiers.js @@ -0,0 +1,26 @@ +module.exports = { + "confirm sig requests": { + signMessage: (msgData, cb) => { + const stateUpdate = { + unapprovedMsgs: {}, + unapprovedMsgCount: 0, + } + return cb(null, stateUpdate) + }, + signPersonalMessage: (msgData, cb) => { + const stateUpdate = { + unapprovedPersonalMsgs: {}, + unapprovedPersonalMsgsCount: 0, + } + return cb(null, stateUpdate) + }, + signTypedMessage: (msgData, cb) => { + const stateUpdate = { + unapprovedTypedMessages: {}, + unapprovedTypedMessagesCount: 0, + } + return cb(null, stateUpdate) + }, + }, +} + diff --git a/development/genStates.js b/development/genStates.js index 39a672ee0..bc274c757 100644 --- a/development/genStates.js +++ b/development/genStates.js @@ -1,18 +1,21 @@ const fs = require('fs') const path = require('path') +const promisify = require('pify') -const statesPath = path.join(__dirname, 'states') -const stateNames = fs.readdirSync(statesPath) +start().catch(console.error) -const states = stateNames.reduce((result, stateFileName) => { - const statePath = path.join(__dirname, 'states', stateFileName) - const stateFile = fs.readFileSync(statePath).toString() - const state = JSON.parse(stateFile) - result[stateFileName.split('.')[0].replace(/-/g, ' ', 'g')] = state - return result -}, {}) - -const result = `module.exports = ${JSON.stringify(states)}` - -const statesJsonPath = path.join(__dirname, 'states.js') -fs.writeFileSync(statesJsonPath, result) +async function start () { + const statesPath = path.join(__dirname, 'states') + const stateFilesNames = await promisify(fs.readdir)(statesPath) + const states = {} + await Promise.all(stateFilesNames.map(async (stateFileName) => { + const stateFilePath = path.join(__dirname, 'states', stateFileName) + const stateFileContent = await promisify(fs.readFile)(stateFilePath, 'utf8') + const state = JSON.parse(stateFileContent) + const stateName = stateFileName.split('.')[0].replace(/-/g, ' ', 'g') + states[stateName] = state + })) + const generatedFileContent = `module.exports = ${JSON.stringify(states)}` + const generatedFilePath = path.join(__dirname, 'states.js') + await promisify(fs.writeFile)(generatedFilePath, generatedFileContent) +} diff --git a/development/mock-dev.js b/development/mock-dev.js new file mode 100644 index 000000000..a1fb3a86d --- /dev/null +++ b/development/mock-dev.js @@ -0,0 +1,145 @@ +/* MOCK DEV + * + * This is a utility module. + * It initializes a minimalist browserifiable project + * that contains the Metamask UI, with a local background process. + * + * Includes a state reset button for restoring to initial state. + * + * This is a convenient way to develop and test the plugin + * without having to re-open the plugin or even re-build it. + * + * To use, run `npm run mock`. + */ + +const extend = require('xtend') +const render = require('react-dom').render +const h = require('react-hyperscript') +const Root = require('../ui/app/root') +const configureStore = require('../ui/app/store') +const actions = require('../ui/app/actions') +const states = require('./states') +const backGroundConnectionModifiers = require('./backGroundConnectionModifiers') +const Selector = require('./selector') +const MetamaskController = require('../app/scripts/metamask-controller') +const firstTimeState = require('../app/scripts/first-time-state') +const ExtensionPlatform = require('../app/scripts/platforms/extension') +const extension = require('./mockExtension') +const noop = function () {} + +const log = require('loglevel') +window.log = log +log.setLevel('debug') + +// +// Query String +// + +const qs = require('qs') +let queryString = qs.parse(window.location.href.split('#')[1]) +let selectedView = queryString.view || 'first time' +const firstState = states[selectedView] +updateQueryParams(selectedView) + +function updateQueryParams(newView) { + queryString.view = newView + const params = qs.stringify(queryString) + window.location.href = window.location.href.split('#')[0] + `#${params}` +} + +// +// CSS +// + +const MetaMaskUiCss = require('../ui/css') +const injectCss = require('inject-css') + +// +// MetaMask Controller +// + +const controller = new MetamaskController({ + // User confirmation callbacks: + showUnconfirmedMessage: noop, + unlockAccountMessage: noop, + showUnapprovedTx: noop, + platform: {}, + // initial state + initState: firstTimeState, +}) +global.metamaskController = controller +global.platform = new ExtensionPlatform + +// +// User Interface +// + +actions._setBackgroundConnection(controller.getApi()) +actions.update = function(stateName) { + selectedView = stateName + updateQueryParams(stateName) + const newState = states[selectedView] + return { + type: 'GLOBAL_FORCE_UPDATE', + value: newState, + } +} + +function modifyBackgroundConnection(backgroundConnectionModifier) { + const modifiedBackgroundConnection = Object.assign({}, controller.getApi(), backgroundConnectionModifier) + actions._setBackgroundConnection(modifiedBackgroundConnection) +} + +var css = MetaMaskUiCss() +injectCss(css) + +// parse opts +var store = configureStore(firstState) + +// start app +startApp() + +function startApp(){ + const body = document.body + const container = document.createElement('div') + container.id = 'test-container' + body.appendChild(container) + + render( + h('.super-dev-container', [ + + h('button', { + onClick: (ev) => { + ev.preventDefault() + store.dispatch(actions.update('terms')) + }, + style: { + margin: '19px 19px 0px 19px', + }, + }, 'Reset State'), + + h(Selector, { + actions, + selectedKey: selectedView, + states, + store, + modifyBackgroundConnection, + backGroundConnectionModifiers, + }), + + h('#app-content', { + style: { + height: '500px', + width: '360px', + boxShadow: 'grey 0px 2px 9px', + margin: '20px', + }, + }, [ + h(Root, { + store: store, + }), + ]), + + ] + ), container) +} diff --git a/development/mockExtension.js b/development/mockExtension.js index 55799b2bf..ac03d965c 100644 --- a/development/mockExtension.js +++ b/development/mockExtension.js @@ -37,3 +37,8 @@ apis.forEach(function (api) { extension.runtime.reload = noop extension.tabs.create = noop +extension.runtime.getManifest = function () { + return { + version: 'development' + } +}
\ No newline at end of file diff --git a/development/run-version-bump.js b/development/run-version-bump.js new file mode 100644 index 000000000..98757f58e --- /dev/null +++ b/development/run-version-bump.js @@ -0,0 +1,43 @@ +const promisify = require('pify') +const fs = require('fs') +const readFile = promisify(fs.readFile) +const writeFile = promisify(fs.writeFile) +const path = require('path') +const changelogPath = path.join(__dirname, '..', 'CHANGELOG.md') +const manifestPath = path.join(__dirname, '..', 'app', 'manifest.json') +const manifest = require('../app/manifest.json') +const versionBump = require('./version-bump') +const bumpType = normalizeType(process.argv[2]) + +start().catch(console.error) + +async function start() { + + const changeBuffer = await readFile(changelogPath) + const changelog = changeBuffer.toString() + + const newData = await versionBump(bumpType, changelog, manifest) + + const manifestString = JSON.stringify(newData.manifest, null, 2) + + await writeFile(changelogPath, newData.changelog) + await writeFile(manifestPath, manifestString) + + console.log(`Bumped ${bumpType} to version ${newData.version}`) +} + + +function normalizeType (userInput) { + const err = new Error('First option must be a type (major, minor, or patch)') + if (!userInput || typeof userInput !== 'string') { + throw err + } + + const lower = userInput.toLowerCase() + + if (lower !== 'major' && lower !== 'minor' && lower !== 'patch') { + throw err + } + + return lower +} diff --git a/development/selector.js b/development/selector.js index c466905ca..fd387df15 100644 --- a/development/selector.js +++ b/development/selector.js @@ -11,7 +11,14 @@ function NewComponent () { NewComponent.prototype.render = function () { const props = this.props - let { states, selectedKey, actions, store } = props + let { + states, + selectedKey, + actions, + store, + modifyBackgroundConnection, + backGroundConnectionModifiers, + } = props const state = this.state || {} const selected = state.selected || selectedKey @@ -23,6 +30,8 @@ NewComponent.prototype.render = function () { value: selected, onChange:(event) => { const selectedKey = event.target.value + const backgroundConnectionModifier = backGroundConnectionModifiers[selectedKey] + modifyBackgroundConnection(backgroundConnectionModifier || {}) store.dispatch(actions.update(selectedKey)) this.setState({ selected: selectedKey }) }, diff --git a/development/states/add-token.json b/development/states/add-token.json new file mode 100644 index 000000000..e78393b7f --- /dev/null +++ b/development/states/add-token.json @@ -0,0 +1,132 @@ +{ + "metamask": { + "isInitialized": true, + "isUnlocked": true, + "featureFlags": {"betaUI": true}, + "rpcTarget": "https://rawtestrpc.metamask.io/", + "identities": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "name": "Send Account 1" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "name": "Send Account 2" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "name": "Send Account 3" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "address": "0xd85a4b6a394794842887b8284293d69163007bbb", + "name": "Send Account 4" + } + }, + "unapprovedTxs": {}, + "conversionRate": 1200.88200327, + "conversionDate": 1489013762, + "noActiveNotices": true, + "frequentRpcList": [], + "network": "3", + "accounts": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "code": "0x", + "balance": "0x47c9d71831c76efe", + "nonce": "0x1b", + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "code": "0x", + "balance": "0x37452b1315889f80", + "nonce": "0xa", + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "code": "0x", + "balance": "0x30c9d71831c76efe", + "nonce": "0x1c", + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "code": "0x", + "balance": "0x0", + "nonce": "0x0", + "address": "0xd85a4b6a394794842887b8284293d69163007bbb" + } + }, + "addressBook": [ + { + "address": "0x06195827297c7a80a443b6894d3bdb8824b43896", + "name": "Address Book Account 1" + } + ], + "tokens": [], + "transactions": {}, + "selectedAddressTxList": [], + "unapprovedMsgs": {}, + "unapprovedMsgCount": 0, + "unapprovedPersonalMsgs": {}, + "unapprovedPersonalMsgCount": 0, + "keyringTypes": [ + "Simple Key Pair", + "HD Key Tree" + ], + "keyrings": [ + { + "type": "HD Key Tree", + "accounts": [ + "fdea65c8e26263f6d9a1b5de9555d2931a33b825", + "c5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "2f8d4a878cfa04a6e60d46362f5644deab66572d" + ] + }, + { + "type": "Simple Key Pair", + "accounts": [ + "0xd85a4b6a394794842887b8284293d69163007bbb" + ] + } + ], + "selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", + "currentCurrency": "USD", + "provider": { + "type": "testnet" + }, + "shapeShiftTxList": [], + "lostAccounts": [], + "send": { + "gasLimit": null, + "gasPrice": null, + "gasTotal": "0xb451dc41b578", + "tokenBalance": null, + "from": "", + "to": "", + "amount": "0x0", + "memo": "", + "errors": {}, + "maxModeOn": false, + "editingTransactionId": null + } + }, + "appState": { + "menuOpen": false, + "currentView": { + "name": "accountDetail", + "detailView": null, + "context": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" + }, + "accountDetail": { + "subview": "transactions" + }, + "modal": { + "modalState": {}, + "previousModalState": {} + }, + "transForward": true, + "isLoading": false, + "warning": null, + "scrollToBottom": false, + "forgottenPassword": null + }, + "identities": {} +} diff --git a/development/states/confirm-new-ui.json b/development/states/confirm-new-ui.json new file mode 100644 index 000000000..6ea8e64cd --- /dev/null +++ b/development/states/confirm-new-ui.json @@ -0,0 +1,154 @@ +{ + "metamask": { + "isInitialized": true, + "isUnlocked": true, + "featureFlags": {"betaUI": true}, + "rpcTarget": "https://rawtestrpc.metamask.io/", + "identities": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "name": "Send Account 1" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "name": "Send Account 2" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "name": "Send Account 3" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "address": "0xd85a4b6a394794842887b8284293d69163007bbb", + "name": "Send Account 4" + } + }, + "unapprovedTxs": {}, + "currentCurrency": "USD", + "conversionRate": 1200.88200327, + "conversionDate": 1489013762, + "noActiveNotices": true, + "frequentRpcList": [], + "network": "3", + "accounts": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "code": "0x", + "balance": "0x47c9d71831c76efe", + "nonce": "0x1b", + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "code": "0x", + "balance": "0x37452b1315889f80", + "nonce": "0xa", + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "code": "0x", + "balance": "0x30c9d71831c76efe", + "nonce": "0x1c", + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "code": "0x", + "balance": "0x0", + "nonce": "0x0", + "address": "0xd85a4b6a394794842887b8284293d69163007bbb" + } + }, + "addressBook": [ + { + "address": "0x06195827297c7a80a443b6894d3bdb8824b43896", + "name": "Address Book Account 1" + } + ], + "tokens": [], + "transactions": {}, + "selectedAddressTxList": [], + "unapprovedTxs": { + "4768706228115573": { + "id": 4768706228115573, + "time": 1487363153561, + "status": "unapproved", + "gasMultiplier": 1, + "metamaskNetworkId": "3", + "txParams": { + "from": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "value": "0x1bc16d674ec80000", + "metamaskId": 4768706228115573, + "metamaskNetworkId": "3", + "gas": "0xea60", + "gasPrice": "0xba43b7400" + } + } + }, + "unapprovedMsgs": {}, + "unapprovedMsgCount": 0, + "unapprovedPersonalMsgs": {}, + "unapprovedPersonalMsgCount": 0, + "keyringTypes": [ + "Simple Key Pair", + "HD Key Tree" + ], + "keyrings": [ + { + "type": "HD Key Tree", + "accounts": [ + "fdea65c8e26263f6d9a1b5de9555d2931a33b825", + "c5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "2f8d4a878cfa04a6e60d46362f5644deab66572d" + ] + }, + { + "type": "Simple Key Pair", + "accounts": [ + "0xd85a4b6a394794842887b8284293d69163007bbb" + ] + } + ], + "selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", + "currentCurrency": "USD", + "provider": { + "type": "testnet" + }, + "shapeShiftTxList": [], + "lostAccounts": [], + "send": { + "gasLimit": "0xea60", + "gasPrice": "0xba43b7400", + "gasTotal": "0xb451dc41b578", + "tokenBalance": null, + "from": { + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "balance": "0x37452b1315889f80" + }, + "to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "amount": "0x1bc16d674ec80000", + "memo": "", + "errors": {}, + "maxModeOn": false, + "editingTransactionId": null + } + }, + "appState": { + "menuOpen": false, + "currentView": { + "name": "confTx", + "detailView": null, + "context": 0 + }, + "accountDetail": { + "subview": "transactions" + }, + "modal": { + "modalState": {}, + "previousModalState": {} + }, + "transForward": true, + "isLoading": false, + "warning": null, + "scrollToBottom": false, + "forgottenPassword": null + }, + "identities": {} +} diff --git a/development/states/confirm-sig-requests.json b/development/states/confirm-sig-requests.json new file mode 100644 index 000000000..0a691e948 --- /dev/null +++ b/development/states/confirm-sig-requests.json @@ -0,0 +1,175 @@ +{ + "metamask": { + "isInitialized": true, + "isUnlocked": true, + "featureFlags": {"betaUI": true}, + "rpcTarget": "https://rawtestrpc.metamask.io/", + "identities": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "name": "Send Account 1" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "name": "Send Account 2" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "name": "Send Account 3" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "address": "0xd85a4b6a394794842887b8284293d69163007bbb", + "name": "Send Account 4" + } + }, + "unapprovedTxs": {}, + "currentCurrency": "USD", + "conversionRate": 1200.88200327, + "conversionDate": 1489013762, + "noActiveNotices": true, + "frequentRpcList": [], + "network": "3", + "accounts": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "code": "0x", + "balance": "0x47c9d71831c76efe", + "nonce": "0x1b", + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "code": "0x", + "balance": "0x37452b1315889f80", + "nonce": "0xa", + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "code": "0x", + "balance": "0x30c9d71831c76efe", + "nonce": "0x1c", + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "code": "0x", + "balance": "0x0", + "nonce": "0x0", + "address": "0xd85a4b6a394794842887b8284293d69163007bbb" + } + }, + "addressBook": [ + { + "address": "0x06195827297c7a80a443b6894d3bdb8824b43896", + "name": "Address Book Account 1" + } + ], + "tokens": [], + "transactions": {}, + "selectedAddressTxList": [], + "unapprovedTxs": {}, + "unapprovedMsgs": { + "8927167822566864": { + "id": 8927167822566864, + "msgParams": { + "data": "0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0", + "from": "0x0d0c7188d9c72b019a5da9bca0d127680c22e658" + }, + "status": "unapproved", + "time": 1537889069339, + "type": "eth_sign" + } + }, + "unapprovedMsgCount": 1, + "unapprovedPersonalMsgs": { + "8907167822566865": { + "id": 8907167822566865, + "msgParams": { + "data": "0x23205465726d73206f662055736520230a0a2a2a544849532041475245454d454e54204953205355424a45435420544f2042494e44494e47204152424954524154494f4e20414e44204120574149564552204f4620434c41535320414354494f4e205249474854532041532044455441494c454420494e2053454354494f4e2031332e20504c454153452052454144205448452041475245454d454e54204341524546554c4c592e2a2a0a0a5f4f7572205465726d73206f66205573652068617665206265656e2075706461746564206173206f662053657074656d62657220352c20323031365f0a0a232320312e20416363657074616e6365206f66205465726d732023230a0a4d6574614d61736b2070726f7669646573206120706c6174666f726d20666f72206d616e6167696e6720457468657265756d20286f7220224554482229206163636f756e74732c20616e6420616c6c6f77696e67206f7264696e61727920776562736974657320746f20696e74657261637420776974682074686520457468657265756d20626c6f636b636861696e2c207768696c65206b656570696e6720746865207573657220696e20636f6e74726f6c206f7665722077686174207472616e73616374696f6e73207468657920617070726f76652c207468726f756768206f75722077656273697465206c6f63617465642061745b205d28687474703a2f2f6d6574616d61736b2e696f295b68747470733a2f2f6d6574616d61736b2e696f2f5d2868747470733a2f2f6d6574616d61736b2e696f2f2920616e642062726f7773657220706c7567696e2028746865202253697465222920e2809420776869636820696e636c7564657320746578742c20696d616765732c20617564696f2c20636f646520616e64206f74686572206d6174657269616c73202028636f6c6c6563746976656c792c2074686520e2809c436f6e74656e74e2809d2920616e6420616c6c206f66207468652066656174757265732c20616e642073657276696365732070726f76696465642e2054686520536974652c20616e6420616e79206f746865722066656174757265732c20746f6f6c732c206d6174657269616c732c206f72206f74686572207365727669636573206f6666657265642066726f6d2074696d6520746f2074696d65206279204d6574614d61736b2061726520726566657272656420746f20686572652061732074686520e2809c536572766963652ee2809d20506c656173652072656164207468657365205465726d73206f6620557365202874686520e2809c5465726d73e2809d206f7220e2809c5465726d73206f6620557365e2809d29206361726566756c6c79206265666f7265207573696e672074686520536572766963652e204279207573696e67206f72206f746865727769736520616363657373696e67207468652053657276696365732c206f7220636c69636b696e6720746f20616363657074206f7220616772656520746f207468657365205465726d732077686572652074686174206f7074696f6e206973206d61646520617661696c61626c652c20796f75202831292061636365707420616e6420616772656520746f207468657365205465726d732028322920636f6e73656e7420746f2074686520636f6c6c656374696f6e2c207573652c20646973636c6f7375726520616e64206f746865722068616e646c696e67206f6620696e666f726d6174696f6e2061732064657363726962656420696e206f7572205072697661637920506f6c6963792020616e642028332920616e79206164646974696f6e616c207465726d732c2072756c657320616e6420636f6e646974696f6e73206f662070617274696369706174696f6e20697373756564206279204d6574614d61736b2066726f6d2074696d6520746f2074696d652e20496620796f7520646f206e6f7420616772656520746f20746865205465726d732c207468656e20796f75206d6179206e6f7420616363657373206f72207573652074686520436f6e74656e74206f722053657276696365732e0a0a232320322e204d6f64696669636174696f6e206f66205465726d73206f66205573652023230a0a45786365707420666f722053656374696f6e2031332c2070726f766964696e6720666f722062696e64696e67206172626974726174696f6e20616e6420776169766572206f6620636c61737320616374696f6e207269676874732c204d6574614d61736b207265736572766573207468652072696768742c2061742069747320736f6c652064697363726574696f6e2c20746f206d6f64696679206f72207265706c61636520746865205465726d73206f662055736520617420616e792074696d652e20546865206d6f73742063757272656e742076657273696f6e206f66207468657365205465726d732077696c6c20626520706f73746564206f6e206f757220536974652e20596f75207368616c6c20626520726573706f6e7369626c6520666f7220726576696577696e6720616e64206265636f6d696e672066616d696c696172207769746820616e792073756368206d6f64696669636174696f6e732e20557365206f662074686520536572766963657320627920796f7520616674657220616e79206d6f64696669636174696f6e20746f20746865205465726d7320636f6e737469747574657320796f757220616363657074616e6365206f6620746865205465726d73206f6620557365206173206d6f6469666965642e0a0a0a0a232320332e20456c69676962696c6974792023230a0a596f752068657265627920726570726573656e7420616e642077617272616e74207468617420796f75206172652066756c6c792061626c6520616e6420636f6d706574656e7420746f20656e74657220696e746f20746865207465726d732c20636f6e646974696f6e732c206f626c69676174696f6e732c2061666669726d6174696f6e732c20726570726573656e746174696f6e7320616e642077617272616e746965732073657420666f72746820696e207468657365205465726d7320616e6420746f20616269646520627920616e6420636f6d706c792077697468207468657365205465726d732e0a0a4d6574614d61736b206973206120676c6f62616c20706c6174666f726d20616e6420627920616363657373696e672074686520436f6e74656e74206f722053657276696365732c20796f752061726520726570726573656e74696e6720616e642077617272616e74696e6720746861742c20796f7520617265206f6620746865206c6567616c20616765206f66206d616a6f7269747920696e20796f7572206a7572697364696374696f6e20617320697320726571756972656420746f20616363657373207375636820536572766963657320616e6420436f6e74656e…16e79206368616e67657320746f20746869732073656374696f6e2e204368616e6765732077696c6c206265636f6d6520656666656374697665206f6e207468652036307468206461792c20616e642077696c6c206170706c792070726f73706563746976656c79206f6e6c7920746f20616e7920636c61696d732061726973696e67206166746572207468652036307468206461792e0a0a466f7220616e792064697370757465206e6f74207375626a65637420746f206172626974726174696f6e20796f7520616e64204d6574614d61736b20616772656520746f207375626d697420746f2074686520706572736f6e616c20616e64206578636c7573697665206a7572697364696374696f6e206f6620616e642076656e756520696e20746865206665646572616c20616e6420737461746520636f75727473206c6f636174656420696e204e657720596f726b2c204e657720596f726b2e20596f75206675727468657220616772656520746f206163636570742073657276696365206f662070726f63657373206279206d61696c2c20616e642068657265627920776169766520616e7920616e6420616c6c206a7572697364696374696f6e616c20616e642076656e756520646566656e736573206f746865727769736520617661696c61626c652e0a0a546865205465726d7320616e64207468652072656c6174696f6e73686970206265747765656e20796f7520616e64204d6574614d61736b207368616c6c20626520676f7665726e656420627920746865206c617773206f6620746865205374617465206f66204e657720596f726b20776974686f75742072656761726420746f20636f6e666c696374206f66206c61772070726f766973696f6e732e0a0a23232031342e2047656e6572616c20496e666f726d6174696f6e2023230a0a2323232031342e3120456e746972652041677265656d656e74202323230a0a5468657365205465726d732028616e6420616e79206164646974696f6e616c207465726d732c2072756c657320616e6420636f6e646974696f6e73206f662070617274696369706174696f6e2074686174204d6574614d61736b206d617920706f7374206f6e2074686520536572766963652920636f6e737469747574652074686520656e746972652061677265656d656e74206265747765656e20796f7520616e64204d6574614d61736b2077697468207265737065637420746f20746865205365727669636520616e64207375706572736564657320616e79207072696f722061677265656d656e74732c206f72616c206f72207772697474656e2c206265747765656e20796f7520616e64204d6574614d61736b2e20496e20746865206576656e74206f66206120636f6e666c696374206265747765656e207468657365205465726d7320616e6420746865206164646974696f6e616c207465726d732c2072756c657320616e6420636f6e646974696f6e73206f662070617274696369706174696f6e2c20746865206c61747465722077696c6c207072657661696c206f76657220746865205465726d7320746f2074686520657874656e74206f662074686520636f6e666c6963742e0a0a2323232031342e322057616976657220616e642053657665726162696c697479206f66205465726d73202323230a0a546865206661696c757265206f66204d6574614d61736b20746f206578657263697365206f7220656e666f72636520616e79207269676874206f722070726f766973696f6e206f6620746865205465726d73207368616c6c206e6f7420636f6e73746974757465206120776169766572206f662073756368207269676874206f722070726f766973696f6e2e20496620616e792070726f766973696f6e206f6620746865205465726d7320697320666f756e6420627920616e2061726269747261746f72206f7220636f757274206f6620636f6d706574656e74206a7572697364696374696f6e20746f20626520696e76616c69642c207468652070617274696573206e657665727468656c6573732061677265652074686174207468652061726269747261746f72206f7220636f7572742073686f756c6420656e646561766f7220746f20676976652065666665637420746f2074686520706172746965732720696e74656e74696f6e73206173207265666c656374656420696e207468652070726f766973696f6e2c20616e6420746865206f746865722070726f766973696f6e73206f6620746865205465726d732072656d61696e20696e2066756c6c20666f72636520616e64206566666563742e0a0a2323232031342e332053746174757465206f66204c696d69746174696f6e73202323230a0a596f752061677265652074686174207265676172646c657373206f6620616e792073746174757465206f72206c617720746f2074686520636f6e74726172792c20616e7920636c61696d206f72206361757365206f6620616374696f6e2061726973696e67206f7574206f66206f722072656c6174656420746f2074686520757365206f66207468652053657276696365206f7220746865205465726d73206d7573742062652066696c65642077697468696e206f6e65202831292079656172206166746572207375636820636c61696d206f72206361757365206f6620616374696f6e2061726f7365206f7220626520666f7265766572206261727265642e0a0a2323232031342e342053656374696f6e205469746c6573202323230a0a5468652073656374696f6e207469746c657320696e20746865205465726d732061726520666f7220636f6e76656e69656e6365206f6e6c7920616e642068617665206e6f206c6567616c206f7220636f6e747261637475616c206566666563742e0a0a2323232031342e3520436f6d6d756e69636174696f6e73202323230a0a55736572732077697468207175657374696f6e732c20636f6d706c61696e7473206f7220636c61696d732077697468207265737065637420746f207468652053657276696365206d617920636f6e74616374207573207573696e67207468652072656c6576616e7420636f6e7461637420696e666f726d6174696f6e2073657420666f7274682061626f766520616e6420617420636f6d6d756e69636174696f6e73406d6574616d61736b2e696f2e0a0a23232031352052656c61746564204c696e6b732023230a0a2a2a5b5465726d73206f66205573655d2868747470733a2f2f6d6574616d61736b2e696f2f7465726d732e68746d6c292a2a0a0a2a2a5b507269766163795d2868747470733a2f2f6d6574616d61736b2e696f2f707269766163792e68746d6c292a2a0a0a2a2a5b4174747269627574696f6e735d2868747470733a2f2f6d6574616d61736b2e696f2f6174747269627574696f6e732e68746d6c292a2a0a", + "from": "0x0d0c7188d9c72b019a5da9bca0d127680c22e659" + }, + "status": "unapproved", + "time": 1517889069339, + "type": "personal_sign" + } + }, + "unapprovedPersonalMsgCount": 0, + "unapprovedTypedMessages": { + "8997167822566869": { + "id": 8997167822566869, + "msgParams": { + "data": [ + {"type": "string", "name": "Message", "value": "Hi, Alice!"}, + {"type": "uint32", "name": "A number", "value": "1337"} + ], + "from": "0x0d0c7188d9c72b019a5da9bca0d127680c22e659" + }, + "status": "unapproved", + "time": 1617889069339, + "type": "eth_signTypedData" + } + }, + "unapprovedTypedMessagesCount": 1, + "keyringTypes": [ + "Simple Key Pair", + "HD Key Tree" + ], + "keyrings": [ + { + "type": "HD Key Tree", + "accounts": [ + "fdea65c8e26263f6d9a1b5de9555d2931a33b825", + "c5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "2f8d4a878cfa04a6e60d46362f5644deab66572d" + ] + }, + { + "type": "Simple Key Pair", + "accounts": [ + "0xd85a4b6a394794842887b8284293d69163007bbb" + ] + } + ], + "selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", + "currentCurrency": "USD", + "provider": { + "type": "testnet" + }, + "shapeShiftTxList": [], + "lostAccounts": [], + "send": { + "gasLimit": "0xea60", + "gasPrice": "0xba43b7400", + "gasTotal": "0xb451dc41b578", + "tokenBalance": null, + "from": { + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "balance": "0x37452b1315889f80" + }, + "to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "amount": "0x1bc16d674ec80000", + "memo": "", + "errors": {}, + "maxModeOn": false, + "editingTransactionId": null + } + }, + "appState": { + "menuOpen": false, + "currentView": { + "name": "confTx", + "detailView": null, + "context": 0 + }, + "accountDetail": { + "subview": "transactions" + }, + "modal": { + "modalState": {}, + "previousModalState": {} + }, + "transForward": true, + "isLoading": false, + "warning": null, + "scrollToBottom": false, + "forgottenPassword": null + }, + "identities": {} +} diff --git a/development/states/first-time.json b/development/states/first-time.json index b2cc8ef8f..4f5352992 100644 --- a/development/states/first-time.json +++ b/development/states/first-time.json @@ -8,6 +8,7 @@ "frequentRpcList": [], "unapprovedTxs": {}, "currentCurrency": "USD", + "featureFlags": {"betaUI": false}, "conversionRate": 12.7527416, "conversionDate": 1487624341, "noActiveNotices": false, @@ -34,7 +35,8 @@ "type": "testnet" }, "shapeShiftTxList": [], - "lostAccounts": [] + "lostAccounts": [], + "tokens": [] }, "appState": { "menuOpen": false, @@ -47,7 +49,12 @@ }, "transForward": true, "isLoading": false, - "warning": null + "warning": null, + "modal": { + "modalState": {"name": null}, + "open": false, + "previousModalState": {"name": null} + } }, "identities": {}, "computedBalances": {} diff --git a/development/states/pending-tx.json b/development/states/pending-tx.json new file mode 100644 index 000000000..bfa93f7ae --- /dev/null +++ b/development/states/pending-tx.json @@ -0,0 +1,739 @@ +{ + "metamask": { + "isInitialized": true, + "isUnlocked": true, + "isMascara": false, + "rpcTarget": "https://rawtestrpc.metamask.io/", + "identities": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "name": "Account 1" + } + }, + "unapprovedTxs": {}, + "noActiveNotices": true, + "frequentRpcList": [ + "http://192.168.1.34:7545/" + ], + "addressBook": [], + "tokenExchangeRates": {}, + "coinOptions": {}, + "provider": { + "type": "mainnet", + "rpcTarget": "https://mainnet.infura.io/metamask" + }, + "network": "1", + "accounts": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "code": "0x", + "balance": "0x1b3f641ed0c2f62", + "nonce": "0x35", + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" + } + }, + "currentBlockGasLimit": "0x66df83", + "selectedAddressTxList": [ + { + "id": 3516145537630216, + "time": 1512615655535, + "status": "submitted", + "metamaskNetworkId": "1", + "txParams": { + "from": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "to": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "value": "0x16345785d8a0000", + "gasPrice": "0xc1b710800", + "gas": "0x7b0c", + "nonce": "0x35", + "chainId": "0x1" + }, + "gasPriceSpecified": false, + "gasLimitSpecified": false, + "estimatedGas": "5208", + "history": [ + { + "id": 3516145537630216, + "time": 1512615655535, + "status": "unapproved", + "metamaskNetworkId": "1", + "txParams": { + "from": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "to": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "value": "0x16345785d8a0000", + "gasPrice": "0xe6f7cec00", + "gas": "0x7b0c" + }, + "gasPriceSpecified": false, + "gasLimitSpecified": false, + "estimatedGas": "5208" + }, + [ + { + "op": "replace", + "path": "/txParams/gasPrice", + "value": "0xc1b710800", + "note": "confTx: user approved transaction" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "approved", + "note": "txStateManager: setting status to approved" + } + ], + [ + { + "op": "add", + "path": "/txParams/nonce", + "value": "0x35", + "note": "transactions#approveTransaction" + }, + { + "op": "add", + "path": "/nonceDetails", + "value": { + "params": { + "highestLocalNonce": 53, + "highestSuggested": 53, + "nextNetworkNonce": 53 + }, + "local": { + "name": "local", + "nonce": 53, + "details": { + "startPoint": 53, + "highest": 53 + } + }, + "network": { + "name": "network", + "nonce": 53, + "details": { + "baseCount": 53 + } + } + } + } + ], + [ + { + "op": "add", + "path": "/txParams/chainId", + "value": "0x1", + "note": "txStateManager: setting status to signed" + }, + { + "op": "replace", + "path": "/status", + "value": "signed" + } + ], + [ + { + "op": "add", + "path": "/rawTx", + "value": "0xf86c35850c1b710800827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008026a0f5142ba79a13ca7ec65548953017edafb217803244bbf9821d9ad077d89921e9a03afcb614169c90be9905d5b469d06984825c76675d3a535937cdb8f2ad1c0a95", + "note": "transactions#publishTransaction" + } + ], + [ + { + "op": "add", + "path": "/hash", + "value": "0x7ce19c0d128ca11293b44a4e6d3cc9063665c00ea8c8eb400f548e132c147353", + "note": "transactions#setTxHash" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "submitted", + "note": "txStateManager: setting status to submitted" + } + ], + [ + { + "op": "add", + "path": "/firstRetryBlockNumber", + "value": "0x478ab3", + "note": "transactions/pending-tx-tracker#event: tx:block-update" + } + ] + ], + "nonceDetails": { + "params": { + "highestLocalNonce": 53, + "highestSuggested": 53, + "nextNetworkNonce": 53 + }, + "local": { + "name": "local", + "nonce": 53, + "details": { + "startPoint": 53, + "highest": 53 + } + }, + "network": { + "name": "network", + "nonce": 53, + "details": { + "baseCount": 53 + } + } + }, + "rawTx": "0xf86c35850c1b710800827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008026a0f5142ba79a13ca7ec65548953017edafb217803244bbf9821d9ad077d89921e9a03afcb614169c90be9905d5b469d06984825c76675d3a535937cdb8f2ad1c0a95", + "hash": "0x7ce19c0d128ca11293b44a4e6d3cc9063665c00ea8c8eb400f548e132c147353", + "firstRetryBlockNumber": "0x478ab3" + }, + { + "id": 3516145537630211, + "time": 1512613432658, + "status": "confirmed", + "metamaskNetworkId": "1", + "txParams": { + "from": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "to": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "value": "0x16345785d8a0000", + "gasPrice": "0xba43b7400", + "gas": "0x7b0c", + "nonce": "0x34", + "chainId": "0x1" + }, + "gasPriceSpecified": false, + "gasLimitSpecified": false, + "estimatedGas": "5208", + "history": [ + { + "id": 3516145537630211, + "time": 1512613432658, + "status": "unapproved", + "metamaskNetworkId": "1", + "txParams": { + "from": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "to": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "value": "0x16345785d8a0000", + "gasPrice": "0xdf8475800", + "gas": "0x7b0c" + }, + "gasPriceSpecified": false, + "gasLimitSpecified": false, + "estimatedGas": "5208" + }, + [ + { + "op": "replace", + "path": "/txParams/gasPrice", + "value": "0xba43b7400", + "note": "confTx: user approved transaction" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "approved", + "note": "txStateManager: setting status to approved" + } + ], + [ + { + "op": "add", + "path": "/txParams/nonce", + "value": "0x34", + "note": "transactions#approveTransaction" + }, + { + "op": "add", + "path": "/nonceDetails", + "value": { + "params": { + "highestLocalNonce": 52, + "highestSuggested": 52, + "nextNetworkNonce": 52 + }, + "local": { + "name": "local", + "nonce": 52, + "details": { + "startPoint": 52, + "highest": 52 + } + }, + "network": { + "name": "network", + "nonce": 52, + "details": { + "baseCount": 52 + } + } + } + } + ], + [ + { + "op": "add", + "path": "/txParams/chainId", + "value": "0x1", + "note": "txStateManager: setting status to signed" + }, + { + "op": "replace", + "path": "/status", + "value": "signed" + } + ], + [ + { + "op": "add", + "path": "/rawTx", + "value": "0xf86c34850ba43b7400827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008026a073a4afdb8e8ad32b0cf9039af56c66baffd60d30e75cee5c1b783208824eafb8a0021ca6c1714a2c71281333ab77f776d3514348ab77967280fca8a5b4be44285e", + "note": "transactions#publishTransaction" + } + ], + [ + { + "op": "add", + "path": "/hash", + "value": "0x5c98409883fdfd3cd24058a83b91470da6c40ffae41a40eb90d7dee0b837d26d", + "note": "transactions#setTxHash" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "submitted", + "note": "txStateManager: setting status to submitted" + } + ], + [ + { + "op": "add", + "path": "/firstRetryBlockNumber", + "value": "0x478a2c", + "note": "transactions/pending-tx-tracker#event: tx:block-update" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "confirmed", + "note": "txStateManager: setting status to confirmed" + } + ] + ], + "nonceDetails": { + "params": { + "highestLocalNonce": 52, + "highestSuggested": 52, + "nextNetworkNonce": 52 + }, + "local": { + "name": "local", + "nonce": 52, + "details": { + "startPoint": 52, + "highest": 52 + } + }, + "network": { + "name": "network", + "nonce": 52, + "details": { + "baseCount": 52 + } + } + }, + "rawTx": "0xf86c34850ba43b7400827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008026a073a4afdb8e8ad32b0cf9039af56c66baffd60d30e75cee5c1b783208824eafb8a0021ca6c1714a2c71281333ab77f776d3514348ab77967280fca8a5b4be44285e", + "hash": "0x5c98409883fdfd3cd24058a83b91470da6c40ffae41a40eb90d7dee0b837d26d", + "firstRetryBlockNumber": "0x478a2c" + }, + { + "id": 3516145537630210, + "time": 1512612826136, + "status": "confirmed", + "metamaskNetworkId": "1", + "txParams": { + "from": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "to": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "value": "0x16345785d8a0000", + "gasPrice": "0xa7a358200", + "gas": "0x7b0c", + "nonce": "0x33", + "chainId": "0x1" + }, + "gasPriceSpecified": false, + "gasLimitSpecified": false, + "estimatedGas": "5208", + "history": [ + { + "id": 3516145537630210, + "time": 1512612826136, + "status": "unapproved", + "metamaskNetworkId": "1", + "txParams": { + "from": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "to": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "value": "0x16345785d8a0000", + "gasPrice": "0xba43b7400", + "gas": "0x7b0c" + }, + "gasPriceSpecified": false, + "gasLimitSpecified": false, + "estimatedGas": "5208" + }, + [ + { + "op": "replace", + "path": "/txParams/gasPrice", + "value": "0xa7a358200", + "note": "confTx: user approved transaction" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "approved", + "note": "txStateManager: setting status to approved" + } + ], + [ + { + "op": "add", + "path": "/txParams/nonce", + "value": "0x33", + "note": "transactions#approveTransaction" + }, + { + "op": "add", + "path": "/nonceDetails", + "value": { + "params": { + "highestLocalNonce": 0, + "highestSuggested": 51, + "nextNetworkNonce": 51 + }, + "local": { + "name": "local", + "nonce": 51, + "details": { + "startPoint": 51, + "highest": 51 + } + }, + "network": { + "name": "network", + "nonce": 51, + "details": { + "baseCount": 51 + } + } + } + } + ], + [ + { + "op": "add", + "path": "/txParams/chainId", + "value": "0x1", + "note": "txStateManager: setting status to signed" + }, + { + "op": "replace", + "path": "/status", + "value": "signed" + } + ], + [ + { + "op": "add", + "path": "/rawTx", + "value": "0xf86c33850a7a358200827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008026a0021a8cd6c10208cc593e22af53637e5d127cee5cc6f9443a3e758a02afff1d7ca025f7420e974d3f2c668c165040987c72543a8e709bfea3528a62836a6ced9ce8", + "note": "transactions#publishTransaction" + } + ], + [ + { + "op": "add", + "path": "/hash", + "value": "0x289772800898bc9cd414530d8581c0da257a9055e4aaaa6d10d92d700bfbd044", + "note": "transactions#setTxHash" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "submitted", + "note": "txStateManager: setting status to submitted" + } + ], + [ + { + "op": "add", + "path": "/firstRetryBlockNumber", + "value": "0x478a04", + "note": "transactions/pending-tx-tracker#event: tx:block-update" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "confirmed", + "note": "txStateManager: setting status to confirmed" + } + ] + ], + "nonceDetails": { + "params": { + "highestLocalNonce": 0, + "highestSuggested": 51, + "nextNetworkNonce": 51 + }, + "local": { + "name": "local", + "nonce": 51, + "details": { + "startPoint": 51, + "highest": 51 + } + }, + "network": { + "name": "network", + "nonce": 51, + "details": { + "baseCount": 51 + } + } + }, + "rawTx": "0xf86c33850a7a358200827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008026a0021a8cd6c10208cc593e22af53637e5d127cee5cc6f9443a3e758a02afff1d7ca025f7420e974d3f2c668c165040987c72543a8e709bfea3528a62836a6ced9ce8", + "hash": "0x289772800898bc9cd414530d8581c0da257a9055e4aaaa6d10d92d700bfbd044", + "firstRetryBlockNumber": "0x478a04" + }, + { + "id": 3516145537630209, + "time": 1512612809252, + "status": "failed", + "metamaskNetworkId": "1", + "txParams": { + "from": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "to": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "value": "0x16345785d8a0000", + "gasPrice": "0x77359400", + "gas": "0x7b0c", + "nonce": "0x33", + "chainId": "0x1" + }, + "gasPriceSpecified": false, + "gasLimitSpecified": false, + "estimatedGas": "5208", + "history": [ + { + "id": 3516145537630209, + "time": 1512612809252, + "status": "unapproved", + "metamaskNetworkId": "1", + "txParams": { + "from": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "to": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "value": "0x16345785d8a0000", + "gasPrice": "0xba43b7400", + "gas": "0x7b0c" + }, + "gasPriceSpecified": false, + "gasLimitSpecified": false, + "estimatedGas": "5208" + }, + [ + { + "op": "replace", + "path": "/txParams/gasPrice", + "value": "0x77359400", + "note": "confTx: user approved transaction" + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "approved", + "note": "txStateManager: setting status to approved" + } + ], + [ + { + "op": "add", + "path": "/txParams/nonce", + "value": "0x33", + "note": "transactions#approveTransaction" + }, + { + "op": "add", + "path": "/nonceDetails", + "value": { + "params": { + "highestLocalNonce": 0, + "highestSuggested": 51, + "nextNetworkNonce": 51 + }, + "local": { + "name": "local", + "nonce": 51, + "details": { + "startPoint": 51, + "highest": 51 + } + }, + "network": { + "name": "network", + "nonce": 51, + "details": { + "baseCount": 51 + } + } + } + } + ], + [ + { + "op": "add", + "path": "/txParams/chainId", + "value": "0x1", + "note": "txStateManager: setting status to signed" + }, + { + "op": "replace", + "path": "/status", + "value": "signed" + } + ], + [ + { + "op": "add", + "path": "/rawTx", + "value": "0xf86b338477359400827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008025a098624a27ae79b2b1adc63b913850f266a920cb9d93e6588b8df9b8883eb1b323a00cc6fd855723a234f4f93b48caf7a7659366d09e5c5887f0a4c2e5fa68012cd7", + "note": "transactions#publishTransaction" + } + ], + [ + { + "op": "add", + "path": "/err", + "value": { + "message": "Error: [ethjs-rpc] rpc error with payload {\"id\":7801900228852,\"jsonrpc\":\"2.0\",\"params\":[\"0xf86b338477359400827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008025a098624a27ae79b2b1adc63b913850f266a920cb9d93e6588b8df9b8883eb1b323a00cc6fd855723a234f4f93b48caf7a7659366d09e5c5887f0a4c2e5fa68012cd7\"],\"method\":\"eth_sendRawTransaction\"} Error: transaction underpriced", + "stack": "Error: [ethjs-rpc] rpc error with payload {\"id\":7801900228852,\"jsonrpc\":\"2.0\",\"params\":[\"0xf86b338477359400827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008025a098624a27ae79b2b1adc63b913850f266a920cb9d93e6588b8df9b8883eb1b323a00cc6fd855723a234f4f93b48caf7a7659366d09e5c5887f0a4c2e5fa68012cd7\"],\"method\":\"eth_sendRawTransaction\"} Error: transaction underpriced\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:60327:26\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:88030:9\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16678:16\n at replenish (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16522:25)\n at iterateeCallback (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16512:17)\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16694:16\n at resultObj.id (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:88012:9)\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16813:16\n at replenish (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16527:17)\n at iterateeCallback (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16512:17)" + } + } + ], + [ + { + "op": "replace", + "path": "/status", + "value": "failed", + "note": "txStateManager: setting status to failed" + } + ] + ], + "nonceDetails": { + "params": { + "highestLocalNonce": 0, + "highestSuggested": 51, + "nextNetworkNonce": 51 + }, + "local": { + "name": "local", + "nonce": 51, + "details": { + "startPoint": 51, + "highest": 51 + } + }, + "network": { + "name": "network", + "nonce": 51, + "details": { + "baseCount": 51 + } + } + }, + "rawTx": "0xf86b338477359400827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008025a098624a27ae79b2b1adc63b913850f266a920cb9d93e6588b8df9b8883eb1b323a00cc6fd855723a234f4f93b48caf7a7659366d09e5c5887f0a4c2e5fa68012cd7", + "err": { + "message": "Error: [ethjs-rpc] rpc error with payload {\"id\":7801900228852,\"jsonrpc\":\"2.0\",\"params\":[\"0xf86b338477359400827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008025a098624a27ae79b2b1adc63b913850f266a920cb9d93e6588b8df9b8883eb1b323a00cc6fd855723a234f4f93b48caf7a7659366d09e5c5887f0a4c2e5fa68012cd7\"],\"method\":\"eth_sendRawTransaction\"} Error: transaction underpriced", + "stack": "Error: [ethjs-rpc] rpc error with payload {\"id\":7801900228852,\"jsonrpc\":\"2.0\",\"params\":[\"0xf86b338477359400827b0c94fdea65c8e26263f6d9a1b5de9555d2931a33b82588016345785d8a00008025a098624a27ae79b2b1adc63b913850f266a920cb9d93e6588b8df9b8883eb1b323a00cc6fd855723a234f4f93b48caf7a7659366d09e5c5887f0a4c2e5fa68012cd7\"],\"method\":\"eth_sendRawTransaction\"} Error: transaction underpriced\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:60327:26\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:88030:9\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16678:16\n at replenish (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16522:25)\n at iterateeCallback (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16512:17)\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16694:16\n at resultObj.id (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:88012:9)\n at chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16813:16\n at replenish (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16527:17)\n at iterateeCallback (chrome-extension://ebjbdknjcgcbchkagneicjfpneaghdhb/scripts/background.js:16512:17)" + } + } + ], + "unapprovedMsgs": {}, + "unapprovedMsgCount": 0, + "unapprovedPersonalMsgs": {}, + "unapprovedPersonalMsgCount": 0, + "unapprovedTypedMessages": {}, + "unapprovedTypedMessagesCount": 0, + "keyringTypes": [ + "Simple Key Pair", + "HD Key Tree" + ], + "keyrings": [ + { + "type": "HD Key Tree", + "accounts": [ + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" + ] + } + ], + "computedBalances": {}, + "currentAccountTab": "history", + "tokens": [ + { + "address": "0x0d8775f648430679a709e98d2b0cb6250d2887ef", + "symbol": "BAT", + "decimals": "18" + } + ], + "selectedAddress": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "currentCurrency": "usd", + "conversionRate": 418.62, + "conversionDate": 1512615622, + "infuraNetworkStatus": { + "mainnet": "ok", + "ropsten": "ok", + "kovan": "ok", + "rinkeby": "ok" + }, + "shapeShiftTxList": [], + "lostAccounts": [] + }, + "appState": { + "shouldClose": true, + "menuOpen": false, + "currentView": { + "name": "accountDetail", + "context": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" + }, + "accountDetail": { + "subview": "transactions", + "accountExport": "none", + "privateKey": "" + }, + "transForward": false, + "isLoading": false, + "warning": null, + "forgottenPassword": false, + "scrollToBottom": false + }, + "identities": {}, + "version": "3.12.1", + "platform": { + "arch": "x86-64", + "nacl_arch": "x86-64", + "os": "mac" + }, + "browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36" +}
\ No newline at end of file diff --git a/development/states/send-edit.json b/development/states/send-edit.json new file mode 100644 index 000000000..6ea8e64cd --- /dev/null +++ b/development/states/send-edit.json @@ -0,0 +1,154 @@ +{ + "metamask": { + "isInitialized": true, + "isUnlocked": true, + "featureFlags": {"betaUI": true}, + "rpcTarget": "https://rawtestrpc.metamask.io/", + "identities": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "name": "Send Account 1" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "name": "Send Account 2" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "name": "Send Account 3" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "address": "0xd85a4b6a394794842887b8284293d69163007bbb", + "name": "Send Account 4" + } + }, + "unapprovedTxs": {}, + "currentCurrency": "USD", + "conversionRate": 1200.88200327, + "conversionDate": 1489013762, + "noActiveNotices": true, + "frequentRpcList": [], + "network": "3", + "accounts": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "code": "0x", + "balance": "0x47c9d71831c76efe", + "nonce": "0x1b", + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "code": "0x", + "balance": "0x37452b1315889f80", + "nonce": "0xa", + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "code": "0x", + "balance": "0x30c9d71831c76efe", + "nonce": "0x1c", + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "code": "0x", + "balance": "0x0", + "nonce": "0x0", + "address": "0xd85a4b6a394794842887b8284293d69163007bbb" + } + }, + "addressBook": [ + { + "address": "0x06195827297c7a80a443b6894d3bdb8824b43896", + "name": "Address Book Account 1" + } + ], + "tokens": [], + "transactions": {}, + "selectedAddressTxList": [], + "unapprovedTxs": { + "4768706228115573": { + "id": 4768706228115573, + "time": 1487363153561, + "status": "unapproved", + "gasMultiplier": 1, + "metamaskNetworkId": "3", + "txParams": { + "from": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "value": "0x1bc16d674ec80000", + "metamaskId": 4768706228115573, + "metamaskNetworkId": "3", + "gas": "0xea60", + "gasPrice": "0xba43b7400" + } + } + }, + "unapprovedMsgs": {}, + "unapprovedMsgCount": 0, + "unapprovedPersonalMsgs": {}, + "unapprovedPersonalMsgCount": 0, + "keyringTypes": [ + "Simple Key Pair", + "HD Key Tree" + ], + "keyrings": [ + { + "type": "HD Key Tree", + "accounts": [ + "fdea65c8e26263f6d9a1b5de9555d2931a33b825", + "c5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "2f8d4a878cfa04a6e60d46362f5644deab66572d" + ] + }, + { + "type": "Simple Key Pair", + "accounts": [ + "0xd85a4b6a394794842887b8284293d69163007bbb" + ] + } + ], + "selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", + "currentCurrency": "USD", + "provider": { + "type": "testnet" + }, + "shapeShiftTxList": [], + "lostAccounts": [], + "send": { + "gasLimit": "0xea60", + "gasPrice": "0xba43b7400", + "gasTotal": "0xb451dc41b578", + "tokenBalance": null, + "from": { + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "balance": "0x37452b1315889f80" + }, + "to": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "amount": "0x1bc16d674ec80000", + "memo": "", + "errors": {}, + "maxModeOn": false, + "editingTransactionId": null + } + }, + "appState": { + "menuOpen": false, + "currentView": { + "name": "confTx", + "detailView": null, + "context": 0 + }, + "accountDetail": { + "subview": "transactions" + }, + "modal": { + "modalState": {}, + "previousModalState": {} + }, + "transForward": true, + "isLoading": false, + "warning": null, + "scrollToBottom": false, + "forgottenPassword": null + }, + "identities": {} +} diff --git a/development/states/send-new-ui.json b/development/states/send-new-ui.json new file mode 100644 index 000000000..a0a2c66e4 --- /dev/null +++ b/development/states/send-new-ui.json @@ -0,0 +1,133 @@ +{ + "metamask": { + "isInitialized": true, + "isUnlocked": true, + "featureFlags": {"betaUI": true}, + "rpcTarget": "https://rawtestrpc.metamask.io/", + "identities": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825", + "name": "Send Account 1" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "name": "Send Account 2" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d", + "name": "Send Account 3" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "address": "0xd85a4b6a394794842887b8284293d69163007bbb", + "name": "Send Account 4" + } + }, + "unapprovedTxs": {}, + "currentCurrency": "USD", + "conversionRate": 1200.88200327, + "conversionDate": 1489013762, + "noActiveNotices": true, + "frequentRpcList": [], + "network": "3", + "accounts": { + "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825": { + "code": "0x", + "balance": "0x47c9d71831c76efe", + "nonce": "0x1b", + "address": "0xfdea65c8e26263f6d9a1b5de9555d2931a33b825" + }, + "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb": { + "code": "0x", + "balance": "0x37452b1315889f80", + "nonce": "0xa", + "address": "0xc5b8dbac4c1d3f152cdeb400e2313f309c410acb" + }, + "0x2f8d4a878cfa04a6e60d46362f5644deab66572d": { + "code": "0x", + "balance": "0x30c9d71831c76efe", + "nonce": "0x1c", + "address": "0x2f8d4a878cfa04a6e60d46362f5644deab66572d" + }, + "0xd85a4b6a394794842887b8284293d69163007bbb": { + "code": "0x", + "balance": "0x0", + "nonce": "0x0", + "address": "0xd85a4b6a394794842887b8284293d69163007bbb" + } + }, + "addressBook": [ + { + "address": "0x06195827297c7a80a443b6894d3bdb8824b43896", + "name": "Address Book Account 1" + } + ], + "tokens": [], + "transactions": {}, + "selectedAddressTxList": [], + "unapprovedMsgs": {}, + "unapprovedMsgCount": 0, + "unapprovedPersonalMsgs": {}, + "unapprovedPersonalMsgCount": 0, + "keyringTypes": [ + "Simple Key Pair", + "HD Key Tree" + ], + "keyrings": [ + { + "type": "HD Key Tree", + "accounts": [ + "fdea65c8e26263f6d9a1b5de9555d2931a33b825", + "c5b8dbac4c1d3f152cdeb400e2313f309c410acb", + "2f8d4a878cfa04a6e60d46362f5644deab66572d" + ] + }, + { + "type": "Simple Key Pair", + "accounts": [ + "0xd85a4b6a394794842887b8284293d69163007bbb" + ] + } + ], + "selectedAddress": "0xd85a4b6a394794842887b8284293d69163007bbb", + "currentCurrency": "USD", + "provider": { + "type": "testnet" + }, + "shapeShiftTxList": [], + "lostAccounts": [], + "send": { + "gasLimit": null, + "gasPrice": null, + "gasTotal": "0xb451dc41b578", + "tokenBalance": null, + "from": "", + "to": "", + "amount": "0x0", + "memo": "", + "errors": {}, + "maxModeOn": false, + "editingTransactionId": null + } + }, + "appState": { + "menuOpen": false, + "currentView": { + "name": "accountDetail", + "detailView": null, + "context": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc" + }, + "accountDetail": { + "subview": "transactions" + }, + "modal": { + "modalState": {}, + "previousModalState": {} + }, + "transForward": true, + "isLoading": false, + "warning": null, + "scrollToBottom": false, + "forgottenPassword": null + }, + "identities": {} +} diff --git a/development/ui-dev.js b/development/ui-dev.js new file mode 100644 index 000000000..cac433909 --- /dev/null +++ b/development/ui-dev.js @@ -0,0 +1,97 @@ +/* UI DEV + * + * This is a utility module. + * It initializes a minimalist browserifiable project + * that contains the Metamask UI, with a mocked state. + * + * Includes a state menu for switching between different + * mocked states, along with query param support, + * so those states are preserved when live-reloading. + * + * This is a convenient way to develop on the UI + * without having to re-enter your password + * every time the plugin rebuilds. + * + * To use, run `npm run ui`. + */ + +const render = require('react-dom').render +const h = require('react-hyperscript') +const Root = require('../ui/app/root') +const configureStore = require('./uiStore') +const states = require('./states') +const Selector = require('./selector') + +// logger +const log = require('loglevel') +window.log = log +log.setDefaultLevel(1) + +// Query String +const qs = require('qs') +let queryString = qs.parse(window.location.href.split('#')[1]) +let selectedView = queryString.view || 'first time' +const firstState = states[selectedView] +updateQueryParams(selectedView) + +// CSS +const MetaMaskUiCss = require('../ui/css') +const injectCss = require('inject-css') + + +function updateQueryParams(newView) { + queryString.view = newView + const params = qs.stringify(queryString) + window.location.href = window.location.href.split('#')[0] + `#${params}` +} + +const actions = { + _setBackgroundConnection(){}, + update: function(stateName) { + selectedView = stateName + updateQueryParams(stateName) + const newState = states[selectedView] + return { + type: 'GLOBAL_FORCE_UPDATE', + value: newState, + } + }, +} + +var css = MetaMaskUiCss() +injectCss(css) + +// parse opts +var store = configureStore(states[selectedView]) + +// start app +startApp() + +function startApp(){ + const body = document.body + const container = document.createElement('div') + container.id = 'test-container' + body.appendChild(container) + + render( + h('.super-dev-container', [ + + h(Selector, { actions, selectedKey: selectedView, states, store }), + + h('#app-content', { + style: { + height: '500px', + width: '360px', + boxShadow: 'grey 0px 2px 9px', + margin: '20px', + }, + }, [ + h(Root, { + store: store, + }), + ]), + + ] + ), container) +} + diff --git a/development/version-bump.js b/development/version-bump.js new file mode 100644 index 000000000..bedf87c01 --- /dev/null +++ b/development/version-bump.js @@ -0,0 +1,52 @@ +const clone = require('clone') + +async function versionBump(bumpType, changelog, oldManifest) { + const manifest = clone(oldManifest) + const newVersion = newVersionFrom(manifest, bumpType) + + manifest.version = newVersion + const date = (new Date()).toDateString() + + const logHeader = `\n## ${newVersion} ${date}` + const logLines = changelog.split('\n') + for (let i = 0; i < logLines.length; i++) { + if (logLines[i].includes('Current Master')) { + logLines.splice(i + 1, 0, logHeader) + break + } + } + + return { + version: newVersion, + manifest: manifest, + changelog: logLines.join('\n') + } +} + +function newVersionFrom (manifest, bumpType) { + const string = manifest.version + let segments = string.split('.').map((str) => parseInt(str)) + + switch (bumpType) { + case 'major': + segments[0] += 1 + segments[1] = 0 + segments[2] = 0 + break + case 'minor': + segments[1] += 1 + segments[2] = 0 + break + case 'patch': + segments[2] += 1 + break + } + + return segments.map(String).join('.') +} + +function bumpManifest (manifest, bumpType) { + +} + +module.exports = versionBump |