@ -1,23 +0,0 @@ |
||||
{ |
||||
"presets": [ |
||||
[ |
||||
"env", |
||||
{ |
||||
"targets": { |
||||
"browsers": [ |
||||
">0.25%", |
||||
"not ie 11", |
||||
"not op_mini all" |
||||
] |
||||
} |
||||
} |
||||
], |
||||
"react", |
||||
"stage-0" |
||||
], |
||||
"plugins": [ |
||||
"transform-runtime", |
||||
"transform-async-to-generator", |
||||
"transform-class-properties" |
||||
] |
||||
} |
@ -1,12 +0,0 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
set -u |
||||
set -o pipefail |
||||
|
||||
if ! npm audit |
||||
then |
||||
! npm audit --json > audit.json |
||||
printf '%s\n' '' |
||||
node .circleci/scripts/npm-audit-check.js |
||||
fi |
@ -1,24 +0,0 @@ |
||||
const path = require('path') |
||||
const audit = require(path.join(__dirname, '..', '..', 'audit.json')) |
||||
const error = audit.error |
||||
const advisories = Object.keys(audit.advisories || []).map((k) => audit.advisories[k]) |
||||
|
||||
if (error) { |
||||
process.exit(1) |
||||
} |
||||
|
||||
let count = 0 |
||||
for (const advisory of advisories) { |
||||
if (advisory.severity === 'low') { |
||||
continue |
||||
} |
||||
|
||||
count += advisory.findings.some((finding) => (!finding.dev && !finding.optional)) |
||||
} |
||||
|
||||
if (count > 0) { |
||||
console.log(`Audit shows ${count} moderate or high severity advisories _in the production dependencies_`) |
||||
process.exit(1) |
||||
} else { |
||||
console.log(`Audit shows _zero_ moderate or high severity advisories _in the production dependencies_`) |
||||
} |
@ -0,0 +1,44 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
set -u |
||||
set -o pipefail |
||||
|
||||
if [[ "${CI:-}" != 'true' ]] |
||||
then |
||||
printf '%s\n' 'CI environment variable must be set to true' |
||||
exit 1 |
||||
fi |
||||
|
||||
if [[ "${CIRCLECI:-}" != 'true' ]] |
||||
then |
||||
printf '%s\n' 'CIRCLECI environment variable must be set to true' |
||||
exit 1 |
||||
fi |
||||
|
||||
version="${CIRCLE_BRANCH/Version-v/}" |
||||
|
||||
if ! grep --quiet --fixed-strings "$version" CHANGELOG.md |
||||
then |
||||
printf '%s\n' 'Adding this release to CHANGELOG.md' |
||||
date_str="$(date '+%a %b %d %Y')" |
||||
cp CHANGELOG.md{,.bak} |
||||
|
||||
update_headers=$(cat <<END |
||||
/## Current Develop Branch/ { |
||||
print "## Current Develop Branch\n"; |
||||
print "## ${version} ${date_str}"; |
||||
next; |
||||
} |
||||
{ |
||||
print; |
||||
} |
||||
END |
||||
) |
||||
|
||||
awk "$update_headers" CHANGELOG.md.bak > CHANGELOG.md |
||||
rm CHANGELOG.md.bak |
||||
else |
||||
printf '%s\n' "CHANGELOG.md already includes a header for ${version}" |
||||
exit 0 |
||||
fi |
@ -0,0 +1,38 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
set -u |
||||
set -o pipefail |
||||
|
||||
if [[ "${CI:-}" != 'true' ]] |
||||
then |
||||
printf '%s\n' 'CI environment variable must be set to true' |
||||
exit 1 |
||||
fi |
||||
|
||||
if [[ "${CIRCLECI:-}" != 'true' ]] |
||||
then |
||||
printf '%s\n' 'CIRCLECI environment variable must be set to true' |
||||
exit 1 |
||||
fi |
||||
|
||||
printf '%s\n' 'Updating the manifest version if needed' |
||||
|
||||
version="${CIRCLE_BRANCH/Version-v/}" |
||||
updated_manifest="$(jq ".version = \"$version\"" app/manifest.json)" |
||||
printf '%s\n' "$updated_manifest" > app/manifest.json |
||||
|
||||
if [[ -z $(git status --porcelain) ]] |
||||
then |
||||
printf '%s\n' 'App manifest version already set' |
||||
exit 0 |
||||
fi |
||||
|
||||
git \ |
||||
-c user.name='MetaMask Bot' \ |
||||
-c user.email='metamaskbot@users.noreply.github.com' \ |
||||
commit --message "${CIRCLE_BRANCH/-/ }" \ |
||||
CHANGELOG.md app/manifest.json |
||||
|
||||
repo_slug="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" |
||||
git push "https://$GITHUB_TOKEN_USER:$GITHUB_TOKEN@github.com/$repo_slug" "$CIRCLE_BRANCH" |
@ -0,0 +1,51 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
set -x |
||||
set -e |
||||
set -u |
||||
set -o pipefail |
||||
|
||||
if [[ "${CI:-}" != 'true' ]] |
||||
then |
||||
printf '%s\n' 'CI environment variable must be set to true' |
||||
exit 1 |
||||
fi |
||||
|
||||
if [[ "${CIRCLECI:-}" != 'true' ]] |
||||
then |
||||
printf '%s\n' 'CIRCLECI environment variable must be set to true' |
||||
exit 1 |
||||
fi |
||||
|
||||
function install_github_cli () |
||||
{ |
||||
printf '%s\n' 'Installing hub CLI' |
||||
pushd "$(mktemp -d)" |
||||
curl -sSL 'https://github.com/github/hub/releases/download/v2.11.2/hub-linux-amd64-2.11.2.tgz' | tar xz |
||||
PATH="$PATH:$PWD/hub-linux-amd64-2.11.2/bin" |
||||
popd |
||||
} |
||||
|
||||
current_commit_msg=$(git show -s --format='%s' HEAD) |
||||
|
||||
if grep --quiet '^Version v' <<< "$current_commit_msg" |
||||
then |
||||
install_github_cli |
||||
|
||||
printf '%s\n' 'Creating GitHub Release' |
||||
read -ra commit_words <<< "$current_commit_msg" |
||||
tag="${commit_words[1]}" |
||||
release_body="$(awk -v version="${tag##v}" -f .circleci/scripts/show-changelog.awk CHANGELOG.md)" |
||||
pushd builds |
||||
hub release create \ |
||||
--attach metamask-chrome-*.zip \ |
||||
--attach metamask-firefox-*.zip \ |
||||
--message "${commit_words[0]} ${commit_words[1]#v}" \ |
||||
--message "$release_body" \ |
||||
--commitish "$CIRCLE_SHA1" \ |
||||
"$tag" |
||||
popd |
||||
else |
||||
printf '%s\n' 'Skipping GitHub Release' |
||||
exit 0 |
||||
fi |
@ -0,0 +1,54 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
set -u |
||||
set -o pipefail |
||||
|
||||
if [[ "${CI:-}" != 'true' ]] |
||||
then |
||||
printf '%s\n' 'CI environment variable must be set to true' |
||||
exit 1 |
||||
fi |
||||
|
||||
if [[ "${CIRCLECI:-}" != 'true' ]] |
||||
then |
||||
printf '%s\n' 'CIRCLECI environment variable must be set to true' |
||||
exit 1 |
||||
fi |
||||
|
||||
if [[ -z "${GITHUB_TOKEN:-}" ]] |
||||
then |
||||
printf '%s\n' 'GITHUB_TOKEN environment variable must be set' |
||||
exit 1 |
||||
fi |
||||
|
||||
function install_github_cli () |
||||
{ |
||||
printf '%s\n' 'Installing hub CLI' |
||||
pushd "$(mktemp -d)" |
||||
curl -sSL 'https://github.com/github/hub/releases/download/v2.11.2/hub-linux-amd64-2.11.2.tgz' | tar xz |
||||
PATH="$PATH:$PWD/hub-linux-amd64-2.11.2/bin" |
||||
popd |
||||
} |
||||
|
||||
version="${CIRCLE_BRANCH/Version-v/}" |
||||
base_branch='develop' |
||||
|
||||
if [[ -n "${CI_PULL_REQUEST:-}" ]] |
||||
then |
||||
printf '%s\n' 'CI_PULL_REQUEST is set, pull request already exists for this build' |
||||
exit 0 |
||||
fi |
||||
|
||||
install_github_cli |
||||
|
||||
printf '%s\n' "Creating a Pull Request for $version on GitHub" |
||||
|
||||
if ! hub pull-request \ |
||||
--reviewer '@MetaMask/extension-release-team' \ |
||||
--message "${CIRCLE_BRANCH/-/ } RC" --message ':package: :rocket:' \ |
||||
--base "$CIRCLE_PROJECT_USERNAME:$base_branch" \ |
||||
--head "$CIRCLE_PROJECT_USERNAME:$CIRCLE_BRANCH"; |
||||
then |
||||
printf '%s\n' 'Pull Request already exists' |
||||
fi |
@ -0,0 +1,52 @@ |
||||
# DESCRIPTION |
||||
# |
||||
# This script will print out all of the CHANGELOG.md lines for a given version |
||||
# with the assumption that the CHANGELOG.md files looks something along the |
||||
# lines of: |
||||
# |
||||
# ``` |
||||
# ## 6.6.2 Fri Jun 07 2019 |
||||
# |
||||
# - [#6690](https://github.com/MetaMask/metamask-extension/pull/6690): Some words |
||||
# - [#6700](https://github.com/MetaMask/metamask-extension/pull/6700): some more words |
||||
# |
||||
# ## 6.6.1 Thu Jun 06 2019 |
||||
# |
||||
# - [#6691](https://github.com/MetaMask/metamask-extension/pull/6691): Revert other words |
||||
# |
||||
# ## 6.6.0 Mon Jun 03 2019 |
||||
# |
||||
# - [#6659](https://github.com/MetaMask/metamask-extension/pull/6659): foo |
||||
# - [#6671](https://github.com/MetaMask/metamask-extension/pull/6671): bar |
||||
# - [#6625](https://github.com/MetaMask/metamask-extension/pull/6625): baz |
||||
# - [#6633](https://github.com/MetaMask/metamask-extension/pull/6633): Many many words |
||||
# |
||||
# |
||||
# ``` |
||||
# |
||||
# EXAMPLE |
||||
# |
||||
# Run this script like so, passing in the version: |
||||
# |
||||
# ``` |
||||
# awk -v version='6.6.0' -f .circleci/scripts/show-changelog.awk CHANGELOG.md |
||||
# ``` |
||||
# |
||||
|
||||
BEGIN { |
||||
inside_section = 0; |
||||
} |
||||
|
||||
$1 == "##" && $2 == version { |
||||
inside_section = 1; |
||||
next; |
||||
} |
||||
|
||||
$1 == "##" && $2 != version { |
||||
inside_section = 0; |
||||
next; |
||||
} |
||||
|
||||
inside_section && !/^$/ { |
||||
print $0; |
||||
} |
@ -0,0 +1,20 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
set -u |
||||
set -o pipefail |
||||
|
||||
yarn audit --level moderate --groups dependencies |
||||
audit_status="$?" |
||||
|
||||
# Use a bitmask to ignore INFO and LOW severity audit results |
||||
# See here: https://yarnpkg.com/lang/en/docs/cli/audit/ |
||||
audit_status="$(( audit_status & 11100 ))" |
||||
|
||||
if [[ "$audit_status" != 0 ]] |
||||
then |
||||
count="$(yarn audit --level moderate --groups dependencies --json | tail -1 | jq '.data.vulnerabilities.moderate + .data.vulnerabilities.high + .data.vulnerabilities.critical')" |
||||
printf "Audit shows %s moderate or high severity advisories _in the production dependencies_\n" "$count" |
||||
exit 1 |
||||
else |
||||
printf "Audit shows _zero_ moderate or high severity advisories _in the production dependencies_\n" |
||||
fi |
@ -1 +1,8 @@ |
||||
CHANGELOG.md merge=union |
||||
|
||||
# Reviewing the lockfile contents is an important step in verifying that |
||||
# we're using the dependencies we expect to be using |
||||
package-lock.json linguist-generated=false |
||||
yarn.lock linguist-generated=false |
||||
|
||||
test/e2e/send-eth-with-private-key-test/ethereumjs-tx.js linguist-vendored linguist-generated |
||||
|
@ -1,7 +1,8 @@ |
||||
# Lines starting with '#' are comments. |
||||
# Each line is a file pattern followed by one or more owners. |
||||
|
||||
package*.json @whymarrh |
||||
ui/ @danjm @whymarrh |
||||
package.json @danjm @whymarrh @Gudahtt |
||||
yarn.lock @danjm @whymarrh @Gudahtt |
||||
ui/ @danjm @whymarrh @Gudahtt |
||||
app/scripts/controllers/transactions @frankiebee |
||||
|
||||
|
After Width: | Height: | Size: 745 B |
After Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 692 B |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 1018 B |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 883 B |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,43 @@ |
||||
const ObservableStore = require('obs-store') |
||||
const extend = require('xtend') |
||||
|
||||
/** |
||||
* @typedef {Object} InitState |
||||
* @property {Boolean} seedPhraseBackedUp Indicates whether the user has completed the seed phrase backup challenge |
||||
*/ |
||||
|
||||
/** |
||||
* @typedef {Object} OnboardingOptions |
||||
* @property {InitState} initState The initial controller state |
||||
*/ |
||||
|
||||
/** |
||||
* Controller responsible for maintaining |
||||
* a cache of account balances in local storage |
||||
*/ |
||||
class OnboardingController { |
||||
/** |
||||
* Creates a new controller instance |
||||
* |
||||
* @param {OnboardingOptions} [opts] Controller configuration parameters |
||||
*/ |
||||
constructor (opts = {}) { |
||||
const initState = extend({ |
||||
seedPhraseBackedUp: null, |
||||
}, opts.initState) |
||||
this.store = new ObservableStore(initState) |
||||
} |
||||
|
||||
setSeedPhraseBackedUp (newSeedPhraseBackUpState) { |
||||
this.store.updateState({ |
||||
seedPhraseBackedUp: newSeedPhraseBackUpState, |
||||
}) |
||||
} |
||||
|
||||
getSeedPhraseBackedUp () { |
||||
return this.store.getState().seedPhraseBackedUp |
||||
} |
||||
|
||||
} |
||||
|
||||
module.exports = OnboardingController |
@ -0,0 +1,33 @@ |
||||
const version = 34 |
||||
const clone = require('clone') |
||||
|
||||
/** |
||||
* The purpose of this migration is to enable the {@code privacyMode} feature flag and set the user as being migrated |
||||
* if it was {@code false}. |
||||
*/ |
||||
module.exports = { |
||||
version, |
||||
migrate: async function (originalVersionedData) { |
||||
const versionedData = clone(originalVersionedData) |
||||
versionedData.meta.version = version |
||||
const state = versionedData.data |
||||
versionedData.data = transformState(state) |
||||
return versionedData |
||||
}, |
||||
} |
||||
|
||||
function transformState (state) { |
||||
const { PreferencesController } = state |
||||
|
||||
if (PreferencesController) { |
||||
const featureFlags = PreferencesController.featureFlags || {} |
||||
|
||||
if (!featureFlags.privacyMode && typeof PreferencesController.migratedPrivacyMode === 'undefined') { |
||||
// Mark the state has being migrated and enable Privacy Mode
|
||||
PreferencesController.migratedPrivacyMode = true |
||||
featureFlags.privacyMode = true |
||||
} |
||||
} |
||||
|
||||
return state |
||||
} |
@ -0,0 +1,28 @@ |
||||
// next version number
|
||||
const version = 35 |
||||
|
||||
/* |
||||
|
||||
Removes the deprecated 'seedWords' state |
||||
|
||||
*/ |
||||
|
||||
const clone = require('clone') |
||||
|
||||
module.exports = { |
||||
version, |
||||
|
||||
migrate: async function (originalVersionedData) { |
||||
const versionedData = clone(originalVersionedData) |
||||
versionedData.meta.version = version |
||||
versionedData.data = transformState(versionedData.data) |
||||
return versionedData |
||||
}, |
||||
} |
||||
|
||||
function transformState (state) { |
||||
if (state.PreferencesController && state.PreferencesController.seedWords !== undefined) { |
||||
delete state.PreferencesController.seedWords |
||||
} |
||||
return state |
||||
} |
@ -1,77 +0,0 @@ |
||||
const {EventEmitter} = require('events') |
||||
const async = require('async') |
||||
const Dnode = require('dnode') |
||||
const Eth = require('ethjs') |
||||
const EthQuery = require('eth-query') |
||||
const launchMetamaskUi = require('../../ui') |
||||
const StreamProvider = require('web3-stream-provider') |
||||
const {setupMultiplex} = require('./lib/stream-utils.js') |
||||
|
||||
module.exports = initializePopup |
||||
|
||||
/** |
||||
* Asynchronously initializes the MetaMask popup UI |
||||
* |
||||
* @param {{ container: Element, connectionStream: * }} config Popup configuration object |
||||
* @param {Function} cb Called when initialization is complete |
||||
*/ |
||||
function initializePopup ({ container, connectionStream }, cb) { |
||||
// setup app
|
||||
async.waterfall([ |
||||
(cb) => connectToAccountManager(connectionStream, cb), |
||||
(accountManager, cb) => launchMetamaskUi({ container, accountManager }, cb), |
||||
], cb) |
||||
} |
||||
|
||||
/** |
||||
* Establishes streamed connections to background scripts and a Web3 provider |
||||
* |
||||
* @param {PortDuplexStream} connectionStream PortStream instance establishing a background connection |
||||
* @param {Function} cb Called when controller connection is established |
||||
*/ |
||||
function connectToAccountManager (connectionStream, cb) { |
||||
// setup communication with background
|
||||
// setup multiplexing
|
||||
const mx = setupMultiplex(connectionStream) |
||||
// connect features
|
||||
setupControllerConnection(mx.createStream('controller'), cb) |
||||
setupWeb3Connection(mx.createStream('provider')) |
||||
} |
||||
|
||||
/** |
||||
* Establishes a streamed connection to a Web3 provider |
||||
* |
||||
* @param {PortDuplexStream} connectionStream PortStream instance establishing a background connection |
||||
*/ |
||||
function setupWeb3Connection (connectionStream) { |
||||
const providerStream = new StreamProvider() |
||||
providerStream.pipe(connectionStream).pipe(providerStream) |
||||
connectionStream.on('error', console.error.bind(console)) |
||||
providerStream.on('error', console.error.bind(console)) |
||||
global.ethereumProvider = providerStream |
||||
global.ethQuery = new EthQuery(providerStream) |
||||
global.eth = new Eth(providerStream) |
||||
} |
||||
|
||||
/** |
||||
* Establishes a streamed connection to the background account manager |
||||
* |
||||
* @param {PortDuplexStream} connectionStream PortStream instance establishing a background connection |
||||
* @param {Function} cb Called when the remote account manager connection is established |
||||
*/ |
||||
function setupControllerConnection (connectionStream, cb) { |
||||
// this is a really sneaky way of adding EventEmitter api
|
||||
// to a bi-directional dnode instance
|
||||
const eventEmitter = new EventEmitter() |
||||
const accountManagerDnode = Dnode({ |
||||
sendUpdate: function (state) { |
||||
eventEmitter.emit('update', state) |
||||
}, |
||||
}) |
||||
connectionStream.pipe(accountManagerDnode).pipe(connectionStream) |
||||
accountManagerDnode.once('remote', function (accountManager) { |
||||
// setup push events
|
||||
accountManager.on = eventEmitter.on.bind(eventEmitter) |
||||
cb(null, accountManager) |
||||
}) |
||||
} |
@ -0,0 +1,24 @@ |
||||
module.exports = function (api) { |
||||
api.cache(false) |
||||
return { |
||||
presets: [ |
||||
[ |
||||
'@babel/preset-env', |
||||
{ |
||||
targets: { |
||||
browsers: [ |
||||
'chrome >= 58', |
||||
'firefox >= 60', |
||||
], |
||||
}, |
||||
}, |
||||
], |
||||
'@babel/preset-react', |
||||
], |
||||
plugins: [ |
||||
'@babel/plugin-transform-runtime', |
||||
'@babel/plugin-proposal-class-properties', |
||||
'@babel/plugin-proposal-object-rest-spread', |
||||
], |
||||
} |
||||
} |
@ -1,26 +1,60 @@ |
||||
#! /bin/bash |
||||
# update tags |
||||
#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
set -u |
||||
set -o pipefail |
||||
|
||||
readonly URL='https://github.com/MetaMask/metamask-extension' |
||||
|
||||
git fetch --tags |
||||
# get origin |
||||
URL='https://github.com/MetaMask/metamask-extension' |
||||
# get git logs from last tag until HEAD, pretty by 'subject::body' filtered by grep for PRs made with Github squash merge or Github regular merge |
||||
LOG=$(git log $(git describe --tags $(git rev-list --tags --max-count=1))..HEAD --pretty="%s::%b" --reverse --grep="Merge pull request #" --grep="(#"); |
||||
while read -r line; do |
||||
# get git log subject |
||||
SUBJECT=$(echo $line | sed -E 's/(.*):{2}(.*)/\1/') |
||||
# get git log PR id, PR made with Github squash merge or Github regular merge |
||||
PR=$(echo $SUBJECT | sed 's/^.*(#\([^&]*\)).*/\1/' | sed 's/^.*#\([^&]*\) from.*/\1/') |
||||
# if PR made with Github squash merge, subject is the body |
||||
if [ -z "$(echo $line | sed -E 's/(.*):{2}(.*)/\2/')" ]; then |
||||
BODY=$(echo $SUBJECT | sed "s/(#$PR)//g"); else |
||||
BODY=$(echo $line | sed -E 's/(.*):{2}(.*)/\2/') |
||||
|
||||
most_recent_tag="$(git describe --tags "$(git rev-list --tags --max-count=1)")" |
||||
|
||||
git rev-list "${most_recent_tag}"..HEAD | while read commit |
||||
do |
||||
subject="$(git show -s --format="%s" "$commit")" |
||||
|
||||
# Squash & Merge: the commit subject is parsed as `<description> (#<PR ID>)` |
||||
if grep -E -q '\(#[[:digit:]]+\)' <<< "$subject" |
||||
then |
||||
pr="$(awk '{print $NF}' <<< "$subject" | tr -d '()')" |
||||
prefix="[$pr]($URL/pull/${pr###}): " |
||||
description="$(awk '{NF--; print $0}' <<< "$subject")" |
||||
|
||||
# Merge: the PR ID is parsed from the git subject (which is of the form `Merge pull request |
||||
# #<PR ID> from <branch>`, and the description is assumed to be the first line of the body. |
||||
# If no body is found, the description is set to the commit subject |
||||
elif grep -E -q '#[[:digit:]]+\sfrom' <<< "$subject" |
||||
then |
||||
pr="$(awk '{print $4}' <<< "$subject")" |
||||
prefix="[$pr]($URL/pull/${pr###}): " |
||||
|
||||
first_line_of_body="$(git show -s --format="%b" "$commit" | head -n 1 | tr -d '\r')" |
||||
if [[ -z "$first_line_of_body" ]] |
||||
then |
||||
description="$subject" |
||||
else |
||||
description="$first_line_of_body" |
||||
fi |
||||
|
||||
# Normal commits: The commit subject is the description, and the PR ID is omitted. |
||||
else |
||||
pr='' |
||||
prefix='' |
||||
description="$subject" |
||||
fi |
||||
|
||||
# add entry to CHANGELOG |
||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then |
||||
if [[ "$OSTYPE" == "linux-gnu" ]] |
||||
then |
||||
# shellcheck disable=SC1004 |
||||
sed -i'' '/## Current Develop Branch/a\ |
||||
- [#'"$PR"']('"$URL"'/pull/'"$PR"'): '"$BODY"''$'\n' CHANGELOG.md; else |
||||
- '"$prefix$description"''$'\n' CHANGELOG.md |
||||
else |
||||
# shellcheck disable=SC1004 |
||||
sed -i '' '/## Current Develop Branch/a\ |
||||
- [#'"$PR"']('"$URL"'/pull/'"$PR"'): '"$BODY"''$'\n' CHANGELOG.md; |
||||
- '"$prefix$description"''$'\n' CHANGELOG.md |
||||
fi |
||||
done <<< "$LOG" |
||||
done |
||||
|
||||
echo 'CHANGELOG updated' |
||||
|
@ -1,44 +0,0 @@ |
||||
/* MockExtension |
||||
* |
||||
* A module for importing the global extension polyfiller |
||||
* and stubbing out all the extension methods with appropriate mocks. |
||||
*/ |
||||
|
||||
const extension = require('extensionizer') |
||||
const noop = function () {} |
||||
|
||||
const apis = [ |
||||
'alarms', |
||||
'bookmarks', |
||||
'browserAction', |
||||
'commands', |
||||
'contextMenus', |
||||
'cookies', |
||||
'downloads', |
||||
'events', |
||||
'extension', |
||||
'extensionTypes', |
||||
'history', |
||||
'i18n', |
||||
'idle', |
||||
'notifications', |
||||
'pageAction', |
||||
'runtime', |
||||
'storage', |
||||
'tabs', |
||||
'webNavigation', |
||||
'webRequest', |
||||
'windows', |
||||
] |
||||
|
||||
apis.forEach(function (api) { |
||||
extension[api] = {} |
||||
}) |
||||
|
||||
extension.runtime.reload = noop |
||||
extension.tabs.create = noop |
||||
extension.runtime.getManifest = function () { |
||||
return { |
||||
version: 'development', |
||||
} |
||||
} |
@ -0,0 +1 @@ |
||||
require('react-devtools') |
@ -0,0 +1,28 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
set -u |
||||
set -o pipefail |
||||
|
||||
ganache_cli="$(npm bin)/ganache-cli" |
||||
seed_phrase="${GANACHE_SEED_PHRASE:-phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent}" |
||||
|
||||
_term () { |
||||
printf '%s\n' "Received SIGTERM, sending SIGKILL to Ganache" |
||||
kill -KILL "$child" 2>/dev/null |
||||
exit 42 |
||||
} |
||||
|
||||
_int () { |
||||
printf '%s\n' "Received SIGINT, sending SIGKILL to Ganache" |
||||
kill -KILL "$child" 2>/dev/null |
||||
exit 42 |
||||
} |
||||
|
||||
trap _term SIGTERM |
||||
trap _int SIGINT |
||||
|
||||
$ganache_cli --noVMErrorsOnRPCResponse --networkId 5777 --mnemonic "$seed_phrase" ${GANACHE_ARGS:-} & |
||||
|
||||
child=$! |
||||
wait "$child" |
@ -1,15 +0,0 @@ |
||||
# Development Tools & Configurations |
||||
|
||||
This folder contains configuration files which are used by the the different |
||||
development-tools, like e.g. JsDoc. |
||||
|
||||
|
||||
## Appveyor |
||||
|
||||
|
||||
https://www.appveyor.com/docs/build-configuration/#alternative-yaml-file-location |
||||
|
||||
Withtin the configuration, point to a weblocation of a txt config file: |
||||
|
||||
https://ci.appveyor.com/project/lazaridiscom/mm-vault/settings |
||||
https://raw.githubusercontent.com/lazaridiscom/mm-vault/master/dev/tools/appveyor.txt |
@ -1,21 +0,0 @@ |
||||
# Test against the latest version of this Node.js version |
||||
environment: |
||||
nodejs_version: "8" |
||||
|
||||
# Install scripts. (runs after repo cloning) |
||||
install: |
||||
# Get the latest stable version of Node.js or io.js |
||||
- ps: Install-Product node $env:nodejs_version |
||||
# install modules |
||||
- npm install |
||||
|
||||
# Post-install test scripts. |
||||
test_script: |
||||
# Output useful info for debugging. |
||||
- node --version |
||||
- npm --version |
||||
# run tests |
||||
- npm test |
||||
|
||||
# Don't actually build. |
||||
build: off |
@ -1,96 +0,0 @@ |
||||
/* 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/pages') |
||||
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') |
||||
const queryString = qs.parse(window.location.href.split('#')[1]) |
||||
let selectedView = queryString.view || 'first time' |
||||
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) |
||||
} |
||||
|
@ -1,18 +0,0 @@ |
||||
const createStore = require('redux').createStore |
||||
const applyMiddleware = require('redux').applyMiddleware |
||||
const thunkMiddleware = require('redux-thunk').default |
||||
const createLogger = require('redux-logger').createLogger |
||||
const rootReducer = require('../ui/app/ducks') |
||||
|
||||
module.exports = configureStore |
||||
|
||||
const loggerMiddleware = createLogger() |
||||
|
||||
const createStoreWithMiddleware = applyMiddleware( |
||||
thunkMiddleware, |
||||
loggerMiddleware |
||||
)(createStore) |
||||
|
||||
function configureStore (initialState) { |
||||
return createStoreWithMiddleware(rootReducer, initialState) |
||||
} |
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 214 KiB |
@ -0,0 +1,20 @@ |
||||
# Account Menu |
||||
|
||||
The account menu is the popup menu which contains options such as: |
||||
- Logging out |
||||
- Switching accounts |
||||
- Creating a new account |
||||
- Importing an account |
||||
- Connecting a HW wallet |
||||
- Looking up info & help |
||||
- Adjusting settings |
||||
|
||||
It can be seen below where it has been outlined with a red box |
||||
|
||||
![Screenshot of account menu](https://i.imgur.com/xpkfIuR.png) |
||||
|
||||
Above screenshot showing the menu bar in MetaMask 6.7.1 |
||||
|
||||
|
||||
|
||||
|
@ -1,15 +0,0 @@ |
||||
## Generating Notices |
||||
|
||||
To add a notice: |
||||
``` |
||||
npm run generateNotice |
||||
``` |
||||
Enter the body of your notice into the text editor that pops up, without including the body. Be sure to save the file before closing the window! |
||||
Afterwards, enter the title of the notice in the command line and press enter. Afterwards, add and commit the new changes made. |
||||
|
||||
To delete a notice: |
||||
``` |
||||
npm run deleteNotice |
||||
``` |
||||
A list of active notices will pop up. Enter the corresponding id in the command line prompt and add and commit the new changes afterwards. |
||||
|