diff --git a/.circleci/config.yml b/.circleci/config.yml index 77029bc0e66..ed93fd47640 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -59,7 +59,7 @@ jobs: at: ~/app - restore_cache: - keys: + keys: - yarn-v2-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }} - yarn-v2-{{ arch }}-{{ .Branch }}- - yarn-v2-{{ arch }}- @@ -94,6 +94,7 @@ jobs: name: Build packages command: | # separate build to avoid ENOMEN in CI :( + yarn build --scope @celo/utils yarn build --scope @celo/protocol yarn build --scope docs yarn build --scope @celo/walletkit @@ -207,6 +208,29 @@ jobs: name: test # Flaky tests - run them twice command: yarn --cwd packages/protocol test || yarn --cwd packages/protocol test + + # Slow and flaky compared to protocol-test which runs without coverage + protocol-test-with-code-coverage: + <<: *defaults + steps: + - attach_workspace: + at: ~/app + - run: + name: Check if the test should run + command: | + FILES_TO_CHECK="${PWD}/packages/protocol,${PWD}/packages/utils,${PWD}/.circleci/config.yml" + ./scripts/ci_check_if_test_should_run_v2.sh ${FILES_TO_CHECK} + - run: + name: test + # Flaky tests - run them twice + command: yarn --cwd packages/protocol test:coverage || yarn --cwd packages/protocol test:coverage + - store_artifacts: + path: packages/protocol/coverage + destination: protocol/coverage + - run: + name: Upload to CodeCov + command: yarn codecov -F protocol + contractkit-test: <<: *defaults steps: @@ -260,7 +284,11 @@ jobs: git --no-pager diff packages/docs/command-line-interface echo "There are git differences after generating CLI docs" exit 1 - fi + fi + - run: + name: Verify that a new account can be created + command: | + yarn --cwd=packages/cli run celocli account:new end-to-end-geth-transfer-test: <<: *defaults @@ -451,7 +479,10 @@ jobs: steps: - run: name: Installing npm package - @celo/walletkit - command: yarn add @celo/walletkit + command: | + # Try one more time in case the first attempt fails + # to deal with scenarios like https://circleci.com/gh/celo-org/celo-monorepo/23329 + yarn add @celo/walletkit || yarn add @celo/walletkit test-celocli-npm-package-install: working_directory: ~/app @@ -514,7 +545,7 @@ workflows: requires: - lint-checks - walletkit-test - nightly: + npm-install-testing-cron-workflow: triggers: - schedule: # 7 PM in UTC = noon in PDT. @@ -529,3 +560,25 @@ workflows: - test-utils-npm-package-install - test-walletkit-npm-package-install - test-celocli-npm-package-install + protocol-testing-with-code-coverage-cron-workflow: + triggers: + - schedule: + # 1 PM in UTC = 6 AM in PDT. + # Best for this slow test (~3 hours) to run during SF early morning. + cron: "0 13 * * *" + filters: + branches: + only: + - master + jobs: + - install_dependencies + - lint-checks: + requires: + - install_dependencies + - walletkit-test: + requires: + - install_dependencies + - protocol-test-with-code-coverage: + requires: + - lint-checks + - walletkit-test diff --git a/.codecov.yml b/.codecov.yml index 7ecad1b2d50..6fc6187f84c 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -7,11 +7,11 @@ coverage: flags: mobile threshold: 40% target: 10% - # protocol: - # paths: "packages/protocol/" - # flags: protocol - # threshold: 5% - # target: 90% + protocol: + paths: "packages/protocol/" + flags: protocol + threshold: 5% + target: 90% patch: default: off @@ -19,6 +19,6 @@ flags: mobile: paths: - packages/mobile/ - # protocol: - # paths: - # - packages/protocol/ + protocol: + paths: + - packages/protocol/ diff --git a/.env b/.env index 792ba5a140a..a30459b5804 100644 --- a/.env +++ b/.env @@ -3,6 +3,8 @@ ENV_TYPE="development" GETH_VERBOSITY=1 +VM_BASED=false + KUBERNETES_CLUSTER_NAME="celo-networks-dev" KUBERNETES_CLUSTER_ZONE="us-west1-a" CLUSTER_DOMAIN_NAME="celo-networks-dev" @@ -33,12 +35,13 @@ GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261" # Genesis Vars NETWORK_ID=1101 CONSENSUS_TYPE="istanbul" -PREDEPLOYED_CONTRACTS="REGISTRY" BLOCK_TIME=1 EPOCH=30000 # "og" -> our original 4 validators, "${n}" -> for deriving n validators from the MNEMONIC VALIDATORS="3" STATIC_IPS_FOR_GETH_NODES=false +# Whether tx_nodes/validators stateful set should use ssd persistent disks +GETH_NODES_SSD_DISKS=true GETHTX1_NODE_ID="1182aa8c9dbb96cd1aa71b74e2b6b481085971e08b210bab3b64c39d54876d4b1370f3f2c3cc3c0f52806a0e5772aa3fe937b4ceda8b97c5bf647a34170555e4" GETHTX2_NODE_ID="b1d8deee4e5f4faf9b7e8e7fbd5e19545632d9023ff10de55e2e7a37464c52d1d6fb3ac8cb011757558b37309b83d915de19ef86eb27fe13209cc02d0098ee1f" diff --git a/.env.alfajores b/.env.alfajores index 7a5aebe1c18..f51bf246c03 100644 --- a/.env.alfajores +++ b/.env.alfajores @@ -2,6 +2,8 @@ ENV_TYPE="production" GETH_VERBOSITY=2 +VM_BASED=false + KUBERNETES_CLUSTER_NAME="alfajores" KUBERNETES_CLUSTER_ZONE="us-west1-a" CLUSTER_DOMAIN_NAME="celo-testnet" @@ -37,7 +39,6 @@ GETH_EXPORTER_DOCKER_IMAGE_TAG="6df683de7ae30d3fbca384abb14599d0e8130d35" # Genesis Vars NETWORK_ID=44782 CONSENSUS_TYPE="istanbul" -PREDEPLOYED_CONTRACTS="REGISTRY" BLOCK_TIME=5 EPOCH=720 // 1 hour @@ -46,6 +47,8 @@ EPOCH=720 // 1 hour VALIDATORS=70 TX_NODES=10 STATIC_IPS_FOR_GETH_NODES=true +# Whether tx_nodes/validators stateful set should use ssd persistent disks +GETH_NODES_SSD_DISKS=true ADMIN_RPC_ENABLED=false @@ -56,7 +59,7 @@ CLUSTER_CREATION_FLAGS="--enable-autoscaling --min-nodes 3 --max-nodes 8 --machi GETH_NODE_CPU_REQUEST=400m -GETH_NODE_MEMORY_REQUEST=2.5G +GETH_NODE_MEMORY_REQUEST=4.5G VERIFICATION_POOL_URL="https://us-central1-celo-testnet-production.cloudfunctions.net/handleVerificationRequestalfajores/v0.1/sms/" VERIFICATION_REWARDS_URL="https://us-central1-celo-testnet-production.cloudfunctions.net/handleVerificationRequestalfajores/v0.1/rewards/" diff --git a/.env.alfajoresstaging b/.env.alfajoresstaging index c8c7e963e39..60ba8e9e7dd 100644 --- a/.env.alfajoresstaging +++ b/.env.alfajoresstaging @@ -4,6 +4,8 @@ ENV_TYPE="staging" GETH_VERBOSITY=2 +VM_BASED=false + KUBERNETES_CLUSTER_NAME="alfajoresstaging" KUBERNETES_CLUSTER_ZONE="us-west1-a" CLUSTER_DOMAIN_NAME="celo-testnet" @@ -41,7 +43,6 @@ GETH_EXPORTER_DOCKER_IMAGE_TAG="6df683de7ae30d3fbca384abb14599d0e8130d35" # Genesis Vars NETWORK_ID=1101 CONSENSUS_TYPE="istanbul" -PREDEPLOYED_CONTRACTS="REGISTRY" BLOCK_TIME=5 # Minimum epoch length is 1 day EPOCH=17280 @@ -51,6 +52,8 @@ EPOCH=17280 VALIDATORS=70 TX_NODES=10 STATIC_IPS_FOR_GETH_NODES=true +# Whether tx_nodes/validators stateful set should use ssd persistent disks +GETH_NODES_SSD_DISKS=true ADMIN_RPC_ENABLED=false diff --git a/.env.integration b/.env.integration index b9431655867..5c0c8339dc0 100644 --- a/.env.integration +++ b/.env.integration @@ -20,15 +20,15 @@ BLOCKSCOUT_SUBNETWORK_NAME="Integration" GETH_NODE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-testnet/geth" # When upgrading change this to latest commit hash from the master of the geth repo # `geth $ git show | head -n 1` -GETH_NODE_DOCKER_IMAGE_TAG="f68c6301cad91196867f06c701e6b4aa30838939" +GETH_NODE_DOCKER_IMAGE_TAG="7a12221e9c7ca5a9f6a7904b0325d4ee275041bc" GETH_BOOTNODE_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/geth-all" # When upgrading change this to latest commit hash from the master of the geth repo # `geth $ git show | head -n 1` -GETH_BOOTNODE_DOCKER_IMAGE_TAG="f68c6301cad91196867f06c701e6b4aa30838939" +GETH_BOOTNODE_DOCKER_IMAGE_TAG="7a12221e9c7ca5a9f6a7904b0325d4ee275041bc" CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo" -CELOTOOL_DOCKER_IMAGE_TAG="celotool-0f47f85d07a177bd9b6e81987bc95e35d5056531" +CELOTOOL_DOCKER_IMAGE_TAG="celotool-dfdc3e8b26e98aa294b27e2b5621c184488a10db" TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo" TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_TAG="transaction-metrics-exporter-d3d165a7db548d175cd703c86c20c1657c04368d" @@ -39,7 +39,6 @@ GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261" # Genesis Vars NETWORK_ID=1101 CONSENSUS_TYPE="istanbul" -PREDEPLOYED_CONTRACTS="REGISTRY" BLOCK_TIME=3 EPOCH=1000 @@ -48,6 +47,8 @@ EPOCH=1000 VALIDATORS=20 TX_NODES=2 STATIC_IPS_FOR_GETH_NODES=false +# Whether tx_nodes/validators stateful set should use ssd persistent disks +GETH_NODES_SSD_DISKS=true ADMIN_RPC_ENABLED=false diff --git a/.env.integrationtesting b/.env.integrationtesting index 0b7f3e1a6a1..0cabeca074e 100644 --- a/.env.integrationtesting +++ b/.env.integrationtesting @@ -3,6 +3,8 @@ ENV_TYPE="integrationtesting" GETH_VERBOSITY=4 +VM_BASED=false + KUBERNETES_CLUSTER_NAME="integration" KUBERNETES_CLUSTER_ZONE="us-west1-a" CLUSTER_DOMAIN_NAME="celo-testnet" @@ -30,7 +32,6 @@ GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261" # Genesis Vars NETWORK_ID=1101 CONSENSUS_TYPE="istanbul" -PREDEPLOYED_CONTRACTS="REGISTRY" BLOCK_TIME=5 # "og" -> our original 4 tx nodes, "${n}" -> for deriving n tx nodes from the MNEMONIC diff --git a/.env.pilot b/.env.pilot index 1840dc214a9..b266b8cfcc4 100644 --- a/.env.pilot +++ b/.env.pilot @@ -2,6 +2,8 @@ ENV_TYPE="production" GETH_VERBOSITY=2 +VM_BASED=false + KUBERNETES_CLUSTER_NAME="pilot" KUBERNETES_CLUSTER_ZONE="us-west1-a" CLUSTER_DOMAIN_NAME="celo-testnet" @@ -18,15 +20,15 @@ BLOCKSCOUT_SUBNETWORK_NAME="Pilot" GETH_NODE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-testnet/geth" # When upgrading change this to latest commit hash from the master of the geth repo # `geth $ git show | head -n 1` -GETH_NODE_DOCKER_IMAGE_TAG="58a4453c22504e3367a4d95177320acda4c5b061" +GETH_NODE_DOCKER_IMAGE_TAG="f68c6301cad91196867f06c701e6b4aa30838939" GETH_BOOTNODE_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/geth-all" # When upgrading change this to latest commit hash from the master of the geth repo # `geth $ git show | head -n 1` -GETH_BOOTNODE_DOCKER_IMAGE_TAG="58a4453c22504e3367a4d95177320acda4c5b061" +GETH_BOOTNODE_DOCKER_IMAGE_TAG="f68c6301cad91196867f06c701e6b4aa30838939" CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo" -CELOTOOL_DOCKER_IMAGE_TAG="celotool-2616309a839a30e53faecfafb9b68ab51a5fcdcf" +CELOTOOL_DOCKER_IMAGE_TAG="celotool-2a96d35273ba2f8db80ba529a05c614171c24491" TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo" TRANSACTION_METRICS_EXPORTER_DOCKER_IMAGE_TAG="transaction-metrics-exporter-2616309a839a30e53faecfafb9b68ab51a5fcdcf" @@ -37,7 +39,6 @@ GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261" # Genesis Vars NETWORK_ID=1101 CONSENSUS_TYPE="istanbul" -PREDEPLOYED_CONTRACTS="REGISTRY" BLOCK_TIME=5 EPOCH=17280 // Minimum epoch length is 1 day @@ -46,6 +47,8 @@ EPOCH=17280 // Minimum epoch length is 1 day VALIDATORS=10 TX_NODES=2 STATIC_IPS_FOR_GETH_NODES=false +# Whether tx_nodes/validators stateful set should use ssd persistent disks +GETH_NODES_SSD_DISKS=true ADMIN_RPC_ENABLED=false @@ -75,4 +78,4 @@ PROMTOSD_EXPORT_INTERVAL="5m" AUCTION_CRON_SPEC="*/5 * * * *" -SMS_RETRIEVER_HASH_CODE=l5k6LvdPDXS +SMS_RETRIEVER_HASH_CODE=1SlgTw9pFW5 diff --git a/.env.pilotstaging b/.env.pilotstaging index 1dfc70a0a33..de9da167373 100644 --- a/.env.pilotstaging +++ b/.env.pilotstaging @@ -2,6 +2,8 @@ ENV_TYPE="staging" GETH_VERBOSITY=2 +VM_BASED=false + KUBERNETES_CLUSTER_NAME="pilotstaging" KUBERNETES_CLUSTER_ZONE="us-west1-a" CLUSTER_DOMAIN_NAME="celo-testnet" @@ -12,21 +14,21 @@ BLOCKSCOUT_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/blockscout" BLOCKSCOUT_WEB_DOCKER_IMAGE_TAG="web-f6c3e0888d1d0ef72dc8bf870808702b7fd13730" BLOCKSCOUT_INDEXER_DOCKER_IMAGE_TAG="indexer-f6c3e0888d1d0ef72dc8bf870808702b7fd13730" BLOCKSCOUT_WEB_REPLICAS=3 -BLOCKSCOUT_DB_SUFFIX="3" +BLOCKSCOUT_DB_SUFFIX="5" BLOCKSCOUT_SUBNETWORK_NAME="Pilot Staging" GETH_NODE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-testnet/geth" # When upgrading change this to latest commit hash from the master of the geth repo # `geth $ git show | head -n 1` -GETH_NODE_DOCKER_IMAGE_TAG="58a4453c22504e3367a4d95177320acda4c5b061" +GETH_NODE_DOCKER_IMAGE_TAG="f68c6301cad91196867f06c701e6b4aa30838939" GETH_BOOTNODE_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/geth-all" # When upgrading change this to latest commit hash from the master of the geth repo # `geth $ git show | head -n 1` -GETH_BOOTNODE_DOCKER_IMAGE_TAG="58a4453c22504e3367a4d95177320acda4c5b061" +GETH_BOOTNODE_DOCKER_IMAGE_TAG="f68c6301cad91196867f06c701e6b4aa30838939" CELOTOOL_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet/celo-monorepo" -CELOTOOL_DOCKER_IMAGE_TAG="celotool-2616309a839a30e53faecfafb9b68ab51a5fcdcf" +CELOTOOL_DOCKER_IMAGE_TAG="celotool-2a96d35273ba2f8db80ba529a05c614171c24491" GETH_EXPORTER_DOCKER_IMAGE_REPOSITORY="gcr.io/celo-testnet-production/geth-exporter" GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261" @@ -34,7 +36,6 @@ GETH_EXPORTER_DOCKER_IMAGE_TAG="ed7d21bd50592709173368cd697ef73c1774a261" # Genesis Vars NETWORK_ID=1101 CONSENSUS_TYPE="istanbul" -PREDEPLOYED_CONTRACTS="REGISTRY" BLOCK_TIME=5 EPOCH=17280 // Minimum epoch length is 1 day @@ -43,6 +44,8 @@ EPOCH=17280 // Minimum epoch length is 1 day VALIDATORS=10 TX_NODES=2 STATIC_IPS_FOR_GETH_NODES=false +# Whether tx_nodes/validators stateful set should use ssd persistent disks +GETH_NODES_SSD_DISKS=true ADMIN_RPC_ENABLED=false @@ -72,4 +75,4 @@ PROMTOSD_EXPORT_INTERVAL="5m" AUCTION_CRON_SPEC="*/5 * * * *" -SMS_RETRIEVER_HASH_CODE=l5k6LvdPDXS +SMS_RETRIEVER_HASH_CODE=1SlgTw9pFW5 diff --git a/README-dev.md b/README-dev.md new file mode 100644 index 00000000000..d490a2c06d6 --- /dev/null +++ b/README-dev.md @@ -0,0 +1,71 @@ +# README GUIDE FOR CELO DEVELOPERS + +## How to publish a new npm package + +First checkout the alfajores branch. + +``` +celo-monorepo $ git checkout alfajores +celo-monorepo $ yarn +``` + +Before publishing a new celocli package, test in isolation using Docker. This confirms that it is locally installable and does not have implict dependency on rest of the celo-monorepo or have an implicit dependency which is an explicit dependency of another celo-monorepo package. + +``` +# To test utils package, change $PWD/packages/cli to $PWD/packages/utils +# To test contractkit package, change $PWD/packages/contractkit to $PWD/packages/contractkit +celo-monorepo $ docker run -v $PWD/packages/cli:/tmp/npm_package -it --entrypoint bash node:8 +root@e0d56700584f:/# mkdir /tmp/tmp1 && cd /tmp/tmp1 +root@e0d56700584f:/tmp/tmp1# npm install /tmp/npm_package/ +``` + +After testing, exit the docker container, and publish the package. Do note that all our packages are prefixed with "@celo/" and only members listed [here](https://www.npmjs.com/settings/celo/members) can publish new packages or update the existing ones. + +``` +# Publish the package publicly +celo-monorepo/packages/cli $ yarn publish --access=public +# Increment the version number, after testing, we will push that commit to GitHub +``` + +Let's say the published package version number 0.0.15, verify that it is installable + +``` +/tmp/tmp1 $ npm install @celo/cli@0.0.20 +``` + +Once you publish do some manual tests, for example, after publishing `celocli` + +``` +# Docker for an isolated environment again +celo-monorepo $ docker run -it --entrypoint bash node:8 +root@e0d56700584f:/# mkdir /tmp/tmp1 && cd /tmp/tmp1 +root@e0d56700584f:/tmp/tmp1# npm install @celo/celocli@0.0.20 +/tmp/tmp1# ./node_modules/.bin/celocli +CLI Tool for transacting with the Celo protocol + +VERSION + @celo/celocli/0.0.20 linux-x64 node-v8.16.1 + +USAGE + $ celocli [COMMAND] + +COMMANDS + account Manage your account, send and receive Celo Gold and Celo Dollars + bonds Manage bonded deposits to participate in governance and earn rewards + config Configure CLI options which persist across commands + exchange Commands for interacting with the Exchange + help display help for celocli + node Manage your full node + validator View validator information and register your own + validatorgroup View validator group information and cast votes + +root@f8c51e3c7bc3:/tmp/tmp1# ./node_modules/.bin/celocli account:new +This is not being stored anywhere, so, save the mnemonic somewhere to use this account at a later point + +mnemonic: wall school patrol also peasant enroll build merit health reduce junior obtain awful sword warfare sponsor honey display resemble bubble trend elevator ostrich assist +privateKey: a9531609ca3d1c224e0742a4bb9b9e2fae67cc9d872797869092804e1500d67c +publicKey: 0429b83753806f2b61ddab2e8a139214c3c8a5dfd0557557830b13342f2490bad6f61767e1b0707be51685e5e13683e6fa276333cbdb06f07768a09b8070e27259accountAddress: 0xf63e0F60DFcd84090D2863e0Dfa452B871fdC6d7 +``` + +Now push your changes `git push origin alfajores`. +If you don't have access to the repo, you might have to open a PR. diff --git a/SETUP.md b/SETUP.md index 3221d3db1a2..6277b63c096 100644 --- a/SETUP.md +++ b/SETUP.md @@ -1,5 +1,27 @@ # Celo Engineering Setup +- [Celo Engineering Setup](#celo-engineering-setup) + - [Getting Everything Installed](#getting-everything-installed) + - [MacOS](#macos) + - [XCode](#xcode) + - [Homebrew](#homebrew) + - [Install Node, Yarn and friends](#install-node-yarn-and-friends) + - [Java](#java) + - [Install Android Dev Tools](#install-android-dev-tools) + - [Linux](#linux) + - [Install Node, Yarn and friends](#install-node-yarn-and-friends-1) + - [Installing OpenJDK 8](#installing-openjdk-8) + - [Install Android Dev Tools](#install-android-dev-tools-1) + - [Some common stuff](#some-common-stuff) + - [Optional: Install Rust](#optional-install-rust) + - [Optional: Install an Android Emulator](#optional-install-an-android-emulator) + - [Optional: Genymotion](#optional-genymotion) + - [MacOS](#macos-1) + - [Linux](#linux-1) + - [Building celo-monorepo](#building-celo-monorepo) + - [Using an Android test device locally](#using-an-android-test-device-locally) + - [Deploying the user app](#deploying-the-user-app) + This is a living document! Please edit and update it as part of your onboarding process :-) ## Getting Everything Installed @@ -7,7 +29,9 @@ This is a living document! Please edit and update it as part of your onboarding Follow these steps to get everything that you need installed to develop and build the celo-monorepo codebase. -### XCode +### MacOS + +#### XCode Install XCode and its command line tools: @@ -15,7 +39,7 @@ Install XCode and its command line tools: xcode-select --install ``` -### Homebrew +#### Homebrew Install [Homebrew][homebrew], the best way of managing packages on OSX: @@ -23,7 +47,7 @@ Install [Homebrew][homebrew], the best way of managing packages on OSX: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` -### Install Node, Yarn and friends +#### Install Node, Yarn and friends We use Yarn to build all of the [celo-monorepo] repo. @@ -38,31 +62,7 @@ nvm alias default 8 brew install yarn ``` -### Optional: Install Rust - -We use Rust to build the [bls-zexe](https://github.com/celo-org/bls-zexe) repo, which Geth depends on. If you only use the monorepo, you probably don't need this. - -```bash -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -``` - -Re-login to the system and run: - -```bash -rustup install 1.36.0 -rustup default 1.36.0 -``` - -If you're building Geth for Android, you require an NDK that has a cross-compilation toolchain. You can get it by appropriately defining the relevant environment variables, e.g.: - -```bash -export NDK_VERSION=android-ndk-r19c -export ANDROID_NDK=ndk_bundle/android-ndk-r19c -``` - -and running `make ndk_bundle`. This will download the NDK for your platform. - -### Java +#### Java We need Java to be able to build and run Android to deploy the mobile app to test devices. Android currently only builds correctly with Java 8. (Using @@ -82,7 +82,7 @@ eval "$(jenv init -)" jenv add /Library/Java/JavaVirtualMachines//Contents/Home ``` -### Install Android Dev Tools +#### Install Android Dev Tools Install the Android SDK and platform tools: @@ -106,7 +106,91 @@ Then install the Android 28 platform: sdkmanager 'platforms;android-28' ``` -### (_Optional_) Install an Android Emulator +### Linux + +#### Install Node, Yarn and friends + +We use Yarn to build all of the [celo-monorepo] repo. + +Install `nvm` (allows you to manage multiple versions of Node), Node 8 and `yarn`: + +```bash +# Installing Node +sudo apt-get update +sudo apt-get install nodejs + +# Installing Nvm +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash +source ~/.bashrc + +# Setting up the right version of Nvm +nvm install 8 +nvm alias default 8 + +# Installing Yarn - https://yarnpkg.com/en/docs/install#debian-stable +curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list +sudo apt-get update && sudo apt-get install yarn +``` + +#### Installing OpenJDK 8 + +``` +sudo apt install openjdk-8-jdk +``` + +#### Install Android Dev Tools + +You can download the complete Android Studio and SDK from the [Android Developer download site](https://developer.android.com/studio/#downloads). + +The steps are: + +1. Unpack the .zip file you downloaded to an appropriate location for your applications, such as within `/usr/local/` for your user profile, or `/opt/` for shared users. + + If you're using a 64-bit version of Linux, make sure you first install the [required libraries for 64-bit machines](https://developer.android.com/studio/install#64bit-libs). + +1. To launch Android Studio, open a terminal, navigate to the `android-studio/bin/` directory, and execute `studio.sh`. + +1. Select whether you want to import previous Android Studio settings or not, then click OK. + +1. The Android Studio Setup Wizard guides you through the rest of the setup, which includes downloading Android SDK components that are required for development. + +You can find the complete instructions about how to install the tools in Linux environments in the [Documentation page](https://developer.android.com/studio/install#linux). + +### Some common stuff + +#### Optional: Install Rust + +We use Rust to build the [bls-zexe](https://github.com/celo-org/bls-zexe) repo, which Geth depends on. If you only use the monorepo, you probably don't need this. + +```bash +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +Now lets add Rust to the PATH: + +``` +echo "export PATH=$PATH:~/.cargo/bin/" >> ~/.bashrc +source ~/.bashrc +``` + +With Rust binaries in your PATH you should be able to run: + +```bash +rustup install 1.36.0 +rustup default 1.36.0 +``` + +If you're building Geth for Android, you require an NDK that has a cross-compilation toolchain. You can get it by appropriately defining the relevant environment variables, e.g.: + +```bash +export NDK_VERSION=android-ndk-r19c +export ANDROID_NDK=ndk_bundle/android-ndk-r19c +``` + +and running `make ndk_bundle`. This will download the NDK for your platform. + +#### Optional: Install an Android Emulator Install the Android 28 system image and create an Android Virtual Device: @@ -127,9 +211,11 @@ Run the emulator with: emulator -avd Nexus_5X_API_28 ``` -### Genymotion +#### Optional: Genymotion -Alternatively, you can install Genymotion, a nice emulator manager: +Optionally, as alternative to other emulators you can install Genymotion, a nice emulator manager: + +##### MacOS ```bash brew cask install genymotion @@ -144,6 +230,16 @@ Then make sure the ADB path is set correctly in Genymotion — set `Preferences > ADB > Use custom Android SDK tools` to `/usr/local/share/android-sdk` (same as `$ANDROID_HOME`) +##### Linux + +You can download the Linux version of Genymotion from the [fun zone!](https://www.genymotion.com/fun-zone/) (you need to sign in first). + +After having the binary you only need to run the installer: + +``` +sudo ./genymotion-3.0.2-linux_x64.bin +``` + ### Building celo-monorepo Clone the [celo-monorepo] repo: diff --git a/dockerfiles/cloudbuild/Dockerfile b/dockerfiles/cloudbuild/Dockerfile new file mode 100644 index 00000000000..8c5f1ac8f37 --- /dev/null +++ b/dockerfiles/cloudbuild/Dockerfile @@ -0,0 +1,19 @@ +FROM node:8 + +RUN apt-get update -y +RUN apt-get install lsb-release libudev-dev libusb-dev -y --no-install-recommends apt-utils +RUN npm install -g yarn + +# Install Kubernetes, as per https://kubernetes.io/docs/tasks/tools/install-kubectl/ +RUN apt-get install -y apt-transport-https && \ + curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \ + echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list && \ + apt-get update && \ + apt-get install -y kubectl + +RUN export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \ + echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \ + curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \ + apt-get update -y && apt-get install google-cloud-sdk -y + +CMD ["/bin/sh"] diff --git a/dockerfiles/transaction-metrics-exporter/Dockerfile b/dockerfiles/transaction-metrics-exporter/Dockerfile index c17ead39d0c..20395bcf05a 100644 --- a/dockerfiles/transaction-metrics-exporter/Dockerfile +++ b/dockerfiles/transaction-metrics-exporter/Dockerfile @@ -20,6 +20,7 @@ COPY packages/utils /celo-monorepo/packages/utils COPY packages/typescript /celo-monorepo/packages/typescript COPY packages/walletkit /celo-monorepo/packages/walletkit COPY packages/celotool /celo-monorepo/packages/celotool +COPY packages/verification-pool-api /celo-monorepo/packages/verification-pool-api COPY packages/transaction-metrics-exporter /celo-monorepo/packages/transaction-metrics-exporter WORKDIR /celo-monorepo diff --git a/package.json b/package.json index 62f7f6af7f8..d3199e863a2 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,10 @@ }, "resolutions": { "node-gyp": "5.0.1", - "tar": "4.4.10" + "tar": "4.4.10", + "lodash": "4.17.15", + "**/codecov/**/js-yaml": "^3.13.1", + "**/deep-extend": "^0.5.1", + "**/extend": "^3.0.2" } } diff --git a/packages/blockchain-api/app.int.yaml b/packages/blockchain-api/app.integration.yaml similarity index 100% rename from packages/blockchain-api/app.int.yaml rename to packages/blockchain-api/app.integration.yaml diff --git a/packages/blockchain-api/app.pilot.yaml b/packages/blockchain-api/app.pilot.yaml index 1b7a6a05b00..28e1dbb6d8b 100644 --- a/packages/blockchain-api/app.pilot.yaml +++ b/packages/blockchain-api/app.pilot.yaml @@ -6,8 +6,8 @@ env_variables: EXCHANGE_RATES_API: 'https://api.exchangeratesapi.io' BLOCKSCOUT_API: 'https://pilot-blockscout.celo-testnet.org/api' # Pull addresses from the build artifacts of the network in protocol/build - CELO_GOLD_ADDRESS: '0x0ee512BC806Bd0Ca4C09211D035D2928FC43faA6' - CELO_DOLLAR_ADDRESS: '0xEd9f83788Cad26d5671F9D18520995dB005C03cd' + CELO_GOLD_ADDRESS: '0xa69c3D18a74B3FD5F8aDA748428d0bfF8c5387Fe' + CELO_DOLLAR_ADDRESS: '0x996e24D7791A182f237635018c49E30cdA8FBa5e' FAUCET_ADDRESS: '0x387bCb16Bfcd37AccEcF5c9eB2938E30d3aB8BF2' VERIFICATION_REWARDS_ADDRESS: '0xb4fdaf5f3cd313654aa357299ada901b1d2dd3b5' - ATTESTATIONS_ADDRESS: '0x4C5cEB976901e9794baF239AF942eAD721aB21E0' + ATTESTATIONS_ADDRESS: '0x2cDEc3af5727dF2d490cF6068980E67dc6c19438' diff --git a/packages/blockchain-api/app.pilotstaging.yaml b/packages/blockchain-api/app.pilotstaging.yaml index 1fd7e6f47f2..4d1e85d46f8 100644 --- a/packages/blockchain-api/app.pilotstaging.yaml +++ b/packages/blockchain-api/app.pilotstaging.yaml @@ -6,8 +6,8 @@ env_variables: EXCHANGE_RATES_API: 'https://api.exchangeratesapi.io' BLOCKSCOUT_API: 'https://pilotstaging-blockscout.celo-testnet.org/api' # Pull addresses from the build artifacts of the network in protocol/build - CELO_GOLD_ADDRESS: '0x4Bd6E33F6D8062E3f8F0B8CC43f59832c8f4c875' - CELO_DOLLAR_ADDRESS: '0x70aD391A6EDf249FB09Ac20c6Ceb0443dA0F40dE' + CELO_GOLD_ADDRESS: '0x2c9829C36c9D0802f04C6a06c423e132a3Ae1767' + CELO_DOLLAR_ADDRESS: '0x21C4A2C97eaE0c0E8c630FB3529F7718Fa37eCC1' FAUCET_ADDRESS: '0x545DEBe3030B570731EDab192640804AC8Cf65CA' VERIFICATION_REWARDS_ADDRESS: '0xb4fdaf5f3cd313654aa357299ada901b1d2dd3b5' - ATTESTATIONS_ADDRESS: '0x1b1c81d60d229aB4D9ED2D7ca73c44dFfC89e19A' + ATTESTATIONS_ADDRESS: '0xE3085194DFf8230EBccd5D6C55C59D52Fd9D5b90' diff --git a/packages/blockchain-api/cloudbuild/cloudbuild.yaml b/packages/blockchain-api/cloudbuild/cloudbuild.yaml new file mode 100644 index 00000000000..bed49fb8d24 --- /dev/null +++ b/packages/blockchain-api/cloudbuild/cloudbuild.yaml @@ -0,0 +1,8 @@ +steps: + +# Deploy to app engine using yarn command +- name: "gcr.io/celo-testnet/global/yarn-gcloud" + args: ['yarn', 'deploy', '-n', '$_NETWORK_NAME'] + id: Deploy blockchain api to app engine based on _NETWORK_NAME substitution (integration, production, etc.) + dir: 'packages/blockchain-api' +timeout: "1200s" \ No newline at end of file diff --git a/packages/blockchain-api/deploy.sh b/packages/blockchain-api/deploy.sh new file mode 100755 index 00000000000..e970a899c10 --- /dev/null +++ b/packages/blockchain-api/deploy.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Deploys the blockchain api to App Engine +# +# Flags: +# -n: Name of the network, maps to App Engine 'service' (integration, production, etc.) + +NETWORK="" + +while getopts 'a:n:' flag; do + case "${flag}" in + n) NETWORK="$OPTARG" ;; + *) error "Unexpected option ${flag}" ;; + esac +done + +[ -z "$NETWORK" ] && echo "Need to set the NETWORK via the -n flag" && exit 1; + +echo "Starting blockchain api deployment." + +echo 'Deploying to gcloud' +gcloud --project celo-testnet app deploy -q "app.${NETWORK}.yaml" + +echo 'Hitting service url to trigger update' +# This seems to be necessary to ensure get App Engine starts the service +curl "https://${NETWORK}-dot-celo-testnet.appspot.com" > /dev/null 2>&1 + +echo "Done deployment." diff --git a/packages/blockchain-api/package.json b/packages/blockchain-api/package.json index d543a8ddb0e..cc23914986c 100644 --- a/packages/blockchain-api/package.json +++ b/packages/blockchain-api/package.json @@ -16,7 +16,7 @@ "start:dev": "tsc-watch --onSuccess \"node ./dist/index.js\" ", "build": "tsc -p .", "gcp-build": "npm run build", - "deploy": "gcloud app deploy" + "deploy": "./deploy.sh" }, "dependencies": { "apollo-datasource-rest": "^0.3.1", diff --git a/packages/blockchain-api/src/blockscout.ts b/packages/blockchain-api/src/blockscout.ts index a8d197f2956..383cf12975d 100644 --- a/packages/blockchain-api/src/blockscout.ts +++ b/packages/blockchain-api/src/blockscout.ts @@ -29,7 +29,7 @@ const MODULE_ACTIONS = { }, } -interface BlockscoutTransaction { +export interface BlockscoutTransaction { value: string txreceipt_status: string transactionIndex: string diff --git a/packages/blockchain-api/src/config.ts b/packages/blockchain-api/src/config.ts index a255bd92dba..86494a9664e 100644 --- a/packages/blockchain-api/src/config.ts +++ b/packages/blockchain-api/src/config.ts @@ -3,7 +3,6 @@ import dotenv from 'dotenv' // Load environment variables from .env file dotenv.config() -// TODO(kamyar): import from /packages/mobile/src/geth/currencies.ts export const CONTRACT_SYMBOL_MAPPING: { [key: string]: string } = { // GOLD_CONTRACT_ADDRESS [(process.env.CELO_GOLD_ADDRESS as string).toLowerCase()]: 'Celo Gold', diff --git a/packages/blockchain-api/src/currencyConversion.ts b/packages/blockchain-api/src/currencyConversion.ts index 0bfd2333a02..cadb29fc368 100644 --- a/packages/blockchain-api/src/currencyConversion.ts +++ b/packages/blockchain-api/src/currencyConversion.ts @@ -3,10 +3,6 @@ import { EXCHANGE_RATES_API } from './config' import { CurrencyConversionArgs, ExchangeRate } from './schema' import { formatDateString } from './utils' -// TODO move this caching to FirebaseDb -// Currency code to date string to exchange rate -const exchangeRateCache = new Map>() - interface ExchangeRateApiResult { rates: { [currencyCode: string]: number } base: string @@ -14,6 +10,10 @@ interface ExchangeRateApiResult { } export class CurrencyConversionAPI extends RESTDataSource { + // TODO move this caching to FirebaseDb + // Currency code to date string to exchange rate + exchangeRateCache = new Map>() + constructor() { super() this.baseURL = EXCHANGE_RATES_API @@ -61,16 +61,16 @@ export class CurrencyConversionAPI extends RESTDataSource { private getRateForCurrencyCode(currencyCode: string, date: Date) { return ( - (exchangeRateCache.get(currencyCode) && - exchangeRateCache.get(currencyCode)!.get(date.toDateString())) || + (this.exchangeRateCache.get(currencyCode) && + this.exchangeRateCache.get(currencyCode)!.get(date.toDateString())) || undefined ) } private setRateForCurrencyCode(currencyCode: string, date: Date, rate: number) { - if (!exchangeRateCache.get(currencyCode)) { - exchangeRateCache.set(currencyCode, new Map()) + if (!this.exchangeRateCache.get(currencyCode)) { + this.exchangeRateCache.set(currencyCode, new Map()) } - exchangeRateCache.get(currencyCode)!.set(date.toDateString(), rate) + this.exchangeRateCache.get(currencyCode)!.set(date.toDateString(), rate) } } diff --git a/packages/blockchain-api/src/schema.ts b/packages/blockchain-api/src/schema.ts index 6768645be3d..acde2377164 100644 --- a/packages/blockchain-api/src/schema.ts +++ b/packages/blockchain-api/src/schema.ts @@ -35,16 +35,13 @@ export interface TransferEvent { export type EventInterface = ExchangeEvent | TransferEvent export interface EventArgs { + // Query params as defined by Blockscout's API address: string - sort: string - filterby: string - startblock: number - endblock: number - page: number - offset: number - // TODO(Kamyar): investigate why timestamp filters are not working - starttimestamp: number - endtimestamp: number + sort?: 'asc' | 'desc' + startblock?: number + endblock?: number + page?: number + offset?: number } export interface ExchangeRate { @@ -91,25 +88,19 @@ export const typeDefs = gql` events( address: String! sort: String - filterby: String startblock: Int endblock: Int page: Int offset: Int - starttimestamp: Float - endtimestamp: Float ): [Event] rewards( address: String! sort: String - filterby: String startblock: Int endblock: Int page: Int offset: Int - starttimestamp: Float - endtimestamp: Float ): [Transfer] currencyConversion(currencyCode: String!, timestamp: Float): ExchangeRate diff --git a/packages/blockchain-api/test/blockscout.test.ts b/packages/blockchain-api/test/blockscout.test.ts new file mode 100644 index 00000000000..43848739dc6 --- /dev/null +++ b/packages/blockchain-api/test/blockscout.test.ts @@ -0,0 +1,120 @@ +import { BlockscoutAPI } from '../src/blockscout' +import mockTokenTxs from './mockTokenTxs' + +const mockDataSourceGet = jest.fn(() => mockTokenTxs) + +jest.mock('apollo-datasource-rest', () => { + class MockRESTDataSource { + baseUrl = '' + get = mockDataSourceGet + } + + return { + RESTDataSource: MockRESTDataSource, + } +}) + +jest.mock('../src/config.ts', () => { + return { + ...jest.requireActual('../src/config.ts'), + FAUCET_ADDRESS: '0x0000000000000000000000000000000000f40c37', + ATTESTATIONS_ADDRESS: '0x0000000000000000000000000000000000a77357', + } +}) + +describe('Blockscout', () => { + let blockscoutAPI: BlockscoutAPI + + beforeEach(() => { + blockscoutAPI = new BlockscoutAPI() + mockDataSourceGet.mockClear() + }) + + it('should get feed events and label them properly', async () => { + const result = await blockscoutAPI.getFeedEvents({ + address: '0x0000000000000000000000000000000000007E57', + }) + + // Reversing for convinience to match the order in mock data + const events = result.reverse() + + expect(events).toHaveLength(mockTokenTxs.result.length - 1) + + expect(events[0]).toMatchObject({ + type: 'EXCHANGE', + timestamp: 1566345866, + block: 90637, + inSymbol: 'Celo Gold', + inValue: 10, + outSymbol: 'Celo Dollar', + outValue: 10, + hash: '0x961403536006f9c120c23900f94da59dbf43edf10eb3569b448665483bab77b2', + }) + + expect(events[1]).toMatchObject({ + type: 'SENT', + timestamp: 1566346276, + block: 90719, + value: 0.15, + address: '0x8b7649116f169d2d2aebb6ea1a77f0baf31f2811', + comment: '', + symbol: 'Celo Dollar', + hash: '0x21dd2c18ae6c80d61ffbddaa073f7cde7bbfe9436fdf5059b506f1686326a2fb', + }) + + expect(events[2]).toMatchObject({ + type: 'RECEIVED', + timestamp: 1566479946, + block: 117453, + value: 10, + address: '0xf4314cb9046bece6aa54bb9533155434d0c76909', + comment: '', + symbol: 'Celo Dollar', + hash: '0xe70bf600802bae7a0d42d89d54b8cdb977a8c5a34a239ec73597c7abcab74536', + }) + + expect(events[3]).toMatchObject({ + type: 'SENT', + timestamp: 1566481000, + block: 117451, + value: 1, + address: '0xf4314cb9046bece6aa54bb9533155434d0c76909', + comment: '', + symbol: 'Celo Gold', + hash: '0xc6689ed516e8b114e875d682bbf7ba318ea16841711d97ce473f20da289435be', + }) + + expect(events[4]).toMatchObject({ + type: 'RECEIVED', + timestamp: 1566482000, + block: 117451, + value: 10, + address: '0xf4314cb9046bece6aa54bb9533155434d0c76909', + comment: '', + symbol: 'Celo Gold', + hash: '0xe8fe81f455eb34b672a8d8dd091472f1ae8d4d204817f0bcbb7a13486b9b5605', + }) + + expect(events[5]).toMatchObject({ + type: 'FAUCET', + timestamp: 1566483000, + block: 117451, + value: 5, + address: '0x0000000000000000000000000000000000f40c37', + comment: '', + symbol: 'Celo Gold', + hash: '0xf6856169eb7bf78211babc312028cddf3dad2761799428ab6e4fcf297a27fe09', + }) + + expect(events[6]).toMatchObject({ + type: 'VERIFICATION_FEE', + timestamp: 1566484000, + block: 117451, + value: 0.2, + address: '0x0000000000000000000000000000000000a77357', + comment: '', + symbol: 'Celo Gold', + hash: '0xcc2120e5d050fd68284dc01f6464b2ed8f7358ca80fccb20967af28eb7d79160', + }) + }) +}) diff --git a/packages/blockchain-api/test/currencyConversion.test.ts b/packages/blockchain-api/test/currencyConversion.test.ts new file mode 100644 index 00000000000..63a2f2e571a --- /dev/null +++ b/packages/blockchain-api/test/currencyConversion.test.ts @@ -0,0 +1,44 @@ +import { CurrencyConversionAPI } from '../src/currencyConversion' + +const mockDataSourceGet = jest.fn(() => ({ + rates: { + MXN: 20, + }, + base: 'USD', + date: '2019-09-04', +})) + +jest.mock('apollo-datasource-rest', () => { + class MockRESTDataSource { + baseUrl = '' + get = mockDataSourceGet + } + + return { + RESTDataSource: MockRESTDataSource, + } +}) + +describe('Currency Conversion', () => { + let currencyConversionAPI: CurrencyConversionAPI + + beforeEach(() => { + currencyConversionAPI = new CurrencyConversionAPI() + mockDataSourceGet.mockClear() + }) + + it('should retrieve exchange rates for given currency', async () => { + const result = await currencyConversionAPI.getExchangeRate({ currencyCode: 'MXN' }) + expect(result).toMatchObject({ rate: 20 }) + expect(mockDataSourceGet).toHaveBeenCalledTimes(1) + }) + + it('should retrieve exchange rates from cache', async () => { + const result1 = await currencyConversionAPI.getExchangeRate({ currencyCode: 'MXN' }) + expect(result1).toMatchObject({ rate: 20 }) + expect(mockDataSourceGet).toHaveBeenCalledTimes(1) + const result2 = await currencyConversionAPI.getExchangeRate({ currencyCode: 'MXN' }) + expect(result2).toMatchObject({ rate: 20 }) + expect(mockDataSourceGet).toHaveBeenCalledTimes(1) + }) +}) diff --git a/packages/blockchain-api/test/mockTokenTxs.ts b/packages/blockchain-api/test/mockTokenTxs.ts new file mode 100644 index 00000000000..f5bafba1d1b --- /dev/null +++ b/packages/blockchain-api/test/mockTokenTxs.ts @@ -0,0 +1,198 @@ +const mockTokenTxs = { + status: '1', + // indexes 0 and 1 are an exchange tx gold to dollars + // index 2 is an outgoing dollars tx + // index 3 is an incoming dolars tx + // index 4 in an outgoing gold tx + // index 5 in an incoming gold tx + // index 6 in an incoming faucet + // index 7 is an outgoing verification fee + result: [ + // Exchange outgoing + { + value: '10000000000000000000', + transactionIndex: '0', + tokenSymbol: 'cGLD', + tokenName: 'Celo Gold', + tokenDecimal: '18', + to: '0xe167029b1a56c6cba74c35c472e9db3c9e2402ff', + timeStamp: '1566345866', + nonce: '223', + input: + '0xa9059cbb000000000000000000000000e167029b1a56c6cba74c35c472e9db3c9e2402ff0000000000000000000000000000000000000000000000008ac7230489e80000', + hash: '0x961403536006f9c120c23900f94da59dbf43edf10eb3569b448665483bab77b2', + gasUsed: '67154', + gasPrice: '100000000000', + gas: '6700000', + from: '0x0000000000000000000000000000000000007E57', + cumulativeGasUsed: '67154', + contractAddress: '0x1313e2f3ebef8f0d869eeceb796d55a066eea863', + confirmations: '269650', + blockNumber: '90637', + blockHash: '0x9ca0ae7f9496660c849069e05f8f429048bc185d7578f6315f07c0e68ad0b330', + }, + // Exchange incoming + { + value: '10000000000000000000', + transactionIndex: '0', + tokenSymbol: 'cUSD', + tokenName: 'Celo Dollar', + tokenDecimal: '18', + to: '0x0000000000000000000000000000000000007E57', + timeStamp: '1566345876', + nonce: '224', + input: + '0xa9059cbb000000000000000000000000e167029b1a56c6cba74c35c472e9db3c9e2402ff0000000000000000000000000000000000000000000000008ac7230489e80000', + hash: '0x961403536006f9c120c23900f94da59dbf43edf10eb3569b448665483bab77b2', + gasUsed: '55740', + gasPrice: '100000000000', + gas: '6700000', + from: '0xf4314cb9046bece6aa54bb9533155434d0c76909', + cumulativeGasUsed: '55740', + contractAddress: '0x2df4dd6bd1b26a8503f763506bdb8e7cf165f69e', + confirmations: '269648', + blockNumber: '90639', + blockHash: '0x6cec0caf59b0441812cb6a7eb7eeadae1721bf5cc3beeaa993e2bfd8a570bb22', + }, + // Dollars sent + { + value: '150000000000000000', + transactionIndex: '1', + tokenSymbol: 'cUSD', + tokenName: 'Celo Dollar', + tokenDecimal: '18', + to: '0x8b7649116f169d2d2aebb6ea1a77f0baf31f2811', + timeStamp: '1566346276', + nonce: '1', + input: + '0xd02e0f0c681ea8bf469fe300315d8caf1f9c22002c1f516a8b329cfcc9288e3518104f4300000000000000000000000000000000000000000000000000000000000000030000000000000000000000002df4dd6bd1b26a8503f763506bdb8e7cf165f69e', + hash: '0x21dd2c18ae6c80d61ffbddaa073f7cde7bbfe9436fdf5059b506f1686326a2fb', + gasUsed: '1604760', + gasPrice: '200', + gas: '7000000', + from: '0x0000000000000000000000000000000000007E57', + cumulativeGasUsed: '1788432', + contractAddress: '0x2df4dd6bd1b26a8503f763506bdb8e7cf165f69e', + confirmations: '269568', + blockNumber: '90719', + blockHash: '0x9418a662ed1f4a33297500a2a14af01c6bbd7aeb88eb80324d7fbd7d41a9236f', + }, + // Dollars received + { + value: '10000000000000000000', + transactionIndex: '0', + tokenSymbol: 'cUSD', + tokenName: 'Celo Dollar', + tokenDecimal: '18', + to: '0x0000000000000000000000000000000000007E57', + timeStamp: '1566479946', + nonce: '234', + input: + '0xa9059cbb000000000000000000000000e167029b1a56c6cba74c35c472e9db3c9e2402ff0000000000000000000000000000000000000000000000008ac7230489e80000', + hash: '0xe70bf600802bae7a0d42d89d54b8cdb977a8c5a34a239ec73597c7abcab74536', + gasUsed: '40740', + gasPrice: '100000000000', + gas: '6700000', + from: '0xf4314cb9046bece6aa54bb9533155434d0c76909', + cumulativeGasUsed: '40740', + contractAddress: '0x2df4dd6bd1b26a8503f763506bdb8e7cf165f69e', + confirmations: '242834', + blockNumber: '117453', + blockHash: '0x995bfb34d28ead83fed889bc46fc18ec3e82bb7172ef5d5bf78a5086fd715e41', + }, + // Gold sent + { + value: '1000000000000000000', + transactionIndex: '0', + tokenSymbol: 'cGLD', + tokenName: 'Celo Gold', + tokenDecimal: '18', + to: '0xf4314cb9046bece6aa54bb9533155434d0c76909', + timeStamp: '1566481000', + nonce: '233', + input: + '0xa9059cbb000000000000000000000000e167029b1a56c6cba74c35c472e9db3c9e2402ff0000000000000000000000000000000000000000000000008ac7230489e80000', + hash: '0xc6689ed516e8b114e875d682bbf7ba318ea16841711d97ce473f20da289435be', + gasUsed: '67154', + gasPrice: '100000000000', + gas: '6700000', + from: '0x0000000000000000000000000000000000007E57', + cumulativeGasUsed: '67154', + contractAddress: '0x1313e2f3ebef8f0d869eeceb796d55a066eea863', + confirmations: '242836', + blockNumber: '117451', + blockHash: '0xcfffc293e190c74490b6c5a3ea831e7020c4380d7a5330716b9eb6e0db1df95d', + }, + // Gold received + { + value: '10000000000000000000', + transactionIndex: '0', + tokenSymbol: 'cGLD', + tokenName: 'Celo Gold', + tokenDecimal: '18', + to: '0x0000000000000000000000000000000000007E57', + timeStamp: '1566482000', + nonce: '234', + input: + '0xa9059cbb000000000000000000000000e167029b1a56c6cba74c35c472e9db3c9e2402ff0000000000000000000000000000000000000000000000008ac7230489e80000', + hash: '0xe8fe81f455eb34b672a8d8dd091472f1ae8d4d204817f0bcbb7a13486b9b5605', + gasUsed: '67154', + gasPrice: '100000000000', + gas: '6700000', + from: '0xf4314cb9046bece6aa54bb9533155434d0c76909', + cumulativeGasUsed: '67154', + contractAddress: '0x1313e2f3ebef8f0d869eeceb796d55a066eea863', + confirmations: '242836', + blockNumber: '117451', + blockHash: '0xcfffc293e190c74490b6c5a3ea831e7020c4380d7a5330716b9eb6e0db1df95d', + }, + // Faucet received + { + value: '5000000000000000000', + transactionIndex: '0', + tokenSymbol: 'cGLD', + tokenName: 'Celo Gold', + tokenDecimal: '18', + to: '0x0000000000000000000000000000000000007E57', + timeStamp: '1566483000', + nonce: '233', + input: + '0xa9059cbb000000000000000000000000e167029b1a56c6cba74c35c472e9db3c9e2402ff0000000000000000000000000000000000000000000000008ac7230489e80000', + hash: '0xf6856169eb7bf78211babc312028cddf3dad2761799428ab6e4fcf297a27fe09', + gasUsed: '67154', + gasPrice: '100000000000', + gas: '6700000', + from: '0x0000000000000000000000000000000000f40c37', + cumulativeGasUsed: '67154', + contractAddress: '0x1313e2f3ebef8f0d869eeceb796d55a066eea863', + confirmations: '242836', + blockNumber: '117451', + blockHash: '0xcfffc293e190c74490b6c5a3ea831e7020c4380d7a5330716b9eb6e0db1df95d', + }, + // Verification fee sent + { + value: '200000000000000000', + transactionIndex: '0', + tokenSymbol: 'cUSD', + tokenName: 'Celo Dollar', + tokenDecimal: '18', + to: '0x0000000000000000000000000000000000a77357', + timeStamp: '1566484000', + nonce: '233', + input: + '0xa9059cbb000000000000000000000000e167029b1a56c6cba74c35c472e9db3c9e2402ff0000000000000000000000000000000000000000000000008ac7230489e80000', + hash: '0xcc2120e5d050fd68284dc01f6464b2ed8f7358ca80fccb20967af28eb7d79160', + gasUsed: '67154', + gasPrice: '100000000000', + gas: '6700000', + from: '0x0000000000000000000000000000000000007E57', + cumulativeGasUsed: '67154', + contractAddress: '0x1313e2f3ebef8f0d869eeceb796d55a066eea863', + confirmations: '242836', + blockNumber: '117451', + blockHash: '0xcfffc293e190c74490b6c5a3ea831e7020c4380d7a5330716b9eb6e0db1df95d', + }, + ], + message: 'OK', +} +export default mockTokenTxs diff --git a/packages/celotool/.gitignore b/packages/celotool/.gitignore index d36977dc476..2c6ebdeb5ea 100644 --- a/packages/celotool/.gitignore +++ b/packages/celotool/.gitignore @@ -1 +1,2 @@ +/lib/ .tmp diff --git a/packages/celotool/ci_test_governance.sh b/packages/celotool/ci_test_governance.sh index dffc640c385..39c193ea9f3 100755 --- a/packages/celotool/ci_test_governance.sh +++ b/packages/celotool/ci_test_governance.sh @@ -12,9 +12,9 @@ if [ "${1}" == "checkout" ]; then # Test master by default. BRANCH_TO_TEST=${2:-"master"} echo "Checking out geth at branch ${BRANCH_TO_TEST}..." - ../../node_modules/.bin/mocha -r ts-node/register geth_tests/governance_tests.ts --branch ${BRANCH_TO_TEST} + ../../node_modules/.bin/mocha -r ts-node/register src/e2e-tests/governance_tests.ts --branch ${BRANCH_TO_TEST} elif [ "${1}" == "local" ]; then export GETH_DIR="${2}" echo "Testing using local geth dir ${GETH_DIR}..." - ../../node_modules/.bin/mocha -r ts-node/register geth_tests/governance_tests.ts --localgeth ${GETH_DIR} + ../../node_modules/.bin/mocha -r ts-node/register src/e2e-tests/governance_tests.ts --localgeth ${GETH_DIR} fi diff --git a/packages/celotool/ci_test_sync.sh b/packages/celotool/ci_test_sync.sh index 69735bb491c..c26482d3a86 100755 --- a/packages/celotool/ci_test_sync.sh +++ b/packages/celotool/ci_test_sync.sh @@ -12,9 +12,9 @@ if [ "${1}" == "checkout" ]; then # Test master by default. BRANCH_TO_TEST=${2:-"master"} echo "Checking out geth at branch ${BRANCH_TO_TEST}..." - ../../node_modules/.bin/mocha -r ts-node/register geth_tests/sync_tests.ts --branch ${BRANCH_TO_TEST} + ../../node_modules/.bin/mocha -r ts-node/register src/e2e-tests/sync_tests.ts --branch ${BRANCH_TO_TEST} elif [ "${1}" == "local" ]; then export GETH_DIR="${2}" echo "Testing using local geth dir ${GETH_DIR}..." - ../../node_modules/.bin/mocha -r ts-node/register geth_tests/sync_tests.ts --localgeth ${GETH_DIR} + ../../node_modules/.bin/mocha -r ts-node/register src/e2e-tests/sync_tests.ts --localgeth ${GETH_DIR} fi diff --git a/packages/celotool/ci_test_sync_with_network.sh b/packages/celotool/ci_test_sync_with_network.sh index bbde160ce34..ac7e8f6ac1d 100755 --- a/packages/celotool/ci_test_sync_with_network.sh +++ b/packages/celotool/ci_test_sync_with_network.sh @@ -38,7 +38,7 @@ test_ultralight_sync () { # Get the epoch size by sourcing this file source ${CELO_MONOREPO_DIR}/.env.${NETWORK_NAME} # Verify what happened by reading the logs. - ${CELO_MONOREPO_DIR}/node_modules/.bin/mocha -r ts-node/register ${CELO_MONOREPO_DIR}/packages/celotool/geth_tests/verify_ultralight_geth_logs.ts --gethlogfile ${GETH_LOG_FILE} --epoch ${EPOCH} + ${CELO_MONOREPO_DIR}/node_modules/.bin/mocha -r ts-node/register ${CELO_MONOREPO_DIR}/packages/celotool/src/e2e-tests/verify_ultralight_geth_logs.ts --gethlogfile ${GETH_LOG_FILE} --epoch ${EPOCH} } # Some code in celotool requires this file to contain the MNEMONOIC. diff --git a/packages/celotool/ci_test_transfers.sh b/packages/celotool/ci_test_transfers.sh index 97130e0b4ff..b1726aea74b 100755 --- a/packages/celotool/ci_test_transfers.sh +++ b/packages/celotool/ci_test_transfers.sh @@ -12,9 +12,9 @@ if [ "${1}" == "checkout" ]; then # Test master by default. BRANCH_TO_TEST=${2:-"master"} echo "Checking out geth at branch ${BRANCH_TO_TEST}..." - ../../node_modules/.bin/mocha -r ts-node/register geth_tests/transfer_tests.ts --branch ${BRANCH_TO_TEST} + ../../node_modules/.bin/mocha -r ts-node/register src/e2e-tests/transfer_tests.ts --branch ${BRANCH_TO_TEST} elif [ "${1}" == "local" ]; then export GETH_DIR="${2}" echo "Testing using local geth dir ${GETH_DIR}..." - ../../node_modules/.bin/mocha -r ts-node/register geth_tests/transfer_tests.ts --localgeth ${GETH_DIR} + ../../node_modules/.bin/mocha -r ts-node/register src/e2e-tests/transfer_tests.ts --localgeth ${GETH_DIR} fi diff --git a/packages/celotool/cloudbuild.yaml b/packages/celotool/cloudbuild.yaml new file mode 100644 index 00000000000..8dad1f34cd3 --- /dev/null +++ b/packages/celotool/cloudbuild.yaml @@ -0,0 +1,16 @@ +steps: + +# Unshallow clone +- name: gcr.io/cloud-builders/git + args: ['fetch', '--unshallow'] + +# build docker image for google container registry +- name: gcr.io/kaniko-project/executor:latest + args: [ + "--dockerfile=dockerfiles/monorepo/Dockerfile.celotool", + "--cache=true", + "--destination=gcr.io/$PROJECT_ID/celo-monorepo:celotool-$COMMIT_SHA" + ] + id: Build celotool docker image + waitFor: ['-'] +timeout: 1000s \ No newline at end of file diff --git a/packages/celotool/geth_tests/constants.sh b/packages/celotool/geth_tests/constants.sh deleted file mode 100755 index 4de6a941a6a..00000000000 --- a/packages/celotool/geth_tests/constants.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -echo "Setting constants..." -# For now, the script assumes that it runs from a sub-dir of sub-dir of monorepo directory. -CELO_MONOREPO_DIR="${PWD}/../.." - -DATA_DIR="/tmp/tmp2" -export GENESIS_FILE_PATH="/tmp/genesis_ibft_1.json" - -export gethBinary="${GETH_DIR}/build/bin/geth --datadir=${DATA_DIR}" - -# There is a ".env.integrationtesting" file in the root of celo-monorepo which defines the config -# of this network. -export NETWORK_NAME="integrationtesting" -SYNCMODE="full" - -# Taken from .env.integrationtesting -mnemonic="jazz ripple brown cloth door bridge pen danger deer thumb cable prepare negative library vast" -CELOTOOLJS="${CELO_MONOREPO_DIR}/packages/celotool/bin/celotooljs.sh" -# Miner's address -ACCOUNT_0_PRIVATE_KEY=$(${CELOTOOLJS} generate bip32 --accountType validator --index 0 --mnemonic "${mnemonic}") -export ACCOUNT_0="$(${CELOTOOLJS} generate account-address --private-key ${ACCOUNT_0_PRIVATE_KEY})" - -ACCOUNT_1_PRIVATE_KEY=$(${CELOTOOLJS} generate bip32 --accountType validator --index 1 --mnemonic "${mnemonic}") -export ACCOUNT_1="$(${CELOTOOLJS} generate account-address --private-key ${ACCOUNT_1_PRIVATE_KEY})" - -echo "Account 0 private key is ${ACCOUNT_0_PRIVATE_KEY}" -echo "Account 1 private key is ${ACCOUNT_1_PRIVATE_KEY}" -echo "Account 0 is ${ACCOUNT_0}" -echo "Account 1 is ${ACCOUNT_1}" - -# A random account -export ACCOUNT_2="0x047439e30c3b771f5fba75be293c91d32c306a8b" -export GAS_PRICE=999 - -# Now override the variable CELOTOOLJS and add more variables to it. -export CELOTOOLJS="${CELO_MONOREPO_DIR}/packages/celotool/bin/celotooljs.sh \ ---celo-env=${NETWORK_NAME} \ ---geth-dir=${GETH_DIR} \ ---data-dir=${DATA_DIR} \ ---sync-mode=${SYNCMODE} \ ---mining=true \ ---minerGasPrice=${GAS_PRICE} \ ---miner-address=${ACCOUNT_0} \ ---genesis=${GENESIS_FILE_PATH} \ ---nodekeyhex=${ACCOUNT_0_PRIVATE_KEY}" # Without explict node key, transactions will fail with "unauthorized address" error -echo "Finished setting constants" diff --git a/packages/celotool/geth_tests/useless_static-nodes.json b/packages/celotool/geth_tests/useless_static-nodes.json deleted file mode 100644 index 08dd11ba9f0..00000000000 --- a/packages/celotool/geth_tests/useless_static-nodes.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "enode://1182aa8c9dbb96cd1aa71b74e2b6b481085971e08b210bab3b64c39d54876d4b1370f3f2c3cc3c0f52806a0e5772aa3fe937b4ceda8b97c5bf647a34170555e4@35.227.157.31:30303" -] diff --git a/packages/celotool/package.json b/packages/celotool/package.json index f8a1b185302..ea032a2765b 100644 --- a/packages/celotool/package.json +++ b/packages/celotool/package.json @@ -6,6 +6,8 @@ "author": "Celo", "license": "Apache-2.0", "dependencies": { + "@celo/verification-pool-api": "^1.0.0", + "@celo/utils": "^0.0.6-beta5", "@celo/walletkit": "^0.0.14", "@google-cloud/monitoring": "0.7.1", "@google-cloud/pubsub": "^0.28.1", @@ -19,7 +21,7 @@ "buffer-reverse": "^1.0.1", "dotenv": "6.1.0", "ecurve": "^1.0.6", - "js-yaml": "^3.12.0", + "js-yaml": "^3.13.1", "keccak256": "^1.0.0", "lodash": "^4.17.14", "moment": "^2.22.1", @@ -35,12 +37,16 @@ "@types/node-fetch": "^2.1.2", "@types/prompts": "^1.1.1", "@types/web3": "^1.0.18", - "@types/yargs": "^13.0.2" + "@types/yargs": "^13.0.2", + "@types/mocha": "^5.2.1", + "@types/chai": "^4.1.3", + "chai": "^4.1.2", + "mocha": "^5.1.1" }, "scripts": { "cli": "TS_NODE_FILES=true ts-node -r tsconfig-paths/register src/cli.ts", "lint": "tslint -c tslint.json --project tsconfig.json", - "build": "tsc -p tsconfig.json " + "build": "tsc -b ." }, "private": true } diff --git a/packages/celotool/src/cmds/account.ts b/packages/celotool/src/cmds/account.ts index 0da9fcdac5b..355f35aa48a 100644 --- a/packages/celotool/src/cmds/account.ts +++ b/packages/celotool/src/cmds/account.ts @@ -1,4 +1,4 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import * as yargs from 'yargs' export const command = 'account ' diff --git a/packages/celotool/src/cmds/account/faucet-multiple-helper.ts b/packages/celotool/src/cmds/account/faucet-multiple-helper.ts index 7ec404f4466..c4bf9f83b29 100644 --- a/packages/celotool/src/cmds/account/faucet-multiple-helper.ts +++ b/packages/celotool/src/cmds/account/faucet-multiple-helper.ts @@ -1,6 +1,6 @@ // TODO: make this work with new contracts -import { CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' +import { CeloEnvArgv } from 'src/lib/env-utils' export const command = 'faucet-multiple-helper' diff --git a/packages/celotool/src/cmds/account/faucet-multiple.ts b/packages/celotool/src/cmds/account/faucet-multiple.ts index a6082e1301a..5de378187c2 100644 --- a/packages/celotool/src/cmds/account/faucet-multiple.ts +++ b/packages/celotool/src/cmds/account/faucet-multiple.ts @@ -1,7 +1,7 @@ /* tslint:disable no-console */ -import { CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' import { spawnSync } from 'child_process' import path from 'path' +import { CeloEnvArgv } from 'src/lib/env-utils' export const command = 'faucet-multiple' diff --git a/packages/celotool/src/cmds/account/faucet.ts b/packages/celotool/src/cmds/account/faucet.ts index 5d592740e6b..f8ad60c59ae 100644 --- a/packages/celotool/src/cmds/account/faucet.ts +++ b/packages/celotool/src/cmds/account/faucet.ts @@ -1,9 +1,9 @@ -import { AccountArgv } from '@celo/celotool/src/cmds/account' -import { downloadArtifacts } from '@celo/celotool/src/lib/artifacts' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' -import { execCmd, validateAccountAddress } from '@celo/celotool/src/lib/utils' +import { downloadArtifacts } from 'src/lib/artifacts' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { portForwardAnd } from 'src/lib/port_forward' +import { execCmd, validateAccountAddress } from 'src/lib/utils' import * as yargs from 'yargs' +import { AccountArgv } from '../account' export const command = 'faucet' diff --git a/packages/celotool/src/cmds/account/invite.ts b/packages/celotool/src/cmds/account/invite.ts index ba4ab1dd04d..4bc20ea2dc5 100644 --- a/packages/celotool/src/cmds/account/invite.ts +++ b/packages/celotool/src/cmds/account/invite.ts @@ -1,10 +1,10 @@ /* tslint:disable no-console */ -import { AccountArgv } from '@celo/celotool/src/cmds/account' -import { downloadArtifacts } from '@celo/celotool/src/lib/artifacts' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' -import { execCmd } from '@celo/celotool/src/lib/utils' +import { downloadArtifacts } from 'src/lib/artifacts' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { portForwardAnd } from 'src/lib/port_forward' +import { execCmd } from 'src/lib/utils' import { Argv } from 'yargs' +import { AccountArgv } from '../account' export const command = 'invite' diff --git a/packages/celotool/src/cmds/account/list.ts b/packages/celotool/src/cmds/account/list.ts index 6c36d7414b4..470ca54e7a2 100644 --- a/packages/celotool/src/cmds/account/list.ts +++ b/packages/celotool/src/cmds/account/list.ts @@ -1,9 +1,9 @@ /* tslint:disable no-console */ -import { AccountArgv } from '@celo/celotool/src/cmds/account' -import { switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' import fetch from 'node-fetch' +import { switchToClusterFromEnv } from 'src/lib/cluster' import { getBlockscoutUrl } from 'src/lib/endpoints' import { Argv } from 'yargs' +import { AccountArgv } from '../account' export const command = 'list' export const describe = 'Command for listing users' diff --git a/packages/celotool/src/cmds/account/lookup.ts b/packages/celotool/src/cmds/account/lookup.ts index 01c68cf7a91..5b139dfb0e4 100644 --- a/packages/celotool/src/cmds/account/lookup.ts +++ b/packages/celotool/src/cmds/account/lookup.ts @@ -1,11 +1,11 @@ /* tslint:disable no-console */ -import { AccountArgv } from '@celo/celotool/src/cmds/account' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' import { PhoneNumberUtils } from '@celo/utils' // @ts-ignore import { Attestations, lookupPhoneNumbers } from '@celo/walletkit' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { portForwardAnd } from 'src/lib/port_forward' import { Argv } from 'yargs' +import { AccountArgv } from '../account' const Web3 = require('web3') diff --git a/packages/celotool/src/cmds/account/revoke.ts b/packages/celotool/src/cmds/account/revoke.ts index a28ec1a7bbd..815dcb1516a 100644 --- a/packages/celotool/src/cmds/account/revoke.ts +++ b/packages/celotool/src/cmds/account/revoke.ts @@ -1,9 +1,9 @@ -import { AccountArgv } from '@celo/celotool/src/cmds/account' -import { downloadArtifacts } from '@celo/celotool/src/lib/artifacts' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' -import { execCmd } from '@celo/celotool/src/lib/utils' +import { downloadArtifacts } from 'src/lib/artifacts' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { portForwardAnd } from 'src/lib/port_forward' +import { execCmd } from 'src/lib/utils' import * as yargs from 'yargs' +import { AccountArgv } from '../account' export const command = 'revoke' export const describe = 'command for revoking verification of a phone number' diff --git a/packages/celotool/src/cmds/account/verify.ts b/packages/celotool/src/cmds/account/verify.ts index 5064d60ed60..ab2d36d09f3 100644 --- a/packages/celotool/src/cmds/account/verify.ts +++ b/packages/celotool/src/cmds/account/verify.ts @@ -1,5 +1,3 @@ -import { AccountArgv } from '@celo/celotool/src/cmds/account' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' import { PhoneNumberUtils } from '@celo/utils' import { ActionableAttestation, @@ -22,8 +20,10 @@ import { Attestations as AttestationsType } from '@celo/walletkit/lib/types/Atte import { StableToken as StableTokenType } from '@celo/walletkit/lib/types/StableToken' import prompts from 'prompts' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { portForwardAnd } from 'src/lib/port_forward' import { sendTransaction } from 'src/lib/transactions' import * as yargs from 'yargs' +import { AccountArgv } from '../account' const Web3 = require('web3') diff --git a/packages/celotool/src/cmds/account/weekly_faucet.ts b/packages/celotool/src/cmds/account/weekly_faucet.ts index 0a84b940292..fa04ec537ef 100644 --- a/packages/celotool/src/cmds/account/weekly_faucet.ts +++ b/packages/celotool/src/cmds/account/weekly_faucet.ts @@ -1,11 +1,11 @@ /* tslint:disable no-console */ -import { AccountArgv } from '@celo/celotool/src/cmds/account' -import { downloadArtifacts } from '@celo/celotool/src/lib/artifacts' -import { getBlockchainApiUrl } from '@celo/celotool/src/lib/endpoints' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' -import { execCmd } from '@celo/celotool/src/lib/utils' +import { downloadArtifacts } from 'src/lib/artifacts' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { getBlockchainApiUrl } from 'src/lib/endpoints' +import { portForwardAnd } from 'src/lib/port_forward' +import { execCmd } from 'src/lib/utils' import * as yargs from 'yargs' +import { AccountArgv } from '../account' export const command = 'weekly-faucet' diff --git a/packages/celotool/src/cmds/backup.ts b/packages/celotool/src/cmds/backup.ts index d4d30d51dda..5f5d72f6dfc 100644 --- a/packages/celotool/src/cmds/backup.ts +++ b/packages/celotool/src/cmds/backup.ts @@ -1,6 +1,6 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' -import { execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' +import { execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' export const command = 'backup' diff --git a/packages/celotool/src/cmds/contract_addresses.ts b/packages/celotool/src/cmds/contract_addresses.ts index 326a1315841..f06a849e8a3 100644 --- a/packages/celotool/src/cmds/contract_addresses.ts +++ b/packages/celotool/src/cmds/contract_addresses.ts @@ -1,6 +1,6 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' import * as fs from 'fs' import { CONTRACTS_TO_COPY, downloadArtifacts, getContractAddresses } from 'src/lib/artifacts' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import * as yargs from 'yargs' export const command = 'contract-addresses' diff --git a/packages/celotool/src/cmds/copy_contract_artifacts.ts b/packages/celotool/src/cmds/copy_contract_artifacts.ts index 40556123562..ecd7fcc561e 100644 --- a/packages/celotool/src/cmds/copy_contract_artifacts.ts +++ b/packages/celotool/src/cmds/copy_contract_artifacts.ts @@ -1,5 +1,5 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' import { CONTRACTS_TO_COPY, copyContractArtifacts, downloadArtifacts } from 'src/lib/artifacts' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import * as yargs from 'yargs' export const command = 'copy-contract-artifacts' diff --git a/packages/celotool/src/cmds/copy_policies.ts b/packages/celotool/src/cmds/copy_policies.ts index 5bca6c47ee8..71ef05ddd28 100644 --- a/packages/celotool/src/cmds/copy_policies.ts +++ b/packages/celotool/src/cmds/copy_policies.ts @@ -1,16 +1,12 @@ +import { switchToClusterFromEnv } from 'src/lib/cluster' import { addCeloEnvMiddleware, CeloEnvArgv, envVar, fetchEnv, validateAndSwitchToEnv, -} from '@celo/celotool/src/lib/env-utils' -import { - deleteOtherPolicies, - downloadPolicies, - uploadPolicies, -} from '@celo/celotool/src/lib/policies' -import { switchToClusterFromEnv } from 'src/lib/cluster' +} from 'src/lib/env-utils' +import { deleteOtherPolicies, downloadPolicies, uploadPolicies } from 'src/lib/policies' import * as yargs from 'yargs' export const command = 'copy-policies' diff --git a/packages/celotool/src/cmds/deploy.ts b/packages/celotool/src/cmds/deploy.ts index 8ddbc1bf0fe..dc110aa1909 100644 --- a/packages/celotool/src/cmds/deploy.ts +++ b/packages/celotool/src/cmds/deploy.ts @@ -1,4 +1,4 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import * as yargs from 'yargs' export const command = 'deploy ' diff --git a/packages/celotool/src/cmds/deploy/destroy.ts b/packages/celotool/src/cmds/deploy/destroy.ts index 1fa379c3206..535583a82cb 100644 --- a/packages/celotool/src/cmds/deploy/destroy.ts +++ b/packages/celotool/src/cmds/deploy/destroy.ts @@ -1,5 +1,5 @@ -import { DeployArgv } from '@celo/celotool/src/cmds/deploy' import * as yargs from 'yargs' +import { DeployArgv } from '../deploy' export const command = 'destroy ' export const describe = 'destroy an existing deploy' diff --git a/packages/celotool/src/cmds/deploy/destroy/blockscout.ts b/packages/celotool/src/cmds/deploy/destroy/blockscout.ts index ab71d5a3071..dc0cd9b0e7e 100644 --- a/packages/celotool/src/cmds/deploy/destroy/blockscout.ts +++ b/packages/celotool/src/cmds/deploy/destroy/blockscout.ts @@ -1,8 +1,8 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' -import { fetchEnvOrFallback } from '@celo/celotool/src/lib/env-utils' import { removeHelmRelease } from 'src/lib/blockscout' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { fetchEnvOrFallback } from 'src/lib/env-utils' import { deleteCloudSQLInstance } from 'src/lib/helm_deploy' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'blockscout' export const describe = 'upgrade an existing deploy of the blockscout package' diff --git a/packages/celotool/src/cmds/deploy/destroy/chaoskube.ts b/packages/celotool/src/cmds/deploy/destroy/chaoskube.ts index b18168495f6..071d9db09a1 100644 --- a/packages/celotool/src/cmds/deploy/destroy/chaoskube.ts +++ b/packages/celotool/src/cmds/deploy/destroy/chaoskube.ts @@ -1,7 +1,7 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' import { helmReleaseName } from 'src/lib/chaoskube' import { switchToClusterFromEnv } from 'src/lib/cluster' import { removeGenericHelmChart } from 'src/lib/helm_deploy' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'chaoskube' diff --git a/packages/celotool/src/cmds/deploy/destroy/cluster.ts b/packages/celotool/src/cmds/deploy/destroy/cluster.ts index 0c995846f5d..6f99cdf72c0 100644 --- a/packages/celotool/src/cmds/deploy/destroy/cluster.ts +++ b/packages/celotool/src/cmds/deploy/destroy/cluster.ts @@ -1,7 +1,7 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' -import { EnvTypes, envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' import { printReleases } from 'src/cmds/deploy/list' import { deleteCluster, getNonSystemHelmReleases, switchToClusterFromEnv } from 'src/lib/cluster' +import { EnvTypes, envVar, fetchEnv } from 'src/lib/env-utils' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'cluster' diff --git a/packages/celotool/src/cmds/deploy/destroy/ethstats.ts b/packages/celotool/src/cmds/deploy/destroy/ethstats.ts index af452eb963d..89119c488bc 100644 --- a/packages/celotool/src/cmds/deploy/destroy/ethstats.ts +++ b/packages/celotool/src/cmds/deploy/destroy/ethstats.ts @@ -1,6 +1,6 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' -import { createClusterIfNotExists, switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' -import { removeHelmRelease } from '@celo/celotool/src/lib/ethstats' +import { createClusterIfNotExists, switchToClusterFromEnv } from 'src/lib/cluster' +import { removeHelmRelease } from 'src/lib/ethstats' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'ethstats' diff --git a/packages/celotool/src/cmds/deploy/destroy/load-test.ts b/packages/celotool/src/cmds/deploy/destroy/load-test.ts index c6e01d37994..861b6efc733 100644 --- a/packages/celotool/src/cmds/deploy/destroy/load-test.ts +++ b/packages/celotool/src/cmds/deploy/destroy/load-test.ts @@ -1,6 +1,6 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' -import { switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' +import { switchToClusterFromEnv } from 'src/lib/cluster' import { removeHelmRelease } from 'src/lib/load-test' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'load-test' diff --git a/packages/celotool/src/cmds/deploy/destroy/pumba.ts b/packages/celotool/src/cmds/deploy/destroy/pumba.ts index aa06a0ae867..af19ac8e144 100644 --- a/packages/celotool/src/cmds/deploy/destroy/pumba.ts +++ b/packages/celotool/src/cmds/deploy/destroy/pumba.ts @@ -1,7 +1,7 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' import { switchToClusterFromEnv } from 'src/lib/cluster' import { removeGenericHelmChart } from 'src/lib/helm_deploy' import { helmReleaseName } from 'src/lib/pumba' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'pumba' diff --git a/packages/celotool/src/cmds/deploy/destroy/testnet.ts b/packages/celotool/src/cmds/deploy/destroy/testnet.ts index 4c2d32d7235..c86725ee2b4 100644 --- a/packages/celotool/src/cmds/deploy/destroy/testnet.ts +++ b/packages/celotool/src/cmds/deploy/destroy/testnet.ts @@ -1,6 +1,6 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' import { switchToClusterFromEnv } from 'src/lib/cluster' import { deleteFromCluster, deleteStaticIPs } from 'src/lib/helm_deploy' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'testnet' export const describe = 'destroy an existing deploy of the testnet package' diff --git a/packages/celotool/src/cmds/deploy/destroy/tracer-tool.ts b/packages/celotool/src/cmds/deploy/destroy/tracer-tool.ts index 0395d67ec63..67f4d858e3c 100644 --- a/packages/celotool/src/cmds/deploy/destroy/tracer-tool.ts +++ b/packages/celotool/src/cmds/deploy/destroy/tracer-tool.ts @@ -1,6 +1,6 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' -import { switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' +import { switchToClusterFromEnv } from 'src/lib/cluster' import { removeHelmRelease } from 'src/lib/tracer-tool' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'tracer-tool' diff --git a/packages/celotool/src/cmds/deploy/destroy/transaction-metrics-exporter.ts b/packages/celotool/src/cmds/deploy/destroy/transaction-metrics-exporter.ts index 115d33deb0f..064b02c92b3 100644 --- a/packages/celotool/src/cmds/deploy/destroy/transaction-metrics-exporter.ts +++ b/packages/celotool/src/cmds/deploy/destroy/transaction-metrics-exporter.ts @@ -1,6 +1,6 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' -import { switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' +import { switchToClusterFromEnv } from 'src/lib/cluster' import { removeHelmRelease } from 'src/lib/transaction-metrics-exporter' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'transaction-metrics-exporter' diff --git a/packages/celotool/src/cmds/deploy/destroy/verification-pool.ts b/packages/celotool/src/cmds/deploy/destroy/verification-pool.ts index c43402191bd..909ec92344f 100644 --- a/packages/celotool/src/cmds/deploy/destroy/verification-pool.ts +++ b/packages/celotool/src/cmds/deploy/destroy/verification-pool.ts @@ -1,6 +1,6 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' -import { envVar, fetchEnvOrFallback } from '@celo/celotool/src/lib/env-utils' import * as deployUtil from '@celo/verification-pool-api/deployment/deployment-utils' +import { envVar, fetchEnvOrFallback } from 'src/lib/env-utils' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'verification-pool' export const describe = 'Delete an existing deploy of the verification pool package' diff --git a/packages/celotool/src/cmds/deploy/destroy/vm-testnet.ts b/packages/celotool/src/cmds/deploy/destroy/vm-testnet.ts index a420c9aae29..32f0a7102a1 100644 --- a/packages/celotool/src/cmds/deploy/destroy/vm-testnet.ts +++ b/packages/celotool/src/cmds/deploy/destroy/vm-testnet.ts @@ -1,5 +1,5 @@ -import { DestroyArgv } from '@celo/celotool/src/cmds/deploy/destroy' -import { destroy } from '@celo/celotool/src/lib/vm-testnet-utils' +import { destroy } from 'src/lib/vm-testnet-utils' +import { DestroyArgv } from '../../deploy/destroy' export const command = 'vm-testnet' export const describe = 'destroy an existing VM-based testnet' diff --git a/packages/celotool/src/cmds/deploy/initial.ts b/packages/celotool/src/cmds/deploy/initial.ts index 0942f53f6a9..93b657c04fc 100644 --- a/packages/celotool/src/cmds/deploy/initial.ts +++ b/packages/celotool/src/cmds/deploy/initial.ts @@ -1,5 +1,5 @@ -import { DeployArgv } from '@celo/celotool/src/cmds/deploy' import * as yargs from 'yargs' +import { DeployArgv } from '../deploy' export const command = 'initial ' export const describe = 'create the initial deploy of a package in the monorepo' diff --git a/packages/celotool/src/cmds/deploy/initial/blockchain-api.ts b/packages/celotool/src/cmds/deploy/initial/blockchain-api.ts index 506c9afe87e..f005c29f05d 100644 --- a/packages/celotool/src/cmds/deploy/initial/blockchain-api.ts +++ b/packages/celotool/src/cmds/deploy/initial/blockchain-api.ts @@ -1,8 +1,8 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' -import { execCmd } from '@celo/celotool/src/lib/utils' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { envVar, fetchEnv } from 'src/lib/env-utils' +import { execCmd } from 'src/lib/utils' import * as yargs from 'yargs' +import { InitialArgv } from '../../deploy/initial' export const command = 'blockchain-api' export const describe = 'command for upgrading blockchain-api' diff --git a/packages/celotool/src/cmds/deploy/initial/blockscout.ts b/packages/celotool/src/cmds/deploy/initial/blockscout.ts index 0eac51a7169..4156e961be5 100644 --- a/packages/celotool/src/cmds/deploy/initial/blockscout.ts +++ b/packages/celotool/src/cmds/deploy/initial/blockscout.ts @@ -1,7 +1,6 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { fetchEnvOrFallback } from '@celo/celotool/src/lib/env-utils' import { installHelmChart } from 'src/lib/blockscout' import { createClusterIfNotExists, setupCluster, switchToClusterFromEnv } from 'src/lib/cluster' +import { fetchEnvOrFallback } from 'src/lib/env-utils' import { createAndUploadCloudSQLSecretIfNotExists, createCloudSQLInstance, @@ -10,6 +9,7 @@ import { grantRoles, } from 'src/lib/helm_deploy' import yargs from 'yargs' +import { InitialArgv } from '../../deploy/initial' export const command = 'blockscout' diff --git a/packages/celotool/src/cmds/deploy/initial/chaoskube.ts b/packages/celotool/src/cmds/deploy/initial/chaoskube.ts index a070466b96d..63f55172687 100644 --- a/packages/celotool/src/cmds/deploy/initial/chaoskube.ts +++ b/packages/celotool/src/cmds/deploy/initial/chaoskube.ts @@ -1,7 +1,7 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' import { helmChartDir, helmParameters, helmReleaseName } from 'src/lib/chaoskube' import { switchToClusterFromEnv } from 'src/lib/cluster' import { installGenericHelmChart } from 'src/lib/helm_deploy' +import { InitialArgv } from '../../deploy/initial' export const command = 'chaoskube' diff --git a/packages/celotool/src/cmds/deploy/initial/contracts.ts b/packages/celotool/src/cmds/deploy/initial/contracts.ts index e40a011198d..885374a2164 100644 --- a/packages/celotool/src/cmds/deploy/initial/contracts.ts +++ b/packages/celotool/src/cmds/deploy/initial/contracts.ts @@ -1,17 +1,18 @@ /* tslint:disable no-console */ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { uploadArtifacts } from '@celo/celotool/src/lib/artifacts' -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' -import { ensure0x, execCmd } from '@celo/celotool/src/lib/utils' +import { uploadArtifacts } from 'src/lib/artifacts' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { envVar, fetchEnv } from 'src/lib/env-utils' import { AccountType, generatePrivateKey, + getAddressesFor, getPrivateKeysFor, privateKeyToAddress, } from 'src/lib/generate_utils' import { OG_ACCOUNTS } from 'src/lib/genesis_constants' +import { portForwardAnd } from 'src/lib/port_forward' +import { ensure0x, execCmd } from 'src/lib/utils' +import { InitialArgv } from '../../deploy/initial' export const command = 'contracts' @@ -46,10 +47,25 @@ export const handler = async (argv: InitialArgv) => { console.log(`Deploying smart contracts to ${argv.celoEnv}`) const cb = async () => { + const mnemonic = fetchEnv(envVar.MNEMONIC) + + const migrationOverrides = JSON.stringify({ + validators: { + validatorKeys: getValidatorKeys(), + }, + stableToken: { + initialAccounts: getAddressesFor(AccountType.FAUCET, mnemonic, 2), + }, + }) + + const truffleOverrides = JSON.stringify({ + from: minerForEnv(), + }) + await execCmd( `yarn --cwd ../protocol run init-network -n ${ argv.celoEnv - } -c '{ "from" : "${minerForEnv()}" }' -k ${getValidatorKeys()}` + } -c '${truffleOverrides}' -m '${migrationOverrides}'` ) } diff --git a/packages/celotool/src/cmds/deploy/initial/ethstats.ts b/packages/celotool/src/cmds/deploy/initial/ethstats.ts index 13dbf024d14..5d376cbc383 100644 --- a/packages/celotool/src/cmds/deploy/initial/ethstats.ts +++ b/packages/celotool/src/cmds/deploy/initial/ethstats.ts @@ -1,11 +1,7 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { - createClusterIfNotExists, - setupCluster, - switchToClusterFromEnv, -} from '@celo/celotool/src/lib/cluster' -import { installHelmChart } from '@celo/celotool/src/lib/ethstats' +import { createClusterIfNotExists, setupCluster, switchToClusterFromEnv } from 'src/lib/cluster' +import { installHelmChart } from 'src/lib/ethstats' import yargs from 'yargs' +import { InitialArgv } from '../../deploy/initial' export const command = 'ethstats' diff --git a/packages/celotool/src/cmds/deploy/initial/load-test.ts b/packages/celotool/src/cmds/deploy/initial/load-test.ts index b00a60ce93a..0501090633c 100644 --- a/packages/celotool/src/cmds/deploy/initial/load-test.ts +++ b/packages/celotool/src/cmds/deploy/initial/load-test.ts @@ -1,8 +1,8 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { fetchEnv } from '@celo/celotool/src/lib/env-utils' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { fetchEnv } from 'src/lib/env-utils' import { installHelmChart } from 'src/lib/load-test' import * as yargs from 'yargs' +import { InitialArgv } from '../../deploy/initial' export const command = 'load-test' diff --git a/packages/celotool/src/cmds/deploy/initial/notification-service.ts b/packages/celotool/src/cmds/deploy/initial/notification-service.ts index 25307288b06..86575e8df81 100644 --- a/packages/celotool/src/cmds/deploy/initial/notification-service.ts +++ b/packages/celotool/src/cmds/deploy/initial/notification-service.ts @@ -1,5 +1,5 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { execCmd } from '@celo/celotool/src/lib/utils' +import { execCmd } from 'src/lib/utils' +import { InitialArgv } from '../../deploy/initial' export const command = 'notification-service' export const describe = 'command for deploying notification-service' diff --git a/packages/celotool/src/cmds/deploy/initial/pumba.ts b/packages/celotool/src/cmds/deploy/initial/pumba.ts index e165405a050..42c23676484 100644 --- a/packages/celotool/src/cmds/deploy/initial/pumba.ts +++ b/packages/celotool/src/cmds/deploy/initial/pumba.ts @@ -1,7 +1,7 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' import { switchToClusterFromEnv } from 'src/lib/cluster' import { installGenericHelmChart } from 'src/lib/helm_deploy' import { helmChartDir, helmParameters, helmReleaseName } from 'src/lib/pumba' +import { InitialArgv } from '../../deploy/initial' export const command = 'pumba' diff --git a/packages/celotool/src/cmds/deploy/initial/testnet.ts b/packages/celotool/src/cmds/deploy/initial/testnet.ts index 1e6f03f30e6..5d24c1517cb 100644 --- a/packages/celotool/src/cmds/deploy/initial/testnet.ts +++ b/packages/celotool/src/cmds/deploy/initial/testnet.ts @@ -1,4 +1,3 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' import { createClusterIfNotExists, setupCluster, switchToClusterFromEnv } from 'src/lib/cluster' import { createStaticIPs, installHelmChart, pollForBootnodeLoadBalancer } from 'src/lib/helm_deploy' import { @@ -6,6 +5,7 @@ import { uploadStaticNodesToGoogleStorage, } from 'src/lib/testnet-utils' import yargs from 'yargs' +import { InitialArgv } from '../../deploy/initial' export const command = 'testnet' diff --git a/packages/celotool/src/cmds/deploy/initial/tracer-tool.ts b/packages/celotool/src/cmds/deploy/initial/tracer-tool.ts index 00377a64710..55ee2cefa48 100644 --- a/packages/celotool/src/cmds/deploy/initial/tracer-tool.ts +++ b/packages/celotool/src/cmds/deploy/initial/tracer-tool.ts @@ -1,8 +1,8 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' import { switchToClusterFromEnv } from 'src/lib/cluster' import { installHelmChart } from 'src/lib/tracer-tool' +import { execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' +import { InitialArgv } from '../../deploy/initial' export const command = 'tracer-tool' diff --git a/packages/celotool/src/cmds/deploy/initial/transaction-metrics-exporter.ts b/packages/celotool/src/cmds/deploy/initial/transaction-metrics-exporter.ts index 2ba1c536762..04129497d5e 100644 --- a/packages/celotool/src/cmds/deploy/initial/transaction-metrics-exporter.ts +++ b/packages/celotool/src/cmds/deploy/initial/transaction-metrics-exporter.ts @@ -1,6 +1,6 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' +import { switchToClusterFromEnv } from 'src/lib/cluster' import { installHelmChart } from 'src/lib/transaction-metrics-exporter' +import { InitialArgv } from '../../deploy/initial' export const command = 'transaction-metrics-exporter' diff --git a/packages/celotool/src/cmds/deploy/initial/verification-pool.ts b/packages/celotool/src/cmds/deploy/initial/verification-pool.ts index c6a1ad5dad6..5bcb59907a7 100644 --- a/packages/celotool/src/cmds/deploy/initial/verification-pool.ts +++ b/packages/celotool/src/cmds/deploy/initial/verification-pool.ts @@ -1,7 +1,7 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { envVar, fetchEnvOrFallback } from '@celo/celotool/src/lib/env-utils' import * as deployUtil from '@celo/verification-pool-api/deployment/deployment-utils' +import { envVar, fetchEnvOrFallback } from 'src/lib/env-utils' import { getVerificationPoolConfig } from 'src/lib/utils' +import { InitialArgv } from '../../deploy/initial' export const command = 'verification-pool' export const describe = 'Intialize a new deploy of the verification pool package' diff --git a/packages/celotool/src/cmds/deploy/initial/vm-testnet.ts b/packages/celotool/src/cmds/deploy/initial/vm-testnet.ts index 6052a51a2c2..8c1eda4eb68 100644 --- a/packages/celotool/src/cmds/deploy/initial/vm-testnet.ts +++ b/packages/celotool/src/cmds/deploy/initial/vm-testnet.ts @@ -1,5 +1,5 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' -import { deploy } from '@celo/celotool/src/lib/vm-testnet-utils' +import { deploy } from '../../../lib/vm-testnet-utils' +import { InitialArgv } from '../../deploy/initial' export const command = 'vm-testnet' export const describe = 'upgrade a testnet on a VM' diff --git a/packages/celotool/src/cmds/deploy/list.ts b/packages/celotool/src/cmds/deploy/list.ts index 443ca8dee39..1ad6b96000d 100644 --- a/packages/celotool/src/cmds/deploy/list.ts +++ b/packages/celotool/src/cmds/deploy/list.ts @@ -1,4 +1,3 @@ -import { DeployArgv } from '@celo/celotool/src/cmds/deploy' import { forEach, groupBy } from 'lodash' import { getNonSystemHelmReleases, @@ -6,6 +5,7 @@ import { HelmRelease, switchToClusterFromEnv, } from 'src/lib/cluster' +import { DeployArgv } from '../deploy' export const command = 'list' diff --git a/packages/celotool/src/cmds/deploy/migrate.ts b/packages/celotool/src/cmds/deploy/migrate.ts index 3252ea50575..7e2df568e47 100644 --- a/packages/celotool/src/cmds/deploy/migrate.ts +++ b/packages/celotool/src/cmds/deploy/migrate.ts @@ -1,5 +1,5 @@ -import { DeployArgv } from '@celo/celotool/src/cmds/deploy' import * as yargs from 'yargs' +import { DeployArgv } from '../deploy' export const command = 'migrate ' export const describe = 'migrate an existing deploy' diff --git a/packages/celotool/src/cmds/deploy/migrate/blockscout.ts b/packages/celotool/src/cmds/deploy/migrate/blockscout.ts index 6c474fdfd9e..b4a5f42cd68 100644 --- a/packages/celotool/src/cmds/deploy/migrate/blockscout.ts +++ b/packages/celotool/src/cmds/deploy/migrate/blockscout.ts @@ -1,8 +1,8 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { fetchEnvOrFallback } from '@celo/celotool/src/lib/env-utils' import { installHelmChart } from 'src/lib/blockscout' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { fetchEnvOrFallback } from 'src/lib/env-utils' import { retrieveCloudSQLConnectionInfo, upgradeHelmChart } from 'src/lib/helm_deploy' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'blockscout' export const describe = 'migrate an existing deploy to the blockscout package' diff --git a/packages/celotool/src/cmds/deploy/upgrade.ts b/packages/celotool/src/cmds/deploy/upgrade.ts index 15cd8a0e8db..d2069f21b35 100644 --- a/packages/celotool/src/cmds/deploy/upgrade.ts +++ b/packages/celotool/src/cmds/deploy/upgrade.ts @@ -1,5 +1,5 @@ -import { DeployArgv } from '@celo/celotool/src/cmds/deploy' import * as yargs from 'yargs' +import { DeployArgv } from '../deploy' export const command = 'upgrade ' export const describe = 'upgrade an existing deploy' diff --git a/packages/celotool/src/cmds/deploy/upgrade/blockchain-api.ts b/packages/celotool/src/cmds/deploy/upgrade/blockchain-api.ts index 7a9da1d8b0e..bdbbfd7705e 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/blockchain-api.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/blockchain-api.ts @@ -1,8 +1,8 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' -import { execCmd } from '@celo/celotool/src/lib/utils' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { envVar, fetchEnv } from 'src/lib/env-utils' +import { execCmd } from 'src/lib/utils' import * as yargs from 'yargs' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'blockchain-api' export const describe = 'command for upgrading blockchain-api' diff --git a/packages/celotool/src/cmds/deploy/upgrade/blockscout.ts b/packages/celotool/src/cmds/deploy/upgrade/blockscout.ts index d80e94f3f43..fa1ffaae37b 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/blockscout.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/blockscout.ts @@ -1,11 +1,11 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { fetchEnvOrFallback } from '@celo/celotool/src/lib/env-utils' import sleep from 'sleep-promise' import { installHelmChart, removeHelmRelease, upgradeHelmChart } from 'src/lib/blockscout' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { fetchEnvOrFallback } from 'src/lib/env-utils' import { resetCloudSQLInstance, retrieveCloudSQLConnectionInfo } from 'src/lib/helm_deploy' import { execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'blockscout' export const describe = 'upgrade an existing deploy of the blockscout package' diff --git a/packages/celotool/src/cmds/deploy/upgrade/chaoskube.ts b/packages/celotool/src/cmds/deploy/upgrade/chaoskube.ts index 1c6aaa810ac..ad8a242ec5c 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/chaoskube.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/chaoskube.ts @@ -1,7 +1,7 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' import { helmChartDir, helmParameters, helmReleaseName } from 'src/lib/chaoskube' import { switchToClusterFromEnv } from 'src/lib/cluster' import { upgradeGenericHelmChart } from 'src/lib/helm_deploy' +import { InitialArgv } from '../../deploy/initial' export const command = 'chaoskube' diff --git a/packages/celotool/src/cmds/deploy/upgrade/contracts.ts b/packages/celotool/src/cmds/deploy/upgrade/contracts.ts index 653f55c918a..ca633eff4e1 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/contracts.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/contracts.ts @@ -1,8 +1,8 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { downloadArtifacts, uploadArtifacts } from '@celo/celotool/src/lib/artifacts' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' -import { execCmd } from '@celo/celotool/src/lib/utils' +import { downloadArtifacts, uploadArtifacts } from 'src/lib/artifacts' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { portForwardAnd } from 'src/lib/port_forward' +import { execCmd } from 'src/lib/utils' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'contracts' diff --git a/packages/celotool/src/cmds/deploy/upgrade/ethstats.ts b/packages/celotool/src/cmds/deploy/upgrade/ethstats.ts index bfb25f31ae5..cd7fa33222f 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/ethstats.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/ethstats.ts @@ -1,11 +1,7 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { createClusterIfNotExists, switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' -import { - installHelmChart, - removeHelmRelease, - upgradeHelmChart, -} from '@celo/celotool/src/lib/ethstats' +import { createClusterIfNotExists, switchToClusterFromEnv } from 'src/lib/cluster' +import { installHelmChart, removeHelmRelease, upgradeHelmChart } from 'src/lib/ethstats' import yargs from 'yargs' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'ethstats' diff --git a/packages/celotool/src/cmds/deploy/upgrade/faucet.ts b/packages/celotool/src/cmds/deploy/upgrade/faucet.ts index 4b22cc19f98..1a908fd664b 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/faucet.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/faucet.ts @@ -1,18 +1,17 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { downloadArtifacts } from '@celo/celotool/src/lib/artifacts' -import { addCeloEnvMiddleware, getEnvFile } from '@celo/celotool/src/lib/env-utils' -import { portForwardAnd } from '@celo/celotool/src/lib/port_forward' -import { execCmd } from '@celo/celotool/src/lib/utils' import { execSync } from 'child_process' import { config } from 'dotenv' -import { getContractAddresses } from 'src/lib/artifacts' +import { downloadArtifacts, getContractAddresses } from 'src/lib/artifacts' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { addCeloEnvMiddleware, getEnvFile } from 'src/lib/env-utils' import { coerceMnemonicAccountType, generatePrivateKey, privateKeyToAddress, } from 'src/lib/generate_utils' +import { portForwardAnd } from 'src/lib/port_forward' +import { execCmd } from 'src/lib/utils' import * as yargs from 'yargs' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'faucet' diff --git a/packages/celotool/src/cmds/deploy/upgrade/pumba.ts b/packages/celotool/src/cmds/deploy/upgrade/pumba.ts index e56dd34701e..dd323ff61d0 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/pumba.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/pumba.ts @@ -1,7 +1,7 @@ -import { InitialArgv } from '@celo/celotool/src/cmds/deploy/initial' import { switchToClusterFromEnv } from 'src/lib/cluster' import { upgradeGenericHelmChart } from 'src/lib/helm_deploy' import { helmChartDir, helmParameters, helmReleaseName } from 'src/lib/pumba' +import { InitialArgv } from '../../deploy/initial' export const command = 'pumba' diff --git a/packages/celotool/src/cmds/deploy/upgrade/testnet.ts b/packages/celotool/src/cmds/deploy/upgrade/testnet.ts index 2c1ea36c008..b0001f925b0 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/testnet.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/testnet.ts @@ -1,4 +1,3 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' import { switchToClusterFromEnv } from 'src/lib/cluster' import { resetAndUpgradeHelmChart, upgradeHelmChart, upgradeStaticIPs } from 'src/lib/helm_deploy' import { @@ -6,6 +5,7 @@ import { uploadStaticNodesToGoogleStorage, } from 'src/lib/testnet-utils' import * as yargs from 'yargs' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'testnet' export const describe = 'upgrade an existing deploy of the testnet package' diff --git a/packages/celotool/src/cmds/deploy/upgrade/tracer-tool.ts b/packages/celotool/src/cmds/deploy/upgrade/tracer-tool.ts index e2bb18dc208..e3ed279c123 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/tracer-tool.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/tracer-tool.ts @@ -1,6 +1,6 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' +import { switchToClusterFromEnv } from 'src/lib/cluster' import { upgradeHelmChart } from 'src/lib/tracer-tool' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'tracer-tool' diff --git a/packages/celotool/src/cmds/deploy/upgrade/transaction-metrics-exporter.ts b/packages/celotool/src/cmds/deploy/upgrade/transaction-metrics-exporter.ts index 1c2b40d3a9b..8256294c692 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/transaction-metrics-exporter.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/transaction-metrics-exporter.ts @@ -1,6 +1,6 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' +import { switchToClusterFromEnv } from 'src/lib/cluster' import { upgradeHelmChart } from 'src/lib/transaction-metrics-exporter' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'transaction-metrics-exporter' diff --git a/packages/celotool/src/cmds/deploy/upgrade/verification-pool.ts b/packages/celotool/src/cmds/deploy/upgrade/verification-pool.ts index 3a9f9a97e0f..b38d6246d88 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/verification-pool.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/verification-pool.ts @@ -1,6 +1,6 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { envVar, fetchEnvOrFallback } from '@celo/celotool/src/lib/env-utils' import * as deployUtil from '@celo/verification-pool-api/deployment/deployment-utils' +import { envVar, fetchEnvOrFallback } from 'src/lib/env-utils' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'verification-pool' export const describe = 'Upgrade an existing deploy of the verification pool package' diff --git a/packages/celotool/src/cmds/deploy/upgrade/vm-testnet.ts b/packages/celotool/src/cmds/deploy/upgrade/vm-testnet.ts index 45b6dff5cbe..162455b427f 100644 --- a/packages/celotool/src/cmds/deploy/upgrade/vm-testnet.ts +++ b/packages/celotool/src/cmds/deploy/upgrade/vm-testnet.ts @@ -1,6 +1,6 @@ -import { UpgradeArgv } from '@celo/celotool/src/cmds/deploy/upgrade' -import { deploy, taintTestnet, untaintTestnet } from '@celo/celotool/src/lib/vm-testnet-utils' +import { deploy, taintTestnet, untaintTestnet } from 'src/lib/vm-testnet-utils' import yargs from 'yargs' +import { UpgradeArgv } from '../../deploy/upgrade' export const command = 'vm-testnet' export const describe = 'upgrade a testnet on a VM' diff --git a/packages/celotool/src/cmds/fork_env.ts b/packages/celotool/src/cmds/fork_env.ts index 2ea1780e77a..8974e9347a7 100644 --- a/packages/celotool/src/cmds/fork_env.ts +++ b/packages/celotool/src/cmds/fork_env.ts @@ -1,13 +1,8 @@ -import { - CeloEnvArgv, - genericEnvFilePath, - isValidCeloEnv, - monorepoRoot, -} from '@celo/celotool/src/lib/env-utils' import { parse } from 'dotenv' import { readFileSync, writeFileSync } from 'fs' import { map, merge, reduce } from 'lodash' import path from 'path' +import { CeloEnvArgv, genericEnvFilePath, isValidCeloEnv, monorepoRoot } from 'src/lib/env-utils' import * as yargs from 'yargs' export const command = 'fork-env ' diff --git a/packages/celotool/src/cmds/gcp/remove-leaked-forwarding-rules.ts b/packages/celotool/src/cmds/gcp/remove-leaked-forwarding-rules.ts index ff99649d1d3..dde7b02741e 100644 --- a/packages/celotool/src/cmds/gcp/remove-leaked-forwarding-rules.ts +++ b/packages/celotool/src/cmds/gcp/remove-leaked-forwarding-rules.ts @@ -1,5 +1,5 @@ -import { execCmd, execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' import { zip } from 'lodash' +import { execCmd, execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' export const command = 'remove-leaked-forwarding-rules' diff --git a/packages/celotool/src/cmds/generate/genesis-file.ts b/packages/celotool/src/cmds/generate/genesis-file.ts index 9f8ca32340a..82f101871c0 100644 --- a/packages/celotool/src/cmds/generate/genesis-file.ts +++ b/packages/celotool/src/cmds/generate/genesis-file.ts @@ -1,4 +1,4 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import { generateGenesisFromEnv } from 'src/lib/generate_utils' import * as yargs from 'yargs' diff --git a/packages/celotool/src/cmds/geth/build.ts b/packages/celotool/src/cmds/geth/build.ts index 92da3913db8..56391aa4010 100644 --- a/packages/celotool/src/cmds/geth/build.ts +++ b/packages/celotool/src/cmds/geth/build.ts @@ -1,6 +1,6 @@ -import { GethArgv } from '@celo/celotool/src/cmds/geth' -import { execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' +import { execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' +import { GethArgv } from '../geth' export const command = 'build' diff --git a/packages/celotool/src/cmds/geth/create_account.ts b/packages/celotool/src/cmds/geth/create_account.ts index ea4bf2d472a..c3c91d568e5 100644 --- a/packages/celotool/src/cmds/geth/create_account.ts +++ b/packages/celotool/src/cmds/geth/create_account.ts @@ -1,16 +1,12 @@ /* tslint:disable no-console */ -import { GethArgv } from '@celo/celotool/src/cmds/geth' -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' -import { - addCeloGethMiddleware, - execCmd, - execCmdWithExitOnFailure, -} from '@celo/celotool/src/lib/utils' import fs from 'fs' import path from 'path' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import { fetchPassword } from 'src/lib/geth' +import { addCeloGethMiddleware, execCmd, execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' +import { GethArgv } from '../geth' export const command = 'create-account' diff --git a/packages/celotool/src/cmds/geth/get_gold_balance.ts b/packages/celotool/src/cmds/geth/get_gold_balance.ts index e44c7907e2e..4c1c9823d39 100644 --- a/packages/celotool/src/cmds/geth/get_gold_balance.ts +++ b/packages/celotool/src/cmds/geth/get_gold_balance.ts @@ -1,11 +1,7 @@ -import { GethArgv } from '@celo/celotool/src/cmds/geth' -import { addCeloEnvMiddleware } from '@celo/celotool/src/lib/env-utils' -import { - addCeloGethMiddleware, - ensure0x, - execCmdWithExitOnFailure, -} from '@celo/celotool/src/lib/utils' +import { addCeloEnvMiddleware } from 'src/lib/env-utils' +import { addCeloGethMiddleware, ensure0x, execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' +import { GethArgv } from '../geth' export const command = 'get gold balance' diff --git a/packages/celotool/src/cmds/geth/init.ts b/packages/celotool/src/cmds/geth/init.ts index 0f4c33c8dfe..151d16250d5 100644 --- a/packages/celotool/src/cmds/geth/init.ts +++ b/packages/celotool/src/cmds/geth/init.ts @@ -1,11 +1,11 @@ -import { GethArgv } from '@celo/celotool/src/cmds/geth' -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' -import { addCeloGethMiddleware, execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' import fs from 'fs' import path from 'path' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import { getEnodesAddresses, writeStaticNodes } from 'src/lib/geth' +import { addCeloGethMiddleware, execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' +import { GethArgv } from '../geth' const STATIC_NODES_FILE_NAME = 'static-nodes.json' const DEFAULT_GENESIS_FILE_NAME = 'genesis_default.json' diff --git a/packages/celotool/src/cmds/geth/run.ts b/packages/celotool/src/cmds/geth/run.ts index ef484d3af47..37be0587dd9 100644 --- a/packages/celotool/src/cmds/geth/run.ts +++ b/packages/celotool/src/cmds/geth/run.ts @@ -1,9 +1,9 @@ -import { GethArgv } from '@celo/celotool/src/cmds/geth' import { spawnSync } from 'child_process' import fs from 'fs' import path from 'path' import { addCeloGethMiddleware, ensure0x, validateAccountAddress } from 'src/lib/utils' import * as yargs from 'yargs' +import { GethArgv } from '../geth' const STATIC_NODES_FILE_NAME = 'static-nodes.json' diff --git a/packages/celotool/src/cmds/geth/simulate_client.ts b/packages/celotool/src/cmds/geth/simulate_client.ts index 1ccd7dcadd4..4f1c0c9b4f9 100644 --- a/packages/celotool/src/cmds/geth/simulate_client.ts +++ b/packages/celotool/src/cmds/geth/simulate_client.ts @@ -1,10 +1,10 @@ -import { GethArgv } from '@celo/celotool/src/cmds/geth' -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' import fs from 'fs' import { getBlockscoutClusterInternalUrl } from 'src/lib/endpoints' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import { privateKeyToAddress } from 'src/lib/generate_utils' import { checkGethStarted, getWeb3AndTokensContracts, simulateClient, sleep } from 'src/lib/geth' import * as yargs from 'yargs' +import { GethArgv } from '../geth' export const command = 'simulate-client' diff --git a/packages/celotool/src/cmds/geth/static_nodes.ts b/packages/celotool/src/cmds/geth/static_nodes.ts index 19c08a2e58a..dbc6dd5822c 100644 --- a/packages/celotool/src/cmds/geth/static_nodes.ts +++ b/packages/celotool/src/cmds/geth/static_nodes.ts @@ -1,5 +1,5 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import { getEnodesWithExternalIPAddresses, writeStaticNodes } from 'src/lib/geth' import * as yargs from 'yargs' diff --git a/packages/celotool/src/cmds/geth/trace.ts b/packages/celotool/src/cmds/geth/trace.ts index 453dbe00e1a..d648761bd68 100644 --- a/packages/celotool/src/cmds/geth/trace.ts +++ b/packages/celotool/src/cmds/geth/trace.ts @@ -1,8 +1,8 @@ -import { GethArgv } from '@celo/celotool/src/cmds/geth' -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' import { getBlockscoutUrl } from 'src/lib/endpoints' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import { checkGethStarted, getWeb3AndTokensContracts, traceTransactions } from 'src/lib/geth' import * as yargs from 'yargs' +import { GethArgv } from '../geth' export const command = 'trace ' diff --git a/packages/celotool/src/cmds/geth/transfer.ts b/packages/celotool/src/cmds/geth/transfer.ts index 3016dbd0443..c234a81f01d 100644 --- a/packages/celotool/src/cmds/geth/transfer.ts +++ b/packages/celotool/src/cmds/geth/transfer.ts @@ -1,7 +1,7 @@ -import { GethArgv } from '@celo/celotool/src/cmds/geth' import BigNumber from 'bignumber.js' import { checkGethStarted, getWeb3AndTokensContracts, transferERC20Token } from 'src/lib/geth' import * as yargs from 'yargs' +import { GethArgv } from '../geth' export const command = 'transfer ' diff --git a/packages/celotool/src/cmds/links.ts b/packages/celotool/src/cmds/links.ts index e77b897e270..770bdcd6aea 100644 --- a/packages/celotool/src/cmds/links.ts +++ b/packages/celotool/src/cmds/links.ts @@ -1,3 +1,4 @@ +import { getBlockchainApiUrl, getBlockscoutUrl, getEthstatsUrl } from 'src/lib/endpoints' import { addCeloEnvMiddleware, CeloEnvArgv, @@ -5,9 +6,8 @@ import { fetchEnv, fetchEnvOrFallback, getEnvFile, -} from '@celo/celotool/src/lib/env-utils' -import { execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' -import { getBlockchainApiUrl, getBlockscoutUrl, getEthstatsUrl } from 'src/lib/endpoints' +} from 'src/lib/env-utils' +import { execCmdWithExitOnFailure } from 'src/lib/utils' import { Arguments, Argv } from 'yargs' export const command = 'links ' diff --git a/packages/celotool/src/cmds/monitoring.ts b/packages/celotool/src/cmds/monitoring.ts index 88a84943bfe..0e5d79ec558 100644 --- a/packages/celotool/src/cmds/monitoring.ts +++ b/packages/celotool/src/cmds/monitoring.ts @@ -1,4 +1,4 @@ -import { addCeloEnvMiddleware } from '@celo/celotool/src/lib/env-utils' +import { addCeloEnvMiddleware } from 'src/lib/env-utils' import * as yargs from 'yargs' export const command = 'monitoring ' diff --git a/packages/celotool/src/cmds/monitoring/delete.ts b/packages/celotool/src/cmds/monitoring/delete.ts index 0b2dbe0eb1c..cc494694f7d 100644 --- a/packages/celotool/src/cmds/monitoring/delete.ts +++ b/packages/celotool/src/cmds/monitoring/delete.ts @@ -1,4 +1,4 @@ -import { CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' +import { CeloEnvArgv } from 'src/lib/env-utils' import { deleteMetric, getMetrics } from 'src/lib/monitoring' export const command = 'delete' diff --git a/packages/celotool/src/cmds/monitoring/list.ts b/packages/celotool/src/cmds/monitoring/list.ts index 5798f188e0a..bda89131be9 100644 --- a/packages/celotool/src/cmds/monitoring/list.ts +++ b/packages/celotool/src/cmds/monitoring/list.ts @@ -1,4 +1,4 @@ -import { CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' +import { CeloEnvArgv } from 'src/lib/env-utils' import { getMetrics } from 'src/lib/monitoring' export const command = 'list' diff --git a/packages/celotool/src/cmds/port_forward.ts b/packages/celotool/src/cmds/port_forward.ts index eac1d744088..f1e1890db5d 100644 --- a/packages/celotool/src/cmds/port_forward.ts +++ b/packages/celotool/src/cmds/port_forward.ts @@ -1,6 +1,6 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' -import { defaultPortsString, portForward } from '@celo/celotool/src/lib/port_forward' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' +import { defaultPortsString, portForward } from 'src/lib/port_forward' import * as yargs from 'yargs' export const command = 'port-forward' diff --git a/packages/celotool/src/cmds/restore.ts b/packages/celotool/src/cmds/restore.ts index 00114bba3a3..9924ae372a0 100644 --- a/packages/celotool/src/cmds/restore.ts +++ b/packages/celotool/src/cmds/restore.ts @@ -1,6 +1,6 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' -import { execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' +import { execCmdWithExitOnFailure } from 'src/lib/utils' import * as yargs from 'yargs' export const command = 'restore' diff --git a/packages/celotool/src/cmds/switch.ts b/packages/celotool/src/cmds/switch.ts index 4465ef0a792..ccf2b7d48d3 100644 --- a/packages/celotool/src/cmds/switch.ts +++ b/packages/celotool/src/cmds/switch.ts @@ -1,5 +1,5 @@ -import { addCeloEnvMiddleware } from '@celo/celotool/src/lib/env-utils' import { switchToClusterFromEnv } from 'src/lib/cluster' +import { addCeloEnvMiddleware } from 'src/lib/env-utils' import * as yargs from 'yargs' export const command = 'switch' diff --git a/packages/celotool/src/cmds/transactions.ts b/packages/celotool/src/cmds/transactions.ts index 2b1932e111b..f3aa090a3d0 100644 --- a/packages/celotool/src/cmds/transactions.ts +++ b/packages/celotool/src/cmds/transactions.ts @@ -1,4 +1,4 @@ -import { addCeloEnvMiddleware, CeloEnvArgv } from '@celo/celotool/src/lib/env-utils' +import { addCeloEnvMiddleware, CeloEnvArgv } from 'src/lib/env-utils' import { Argv } from 'yargs' export const command = 'transactions ' diff --git a/packages/celotool/src/cmds/transactions/describe.ts b/packages/celotool/src/cmds/transactions/describe.ts index d4865f68a3d..4a192790425 100644 --- a/packages/celotool/src/cmds/transactions/describe.ts +++ b/packages/celotool/src/cmds/transactions/describe.ts @@ -1,4 +1,3 @@ -import { TransactionsArgv } from '@celo/celotool/src/cmds/transactions' import { constructFunctionABICache, getContracts, @@ -8,6 +7,7 @@ import { import { getWeb3Client } from 'src/lib/blockchain' import { switchToClusterFromEnv } from 'src/lib/cluster' import * as yargs from 'yargs' +import { TransactionsArgv } from '../transactions' export const command = 'describe ' diff --git a/packages/celotool/src/cmds/transactions/list.ts b/packages/celotool/src/cmds/transactions/list.ts index f99b8278867..fb9e18ebde0 100644 --- a/packages/celotool/src/cmds/transactions/list.ts +++ b/packages/celotool/src/cmds/transactions/list.ts @@ -1,4 +1,3 @@ -import { TransactionsArgv } from '@celo/celotool/src/cmds/transactions' import { constructFunctionABICache, FunctionABICache, @@ -14,6 +13,7 @@ import { switchToClusterFromEnv } from 'src/lib/cluster' import { getBlockscoutUrl } from 'src/lib/endpoints' import Web3 from 'web3' import * as yargs from 'yargs' +import { TransactionsArgv } from '../transactions' export const command = 'list
' diff --git a/packages/celotool/geth_tests/governance_tests.ts b/packages/celotool/src/e2e-tests/governance_tests.ts similarity index 63% rename from packages/celotool/geth_tests/governance_tests.ts rename to packages/celotool/src/e2e-tests/governance_tests.ts index 4cf43920243..e96570a9242 100644 --- a/packages/celotool/geth_tests/governance_tests.ts +++ b/packages/celotool/src/e2e-tests/governance_tests.ts @@ -1,16 +1,17 @@ +import BigNumber from 'bignumber.js' +import { assert } from 'chai' +import Web3 from 'web3' +import { strip0x } from '../lib/utils' import { + assertRevert, erc20Abi, + getContext, getContractAddress, getEnode, - getHooks, importGenesis, initAndStartGeth, sleep, -} from '@celo/celotool/geth_tests/src/lib/utils' -import BigNumber from 'bignumber.js' -import { strip0x } from '../src/lib/utils' -const assert = require('chai').assert -const Web3 = require('web3') +} from './utils' // TODO(asa): Use the contract kit here instead const lockedGoldAbi = [ @@ -167,6 +168,39 @@ const validatorsAbi = [ stateMutability: 'nonpayable', type: 'function', }, + { + constant: true, + inputs: [ + { + name: 'index', + type: 'uint256', + }, + ], + name: 'validatorAddressFromCurrentSet', + outputs: [ + { + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'numberValidatorsInCurrentSet', + outputs: [ + { + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, ] describe('governance tests', () => { @@ -181,7 +215,7 @@ describe('governance tests', () => { ], } - const hooks: any = getHooks(gethConfig) + const context: any = getContext(gethConfig) let web3: any let lockedGold: any let validators: any @@ -189,22 +223,22 @@ describe('governance tests', () => { before(async function(this: any) { this.timeout(0) - await hooks.before() + await context.hooks.before() }) - after(hooks.after) + after(context.hooks.after) const restart = async () => { - await hooks.restart() + await context.hooks.restart() web3 = new Web3('http://localhost:8545') lockedGold = new web3.eth.Contract(lockedGoldAbi, await getContractAddress('LockedGoldProxy')) goldToken = new web3.eth.Contract(erc20Abi, await getContractAddress('GoldTokenProxy')) validators = new web3.eth.Contract(validatorsAbi, await getContractAddress('ValidatorsProxy')) } - const unlockAccount = async (address: string, web3: any) => { + const unlockAccount = async (address: string, theWeb3: any) => { // Assuming empty password - await web3.eth.personal.unlockAccount(address, '', 1000) + await theWeb3.eth.personal.unlockAccount(address, '', 1000) } const getParsedSignatureOfAddress = async (address: string, signer: string, signerWeb3: any) => { @@ -248,7 +282,7 @@ describe('governance tests', () => { if (!gas) { gas = await tx.estimateGas({ ...txOptions }) } - return await tx.send({ from: group, ...txOptions, gas }) + return tx.send({ from: group, ...txOptions, gas }) } const addMember = async (groupWeb3: any, group: string, member: string, txOptions: any = {}) => { @@ -258,7 +292,7 @@ describe('governance tests', () => { if (!gas) { gas = await tx.estimateGas({ ...txOptions }) } - return await tx.send({ from: group, ...txOptions, gas }) + return tx.send({ from: group, ...txOptions, gas }) } const delegateRewards = async (account: string, delegate: string, txOptions: any = {}) => { @@ -274,7 +308,7 @@ describe('governance tests', () => { if (!gas) { gas = 2 * (await tx.estimateGas({ ...txOptions })) } - return await tx.send({ from: account, ...txOptions, gas }) + return tx.send({ from: account, ...txOptions, gas }) } const redeemRewards = async (account: string, txOptions: any = {}) => { @@ -286,9 +320,150 @@ describe('governance tests', () => { if (!gas) { gas = 2 * (await tx.estimateGas({ ...txOptions })) } - return await tx.send({ from: account, ...txOptions, gas }) + return tx.send({ from: account, ...txOptions, gas }) } + describe('Validators.numberValidatorsInCurrentSet()', () => { + before(async function() { + this.timeout(0) + await restart() + validators = new web3.eth.Contract(validatorsAbi, await getContractAddress('ValidatorsProxy')) + }) + + it('should return the validator set size', async () => { + const numberValidators = await validators.methods.numberValidatorsInCurrentSet().call() + + assert.equal(numberValidators, 5) + }) + + describe('after the validator set changes', () => { + before(async function() { + this.timeout(0) + await restart() + const [groupAddress, groupPrivateKey] = await getValidatorGroupKeys() + const epoch = 10 + + const groupInstance = { + name: 'validatorGroup', + validating: false, + syncmode: 'full', + port: 30325, + wsport: 8567, + privateKey: groupPrivateKey.slice(2), + peers: [await getEnode(8545)], + } + await initAndStartGeth(context.hooks.gethBinaryPath, groupInstance) + const groupWeb3 = new Web3('ws://localhost:8567') + validators = new groupWeb3.eth.Contract( + validatorsAbi, + await getContractAddress('ValidatorsProxy') + ) + // Give the node time to sync. + await sleep(15) + const members = await getValidatorGroupMembers() + await removeMember(groupWeb3, groupAddress, members[0]) + await sleep(epoch * 2) + }) + + it('should return the reduced validator set size', async () => { + const numberValidators = await validators.methods.numberValidatorsInCurrentSet().call() + + assert.equal(numberValidators, 4) + }) + }) + }) + + describe('Validators.validatorAddressFromCurrentSet()', () => { + before(async function() { + this.timeout(0) + await restart() + validators = new web3.eth.Contract(validatorsAbi, await getContractAddress('ValidatorsProxy')) + }) + + it('should return the first validator', async () => { + const resultAddress = await validators.methods.validatorAddressFromCurrentSet(0).call() + + assert.equal(strip0x(resultAddress), context.validators[0].address) + }) + + it('should return the third validator', async () => { + const resultAddress = await validators.methods.validatorAddressFromCurrentSet(2).call() + + assert.equal(strip0x(resultAddress), context.validators[2].address) + }) + + it('should return the fifth validator', async () => { + const resultAddress = await validators.methods.validatorAddressFromCurrentSet(4).call() + + assert.equal(strip0x(resultAddress), context.validators[4].address) + }) + + it('should revert when asked for an out of bounds validator', async function(this: any) { + this.timeout(0) // Disable test timeout + await assertRevert( + validators.methods.validatorAddressFromCurrentSet(5).send({ + from: `0x${context.validators[0].address}`, + }) + ) + }) + + describe('after the validator set changes', () => { + before(async function() { + this.timeout(0) + await restart() + const [groupAddress, groupPrivateKey] = await getValidatorGroupKeys() + const epoch = 10 + + const groupInstance = { + name: 'validatorGroup', + validating: false, + syncmode: 'full', + port: 30325, + wsport: 8567, + privateKey: groupPrivateKey.slice(2), + peers: [await getEnode(8545)], + } + await initAndStartGeth(context.hooks.gethBinaryPath, groupInstance) + const groupWeb3 = new Web3('ws://localhost:8567') + validators = new groupWeb3.eth.Contract( + validatorsAbi, + await getContractAddress('ValidatorsProxy') + ) + // Give the node time to sync. + await sleep(15) + const members = await getValidatorGroupMembers() + await removeMember(groupWeb3, groupAddress, members[0]) + await sleep(epoch * 2) + + validators = new web3.eth.Contract( + validatorsAbi, + await getContractAddress('ValidatorsProxy') + ) + }) + + it('should return the second validator in the first place', async () => { + const resultAddress = await validators.methods.validatorAddressFromCurrentSet(0).call() + + assert.equal(strip0x(resultAddress), context.validators[1].address) + }) + + it('should return the last validator in the fourth place', async () => { + const resultAddress = await validators.methods.validatorAddressFromCurrentSet(3).call() + + assert.equal(strip0x(resultAddress), context.validators[4].address) + }) + + it('should revert when asked for an out of bounds validator', async function(this: any) { + this.timeout(0) + await assertRevert( + validators.methods.validatorAddressFromCurrentSet(4).send({ + from: `0x${context.validators[0].address}`, + }) + ) + }) + }) + }) + describe('when the validator set is changing', () => { const epoch = 10 const expectedEpochMembership = new Map() @@ -306,7 +481,7 @@ describe('governance tests', () => { privateKey: groupPrivateKey.slice(2), peers: [await getEnode(8545)], } - await initAndStartGeth(hooks.gethBinaryPath, groupInstance) + await initAndStartGeth(context.hooks.gethBinaryPath, groupInstance) const groupWeb3 = new Web3('ws://localhost:8567') validators = new groupWeb3.eth.Contract( validatorsAbi, @@ -321,9 +496,9 @@ describe('governance tests', () => { const changeValidatorSet = async (header: any) => { // At the start of epoch N, swap members so the validator set is different for epoch N + 1. - if (header.number % epoch == 0) { - const members = await getValidatorGroupMembers() - const direction = members.includes(membersToSwap[0]) + if (header.number % epoch === 0) { + const groupMembers = await getValidatorGroupMembers() + const direction = groupMembers.includes(membersToSwap[0]) const removedMember = direction ? membersToSwap[0] : membersToSwap[1] const addedMember = direction ? membersToSwap[1] : membersToSwap[0] expectedEpochMembership.set(header.number / epoch, [removedMember, addedMember]) @@ -335,10 +510,11 @@ describe('governance tests', () => { } } - const subscription = groupWeb3.eth.subscribe('newBlockHeaders').on('data', changeValidatorSet) + const subscription = await groupWeb3.eth.subscribe('newBlockHeaders') + subscription.on('data', changeValidatorSet) // Wait for a few epochs while changing the validator set. await sleep(epoch * 3) - subscription.unsubscribe() + ;(subscription as any).unsubscribe() // Wait for the current epoch to complete. await sleep(epoch) }) @@ -346,14 +522,15 @@ describe('governance tests', () => { it('should have produced blocks with the correct validator set', async function(this: any) { this.timeout(0) // Disable test timeout assert.equal(expectedEpochMembership.size, 3) + // tslint:disable-next-line: no-console console.log(expectedEpochMembership) - for (let [epochNumber, membership] of expectedEpochMembership) { + for (const [epochNumber, membership] of expectedEpochMembership) { let containsExpectedMember = false for (let i = epochNumber * epoch + 1; i < (epochNumber + 1) * epoch + 1; i++) { const block = await web3.eth.getBlock(i) assert.notEqual(block.miner.toLowerCase(), membership[1].toLowerCase()) containsExpectedMember = - containsExpectedMember || block.miner.toLowerCase() == membership[0].toLowerCase() + containsExpectedMember || block.miner.toLowerCase() === membership[0].toLowerCase() } assert.isTrue(containsExpectedMember) } @@ -375,7 +552,7 @@ describe('governance tests', () => { rpcport: 8567, privateKey: 'f2f48ee19680706196e2e339e5da3491186e0c4c5030670656b0e0164837257d', } - await initAndStartGeth(hooks.gethBinaryPath, delegateInstance) + await initAndStartGeth(context.hooks.gethBinaryPath, delegateInstance) // Note that we don't need to create an account or make a commitment as this has already been // done in the migration. await delegateRewards(account, delegate) @@ -391,16 +568,16 @@ describe('governance tests', () => { describe('when adding any block', () => { let goldGenesisSupply: any - let addressesWithBalance: string[] = [] + const addressesWithBalance: string[] = [] beforeEach(async function(this: any) { this.timeout(0) // Disable test timeout await restart() const genesis = await importGenesis() goldGenesisSupply = new BigNumber(0) - for (let validator in genesis.alloc) { + Object.keys(genesis.alloc).forEach((validator) => { addressesWithBalance.push(validator) goldGenesisSupply = goldGenesisSupply.plus(genesis.alloc[validator].balance) - } + }) // Block rewards are paid to governance and Locked Gold. // Governance also receives a portion of transaction fees. addressesWithBalance.push(await getContractAddress('GovernanceProxy')) @@ -426,7 +603,7 @@ describe('governance tests', () => { const expectedGoldTotalSupply = balances.reduce((total: BigNumber, b: BigNumber) => b.plus(total) ) - assert.isAtLeast(expectedGoldTotalSupply, goldGenesisSupply) + assert.isAtLeast(expectedGoldTotalSupply.toNumber(), goldGenesisSupply.toNumber()) assert.equal(goldTotalSupply.toString(), expectedGoldTotalSupply.toString()) }) }) diff --git a/packages/celotool/geth_tests/sync_tests.ts b/packages/celotool/src/e2e-tests/sync_tests.ts similarity index 96% rename from packages/celotool/geth_tests/sync_tests.ts rename to packages/celotool/src/e2e-tests/sync_tests.ts index 08bb50213f2..2d99ad4944b 100644 --- a/packages/celotool/geth_tests/sync_tests.ts +++ b/packages/celotool/src/e2e-tests/sync_tests.ts @@ -1,13 +1,13 @@ +import { assert } from 'chai' +import Web3 from 'web3' import { getEnode, - getHooks, GethInstanceConfig, + getHooks, initAndStartGeth, killInstance, sleep, -} from '@celo/celotool/geth_tests/src/lib/utils' -import { assert } from 'chai' -import Web3 from 'web3' +} from './utils' describe('sync tests', function(this: any) { this.timeout(0) @@ -62,9 +62,7 @@ describe('sync tests', function(this: any) { await initAndStartGeth(hooks.gethBinaryPath, syncInstance) }) - afterEach(() => { - killInstance(syncInstance) - }) + afterEach(() => killInstance(syncInstance)) it('should sync the latest block', async () => { const validatingWeb3 = new Web3(`http://localhost:8545`) @@ -99,7 +97,7 @@ describe('sync tests', function(this: any) { const address = (await web3.eth.getAccounts())[0] const currentBlock = await web3.eth.getBlock('latest') for (let i = 0; i < gethConfig.instances.length; i++) { - if ((await web3.eth.getBlock(currentBlock.number - i)).miner == address) { + if ((await web3.eth.getBlock(currentBlock.number - i)).miner === address) { return // A block proposed by validator who lost randomness was found, hence randomness was recovered } } diff --git a/packages/celotool/geth_tests/transfer_tests.ts b/packages/celotool/src/e2e-tests/transfer_tests.ts similarity index 97% rename from packages/celotool/geth_tests/transfer_tests.ts rename to packages/celotool/src/e2e-tests/transfer_tests.ts index 3cc314b7cfd..4c885c41d0b 100644 --- a/packages/celotool/geth_tests/transfer_tests.ts +++ b/packages/celotool/src/e2e-tests/transfer_tests.ts @@ -1,27 +1,17 @@ -import { - erc20Abi, - getContractAddress, - getEnode, - getHooks, - initAndStartGeth, - sleep, -} from '@celo/celotool/geth_tests/src/lib/utils' import { CURRENCY_ENUM } from '@celo/utils' +import { toFixed } from '@celo/utils/lib/fixidity' import BigNumber from 'bignumber.js' import { assert } from 'chai' import Web3 from 'web3' import { Tx } from 'web3/eth/types' +import { erc20Abi, getContractAddress, getEnode, getHooks, initAndStartGeth, sleep } from './utils' const stableTokenAbi = erc20Abi.concat([ { constant: false, inputs: [ { - name: 'rateNumerator', - type: 'uint256', - }, - { - name: 'rateDenominator', + name: 'rate', type: 'uint256', }, { @@ -56,14 +46,6 @@ const stableTokenAbi = erc20Abi.concat([ name: '', type: 'uint256', }, - { - name: '', - type: 'uint256', - }, - { - name: '', - type: 'uint256', - }, ], payable: false, stateMutability: 'view', @@ -306,8 +288,7 @@ describe('transfer tests', function(this: any) { const _web3 = new Web3('http://localhost:8545') const _stableToken = new _web3.eth.Contract(stableTokenAbi, stableTokenAddress) const tx = _stableToken.methods.setInflationParameters( - rateNumerator, - rateDenominator, + toFixed(rateNumerator / rateDenominator).toString(), updatePeriod ) const gas = await tx.estimateGas({ from: validatorAddress }) @@ -342,7 +323,7 @@ describe('transfer tests', function(this: any) { gasCurrency?: string ): Promise<[boolean, any, any]> => { const minGasPrice = await getGasPriceMinimum(gasCurrency) - assert.isAbove(minGasPrice, 0) + assert.isAbove(parseInt(minGasPrice, 10), 0) const receipt = await txPromise const balances = await getBalances() const tx = await web3.eth.getTransaction(receipt.transactionHash) @@ -425,7 +406,7 @@ describe('transfer tests', function(this: any) { } if (!expectSuccess || transferToken !== feeToken) { - it(`should decrement the sender's ${transferToken} balance by the gas fee`, () => { + it(`should decrement the sender's ${feeToken} balance by the gas fee`, () => { assert.equal( initialBalances[feeToken][DEF_FROM_ADDR].minus( newBalances[feeToken][DEF_FROM_ADDR] @@ -455,7 +436,7 @@ describe('transfer tests', function(this: any) { }) } - const GOLD_TRANSACTION_GAS_COST = 23511 + const GOLD_TRANSACTION_GAS_COST = 29180 const syncModes = ['full', 'fast', 'light', 'ultralight'] for (const syncMode of syncModes) { describe(`when running ${syncMode} sync`, () => { @@ -523,13 +504,13 @@ describe('transfer tests', function(this: any) { }) describe('when paying for gas in Celo Dollars', () => { - const intrinsicGas = 156000 + const intrinsicGas = 155000 describe('when there is no demurrage', () => { describe('when setting a gas amount greater than the amount of gas necessary', () => { before(async function(this: any) { await restartGeth(syncMode) - const expectedGasUsed = 158511 + const expectedGasUsed = 163180 ;[txSuccess, newBalances, expectedFees] = await runTestTransaction( transferCeloGold(DEF_FROM_ADDR, DEF_TO_ADDR, DEF_AMOUNT, { gasCurrency: stableTokenAddress, @@ -587,14 +568,14 @@ describe('transfer tests', function(this: any) { // plus a small amount as the new updatePeriod. We then wait to get pas that updatePeriod // so that on transferCeloGold being called, demurrage of 50% is applied. const inflationParams = await stableToken.methods.getInflationParameters().call() - const lastUpdated = new BigNumber(inflationParams[5]) + const lastUpdated = new BigNumber(inflationParams[3]) const timeSinceLastUpdated = new BigNumber(Math.floor(Date.now() / 1000)).minus( lastUpdated ) await setInflationParams(2, 1, timeSinceLastUpdated.toNumber()) - const expectedGasUsed = 158511 + const expectedGasUsed = 163180 ;[txSuccess, newBalances, expectedFees] = await runTestTransaction( transferCeloGold(DEF_FROM_ADDR, DEF_TO_ADDR, DEF_AMOUNT, { gasCurrency: stableTokenAddress, @@ -661,7 +642,7 @@ describe('transfer tests', function(this: any) { // plus a small amount as the new updatePeriod. We then wait to get pas that updatePeriod // so that on transferCeloGold being called, demurrage of 50% is applied. const inflationParams = await stableToken.methods.getInflationParameters().call() - const lastUpdated = new BigNumber(inflationParams[5]) + const lastUpdated = new BigNumber(inflationParams[3]) const timeSinceLastUpdated = new BigNumber(Math.floor(Date.now() / 1000)).minus( lastUpdated ) @@ -734,7 +715,7 @@ describe('transfer tests', function(this: any) { // plus a small amount as the new updatePeriod. We then wait to get pas that updatePeriod // so that on transferCeloGold being called, demurrage of 50% is applied. const inflationParams = await stableToken.methods.getInflationParameters().call() - const lastUpdated = new BigNumber(inflationParams[5]) + const lastUpdated = new BigNumber(inflationParams[3]) const timeSinceLastUpdated = new BigNumber(Math.floor(Date.now() / 1000)).minus( lastUpdated ) @@ -759,7 +740,7 @@ describe('transfer tests', function(this: any) { before(async function(this: any) { await restartGeth(syncMode) - const expectedGasUsed = 190740 + const expectedGasUsed = 189456 ;[txSuccess, newBalances, expectedFees] = await runTestTransaction( transferCeloDollars(DEF_FROM_ADDR, DEF_TO_ADDR, DEF_AMOUNT, { gasCurrency: stableTokenAddress, @@ -776,7 +757,7 @@ describe('transfer tests', function(this: any) { before(async function(this: any) { await restartGeth(syncMode) - const expectedGasUsed = 55740 + const expectedGasUsed = 55456 ;[txSuccess, newBalances, expectedFees] = await runTestTransaction( transferCeloDollars(DEF_FROM_ADDR, DEF_TO_ADDR, DEF_AMOUNT, { gasFeeRecipient: feeRecipientAddress, diff --git a/packages/celotool/geth_tests/src/lib/utils.ts b/packages/celotool/src/e2e-tests/utils.ts similarity index 91% rename from packages/celotool/geth_tests/src/lib/utils.ts rename to packages/celotool/src/e2e-tests/utils.ts index dcc4b53d062..51ca1aebb23 100644 --- a/packages/celotool/geth_tests/src/lib/utils.ts +++ b/packages/celotool/src/e2e-tests/utils.ts @@ -1,19 +1,18 @@ +import { assert } from 'chai' +import { spawn, SpawnOptions } from 'child_process' +import fs from 'fs' +import { join as joinPath, resolve as resolvePath } from 'path' +import { Admin } from 'web3-eth-admin' import { AccountType, - ConsensusType, generateGenesis, getPrivateKeysFor, getValidators, privateKeyToPublicKey, Validator, -} from '@celo/celotool/src/lib/generate_utils' -import { getEnodeAddress } from '@celo/celotool/src/lib/geth' -import { ensure0x } from '@celo/celotool/src/lib/utils' -import { assert } from 'chai' -import { spawn, SpawnOptions } from 'child_process' -import fs from 'fs' -import { join as joinPath, resolve as resolvePath } from 'path' -import { Admin } from 'web3-eth-admin' +} from '../lib/generate_utils' +import { getEnodeAddress } from '../lib/geth' +import { ensure0x } from '../lib/utils' export interface GethInstanceConfig { name: string @@ -37,7 +36,8 @@ export interface GethTestConfig { const TEST_DIR = '/tmp/e2e' const GENESIS_PATH = `${TEST_DIR}/genesis.json` -const networkid = 1101 +const NetworkId = 1101 +const MonorepoRoot = resolvePath(joinPath(__dirname, '../..', '../..')) export function spawnWithLog(cmd: string, args: string[], logsFilepath: string) { try { @@ -148,8 +148,6 @@ export const erc20Abi = [ }, ] -export const monorepoRoot = resolvePath(process.cwd(), './../..') - async function checkoutGethRepo(branch: string, path: string) { await execCmdWithExitOnFailure('rm', ['-rf', path]) await execCmdWithExitOnFailure('git', [ @@ -174,16 +172,12 @@ async function setupTestDir(testDir: string) { } function writeGenesis(validators: Validator[], path: string) { - const blockTime = 0 - const epochLength = 10 - const genesis = generateGenesis( + const genesis = generateGenesis({ validators, - ConsensusType.ISTANBUL, - ['0x000000000000000000000000000000000000ce10'], - blockTime, - epochLength, - networkid - ) + blockTime: 0, + epoch: 10, + chainId: NetworkId, + }) fs.writeFileSync(path, genesis) } @@ -244,7 +238,7 @@ export function sleep(seconds: number) { } export async function getEnode(port: number, ws: boolean = false) { - let p = ws ? 'ws' : 'http' + const p = ws ? 'ws' : 'http' const admin = new Admin(`${p}://localhost:${port}`) return (await admin.getNodeInfo()).enode } @@ -266,7 +260,7 @@ export async function startGeth(gethBinaryPath: string, instance: GethInstanceCo '--nodiscover', '--rpcvhosts=*', '--networkid', - networkid.toString(), + NetworkId.toString(), '--verbosity', '4', '--consoleoutput=stdout', // Send all logs to stdout @@ -323,16 +317,20 @@ export async function startGeth(gethBinaryPath: string, instance: GethInstanceCo } export async function migrateContracts(validatorPrivateKeys: string[], to: number = 1000) { + const migrationOverrides = { + validators: { + minElectableValidators: '1', + validatorKeys: validatorPrivateKeys.map(ensure0x), + }, + } const args = [ '--cwd', - `${monorepoRoot}/packages/protocol`, + `${MonorepoRoot}/packages/protocol`, 'init-network', '-n', 'testing', - '-k', - validatorPrivateKeys.map(ensure0x).join(','), '-m', - '{ "validators": { "minElectableValidators": "1" } }', + JSON.stringify(migrationOverrides), '-t', to.toString(), ] @@ -340,9 +338,9 @@ export async function migrateContracts(validatorPrivateKeys: string[], to: numbe } export function getContractAddress(contractName: string) { - const filePath = `${monorepoRoot}/packages/protocol/build/testing/contracts/${contractName}.json` + const filePath = `${MonorepoRoot}/packages/protocol/build/testing/contracts/${contractName}.json` const contractData = JSON.parse(fs.readFileSync(filePath, 'utf8')) - return contractData.networks[networkid].address + return contractData.networks[NetworkId].address } export async function snapshotDatadir(instance: GethInstanceConfig) { @@ -387,7 +385,7 @@ export async function initAndStartGeth(gethBinaryPath: string, instance: GethIns return startGeth(gethBinaryPath, instance) } -export function getHooks(gethConfig: GethTestConfig) { +export function getContext(gethConfig: GethTestConfig) { const mnemonic = 'jazz ripple brown cloth door bridge pen danger deer thumb cable prepare negative library vast' const validatorInstances = gethConfig.instances.filter((x: any) => x.validating) @@ -412,16 +410,12 @@ export function getHooks(gethConfig: GethTestConfig) { let validatorIndex = 0 for (const instance of gethConfig.instances) { if (instance.validating) { - if (!instance.peers) { - instance.peers = [] - } // Automatically connect validator nodes to eachother. - instance.peers = instance.peers.concat( - validatorEnodes.filter((_: string, i: number) => i !== validatorIndex) + const otherValidators = validatorEnodes.filter( + (_: string, i: number) => i !== validatorIndex ) - if (!instance.privateKey) { - instance.privateKey = validatorPrivateKeys[validatorIndex] - } + instance.peers = (instance.peers || []).concat(otherValidators) + instance.privateKey = instance.privateKey || validatorPrivateKeys[validatorIndex] validatorIndex++ } await initAndStartGeth(gethBinaryPath, instance) @@ -455,7 +449,14 @@ export function getHooks(gethConfig: GethTestConfig) { const after = () => killGeth() - return { before, after, restart, gethBinaryPath } + return { + validators, + hooks: { before, after, restart, gethBinaryPath }, + } +} + +export function getHooks(gethConfig: GethTestConfig) { + return getContext(gethConfig).hooks } export async function assertRevert(promise: any, errorMessage: string = '') { diff --git a/packages/celotool/geth_tests/verify_ultralight_geth_logs.ts b/packages/celotool/src/e2e-tests/verify_ultralight_geth_logs.ts similarity index 100% rename from packages/celotool/geth_tests/verify_ultralight_geth_logs.ts rename to packages/celotool/src/e2e-tests/verify_ultralight_geth_logs.ts diff --git a/packages/celotool/src/index.d.ts b/packages/celotool/src/index.d.ts deleted file mode 100644 index 22fd1d606f3..00000000000 --- a/packages/celotool/src/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare module 'web3-utils' -declare module 'country-data' diff --git a/packages/celotool/src/lib/artifacts.ts b/packages/celotool/src/lib/artifacts.ts index 5c82f2a25fb..6c9f5aaf91c 100644 --- a/packages/celotool/src/lib/artifacts.ts +++ b/packages/celotool/src/lib/artifacts.ts @@ -1,13 +1,8 @@ /* tslint:disable: no-console */ -import { - doCheckOrPromptIfStagingOrProduction, - envVar, - fetchEnv, - isProduction, -} from '@celo/celotool/src/lib/env-utils' -import { execCmd } from '@celo/celotool/src/lib/utils' import { existsSync, mkdirSync, readFileSync, writeFile } from 'fs' import { promisify } from 'util' +import { doCheckOrPromptIfStagingOrProduction, envVar, fetchEnv, isProduction } from './env-utils' +import { execCmd } from './utils' export const CONTRACTS_TO_COPY = [ 'Attestations', diff --git a/packages/celotool/src/lib/blockscout.ts b/packages/celotool/src/lib/blockscout.ts index ca373e92c7d..a3fb9f3d4e3 100644 --- a/packages/celotool/src/lib/blockscout.ts +++ b/packages/celotool/src/lib/blockscout.ts @@ -1,7 +1,7 @@ -import { fetchEnv, fetchEnvOrFallback, isVmBased } from '@celo/celotool/src/lib/env-utils' -import { installGenericHelmChart, removeGenericHelmChart } from '@celo/celotool/src/lib/helm_deploy' -import { execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' -import { getTestnetOutputs } from '@celo/celotool/src/lib/vm-testnet-utils' +import { fetchEnv, fetchEnvOrFallback, isVmBased } from './env-utils' +import { installGenericHelmChart, removeGenericHelmChart } from './helm_deploy' +import { execCmdWithExitOnFailure } from './utils' +import { getTestnetOutputs } from './vm-testnet-utils' export async function installHelmChart( celoEnv: string, diff --git a/packages/celotool/src/lib/chaoskube.ts b/packages/celotool/src/lib/chaoskube.ts index 995a1ed70d3..f83e86890d3 100644 --- a/packages/celotool/src/lib/chaoskube.ts +++ b/packages/celotool/src/lib/chaoskube.ts @@ -1,5 +1,5 @@ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' import { makeHelmParameters } from 'src/lib/helm_deploy' +import { envVar, fetchEnv } from './env-utils' export function helmReleaseName(celoEnv: string) { return celoEnv + '-chaoskube' diff --git a/packages/celotool/src/lib/cluster.ts b/packages/celotool/src/lib/cluster.ts index 9223f3f72f2..b792f6c8585 100644 --- a/packages/celotool/src/lib/cluster.ts +++ b/packages/celotool/src/lib/cluster.ts @@ -1,9 +1,5 @@ -import { - doCheckOrPromptIfStagingOrProduction, - EnvTypes, - envVar, - fetchEnv, -} from '@celo/celotool/src/lib/env-utils' +import sleep from 'sleep-promise' +import { doCheckOrPromptIfStagingOrProduction, EnvTypes, envVar, fetchEnv } from './env-utils' import { createAndUploadBackupSecretIfNotExists, createServiceAccountIfNotExists, @@ -13,15 +9,9 @@ import { installLegoAndNginx, redeployTiller, uploadStorageClass, -} from '@celo/celotool/src/lib/helm_deploy' -import { - execCmd, - execCmdWithExitOnFailure, - outputIncludes, - switchToProjectFromEnv, -} from '@celo/celotool/src/lib/utils' -import { networkName } from '@celo/celotool/src/lib/vm-testnet-utils' -import sleep from 'sleep-promise' +} from './helm_deploy' +import { execCmd, execCmdWithExitOnFailure, outputIncludes, switchToProjectFromEnv } from './utils' +import { networkName } from './vm-testnet-utils' const SYSTEM_HELM_RELEASES = ['nginx-ingress-release', 'kube-lego-release'] const HELM_RELEASE_REGEX = new RegExp(/(.*)-\d+\.\d+\.\d+$/) diff --git a/packages/celotool/src/lib/endpoints.ts b/packages/celotool/src/lib/endpoints.ts index 633513b7119..13597b9be35 100644 --- a/packages/celotool/src/lib/endpoints.ts +++ b/packages/celotool/src/lib/endpoints.ts @@ -1,4 +1,4 @@ -import { CeloEnvArgv, envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' +import { CeloEnvArgv, envVar, fetchEnv } from './env-utils' export function getBlockscoutUrl(argv: CeloEnvArgv) { return `https://${argv.celoEnv}-blockscout.${fetchEnv(envVar.CLUSTER_DOMAIN_NAME)}.org` diff --git a/packages/celotool/src/lib/env-utils.ts b/packages/celotool/src/lib/env-utils.ts index fe6f7002173..000c0f126dd 100644 --- a/packages/celotool/src/lib/env-utils.ts +++ b/packages/celotool/src/lib/env-utils.ts @@ -1,4 +1,4 @@ -// import { confirmAction } from '@celo/celotool/src/lib/utils' +// import { confirmAction } from './utils' import { config } from 'dotenv' import { existsSync } from 'fs' import path from 'path' @@ -34,6 +34,7 @@ export enum envVar { GETH_NODES_BACKUP_CRONJOB_ENABLED = 'GETH_NODES_BACKUP_CRONJOB_ENABLED', GETH_NODE_DOCKER_IMAGE_REPOSITORY = 'GETH_NODE_DOCKER_IMAGE_REPOSITORY', GETH_NODE_DOCKER_IMAGE_TAG = 'GETH_NODE_DOCKER_IMAGE_TAG', + GETH_NODES_SSD_DISKS = 'GETH_NODES_SSD_DISKS', GETH_VERBOSITY = 'GETH_VERBOSITY', GETHTX1_NODE_ID = 'GETHTX1_NODE_ID', GETHTX2_NODE_ID = 'GETHTX2_NODE_ID', @@ -46,7 +47,6 @@ export enum envVar { MOBILE_WALLET_PLAYSTORE_LINK = 'MOBILE_WALLET_PLAYSTORE_LINK', NETWORK_ID = 'NETWORK_ID', NOTIFICATION_SERVICE_FIREBASE_DB = 'NOTIFICATION_SERVICE_FIREBASE_DB', - PREDEPLOYED_CONTRACTS = 'PREDEPLOYED_CONTRACTS', SMS_RETRIEVER_HASH_CODE = 'SMS_RETRIEVER_HASH_CODE', STACKDRIVER_MONITORING_DASHBOARD = 'STACKDRIVER_MONITORING_DASHBOARD', STACKDRIVER_NOTIFICATION_APPLICATIONS_PREFIX = 'STACKDRIVER_NOTIFICATION_APPLICATIONS_PREFIX', diff --git a/packages/celotool/src/lib/ethstats.ts b/packages/celotool/src/lib/ethstats.ts index 9543a72b328..f87a4ccfece 100644 --- a/packages/celotool/src/lib/ethstats.ts +++ b/packages/celotool/src/lib/ethstats.ts @@ -1,6 +1,6 @@ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' import { installGenericHelmChart, removeGenericHelmChart } from 'src/lib/helm_deploy' import { execCmdWithExitOnFailure } from 'src/lib/utils' +import { envVar, fetchEnv } from './env-utils' const helmChartPath = '../helm-charts/ethstats' diff --git a/packages/celotool/src/lib/gcloud_utils.ts b/packages/celotool/src/lib/gcloud_utils.ts index b62e39d4353..6eab54dd51e 100644 --- a/packages/celotool/src/lib/gcloud_utils.ts +++ b/packages/celotool/src/lib/gcloud_utils.ts @@ -1,5 +1,5 @@ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' -import { execCmd } from '@celo/celotool/src/lib/utils' +import { envVar, fetchEnv } from './env-utils' +import { execCmd } from './utils' async function getCurrentGcloudAccount() { const [output] = await execCmd('gcloud config get-value account') diff --git a/packages/celotool/src/lib/generate_utils.ts b/packages/celotool/src/lib/generate_utils.ts index dc6e32e5a7c..6617cde483d 100644 --- a/packages/celotool/src/lib/generate_utils.ts +++ b/packages/celotool/src/lib/generate_utils.ts @@ -1,20 +1,20 @@ -import { blsPrivateKeyToProcessedPrivateKey } from '@celo/celotool/src/lib/bls_utils' -import { envVar, fetchEnv, fetchEnvOrFallback } from '@celo/celotool/src/lib/env-utils' +import * as bls12377js from 'bls12377js' +import { ec as EC } from 'elliptic' +import { range, repeat } from 'lodash' +import rlp from 'rlp' +import Web3 from 'web3' +import { blsPrivateKeyToProcessedPrivateKey } from './bls_utils' +import { envVar, fetchEnv, fetchEnvOrFallback } from './env-utils' import { - CONTRACT_ADDRESSES, CONTRACT_OWNER_STORAGE_LOCATION, GETH_CONFIG_OLD, ISTANBUL_MIX_HASH, OG_ACCOUNTS, PROXY_CONTRACT_CODE, + REGISTRY_ADDRESS, TEMPLATE, -} from '@celo/celotool/src/lib/genesis_constants' -import { ensure0x, strip0x } from '@celo/celotool/src/lib/utils' -import * as bls12377js from 'bls12377js' -import { ec as EC } from 'elliptic' -import { range, repeat } from 'lodash' -import rlp from 'rlp' -import Web3 from 'web3' +} from './genesis_constants' +import { ensure0x, strip0x } from './utils' import bip32 = require('bip32') import bip39 = require('bip39') @@ -93,18 +93,17 @@ export const getStrippedAddressesFor = (accountType: AccountType, mnemonic: stri getAddressesFor(accountType, mnemonic, n).map(strip0x) export const getValidators = (mnemonic: string, n: number) => { - return range(0, n) - .map((i) => generatePrivateKey(mnemonic, AccountType.VALIDATOR, i)) - .map((key) => { - const blsKeyBytes = blsPrivateKeyToProcessedPrivateKey(key) - return { - address: privateKeyToAddress(key).slice(2), - blsPublicKey: bls12377js.BLS.privateToPublicBytes(blsKeyBytes).toString('hex'), - } - }) + return getPrivateKeysFor(AccountType.VALIDATOR, mnemonic, n).map((key) => { + const blsKeyBytes = blsPrivateKeyToProcessedPrivateKey(key) + return { + address: strip0x(privateKeyToAddress(key)), + blsPublicKey: bls12377js.BLS.privateToPublicBytes(blsKeyBytes).toString('hex'), + } + }) } export const generateGenesisFromEnv = (enablePetersburg: boolean = true) => { + const mnemonic = fetchEnv(envVar.MNEMONIC) const validatorEnv = fetchEnv(envVar.VALIDATORS) const validators = validatorEnv === VALIDATOR_OG_SOURCE @@ -115,25 +114,12 @@ export const generateGenesisFromEnv = (enablePetersburg: boolean = true) => { blsPublicKey: bls12377js.BLS.privateToPublicBytes(blsKeyBytes).toString('hex'), } }) - : getValidators(fetchEnv(envVar.MNEMONIC), parseInt(validatorEnv, 10)) - - // @ts-ignore - if (![ConsensusType.CLIQUE, ConsensusType.ISTANBUL].includes(fetchEnv(envVar.CONSENSUS_TYPE))) { - console.error('Unsupported CONSENSUS_TYPE') - process.exit(1) - } + : getValidators(mnemonic, parseInt(validatorEnv, 10)) - // @ts-ignore - const consensusType: ConsensusType = fetchEnv(envVar.CONSENSUS_TYPE) + const consensusType = fetchEnv(envVar.CONSENSUS_TYPE) as ConsensusType - const contracts: string[] = fetchEnv(envVar.PREDEPLOYED_CONTRACTS) - .split(',') - // @ts-ignore - .map((contract) => CONTRACT_ADDRESSES[contract]) - - // @ts-ignore - if (contracts.includes(undefined)) { - console.error('Unsupported PREDEPLOYED_CONTRACTS value') + if (![ConsensusType.CLIQUE, ConsensusType.ISTANBUL].includes(consensusType)) { + console.error('Unsupported CONSENSUS_TYPE') process.exit(1) } @@ -141,15 +127,18 @@ export const generateGenesisFromEnv = (enablePetersburg: boolean = true) => { const epoch = parseInt(fetchEnvOrFallback(envVar.EPOCH, '30000'), 10) const chainId = parseInt(fetchEnv(envVar.NETWORK_ID), 10) - return generateGenesis( + // Assing DEFAULT ammount of gold to 2 faucet accounts + const faucetAddresses = getStrippedAddressesFor(AccountType.FAUCET, mnemonic, 2) + + return generateGenesis({ validators, consensusType, - contracts, blockTime, + initialAccounts: faucetAddresses, epoch, chainId, - enablePetersburg - ) + enablePetersburg, + }) } const generateIstanbulExtraData = (validators: Validator[]) => { @@ -174,15 +163,23 @@ const generateIstanbulExtraData = (validators: Validator[]) => { ) } -export const generateGenesis = ( - validators: Validator[], - consensusType: ConsensusType, - contracts: string[], - blockTime: number, - epoch: number, - chainId: number, - enablePetersburg: boolean = true -) => { +export const generateGenesis = ({ + validators, + consensusType = ConsensusType.ISTANBUL, + initialAccounts: otherAccounts = [], + blockTime, + epoch, + chainId, + enablePetersburg = true, +}: { + validators: Validator[] + consensusType?: ConsensusType + initialAccounts?: string[] + blockTime: number + epoch: number + chainId: number + enablePetersburg?: boolean +}) => { const genesis: any = { ...TEMPLATE } if (!enablePetersburg) { @@ -212,6 +209,13 @@ export const generateGenesis = ( } } + for (const address of otherAccounts) { + genesis.alloc[address] = { + balance: DEFAULT_BALANCE, + } + } + + const contracts = [REGISTRY_ADDRESS] for (const contract of contracts) { genesis.alloc[contract] = { code: PROXY_CONTRACT_CODE, diff --git a/packages/celotool/src/lib/genesis_constants.ts b/packages/celotool/src/lib/genesis_constants.ts index 0c5a9e6fd76..07ebfda220d 100644 --- a/packages/celotool/src/lib/genesis_constants.ts +++ b/packages/celotool/src/lib/genesis_constants.ts @@ -36,13 +36,7 @@ export const TEMPLATE = { export const PROXY_CONTRACT_CODE = '0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303386ba3146100df57806342404e071461012d578063bb913f4114610184578063d29d44ee146101c7578063f7e6af801461020a575b600060405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e000000000000000000815250601701905060405180910390209050805460405136810160405236600082376000803683855af43d604051818101604052816000823e82600081146100db578282f35b8282fd5b61012b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610261565b005b34801561013957600080fd5b5061014261031d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019057600080fd5b506101c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610360565b005b3480156101d357600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061044b565b005b34801561021657600080fd5b5061021f6104bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600061026b6104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806102bd57508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156102c857600080fd5b6102d184610360565b8373ffffffffffffffffffffffffffffffffffffffff16838360405180838380828437820191505092505050600060405180830381855af4915050151561031757600080fd5b50505050565b60008060405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e000000000000000000815250601701905060405180910390209050805491505090565b60008061036b6104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806103bd57508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156103c857600080fd5b60405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e0000000000000000008152506017019050604051809103902091508282558273ffffffffffffffffffffffffffffffffffffffff167fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1360405160405180910390a2505050565b60006104556104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806104a757508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156104b257600080fd5b6104bb82610502565b5050565b60008060405180807f6f72672e63656c6f2e6f776e6572000000000000000000000000000000000000815250600e01905060405180910390209050805491505090565b600060405180807f6f72672e63656c6f2e6f776e6572000000000000000000000000000000000000815250600e019050604051809103902090508181558173ffffffffffffffffffffffffffffffffffffffff167f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe260405160405180910390a250505600a165627a7a723058202e143bd88c74e9d3753b7bec1719bf5907ae012bc140b9b2b6edf2f9b686ff5d0029' -export const CONTRACT_ADDRESSES = { - REGISTRY: '000000000000000000000000000000000000ce10', - // TODO(asa): Remove once we tear down the environments that use these. - ABE: '0000000000000000000000000000000000000abe', - GOLD: '000000000000000000000000000000000000ce10', - RESERVE: '000000000000000000000000000000000000601d', -} +export const REGISTRY_ADDRESS = '000000000000000000000000000000000000ce10' export const CONTRACT_OWNER_STORAGE_LOCATION = '0x34dc5a2556b2030988481969696f29fed38d45813d8003f6c70e5c16ac92ae0f' diff --git a/packages/celotool/src/lib/geth.ts b/packages/celotool/src/lib/geth.ts index 2e1c7240499..9b50f3825da 100644 --- a/packages/celotool/src/lib/geth.ts +++ b/packages/celotool/src/lib/geth.ts @@ -1,12 +1,4 @@ /* tslint:disable: no-console */ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' -import { - AccountType, - generatePrivateKey, - privateKeyToPublicKey, -} from '@celo/celotool/src/lib/generate_utils' -import { retrieveIPAddress } from '@celo/celotool/src/lib/helm_deploy' -import { execCmd, execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' import { convertToContractDecimals, GoldToken, @@ -23,6 +15,10 @@ import fetch from 'node-fetch' import path from 'path' import Web3Type from 'web3' import { TransactionReceipt } from 'web3/types' +import { envVar, fetchEnv } from './env-utils' +import { AccountType, generatePrivateKey, privateKeyToPublicKey } from './generate_utils' +import { retrieveIPAddress } from './helm_deploy' +import { execCmd, execCmdWithExitOnFailure } from './utils' type HandleErrorCallback = (isError: boolean, data: { location: string; error: string }) => void diff --git a/packages/celotool/src/lib/helm_deploy.ts b/packages/celotool/src/lib/helm_deploy.ts index 88b7731ab60..50bd148f5f5 100644 --- a/packages/celotool/src/lib/helm_deploy.ts +++ b/packages/celotool/src/lib/helm_deploy.ts @@ -1,15 +1,11 @@ -import { getKubernetesClusterRegion, switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' -import { - EnvTypes, - envVar, - fetchEnv, - fetchEnvOrFallback, - isProduction, -} from '@celo/celotool/src/lib/env-utils' -import { ensureAuthenticatedGcloudAccount } from '@celo/celotool/src/lib/gcloud_utils' -import { generateGenesisFromEnv } from '@celo/celotool/src/lib/generate_utils' -import { OG_ACCOUNTS } from '@celo/celotool/src/lib/genesis_constants' -import { getStatefulSetReplicas, scaleResource } from '@celo/celotool/src/lib/kubernetes' +import { entries, flatMap, range } from 'lodash' +import sleep from 'sleep-promise' +import { getKubernetesClusterRegion, switchToClusterFromEnv } from './cluster' +import { EnvTypes, envVar, fetchEnv, fetchEnvOrFallback, isProduction } from './env-utils' +import { ensureAuthenticatedGcloudAccount } from './gcloud_utils' +import { generateGenesisFromEnv } from './generate_utils' +import { OG_ACCOUNTS } from './genesis_constants' +import { getStatefulSetReplicas, scaleResource } from './kubernetes' import { execCmd, execCmdWithExitOnFailure, @@ -17,9 +13,7 @@ import { getVerificationPoolSMSURL, outputIncludes, switchToProjectFromEnv, -} from '@celo/celotool/src/lib/utils' -import { entries, flatMap, range } from 'lodash' -import sleep from 'sleep-promise' +} from './utils' const CLOUDSQL_SECRET_NAME = 'blockscout-cloudsql-credentials' const BACKUP_GCS_SECRET_NAME = 'backup-blockchain-credentials' @@ -455,6 +449,11 @@ export async function deletePersistentVolumeClaims(celoEnv: string) { `kubectl delete pvc --selector='component=validators' --namespace ${celoEnv}` ) console.info(output) + + const [outputTx] = await execCmd( + `kubectl delete pvc --selector='component=tx_nodes' --namespace ${celoEnv}` + ) + console.info(outputTx) } catch (error) { console.error(error) if (!error.toString().includes('not found')) { @@ -555,11 +554,13 @@ async function helmParameters(celoEnv: string) { `--set geth.faultyValidators="${fetchEnvOrFallback('FAULTY_VALIDATORS', '0')}"`, `--set geth.faultyValidatorType="${fetchEnvOrFallback('FAULTY_VALIDATOR_TYPE', '0')}"`, `--set geth.tx_nodes="${fetchEnv('TX_NODES')}"`, + `--set geth.ssd_disks="${fetchEnvOrFallback(envVar.GETH_NODES_SSD_DISKS, 'true')}"`, `--set geth.admin_rpc_enabled=${fetchEnvOrFallback('ADMIN_RPC_ENABLED', 'false')}`, `--set mnemonic="${fetchEnv('MNEMONIC')}"`, `--set contracts.cron_jobs.enabled=${fetchEnv('CONTRACT_CRONJOBS_ENABLED')}`, `--set geth.account.secret="${fetchEnv('GETH_ACCOUNT_SECRET')}"`, `--set ethstats.webSocketSecret="${fetchEnv('ETHSTATS_WEBSOCKETSECRET')}"`, + `--set geth.ping_ip_from_packet=${fetchEnvOrFallback('PING_IP_FROM_PACKET', 'false')}`, ...productionTagOverrides, ...(await helmIPParameters(celoEnv)), ...gethAccountParameters, diff --git a/packages/celotool/src/lib/kubernetes.ts b/packages/celotool/src/lib/kubernetes.ts index 56740252bbd..bc6508ffea9 100644 --- a/packages/celotool/src/lib/kubernetes.ts +++ b/packages/celotool/src/lib/kubernetes.ts @@ -1,5 +1,5 @@ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' -import { execCmdWithExitOnFailure } from '@celo/celotool/src/lib/utils' +import { envVar, fetchEnv } from './env-utils' +import { execCmdWithExitOnFailure } from './utils' const NUMBER_OF_TX_NODES = 4 diff --git a/packages/celotool/src/lib/load-test.ts b/packages/celotool/src/lib/load-test.ts index 68cc2be40f3..168eb0df784 100644 --- a/packages/celotool/src/lib/load-test.ts +++ b/packages/celotool/src/lib/load-test.ts @@ -1,6 +1,6 @@ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' import { getEnodesAddresses } from 'src/lib/geth' import { installGenericHelmChart, removeGenericHelmChart } from 'src/lib/helm_deploy' +import { envVar, fetchEnv } from './env-utils' export async function installHelmChart( celoEnv: string, diff --git a/packages/celotool/src/lib/policies.ts b/packages/celotool/src/lib/policies.ts index f74fb18401e..6522b9f6fc6 100644 --- a/packages/celotool/src/lib/policies.ts +++ b/packages/celotool/src/lib/policies.ts @@ -1,5 +1,5 @@ -import { execCmd } from '@celo/celotool/src/lib/utils' import path from 'path' +import { execCmd } from './utils' const yaml = require('js-yaml') const fs = require('fs') const { promisify } = require('util') diff --git a/packages/celotool/src/lib/port_forward.ts b/packages/celotool/src/lib/port_forward.ts index 67bc32b8dc2..afda681d277 100644 --- a/packages/celotool/src/lib/port_forward.ts +++ b/packages/celotool/src/lib/port_forward.ts @@ -1,7 +1,7 @@ /* tslint:disable: no-console */ -import { envVar, fetchEnv, isVmBased } from '@celo/celotool/src/lib/env-utils' -import { execBackgroundCmd, execCmd } from '@celo/celotool/src/lib/utils' import { ChildProcess, spawnSync } from 'child_process' +import { envVar, fetchEnv, isVmBased } from './env-utils' +import { execBackgroundCmd, execCmd } from './utils' function sleep(ms: number) { return new Promise((resolve) => setTimeout(resolve, ms)) diff --git a/packages/celotool/src/lib/pumba.ts b/packages/celotool/src/lib/pumba.ts index e3b71765781..4ecd35145f4 100644 --- a/packages/celotool/src/lib/pumba.ts +++ b/packages/celotool/src/lib/pumba.ts @@ -1,5 +1,5 @@ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' import { makeHelmParameters } from 'src/lib/helm_deploy' +import { envVar, fetchEnv } from './env-utils' export function helmReleaseName(celoEnv: string) { return celoEnv + '-pumba' diff --git a/packages/celotool/src/lib/terraform.ts b/packages/celotool/src/lib/terraform.ts index 2f20b8d3b81..764f1e81697 100644 --- a/packages/celotool/src/lib/terraform.ts +++ b/packages/celotool/src/lib/terraform.ts @@ -1,6 +1,6 @@ -import { execCmd } from '@celo/celotool/src/lib/utils' import fs from 'fs' import path from 'path' +import { execCmd } from './utils' const terraformModulesPath = path.join(__dirname, '../../../terraform-modules') diff --git a/packages/celotool/src/lib/testnet-utils.ts b/packages/celotool/src/lib/testnet-utils.ts index d2eccc0ed3a..881fa989db3 100644 --- a/packages/celotool/src/lib/testnet-utils.ts +++ b/packages/celotool/src/lib/testnet-utils.ts @@ -1,9 +1,9 @@ -import { ensureAuthenticatedGcloudAccount } from '@celo/celotool/src/lib/gcloud_utils' -import { generateGenesisFromEnv } from '@celo/celotool/src/lib/generate_utils' -import { getEnodesWithExternalIPAddresses, sleep } from '@celo/celotool/src/lib/geth' import { StaticNodeUtils } from '@celo/walletkit' import { Storage } from '@google-cloud/storage' import { writeFileSync } from 'fs' +import { ensureAuthenticatedGcloudAccount } from './gcloud_utils' +import { generateGenesisFromEnv } from './generate_utils' +import { getEnodesWithExternalIPAddresses, sleep } from './geth' const genesisBlocksBucketName = 'genesis_blocks' const staticNodesBucketName = StaticNodeUtils.getStaticNodesGoogleStorageBucketName() diff --git a/packages/celotool/src/lib/tracer-tool.ts b/packages/celotool/src/lib/tracer-tool.ts index cdc3658bd59..091b396383b 100644 --- a/packages/celotool/src/lib/tracer-tool.ts +++ b/packages/celotool/src/lib/tracer-tool.ts @@ -1,6 +1,6 @@ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' import { getEnodesAddresses } from 'src/lib/geth' import { execCmdWithExitOnFailure } from 'src/lib/utils' +import { envVar, fetchEnv } from './env-utils' export async function installHelmChart(celoEnv: string) { console.info(`Installing helm release ${celoEnv}-tracer-tool`) diff --git a/packages/celotool/src/lib/transaction-metrics-exporter.ts b/packages/celotool/src/lib/transaction-metrics-exporter.ts index 51b74bb8ed5..b7b7d7f026f 100644 --- a/packages/celotool/src/lib/transaction-metrics-exporter.ts +++ b/packages/celotool/src/lib/transaction-metrics-exporter.ts @@ -1,5 +1,5 @@ -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' import { execCmdWithExitOnFailure } from 'src/lib/utils' +import { envVar, fetchEnv } from './env-utils' export async function installHelmChart(celoEnv: string) { console.info(`Installing helm release ${celoEnv}-transaction-metrics-exporter`) diff --git a/packages/celotool/src/lib/utils.ts b/packages/celotool/src/lib/utils.ts index 17fe4b123ae..ade49332c59 100644 --- a/packages/celotool/src/lib/utils.ts +++ b/packages/celotool/src/lib/utils.ts @@ -1,9 +1,9 @@ -import { switchToClusterFromEnv } from '@celo/celotool/src/lib/cluster' -import { envVar, fetchEnv } from '@celo/celotool/src/lib/env-utils' -import { retrieveIPAddress } from '@celo/celotool/src/lib/helm_deploy' import { exec } from 'child_process' // import prompts from 'prompts' import yargs from 'yargs' +import { switchToClusterFromEnv } from './cluster' +import { envVar, fetchEnv } from './env-utils' +import { retrieveIPAddress } from './helm_deploy' export function execCmd( cmd: string, diff --git a/packages/celotool/src/lib/vm-testnet-utils.ts b/packages/celotool/src/lib/vm-testnet-utils.ts index 86aeacee624..c4e01774228 100644 --- a/packages/celotool/src/lib/vm-testnet-utils.ts +++ b/packages/celotool/src/lib/vm-testnet-utils.ts @@ -1,16 +1,12 @@ -import { - confirmAction, - envVar, - fetchEnv, - fetchEnvOrFallback, -} from '@celo/celotool/src/lib/env-utils' +import { writeFileSync } from 'fs' +import { confirmAction, envVar, fetchEnv, fetchEnvOrFallback } from './env-utils' import { AccountType, generateGenesisFromEnv, generatePrivateKey, privateKeyToAddress, privateKeyToPublicKey, -} from '@celo/celotool/src/lib/generate_utils' +} from './generate_utils' import { applyTerraformModule, destroyTerraformModule, @@ -21,12 +17,8 @@ import { taintTerraformModuleResource, TerraformVars, untaintTerraformModuleResource, -} from '@celo/celotool/src/lib/terraform' -import { - uploadFileToGoogleStorage, - uploadGenesisBlockToGoogleStorage, -} from '@celo/celotool/src/lib/testnet-utils' -import { writeFileSync } from 'fs' +} from './terraform' +import { uploadFileToGoogleStorage, uploadGenesisBlockToGoogleStorage } from './testnet-utils' const secretsBucketName = 'celo-testnet-secrets' const testnetTerraformModule = 'testnet' diff --git a/packages/celotool/index.d.ts b/packages/celotool/src/types.d.ts similarity index 100% rename from packages/celotool/index.d.ts rename to packages/celotool/src/types.d.ts diff --git a/packages/celotool/test/genesis_predeployed_default.json b/packages/celotool/test/genesis_predeployed_default.json deleted file mode 100644 index bdbcb5cc9db..00000000000 --- a/packages/celotool/test/genesis_predeployed_default.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "config": { - "chainId": 1101, - "homesteadBlock": 1, - "eip150Block": 2, - "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "eip155Block": 3, - "eip158Block": 3, - "byzantiumBlock": 4, - "clique": { - "period": 5, - "epoch": 30000 - } - }, - "nonce": "0x0", - "timestamp": "0x5b843511", - "extraData": - "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000feE1a22F43BeeCB912B5a4912ba87527682ef0fC889F21CE69dcc25a4594f73230A55896d67038065372d2bbBaBaAf1495182E31cF13dB0d18463B0EF71690ea7E0c67827d8968882FAC0c4cBBD65BCE0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "gasLimit": "0x8000000", - "difficulty": "0x0400", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "alloc": { - "feE1a22F43BeeCB912B5a4912ba87527682ef0fC": { - "balance": "1000000000000000000000000" - }, - "889F21CE69dcc25a4594f73230A55896d6703806": { - "balance": "1000000000000000000000000" - }, - "5372d2bbBaBaAf1495182E31cF13dB0d18463B0E": { - "balance": "1000000000000000000000000" - }, - "F71690ea7E0c67827d8968882FAC0c4cBBD65BCE": { - "balance": "1000000000000000000000000" - }, - "0000000000000000000000000000000000000abe": { - "code": - "0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303386ba3146100df57806342404e071461012d578063bb913f4114610184578063d29d44ee146101c7578063f7e6af801461020a575b600060405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e000000000000000000815250601701905060405180910390209050805460405136810160405236600082376000803683855af43d604051818101604052816000823e82600081146100db578282f35b8282fd5b61012b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610261565b005b34801561013957600080fd5b5061014261031d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019057600080fd5b506101c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610360565b005b3480156101d357600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061044b565b005b34801561021657600080fd5b5061021f6104bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600061026b6104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806102bd57508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156102c857600080fd5b6102d184610360565b8373ffffffffffffffffffffffffffffffffffffffff16838360405180838380828437820191505092505050600060405180830381855af4915050151561031757600080fd5b50505050565b60008060405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e000000000000000000815250601701905060405180910390209050805491505090565b60008061036b6104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806103bd57508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156103c857600080fd5b60405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e0000000000000000008152506017019050604051809103902091508282558273ffffffffffffffffffffffffffffffffffffffff167fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1360405160405180910390a2505050565b60006104556104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806104a757508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156104b257600080fd5b6104bb82610502565b5050565b60008060405180807f6f72672e63656c6f2e6f776e6572000000000000000000000000000000000000815250600e01905060405180910390209050805491505090565b600060405180807f6f72672e63656c6f2e6f776e6572000000000000000000000000000000000000815250600e019050604051809103902090508181558173ffffffffffffffffffffffffffffffffffffffff167f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe260405160405180910390a250505600a165627a7a723058202e143bd88c74e9d3753b7bec1719bf5907ae012bc140b9b2b6edf2f9b686ff5d0029", - "storage": { - "0x34dc5a2556b2030988481969696f29fed38d45813d8003f6c70e5c16ac92ae0f": - "feE1a22F43BeeCB912B5a4912ba87527682ef0fC" - }, - "balance": "0" - }, - "000000000000000000000000000000000000ce10": { - "code": - "0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303386ba3146100df57806342404e071461012d578063bb913f4114610184578063d29d44ee146101c7578063f7e6af801461020a575b600060405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e000000000000000000815250601701905060405180910390209050805460405136810160405236600082376000803683855af43d604051818101604052816000823e82600081146100db578282f35b8282fd5b61012b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610261565b005b34801561013957600080fd5b5061014261031d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019057600080fd5b506101c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610360565b005b3480156101d357600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061044b565b005b34801561021657600080fd5b5061021f6104bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600061026b6104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806102bd57508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156102c857600080fd5b6102d184610360565b8373ffffffffffffffffffffffffffffffffffffffff16838360405180838380828437820191505092505050600060405180830381855af4915050151561031757600080fd5b50505050565b60008060405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e000000000000000000815250601701905060405180910390209050805491505090565b60008061036b6104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806103bd57508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156103c857600080fd5b60405180807f6f72672e63656c6f2e696d706c656d656e746174696f6e0000000000000000008152506017019050604051809103902091508282558273ffffffffffffffffffffffffffffffffffffffff167fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1360405160405180910390a2505050565b60006104556104bf565b905060008173ffffffffffffffffffffffffffffffffffffffff1614806104a757508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156104b257600080fd5b6104bb82610502565b5050565b60008060405180807f6f72672e63656c6f2e6f776e6572000000000000000000000000000000000000815250600e01905060405180910390209050805491505090565b600060405180807f6f72672e63656c6f2e6f776e6572000000000000000000000000000000000000815250600e019050604051809103902090508181558173ffffffffffffffffffffffffffffffffffffffff167f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe260405160405180910390a250505600a165627a7a723058202e143bd88c74e9d3753b7bec1719bf5907ae012bc140b9b2b6edf2f9b686ff5d0029", - "storage": { - "0x34dc5a2556b2030988481969696f29fed38d45813d8003f6c70e5c16ac92ae0f": - "feE1a22F43BeeCB912B5a4912ba87527682ef0fC" - }, - "balance": "0" - } - }, - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" -} diff --git a/packages/celotool/tsconfig.json b/packages/celotool/tsconfig.json index 3a272b62d7e..ef8424cc086 100644 --- a/packages/celotool/tsconfig.json +++ b/packages/celotool/tsconfig.json @@ -1,29 +1,18 @@ { + "extends": "../typescript/tsconfig.library.json", "compilerOptions": { - "plugins": [ - { - "name": "typescript-tslint-plugin" - } - ], + "outDir": "lib", + "rootDir": "src", "baseUrl": ".", "lib": ["es7", "es2017"], - "module": "commonjs", - "moduleResolution": "node", - "skipLibCheck": true, - "noImplicitAny": true, - "noUnusedLocals": true, - "noUnusedParameters": true, + "target": "es6", "resolveJsonModule": true, - "strict": true, "noEmit": true, - "target": "es6", "esModuleInterop": true, - "allowSyntheticDefaultImports": true, "paths": { - "eth-lib": ["types/eth-lib"], "@google-cloud/monitoring": ["types/monitoring"] } }, - "include": ["src/**/*", "lib/**/*", "index.d.ts"], - "exclude": ["./node_modules/**/*"] + "include": ["src/"], + "exclude": ["node_modules/"] } diff --git a/packages/celotool/tslint.json b/packages/celotool/tslint.json index 1730e39dc29..3f886bf4634 100644 --- a/packages/celotool/tslint.json +++ b/packages/celotool/tslint.json @@ -4,7 +4,7 @@ "exclude": ["**/__mocks__/**", "**/lcov-report/**"] }, "rules": { - "no-relative-imports": true, + "no-relative-imports": false, "max-classes-per-file": [true, 2], "no-global-arrow-functions": false, "no-floating-promises": true diff --git a/packages/celotool/types/pumba.yaml b/packages/celotool/types/pumba.yaml deleted file mode 100644 index b5dccc6442a..00000000000 --- a/packages/celotool/types/pumba.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: DaemonSet -metadata: - name: pumba -spec: - template: - metadata: - labels: - app: pumba - com.gaiaadm.pumba: "true" # prevent pumba from killing itself - name: pumba - spec: - containers: - - image: gaiaadm/pumba:master - imagePullPolicy: Always - name: pumba - # Pumba command: modify it to suite your needs - # Currently: randomly try to kill some container every 3 minutes - args: - - netem - - delay - - --time - - "2000" - resources: - requests: - cpu: 10m - memory: 5M - limits: - cpu: 100m - memory: 20M - # run on regular nodes and not api nodes where the critical infrastucure like kube-scheduler lives - # nodeSelector: - # node-type: node - volumeMounts: - - name: dockersocket - mountPath: /var/run/docker.sock - volumes: - - hostPath: - path: /var/run/docker.sock - name: dockersocket \ No newline at end of file diff --git a/packages/cli/cloudbuild.yaml b/packages/cli/cloudbuild.yaml new file mode 100644 index 00000000000..8e9824d7003 --- /dev/null +++ b/packages/cli/cloudbuild.yaml @@ -0,0 +1,18 @@ +steps: + +# Unshallow clone +- name: gcr.io/cloud-builders/git + args: ['fetch', '--unshallow'] + +# build docker image for google container registry +- name: gcr.io/kaniko-project/executor:latest + args: [ + "--dockerfile=dockerfiles/cli/Dockerfile.cli", + "--cache=true", + "--destination=gcr.io/$PROJECT_ID/celocli:$COMMIT_SHA", + "--build-arg", + "celo_env=alfajores" + ] + id: Build CLI docker image + waitFor: ['-'] +timeout: 1000s \ No newline at end of file diff --git a/packages/cli/package.json b/packages/cli/package.json index 921ac5006b2..4a69e3fc68d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@celo/celocli", "description": "CLI Tool for transacting with the Celo protocol", - "version": "0.0.17", + "version": "0.0.18", "author": "Celo", "license": "Apache-2.0", "repository": "celo-org/celo-monorepo", @@ -60,7 +60,8 @@ "@types/fs-extra": "^8.0.0", "@types/node": "^10", "@types/web3": "^1.0.18", - "globby": "^8" + "globby": "^8", + "typescript": "^3.5.3" }, "files": [ "README.md", diff --git a/packages/cli/src/commands/lockedgold/lockup.ts b/packages/cli/src/commands/lockedgold/lockup.ts index a99230c7e08..18c689a2fc2 100644 --- a/packages/cli/src/commands/lockedgold/lockup.ts +++ b/packages/cli/src/commands/lockedgold/lockup.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/utils/lib/src/address' +import { Address } from '@celo/utils/lib/address' import { flags } from '@oclif/command' import BigNumber from 'bignumber.js' import { BaseCommand } from '../../base' diff --git a/packages/cli/src/utils/helpers.ts b/packages/cli/src/utils/helpers.ts index cb01bfd0cf3..0645a1019f0 100644 --- a/packages/cli/src/utils/helpers.ts +++ b/packages/cli/src/utils/helpers.ts @@ -1,4 +1,4 @@ -import { eqAddress } from '@celo/utils/lib/src/address' +import { eqAddress } from '@celo/utils/lib/address' import ethjsutil from 'ethereumjs-util' import Web3 from 'web3' diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 00453cb784a..020ae87c3e7 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../typescript/tsconfig.library.json", "compilerOptions": { "rootDir": "src", - "outDir": "lib" + "outDir": "lib", + "esModuleInterop": true }, "include": ["src"] } diff --git a/packages/contractkit/src/address-registry.ts b/packages/contractkit/src/address-registry.ts index e7c0e369a16..a278fb787d8 100644 --- a/packages/contractkit/src/address-registry.ts +++ b/packages/contractkit/src/address-registry.ts @@ -1,4 +1,5 @@ import debugFactory from 'debug' +import Web3 from 'web3' import { Address, AllContracts, CeloContract, NULL_ADDRESS } from './base' import { newRegistry } from './generated/Registry' import { Registry } from './generated/types/Registry' @@ -20,7 +21,8 @@ export class AddressRegistry { async addressFor(contract: CeloContract): Promise
{ if (!this.cache.has(contract)) { - const address = await this.registry.methods.getAddressFor(contract).call() + const hash = Web3.utils.soliditySha3({ type: 'string', value: contract }) + const address = await this.registry.methods.getAddressFor(hash).call() if (!address || address === NULL_ADDRESS) { throw new Error(`Failed to get address for ${contract} from the Registry`) diff --git a/packages/contractkit/src/test-utils/ganache.setup.ts b/packages/contractkit/src/test-utils/ganache.setup.ts index bf051fadbbe..8c1ba6a03cb 100644 --- a/packages/contractkit/src/test-utils/ganache.setup.ts +++ b/packages/contractkit/src/test-utils/ganache.setup.ts @@ -20,6 +20,8 @@ export async function startGanache(datadir: string, opts: { verbose?: boolean } network_id: 1101, db_path: datadir, mnemonic: MNEMONIC, + gasLimit: 7000000, + allowUnlimitedContractSize: true, }) await new Promise((resolve, reject) => { diff --git a/packages/contractkit/src/utils/tx-result.ts b/packages/contractkit/src/utils/tx-result.ts index 471b140bcdb..6ae849bb9cc 100644 --- a/packages/contractkit/src/utils/tx-result.ts +++ b/packages/contractkit/src/utils/tx-result.ts @@ -1,7 +1,7 @@ +import { Future } from '@celo/utils/lib/future' import debugFactory from 'debug' import PromiEvent from 'web3/promiEvent' import { TransactionReceipt } from 'web3/types' -import { Future } from './future' const debug = debugFactory('kit:tx:result') diff --git a/packages/contractkit/src/wrappers/BaseWrapper.ts b/packages/contractkit/src/wrappers/BaseWrapper.ts index bce47e4376e..955aaf7b1e2 100644 --- a/packages/contractkit/src/wrappers/BaseWrapper.ts +++ b/packages/contractkit/src/wrappers/BaseWrapper.ts @@ -1,4 +1,4 @@ -import { zip } from '@celo/utils/lib/src/collections' +import { zip } from '@celo/utils/lib/collections' import BigNumber from 'bignumber.js' import Contract from 'web3/eth/contract' import { TransactionObject } from 'web3/eth/types' diff --git a/packages/contractkit/src/wrappers/LockedGold.ts b/packages/contractkit/src/wrappers/LockedGold.ts index 3c671a8587d..ff1174a44c0 100644 --- a/packages/contractkit/src/wrappers/LockedGold.ts +++ b/packages/contractkit/src/wrappers/LockedGold.ts @@ -1,4 +1,4 @@ -import { zip } from '@celo/utils/lib/src/collections' +import { zip } from '@celo/utils/lib/collections' import BigNumber from 'bignumber.js' import Web3 from 'web3' import { TransactionObject } from 'web3/eth/types' diff --git a/packages/contractkit/src/wrappers/Validators.ts b/packages/contractkit/src/wrappers/Validators.ts index 053639096bd..8f84cf6dcdf 100644 --- a/packages/contractkit/src/wrappers/Validators.ts +++ b/packages/contractkit/src/wrappers/Validators.ts @@ -1,5 +1,5 @@ -import { eqAddress } from '@celo/utils/lib/src/address' -import { zip } from '@celo/utils/lib/src/collections' +import { eqAddress } from '@celo/utils/lib/address' +import { zip } from '@celo/utils/lib/collections' import BigNumber from 'bignumber.js' import { Address, NULL_ADDRESS } from '../base' import { Validators } from '../generated/types/Validators' @@ -119,7 +119,7 @@ export class ValidatorsWrapper extends BaseWrapper { votedGroup: Address, voteWeight: BigNumber ): Promise<{ lesser: Address; greater: Address }> { - const currentVotes = await this.getValidatorGroupsVotes() + const currentVotes = (await this.getValidatorGroupsVotes()).filter((g) => !g.votes.isZero()) const selectedGroup = currentVotes.find((cv) => eqAddress(cv.address, votedGroup)) diff --git a/packages/dappkit/src/index.ts b/packages/dappkit/src/index.ts index 9e3fafbf6be..9111ed0dfbf 100644 --- a/packages/dappkit/src/index.ts +++ b/packages/dappkit/src/index.ts @@ -120,8 +120,8 @@ async function getGasCurrencyContractAddress( export interface TxParams { tx: TransactionObject from: string - to: string - gasCurrency: GasCurrency + to?: string + gasCurrency?: GasCurrency estimatedGas?: number value?: string } @@ -135,10 +135,8 @@ export async function requestTxSig( const baseNonce = await kit.web3.eth.getTransactionCount(txParams[0].from) const txs: TxToSignParam[] = await Promise.all( txParams.map(async (txParam, index) => { - const gasCurrencyContractAddress = await getGasCurrencyContractAddress( - kit, - txParam.gasCurrency - ) + const gasCurrency = txParam.gasCurrency ? txParam.gasCurrency : GasCurrency.cGLD + const gasCurrencyContractAddress = await getGasCurrencyContractAddress(kit, gasCurrency) const value = txParam.value === undefined ? '0' : txParam.value const estimatedTxParams = { diff --git a/packages/docs/command-line-interface/account.md b/packages/docs/command-line-interface/account.md index cdfe634fa0a..7ecfc883e14 100644 --- a/packages/docs/command-line-interface/account.md +++ b/packages/docs/command-line-interface/account.md @@ -16,7 +16,7 @@ EXAMPLE balance 0x5409ed021d9299bf6814279a6a1411a7e866a631 ``` -_See code: [packages/cli/lib/commands/account/balance.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/account/balance.js)_ +_See code: [packages/cli/src/commands/account/balance.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/account/balance.ts)_ ### New @@ -30,7 +30,7 @@ EXAMPLE new ``` -_See code: [packages/cli/lib/commands/account/new.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/account/new.js)_ +_See code: [packages/cli/src/commands/account/new.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/account/new.ts)_ ### Transferdollar @@ -50,7 +50,7 @@ EXAMPLE --amountInWei 1 ``` -_See code: [packages/cli/lib/commands/account/transferdollar.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/account/transferdollar.js)_ +_See code: [packages/cli/src/commands/account/transferdollar.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/account/transferdollar.ts)_ ### Transfergold @@ -70,7 +70,7 @@ EXAMPLE --amountInWei 1 ``` -_See code: [packages/cli/lib/commands/account/transfergold.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/account/transfergold.js)_ +_See code: [packages/cli/src/commands/account/transfergold.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/account/transfergold.ts)_ ### Unlock @@ -88,4 +88,4 @@ EXAMPLE unlock --account 0x5409ed021d9299bf6814279a6a1411a7e866a631 --password 1234 ``` -_See code: [packages/cli/lib/commands/account/unlock.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/account/unlock.js)_ +_See code: [packages/cli/src/commands/account/unlock.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/account/unlock.ts)_ diff --git a/packages/docs/command-line-interface/config.md b/packages/docs/command-line-interface/config.md index 169426b2790..f313c741e4e 100644 --- a/packages/docs/command-line-interface/config.md +++ b/packages/docs/command-line-interface/config.md @@ -13,7 +13,7 @@ USAGE $ celocli config:get ``` -_See code: [packages/cli/lib/commands/config/get.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/config/get.js)_ +_See code: [packages/cli/src/commands/config/get.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/config/get.ts)_ ### Set @@ -27,4 +27,4 @@ OPTIONS --node=node (required) [default: ws://localhost:8546] Node URL ``` -_See code: [packages/cli/lib/commands/config/set.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/config/set.js)_ +_See code: [packages/cli/src/commands/config/set.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/config/set.ts)_ diff --git a/packages/docs/command-line-interface/exchange.md b/packages/docs/command-line-interface/exchange.md index d33539f2fba..16fc35f9776 100644 --- a/packages/docs/command-line-interface/exchange.md +++ b/packages/docs/command-line-interface/exchange.md @@ -19,7 +19,7 @@ EXAMPLE list ``` -_See code: [packages/cli/lib/commands/exchange/list.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/exchange/list.js)_ +_See code: [packages/cli/src/commands/exchange/list.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/exchange/list.ts)_ ### Selldollar @@ -38,7 +38,7 @@ EXAMPLE selldollar 100 300 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d ``` -_See code: [packages/cli/lib/commands/exchange/selldollar.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/exchange/selldollar.js)_ +_See code: [packages/cli/src/commands/exchange/selldollar.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/exchange/selldollar.ts)_ ### Sellgold @@ -57,4 +57,4 @@ EXAMPLE sellgold 100 300 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d ``` -_See code: [packages/cli/lib/commands/exchange/sellgold.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/exchange/sellgold.js)_ +_See code: [packages/cli/src/commands/exchange/sellgold.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/exchange/sellgold.ts)_ diff --git a/packages/docs/command-line-interface/lockedgold.md b/packages/docs/command-line-interface/lockedgold.md index 337dbee9ef6..a8f11cf9a25 100644 --- a/packages/docs/command-line-interface/lockedgold.md +++ b/packages/docs/command-line-interface/lockedgold.md @@ -16,7 +16,7 @@ EXAMPLE list 0x5409ed021d9299bf6814279a6a1411a7e866a631 ``` -_See code: [packages/cli/lib/commands/lockedgold/list.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/lockedgold/list.js)_ +_See code: [packages/cli/src/commands/lockedgold/list.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/lockedgold/list.ts)_ ### Lockup @@ -37,7 +37,7 @@ EXAMPLE lockup --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95 --noticePeriod 8640 --goldAmount 1000000000000000000 ``` -_See code: [packages/cli/lib/commands/lockedgold/lockup.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/lockedgold/lockup.js)_ +_See code: [packages/cli/src/commands/lockedgold/lockup.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/lockedgold/lockup.ts)_ ### Notify @@ -58,7 +58,7 @@ EXAMPLE notify --noticePeriod=3600 --goldAmount=500 ``` -_See code: [packages/cli/lib/commands/lockedgold/notify.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/lockedgold/notify.js)_ +_See code: [packages/cli/src/commands/lockedgold/notify.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/lockedgold/notify.ts)_ ### Register @@ -75,7 +75,7 @@ EXAMPLE register ``` -_See code: [packages/cli/lib/commands/lockedgold/register.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/lockedgold/register.js)_ +_See code: [packages/cli/src/commands/lockedgold/register.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/lockedgold/register.ts)_ ### Rewards @@ -95,7 +95,7 @@ EXAMPLES rewards --delegate=0x56e172F6CfB6c7D01C1574fa3E2Be7CC73269D95 ``` -_See code: [packages/cli/lib/commands/lockedgold/rewards.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/lockedgold/rewards.js)_ +_See code: [packages/cli/src/commands/lockedgold/rewards.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/lockedgold/rewards.ts)_ ### Show @@ -116,7 +116,7 @@ EXAMPLES show 0x5409ed021d9299bf6814279a6a1411a7e866a631 --availabilityTime=1562206887 ``` -_See code: [packages/cli/lib/commands/lockedgold/show.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/lockedgold/show.js)_ +_See code: [packages/cli/src/commands/lockedgold/show.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/lockedgold/show.ts)_ ### Withdraw @@ -136,4 +136,4 @@ EXAMPLE withdraw 3600 ``` -_See code: [packages/cli/lib/commands/lockedgold/withdraw.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/lockedgold/withdraw.js)_ +_See code: [packages/cli/src/commands/lockedgold/withdraw.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/lockedgold/withdraw.ts)_ diff --git a/packages/docs/command-line-interface/node.md b/packages/docs/command-line-interface/node.md index d729f27b403..f4c73dc394b 100644 --- a/packages/docs/command-line-interface/node.md +++ b/packages/docs/command-line-interface/node.md @@ -13,4 +13,4 @@ USAGE $ celocli node:accounts ``` -_See code: [packages/cli/lib/commands/node/accounts.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/node/accounts.js)_ +_See code: [packages/cli/src/commands/node/accounts.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/node/accounts.ts)_ diff --git a/packages/docs/command-line-interface/validator.md b/packages/docs/command-line-interface/validator.md index 975e3eb7d81..61aef493ecd 100644 --- a/packages/docs/command-line-interface/validator.md +++ b/packages/docs/command-line-interface/validator.md @@ -22,7 +22,7 @@ EXAMPLES affiliation --unset --from 0x47e172f6cfb6c7d01c1574fa3e2be7cc73269d95 ``` -_See code: [packages/cli/lib/commands/validator/affiliation.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validator/affiliation.js)_ +_See code: [packages/cli/src/commands/validator/affiliation.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validator/affiliation.ts)_ ### List @@ -36,7 +36,7 @@ EXAMPLE list ``` -_See code: [packages/cli/lib/commands/validator/list.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validator/list.js)_ +_See code: [packages/cli/src/commands/validator/list.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validator/list.ts)_ ### Register @@ -63,7 +63,7 @@ EXAMPLE 96bad27bb1c0fd6080a75b0ec9f75b50298a2a8e04b02b2688c8104fca61fb00 ``` -_See code: [packages/cli/lib/commands/validator/register.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validator/register.js)_ +_See code: [packages/cli/src/commands/validator/register.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validator/register.ts)_ ### Show @@ -80,4 +80,4 @@ EXAMPLE show 0x97f7333c51897469E8D98E7af8653aAb468050a3 ``` -_See code: [packages/cli/lib/commands/validator/show.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validator/show.js)_ +_See code: [packages/cli/src/commands/validator/show.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validator/show.ts)_ diff --git a/packages/docs/command-line-interface/validatorgroup.md b/packages/docs/command-line-interface/validatorgroup.md index a340e5e9a8b..c515fb48a82 100644 --- a/packages/docs/command-line-interface/validatorgroup.md +++ b/packages/docs/command-line-interface/validatorgroup.md @@ -16,7 +16,7 @@ EXAMPLE list ``` -_See code: [packages/cli/lib/commands/validatorgroup/list.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validatorgroup/list.js)_ +_See code: [packages/cli/src/commands/validatorgroup/list.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validatorgroup/list.ts)_ ### Member @@ -39,7 +39,7 @@ EXAMPLES member --remove 0x47e172f6cfb6c7d01c1574fa3e2be7cc73269d95 ``` -_See code: [packages/cli/lib/commands/validatorgroup/member.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validatorgroup/member.js)_ +_See code: [packages/cli/src/commands/validatorgroup/member.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validatorgroup/member.ts)_ ### Register @@ -64,7 +64,7 @@ EXAMPLE "http://vgroup.com" ``` -_See code: [packages/cli/lib/commands/validatorgroup/register.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validatorgroup/register.js)_ +_See code: [packages/cli/src/commands/validatorgroup/register.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validatorgroup/register.ts)_ ### Show @@ -81,7 +81,7 @@ EXAMPLE show 0x97f7333c51897469E8D98E7af8653aAb468050a3 ``` -_See code: [packages/cli/lib/commands/validatorgroup/show.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validatorgroup/show.js)_ +_See code: [packages/cli/src/commands/validatorgroup/show.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validatorgroup/show.ts)_ ### Vote @@ -103,4 +103,4 @@ EXAMPLES vote --from 0x4443d0349e8b3075cba511a0a87796597602a0f1 --current ``` -_See code: [packages/cli/lib/commands/validatorgroup/vote.js](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/lib/commands/validatorgroup/vote.js)_ +_See code: [packages/cli/src/commands/validatorgroup/vote.ts](https://github.com/celo-org/celo-monorepo/tree/master/packages/cli/src/commands/validatorgroup/vote.ts)_ diff --git a/packages/faucet/package.json b/packages/faucet/package.json index 5c0b2c60a07..9b19f0e2af1 100644 --- a/packages/faucet/package.json +++ b/packages/faucet/package.json @@ -24,7 +24,7 @@ "eth-lib": "^0.2.8", "firebase": "^6.2.2", "firebase-admin": "^7.0.0", - "firebase-functions": "^2.2.2", + "firebase-functions": "^2.3.1", "rlp": "^2.2.3", "twilio": "^3.23.2", "web3": "1.0.0-beta.37", @@ -37,7 +37,7 @@ "@types/yargs": "^13.0.2", "cross-env": "5.2.0", "firebase-bolt": "^0.8.4", - "firebase-tools": "^7.0.1", + "firebase-tools": "^7.3.0", "rimraf": "2.6.3", "yargs": "14.0.0" diff --git a/packages/faucet/scripts/test-celo-adapter.ts b/packages/faucet/scripts/test-celo-adapter.ts new file mode 100644 index 00000000000..4aab343a17f --- /dev/null +++ b/packages/faucet/scripts/test-celo-adapter.ts @@ -0,0 +1,70 @@ +import Web3 from 'web3' +import { CeloAdapter } from '../src/celo-adapter' +import { getAddress } from '../src/tx' + +// Obtained from `yarn cli config:get --net alfajores` +const Config = { + stable_token_address: '0xd4b4fcaCAc9e23225680e89308E0a4C41Dd9C6B4', + node_url: 'http://35.185.236.10:8545', + escrow_address: '0xEa1B07eb5E3D3f3b93bf0d0ca7e6E2ba6F566Af4', + gold_token_address: '0x11CD75C45638Ec9f41C0e8Df78fc756201E48ff2', +} + +const FAUCET_ADDR = '0x22579CA45eE22E2E16dDF72D955D6cf4c767B0eF' + +async function main() { + const web3 = new Web3(Config.node_url) + + if (process.argv.length !== 4) { + console.log(`Call with: `) + process.exit(1) + } + + const pk = process.argv[2] + const to = process.argv[3] + + if (getAddress(web3, pk).toLowerCase() !== FAUCET_ADDR.toLowerCase()) { + console.log( + `PrivateKey for invalid address. Expected: ${FAUCET_ADDR}, GOT: ${getAddress(web3, pk)}` + ) + process.exit(1) + } + + // Escrow address is an empty string, because we don't need that contract in this function + const celo = new CeloAdapter( + web3, + pk, + Config.stable_token_address, + Config.escrow_address, + Config.gold_token_address + ) + + const printBalance = async (name: string, addr: string) => { + console.log(`Account ${name}: ${addr}`) + console.log(`USD: ${await celo.getDollarsBalance(addr)}`) + console.log(`Gold: ${await celo.getGoldBalance(addr)}`) + console.log('-------------------------------------------') + } + + await printBalance('Funder', celo.defaultAddress) + await printBalance('Recipient', to) + + const goldAmount = Web3.utils.toWei('1', 'ether') + const dollarAmount = Web3.utils.toWei('1', 'ether') + + const goldTx = await celo.transferGold(to, goldAmount) + console.log('txhash', await goldTx.getHash()) + console.log('receipt', await goldTx.waitReceipt()) + + const dollarTx = await celo.transferDollars(to, dollarAmount) + console.log('txhash', await dollarTx.getHash()) + console.log('receipt', await dollarTx.waitReceipt()) + + await printBalance('Funder', celo.defaultAddress) + await printBalance('Recipient', to) +} + +main().catch((err) => { + console.log(err) + process.exit(1) +}) diff --git a/packages/faucet/src/celo-adapter.ts b/packages/faucet/src/celo-adapter.ts index 99c2e1b2dac..7415890ebe9 100644 --- a/packages/faucet/src/celo-adapter.ts +++ b/packages/faucet/src/celo-adapter.ts @@ -5,6 +5,7 @@ import getStableTokenInstance from './contracts/StableToken' import { Escrow } from './contracts/types/Escrow' import { GoldToken } from './contracts/types/GoldToken' import { StableToken } from './contracts/types/StableToken' +import { injectDebugProvider } from './debug-provider' import { getAddress, sendTx } from './tx' export class CeloAdapter { @@ -21,6 +22,8 @@ export class CeloAdapter { private readonly escrowAddress: string, private readonly goldTokenAddress: string ) { + injectDebugProvider(web3) + this.privateKey = this.web3.utils.isHexStrict(pk) ? pk : '0x' + pk this.defaultAddress = getAddress(this.web3, this.privateKey) this.goldToken = getGoldTokenInstance(this.web3, goldTokenAddress) @@ -76,7 +79,7 @@ export class CeloAdapter { ) } - async getDollarsBalance(accountAddress: string = this.defaultAddress) { + getDollarsBalance(accountAddress: string = this.defaultAddress) { return this.stableToken.methods.balanceOf(accountAddress).call() } getGoldBalance(accountAddress: string = this.defaultAddress) { diff --git a/packages/faucet/src/database-helper.ts b/packages/faucet/src/database-helper.ts index 9e4d45daffc..c477a1e96fc 100644 --- a/packages/faucet/src/database-helper.ts +++ b/packages/faucet/src/database-helper.ts @@ -54,6 +54,7 @@ export async function processRequest(snap: DataSnapshot, pool: AccountPool, conf const success = await pool.doWithAccount(requestHandler) await snap.ref.update({ status: success ? RequestStatus.Done : RequestStatus.Failed }) } catch (err) { + console.error(`req(${snap.key}): ERROR proccessRequest`, err) await snap.ref.update({ status: RequestStatus.Failed }) throw err } diff --git a/packages/faucet/src/debug-provider.ts b/packages/faucet/src/debug-provider.ts new file mode 100644 index 00000000000..f758b141dfe --- /dev/null +++ b/packages/faucet/src/debug-provider.ts @@ -0,0 +1,24 @@ +import Web3 from 'web3' +import { Callback, JsonRPCRequest, JsonRPCResponse, Provider } from 'web3/providers' + +class DebugProvider implements Provider { + constructor(private provider: Provider) {} + + send(payload: JsonRPCRequest, callback: Callback): any { + console.log('rpc: -> %O', payload) + + const callbackDecorator = (error: Error, result: JsonRPCResponse) => { + console.log('rpc: <- %O', payload) + callback(error as any, result) + } + return this.provider.send(payload, callbackDecorator as any) + } +} + +export function wrap(provider: Provider) { + return new DebugProvider(provider) +} + +export function injectDebugProvider(web3: Web3) { + web3.setProvider(wrap(web3.currentProvider)) +} diff --git a/packages/faucet/src/index.ts b/packages/faucet/src/index.ts index 8242d727b5c..c7b3784cd7c 100644 --- a/packages/faucet/src/index.ts +++ b/packages/faucet/src/index.ts @@ -1,11 +1,8 @@ -import debugFactory from 'debug' import * as admin from 'firebase-admin' import * as functions from 'firebase-functions' import { getNetworkConfig } from './config' import { AccountPool, processRequest } from './database-helper' -debugFactory.enabled('*') - const PROCESSOR_RUNTIME_OPTS: functions.RuntimeOptions = { // When changing this, check that actionTimeoutMS is less than this number timeoutSeconds: 120, diff --git a/packages/faucet/src/tx.ts b/packages/faucet/src/tx.ts index b8b0d41bf4e..e203ff9c37a 100644 --- a/packages/faucet/src/tx.ts +++ b/packages/faucet/src/tx.ts @@ -1,15 +1,12 @@ // tslint:disable: max-classes-per-file // TODO: investigate tslint issues -import debugFactory from 'debug' + import Web3 from 'web3' import { TransactionObject, Tx } from 'web3/eth/types' import PromiEvent from 'web3/promiEvent' import { TransactionReceipt } from 'web3/types' import { signTransaction } from './protocol/signing-utils' -const debug = debugFactory('cli:tx') -const debugTxObjects = debugFactory('cli:tx:obj') - export function getAddress(web3: Web3, pk: string) { pk = Web3.utils.isHexStrict(pk) ? pk : '0x' + pk return web3.eth.accounts.privateKeyToAccount(pk).address @@ -21,7 +18,7 @@ export async function sendTx( privateKey: string, txParams?: Tx ) { - debug('sendTx: %o, %o', tx.arguments, txParams) + console.log('tx: tx.data= %o, tx= %o', tx.arguments, txParams) const gasPrice = await web3.eth.getGasPrice() const address = getAddress(web3, privateKey) @@ -29,7 +26,7 @@ export async function sendTx( // Estimate Gas mutates txParams, but we need our original obj later const clonedTxParams = { ...txParams, from: address, gasPrice } const estGas = (Web3.utils.toBN(await tx.estimateGas(clonedTxParams)) as any).muln(10) - debug('estimatedGas: %s', estGas) + console.log('tx: estimatedGas= %s', estGas) const signedTx: any = await signTransaction( web3, @@ -47,32 +44,6 @@ export async function sendTx( return new TransactionResult(web3.eth.sendSignedTransaction(rawTransaction)) } -export async function sendSimpleTx(web3: Web3, privateKey: string, txParams?: Tx) { - debug('sendTx: %o', txParams) - - const address = getAddress(web3, privateKey) - const gasPrice = await web3.eth.getGasPrice() - - // Estimate Gas mutates txParams, but we need our original obj later - const clonedTxParams = { ...txParams, from: address } - const estGas = Web3.utils.toBN(await web3.eth.estimateGas(clonedTxParams)) - debug('estimatedGas: %s', estGas) - - const signedTx: any = await signTransaction( - web3, - { - ...txParams, - from: address, - gasPrice, - gas: estGas, - }, - privateKey - ) - - const rawTransaction = signedTx.rawTransaction.toString('hex') - return new TransactionResult(web3.eth.sendSignedTransaction(rawTransaction)) -} - export class Future { public resolve!: (val: T) => void public reject!: (err: any) => void @@ -96,19 +67,20 @@ export class TransactionResult { constructor(pe: PromiEvent) { pe.on('transactionHash', (hash: string) => { - debug('hash: %s', hash) + console.info('@TransactionResult hash: ', hash) this.hashFuture.resolve(hash) }) .on('receipt', (receipt: TransactionReceipt) => { - debugTxObjects('receipt: %O', receipt) + console.info('@TransactionResult receipt: ', receipt) this.receiptFuture.resolve(receipt) }) .on('error', ((error: any, receipt: TransactionReceipt | false) => { + console.info('@TransactionResult error: %O %O', error, receipt) if (!receipt) { - debug('send-error: %o', error) + console.info('@TransactionResult no receipt') this.hashFuture.reject(error) } else { - debug('mining-error: %o, %O', error, receipt) + console.info('@TransactionResult mining error') } this.receiptFuture.reject(error) }) as any) diff --git a/packages/helm-charts/testnet/templates/bootnode.deployment.yaml b/packages/helm-charts/testnet/templates/bootnode.deployment.yaml index 593d88e064c..833a900ee20 100644 --- a/packages/helm-charts/testnet/templates/bootnode.deployment.yaml +++ b/packages/helm-charts/testnet/templates/bootnode.deployment.yaml @@ -35,10 +35,15 @@ spec: set -euo pipefail NAT_FLAG="" [[ "$IP_ADDRESS" != "none" ]] && NAT_FLAG="--nat=extip:$IP_ADDRESS" - /usr/local/bin/bootnode --nodekey=/etc/bootnode/node.key --verbosity=1 ${NAT_FLAG} + /usr/local/bin/bootnode --nodekey=/etc/bootnode/node.key --verbosity=5 ${NAT_FLAG} --networkid=${NETWORK_ID} --ping-ip-from-packet={{ .Values.geth.ping_ip_from_packet }} env: - name: IP_ADDRESS value: {{ default "none" .Values.geth.bootnodeIpAddress }} + - name: NETWORK_ID + valueFrom: + configMapKeyRef: + name: {{ template "ethereum.fullname" . }}-geth-config + key: networkid volumeMounts: - name: data mountPath: /etc/bootnode diff --git a/packages/helm-charts/testnet/templates/txnode.statefulset.yaml b/packages/helm-charts/testnet/templates/txnode.statefulset.yaml index 10facfdb978..7df07d09571 100644 --- a/packages/helm-charts/testnet/templates/txnode.statefulset.yaml +++ b/packages/helm-charts/testnet/templates/txnode.statefulset.yaml @@ -22,6 +22,17 @@ metadata: {{ include "standard.labels" . | indent 4 }} component: tx_nodes spec: + {{ {{- if .Values.geth.ssd_disks -}} + volumeClaimTemplates: + - metadata: + name: data + spec: + storageClassName: ssd + accessModes: [ "ReadWriteOnce" ] + resources: + requests: + storage: 10Gi + {{- end -}}}}} podManagementPolicy: Parallel replicas: {{ .Values.geth.tx_nodes }} serviceName: tx-nodes @@ -90,6 +101,8 @@ spec: ACCOUNT_ADDRESS=`cat /root/.celo/address` NAT_FLAG="" [[ "$STATIC_IPS_FOR_GETH_NODES" == "true" ]] && NAT_FLAG="--nat=extip:`cat /root/.celo/ipAddress`" + PING_IP_FROM_PACKET_FLAG="" + [[ "$PING_IP_FROM_PACKET" == "true" ]] && PING_IP_FROM_PACKET_FLAG="--ping-ip-from-packet" geth \ --bootnodes=enode://`cat /root/.celo/bootnodeEnode` \ --lightserv 90 \ @@ -115,7 +128,8 @@ spec: --consoleoutput=stdout \ --verbosity={{ .Values.geth.verbosity }} \ --ethstats=${HOSTNAME}:${ETHSTATS_SECRET}@${ETHSTATS_SVC} \ - --metrics + --metrics \ + ${PING_IP_FROM_PACKET_FLAG} env: - name: ETHSTATS_SVC value: {{ template "ethereum.fullname" . }}-ethstats.{{ .Release.Namespace }} @@ -133,6 +147,8 @@ spec: value: {{ .Values.geth.miner.verificationpool }} - name: STATIC_IPS_FOR_GETH_NODES value: "{{ default "false" .Values.geth.static_ips }}" + - name: PING_IP_FROM_PACKET + value: "{{ default "false" .Values.geth.ping_ip_from_packet }}" ports: - name: discovery-udp containerPort: 30303 diff --git a/packages/helm-charts/testnet/templates/validators.statefulset.yaml b/packages/helm-charts/testnet/templates/validators.statefulset.yaml index 6ff5b2a4d2a..d710f49f5e7 100644 --- a/packages/helm-charts/testnet/templates/validators.statefulset.yaml +++ b/packages/helm-charts/testnet/templates/validators.statefulset.yaml @@ -25,6 +25,9 @@ spec: - metadata: name: data spec: + {{ {{- if .Values.geth.ssd_disks -}} + storageClassName: ssd + {{- end -}}}}} accessModes: [ "ReadWriteOnce" ] resources: requests: @@ -122,6 +125,8 @@ spec: ACCOUNT_ADDRESS=`cat /root/.celo/address` RID=`cat /root/.celo/replica_id` FAULTY_NODE_FLAGS=`if [ "$RID" -lt "$FAULTY_NODES" ]; then echo -n "--istanbul.faultymode $FAULTY_NODE_TYPE"; fi` + PING_IP_FROM_PACKET_FLAG="" + [[ "$PING_IP_FROM_PACKET" == "true" ]] && PING_IP_FROM_PACKET_FLAG="--ping-ip-from-packet" geth \ --bootnodes=enode://`cat /root/.celo/bootnodeEnode` \ --password=/root/.celo/account/accountSecret \ @@ -150,7 +155,8 @@ spec: --istanbul.blockperiod={{ .Values.geth.blocktime }} \ --maxpeers={{ mul 2 (add .Values.geth.validators .Values.geth.tx_nodes) }} \ --nat=extip:`cat /root/.celo/ipAddress` \ - --metrics + --metrics \ + ${PING_IP_FROM_PACKET_FLAG} env: - name: POD_IP valueFrom: @@ -177,6 +183,8 @@ spec: value: {{ .Values.geth.faultyValidatorType | quote }} - name: STATIC_IPS_FOR_GETH_NODES value: "{{ default false .Values.geth.static_ips }}" + - name: PING_IP_FROM_PACKET + value: "{{ default false .Values.geth.ping_ip_from_packet }}" ports: - name: discovery-udp containerPort: 30303 diff --git a/packages/mobile/.env b/packages/mobile/.env index cc89808cc25..f88d6a0846b 100644 --- a/packages/mobile/.env +++ b/packages/mobile/.env @@ -1,8 +1,8 @@ ENVIRONMENT=local DEFAULT_TESTNET=alfajoresstaging -BLOCKCHAIN_API_URL=https://alfajoresstaging-dot-celo-testnet.appspot.com/ DEV_SETTINGS_ACTIVE_INITIALLY=true FIREBASE_ENABLED=true SECRETS_KEY=debug INSTABUG_TOKEN= INSTABUG_EVENTS= +LOCAL_CURRENCY_SYMBOL=MXN diff --git a/packages/mobile/.env.alfajores b/packages/mobile/.env.alfajores index d466d6ac7f7..e3974511f5f 100644 --- a/packages/mobile/.env.alfajores +++ b/packages/mobile/.env.alfajores @@ -6,3 +6,5 @@ FIREBASE_ENABLED=true SECRETS_KEY=production INSTABUG_TOKEN= INSTABUG_EVENTS=button,shake +LOCAL_CURRENCY_SYMBOL= +SHOW_TESTNET_BANNER=true diff --git a/packages/mobile/.env.integration b/packages/mobile/.env.integration index 3c63c7582c5..d90d6dbcd67 100644 --- a/packages/mobile/.env.integration +++ b/packages/mobile/.env.integration @@ -6,3 +6,5 @@ FIREBASE_ENABLED=true SECRETS_KEY=integration INSTABUG_TOKEN= INSTABUG_EVENTS=button,shake +LOCAL_CURRENCY_SYMBOL= +SHOW_TESTNET_BANNER=true \ No newline at end of file diff --git a/packages/mobile/.env.pilot b/packages/mobile/.env.pilot index bca4f6a27b6..db0bd6960c7 100644 --- a/packages/mobile/.env.pilot +++ b/packages/mobile/.env.pilot @@ -3,6 +3,8 @@ DEFAULT_TESTNET=pilot BLOCKCHAIN_API_URL=https://pilot-dot-celo-testnet-production.appspot.com/ DEV_SETTINGS_ACTIVE_INITIALLY=false FIREBASE_ENABLED=true -SECRETS_KEY=pilot +SECRETS_KEY=production INSTABUG_TOKEN= INSTABUG_EVENTS=button,shake +LOCAL_CURRENCY_SYMBOL=MXN +SHOW_TESTNET_BANNER=false \ No newline at end of file diff --git a/packages/mobile/.env.pilotstaging b/packages/mobile/.env.pilotstaging index e9326e4e381..0775b6d501f 100644 --- a/packages/mobile/.env.pilotstaging +++ b/packages/mobile/.env.pilotstaging @@ -6,3 +6,5 @@ FIREBASE_ENABLED=true SECRETS_KEY=pilotstaging INSTABUG_TOKEN= INSTABUG_EVENTS=button,shake +LOCAL_CURRENCY_SYMBOL=MXN +SHOW_TESTNET_BANNER=false \ No newline at end of file diff --git a/packages/mobile/.env.production b/packages/mobile/.env.production index 739d5605baa..826f1b2cf60 100644 --- a/packages/mobile/.env.production +++ b/packages/mobile/.env.production @@ -6,3 +6,5 @@ FIREBASE_ENABLED=true SECRETS_KEY=production INSTABUG_TOKEN= INSTABUG_EVENTS=shake +LOCAL_CURRENCY_SYMBOL= +SHOW_TESTNET_BANNER=false \ No newline at end of file diff --git a/packages/mobile/.env.staging b/packages/mobile/.env.staging index 725da068458..811ae6cb0d9 100644 --- a/packages/mobile/.env.staging +++ b/packages/mobile/.env.staging @@ -6,3 +6,4 @@ FIREBASE_ENABLED=true SECRETS_KEY=staging INSTABUG_TOKEN= INSTABUG_EVENTS=shake +LOCAL_CURRENCY_SYMBOL= diff --git a/packages/mobile/.env.test b/packages/mobile/.env.test index 7d165f41bd0..3a819cbba17 100644 --- a/packages/mobile/.env.test +++ b/packages/mobile/.env.test @@ -6,3 +6,5 @@ FIREBASE_ENABLED=false SECRETS_KEY=debug INSTABUG_TOKEN= INSTABUG_EVENTS= +LOCAL_CURRENCY_SYMBOL=MXN +SHOW_TESTNET_BANNER=false \ No newline at end of file diff --git a/packages/mobile/.gitignore b/packages/mobile/.gitignore index 1935e99a7d3..89dbca4a860 100644 --- a/packages/mobile/.gitignore +++ b/packages/mobile/.gitignore @@ -80,6 +80,7 @@ android/app/src/staging/google-services.json android/app/src/integration/google-services.json android/app/src/alfajores/google-services.json android/app/src/debug/google-services.json +android/app/src/pilot/google-services.json secrets.json android/sentry.properties ios/sentry.properties diff --git a/packages/mobile/__mocks__/react-native-config.ts b/packages/mobile/__mocks__/react-native-config.ts index fbc732b73e9..c02fc58ec1b 100644 --- a/packages/mobile/__mocks__/react-native-config.ts +++ b/packages/mobile/__mocks__/react-native-config.ts @@ -1,3 +1,4 @@ export default { DEV_SETTINGS_ACTIVE_INITIALLY: 'false', + SHOW_TESTNET_BANNER: 'true', } diff --git a/packages/mobile/android/app/build.gradle b/packages/mobile/android/app/build.gradle index 08351a5544c..1cad8fdf397 100644 --- a/packages/mobile/android/app/build.gradle +++ b/packages/mobile/android/app/build.gradle @@ -81,6 +81,8 @@ project.ext.react = [ devDisabledInStaging: true, bundleInAlfajores: true, devDisabledInAlfajores: true, + bundleInPilot: true, + devDisabledInPilot: true, ] project.ext.envConfigFiles = [ @@ -89,6 +91,7 @@ project.ext.envConfigFiles = [ staging: ".env.staging", release: ".env.production", alfajores: ".env.alfajores", + pilot: ".env.pilot", ] apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" @@ -122,7 +125,7 @@ android { minSdkVersion isDetoxTestBuild ? rootProject.ext.minSdkVersion : 18 targetSdkVersion rootProject.ext.targetSdkVersion versionCode appVersionCode - versionName "1.4.1" + versionName "1.4.2" testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" resValue "string", "build_config_package", "org.celo.mobile" @@ -189,6 +192,14 @@ android { signingConfig signingConfigs.release matchingFallbacks = ['release'] } + + pilot { + applicationIdSuffix ".pilot" + minifyEnabled enableProguardInReleaseBuilds + proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" + signingConfig signingConfigs.release + matchingFallbacks = ['release'] + } } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> diff --git a/packages/mobile/android/app/src/debug/google-services.json.enc b/packages/mobile/android/app/src/debug/google-services.json.enc index 654aaea648c..acbd870b11e 100644 Binary files a/packages/mobile/android/app/src/debug/google-services.json.enc and b/packages/mobile/android/app/src/debug/google-services.json.enc differ diff --git a/packages/mobile/android/app/src/main/AndroidManifest.xml b/packages/mobile/android/app/src/main/AndroidManifest.xml index 8345e97c403..54e3dcbf8bb 100644 --- a/packages/mobile/android/app/src/main/AndroidManifest.xml +++ b/packages/mobile/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - @@ -22,8 +22,7 @@ - + @@ -43,12 +42,6 @@ See README(https://goo.gl/l4GJaQ) for more. --> - - - - - - diff --git a/packages/mobile/android/app/src/main/assets/custom/LicenseDisclaimer.txt b/packages/mobile/android/app/src/main/assets/custom/LicenseDisclaimer.txt index f1324da3c57..6578c5b6ee1 100644 --- a/packages/mobile/android/app/src/main/assets/custom/LicenseDisclaimer.txt +++ b/packages/mobile/android/app/src/main/assets/custom/LicenseDisclaimer.txt @@ -108,7 +108,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ----- -The following software may be included in this product: @babel/code-frame, @babel/core, @babel/generator, @babel/helper-builder-react-jsx, @babel/helper-call-delegate, @babel/helper-create-class-features-plugin, @babel/helper-define-map, @babel/helper-hoist-variables, @babel/helper-member-expression-to-functions, @babel/helper-module-transforms, @babel/helper-regex, @babel/helper-replace-supers, @babel/helper-split-export-declaration, @babel/helpers, @babel/highlight, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-decorators, @babel/plugin-proposal-dynamic-import, @babel/plugin-proposal-export-default-from, @babel/plugin-proposal-nullish-coalescing-operator, @babel/plugin-proposal-object-rest-spread, @babel/plugin-proposal-unicode-property-regex, @babel/plugin-syntax-typescript, @babel/plugin-transform-async-to-generator, @babel/plugin-transform-block-scoping, @babel/plugin-transform-classes, @babel/plugin-transform-destructuring, @babel/plugin-transform-dotall-regex, @babel/plugin-transform-duplicate-keys, @babel/plugin-transform-flow-strip-types, @babel/plugin-transform-for-of, @babel/plugin-transform-function-name, @babel/plugin-transform-modules-amd, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-modules-systemjs, @babel/plugin-transform-named-capturing-groups-regex, @babel/plugin-transform-new-target, @babel/plugin-transform-object-super, @babel/plugin-transform-parameters, @babel/plugin-transform-react-jsx, @babel/plugin-transform-react-jsx-source, @babel/plugin-transform-regenerator, @babel/plugin-transform-runtime, @babel/plugin-transform-template-literals, @babel/plugin-transform-typescript, @babel/plugin-transform-unicode-regex, @babel/preset-env, @babel/preset-typescript, @babel/register, @babel/runtime, @babel/template, @babel/traverse, @babel/types. A copy of the source code may be downloaded from https://github.com/babel/babel/tree/master/packages/babel-code-frame (@babel/code-frame), https://github.com/babel/babel/tree/master/packages/babel-core (@babel/core), https://github.com/babel/babel/tree/master/packages/babel-generator (@babel/generator), https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx (@babel/helper-builder-react-jsx), https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate (@babel/helper-call-delegate), https://github.com/babel/babel/tree/master/packages/babel-helper-create-class-features-plugin (@babel/helper-create-class-features-plugin), https://github.com/babel/babel/tree/master/packages/babel-helper-define-map (@babel/helper-define-map), https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables (@babel/helper-hoist-variables), https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions (@babel/helper-member-expression-to-functions), https://github.com/babel/babel/tree/master/packages/babel-helper-module-transforms (@babel/helper-module-transforms), https://github.com/babel/babel/tree/master/packages/babel-helper-regex (@babel/helper-regex), https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers (@babel/helper-replace-supers), https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration (@babel/helper-split-export-declaration), https://github.com/babel/babel/tree/master/packages/babel-helpers (@babel/helpers), https://github.com/babel/babel/tree/master/packages/babel-highlight (@babel/highlight), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties (@babel/plugin-proposal-class-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-decorators (@babel/plugin-proposal-decorators), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-dynamic-import (@babel/plugin-proposal-dynamic-import), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-default-from (@babel/plugin-proposal-export-default-from), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-nullish-coalescing-operator (@babel/plugin-proposal-nullish-coalescing-operator), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread (@babel/plugin-proposal-object-rest-spread), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-unicode-property-regex (@babel/plugin-proposal-unicode-property-regex), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-typescript (@babel/plugin-syntax-typescript), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator (@babel/plugin-transform-async-to-generator), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoping (@babel/plugin-transform-block-scoping), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes (@babel/plugin-transform-classes), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring (@babel/plugin-transform-destructuring), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-dotall-regex (@babel/plugin-transform-dotall-regex), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-duplicate-keys (@babel/plugin-transform-duplicate-keys), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-strip-types (@babel/plugin-transform-flow-strip-types), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-for-of (@babel/plugin-transform-for-of), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-function-name (@babel/plugin-transform-function-name), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd (@babel/plugin-transform-modules-amd), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs (@babel/plugin-transform-modules-commonjs), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs (@babel/plugin-transform-modules-systemjs), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-named-capturing-groups-regex (@babel/plugin-transform-named-capturing-groups-regex), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-new-target (@babel/plugin-transform-new-target), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super (@babel/plugin-transform-object-super), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters (@babel/plugin-transform-parameters), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx (@babel/plugin-transform-react-jsx), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source (@babel/plugin-transform-react-jsx-source), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator (@babel/plugin-transform-regenerator), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime (@babel/plugin-transform-runtime), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals (@babel/plugin-transform-template-literals), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript (@babel/plugin-transform-typescript), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-unicode-regex (@babel/plugin-transform-unicode-regex), https://github.com/babel/babel/tree/master/packages/babel-preset-env (@babel/preset-env), https://github.com/babel/babel/tree/master/packages/babel-preset-typescript (@babel/preset-typescript), https://github.com/babel/babel/tree/master/packages/babel-register (@babel/register), https://github.com/babel/babel/tree/master/packages/babel-runtime (@babel/runtime), https://github.com/babel/babel/tree/master/packages/babel-template (@babel/template), https://github.com/babel/babel/tree/master/packages/babel-traverse (@babel/traverse), https://github.com/babel/babel/tree/master/packages/babel-types (@babel/types). This software contains the following license and notice below: +The following software may be included in this product: @babel/code-frame, @babel/core, @babel/generator, @babel/helper-builder-react-jsx, @babel/helper-call-delegate, @babel/helper-create-class-features-plugin, @babel/helper-define-map, @babel/helper-hoist-variables, @babel/helper-member-expression-to-functions, @babel/helper-module-transforms, @babel/helper-regex, @babel/helper-replace-supers, @babel/helper-split-export-declaration, @babel/helpers, @babel/highlight, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-decorators, @babel/plugin-proposal-dynamic-import, @babel/plugin-proposal-export-default-from, @babel/plugin-proposal-nullish-coalescing-operator, @babel/plugin-proposal-object-rest-spread, @babel/plugin-proposal-optional-chaining, @babel/plugin-proposal-unicode-property-regex, @babel/plugin-syntax-typescript, @babel/plugin-transform-async-to-generator, @babel/plugin-transform-block-scoping, @babel/plugin-transform-classes, @babel/plugin-transform-destructuring, @babel/plugin-transform-dotall-regex, @babel/plugin-transform-duplicate-keys, @babel/plugin-transform-flow-strip-types, @babel/plugin-transform-for-of, @babel/plugin-transform-function-name, @babel/plugin-transform-modules-amd, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-modules-systemjs, @babel/plugin-transform-named-capturing-groups-regex, @babel/plugin-transform-new-target, @babel/plugin-transform-object-super, @babel/plugin-transform-parameters, @babel/plugin-transform-react-jsx, @babel/plugin-transform-react-jsx-source, @babel/plugin-transform-regenerator, @babel/plugin-transform-runtime, @babel/plugin-transform-template-literals, @babel/plugin-transform-typescript, @babel/plugin-transform-unicode-regex, @babel/preset-env, @babel/preset-typescript, @babel/register, @babel/runtime, @babel/template, @babel/traverse, @babel/types. A copy of the source code may be downloaded from https://github.com/babel/babel/tree/master/packages/babel-code-frame (@babel/code-frame), https://github.com/babel/babel/tree/master/packages/babel-core (@babel/core), https://github.com/babel/babel/tree/master/packages/babel-generator (@babel/generator), https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx (@babel/helper-builder-react-jsx), https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate (@babel/helper-call-delegate), https://github.com/babel/babel/tree/master/packages/babel-helper-create-class-features-plugin (@babel/helper-create-class-features-plugin), https://github.com/babel/babel/tree/master/packages/babel-helper-define-map (@babel/helper-define-map), https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables (@babel/helper-hoist-variables), https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions (@babel/helper-member-expression-to-functions), https://github.com/babel/babel/tree/master/packages/babel-helper-module-transforms (@babel/helper-module-transforms), https://github.com/babel/babel/tree/master/packages/babel-helper-regex (@babel/helper-regex), https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers (@babel/helper-replace-supers), https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration (@babel/helper-split-export-declaration), https://github.com/babel/babel/tree/master/packages/babel-helpers (@babel/helpers), https://github.com/babel/babel/tree/master/packages/babel-highlight (@babel/highlight), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties (@babel/plugin-proposal-class-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-decorators (@babel/plugin-proposal-decorators), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-dynamic-import (@babel/plugin-proposal-dynamic-import), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-default-from (@babel/plugin-proposal-export-default-from), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-nullish-coalescing-operator (@babel/plugin-proposal-nullish-coalescing-operator), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread (@babel/plugin-proposal-object-rest-spread), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining (@babel/plugin-proposal-optional-chaining), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-unicode-property-regex (@babel/plugin-proposal-unicode-property-regex), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-typescript (@babel/plugin-syntax-typescript), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator (@babel/plugin-transform-async-to-generator), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoping (@babel/plugin-transform-block-scoping), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes (@babel/plugin-transform-classes), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring (@babel/plugin-transform-destructuring), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-dotall-regex (@babel/plugin-transform-dotall-regex), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-duplicate-keys (@babel/plugin-transform-duplicate-keys), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-strip-types (@babel/plugin-transform-flow-strip-types), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-for-of (@babel/plugin-transform-for-of), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-function-name (@babel/plugin-transform-function-name), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd (@babel/plugin-transform-modules-amd), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs (@babel/plugin-transform-modules-commonjs), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs (@babel/plugin-transform-modules-systemjs), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-named-capturing-groups-regex (@babel/plugin-transform-named-capturing-groups-regex), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-new-target (@babel/plugin-transform-new-target), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super (@babel/plugin-transform-object-super), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters (@babel/plugin-transform-parameters), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx (@babel/plugin-transform-react-jsx), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source (@babel/plugin-transform-react-jsx-source), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator (@babel/plugin-transform-regenerator), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime (@babel/plugin-transform-runtime), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals (@babel/plugin-transform-template-literals), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript (@babel/plugin-transform-typescript), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-unicode-regex (@babel/plugin-transform-unicode-regex), https://github.com/babel/babel/tree/master/packages/babel-preset-env (@babel/preset-env), https://github.com/babel/babel/tree/master/packages/babel-preset-typescript (@babel/preset-typescript), https://github.com/babel/babel/tree/master/packages/babel-register (@babel/register), https://github.com/babel/babel/tree/master/packages/babel-runtime (@babel/runtime), https://github.com/babel/babel/tree/master/packages/babel-template (@babel/template), https://github.com/babel/babel/tree/master/packages/babel-traverse (@babel/traverse), https://github.com/babel/babel/tree/master/packages/babel-types (@babel/types). This software contains the following license and notice below: MIT License @@ -135,7 +135,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----- -The following software may be included in this product: @babel/core, @babel/helper-builder-binary-assignment-operator-visitor, @babel/helper-explode-assignable-expression, @babel/helper-function-name, @babel/helper-remap-async-to-generator, @babel/helper-simple-access, @babel/helper-wrap-function, @babel/plugin-external-helpers, @babel/plugin-proposal-async-generator-functions, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-json-strings, @babel/plugin-proposal-optional-catch-binding, @babel/plugin-proposal-optional-chaining, @babel/plugin-syntax-async-generators, @babel/plugin-syntax-class-properties, @babel/plugin-syntax-decorators, @babel/plugin-syntax-dynamic-import, @babel/plugin-syntax-export-default-from, @babel/plugin-syntax-flow, @babel/plugin-syntax-json-strings, @babel/plugin-syntax-jsx, @babel/plugin-syntax-nullish-coalescing-operator, @babel/plugin-syntax-object-rest-spread, @babel/plugin-syntax-optional-catch-binding, @babel/plugin-syntax-optional-chaining, @babel/plugin-transform-arrow-functions, @babel/plugin-transform-block-scoped-functions, @babel/plugin-transform-computed-properties, @babel/plugin-transform-exponentiation-operator, @babel/plugin-transform-literals, @babel/plugin-transform-member-expression-literals, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-modules-umd, @babel/plugin-transform-property-literals, @babel/plugin-transform-react-display-name, @babel/plugin-transform-react-jsx-self, @babel/plugin-transform-reserved-words, @babel/plugin-transform-runtime, @babel/plugin-transform-shorthand-properties, @babel/plugin-transform-spread, @babel/plugin-transform-sticky-regex, @babel/plugin-transform-typeof-symbol, @babel/preset-env, @babel/runtime, @babel/runtime-corejs2. A copy of the source code may be downloaded from https://github.com/babel/babel/tree/master/packages/babel-core (@babel/core), https://github.com/babel/babel/tree/master/packages/babel-helper-builder-binary-assignment-operator-visitor (@babel/helper-builder-binary-assignment-operator-visitor), https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression (@babel/helper-explode-assignable-expression), https://github.com/babel/babel/tree/master/packages/babel-helper-function-name (@babel/helper-function-name), https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator (@babel/helper-remap-async-to-generator), https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access (@babel/helper-simple-access), https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function (@babel/helper-wrap-function), https://github.com/babel/babel/tree/master/packages/babel-plugin-external-helpers (@babel/plugin-external-helpers), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions (@babel/plugin-proposal-async-generator-functions), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties (@babel/plugin-proposal-class-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-json-strings (@babel/plugin-proposal-json-strings), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-catch-binding (@babel/plugin-proposal-optional-catch-binding), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining (@babel/plugin-proposal-optional-chaining), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators (@babel/plugin-syntax-async-generators), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-class-properties (@babel/plugin-syntax-class-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-decorators (@babel/plugin-syntax-decorators), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-dynamic-import (@babel/plugin-syntax-dynamic-import), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-default-from (@babel/plugin-syntax-export-default-from), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-flow (@babel/plugin-syntax-flow), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-json-strings (@babel/plugin-syntax-json-strings), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx (@babel/plugin-syntax-jsx), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-nullish-coalescing-operator (@babel/plugin-syntax-nullish-coalescing-operator), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread (@babel/plugin-syntax-object-rest-spread), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding (@babel/plugin-syntax-optional-catch-binding), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining (@babel/plugin-syntax-optional-chaining), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-arrow-functions (@babel/plugin-transform-arrow-functions), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoped-functions (@babel/plugin-transform-block-scoped-functions), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-computed-properties (@babel/plugin-transform-computed-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator (@babel/plugin-transform-exponentiation-operator), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-literals (@babel/plugin-transform-literals), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-member-expression-literals (@babel/plugin-transform-member-expression-literals), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs (@babel/plugin-transform-modules-commonjs), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd (@babel/plugin-transform-modules-umd), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-property-literals (@babel/plugin-transform-property-literals), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name (@babel/plugin-transform-react-display-name), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-self (@babel/plugin-transform-react-jsx-self), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-reserved-words (@babel/plugin-transform-reserved-words), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime (@babel/plugin-transform-runtime), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-shorthand-properties (@babel/plugin-transform-shorthand-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread (@babel/plugin-transform-spread), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-sticky-regex (@babel/plugin-transform-sticky-regex), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typeof-symbol (@babel/plugin-transform-typeof-symbol), https://github.com/babel/babel/tree/master/packages/babel-preset-env (@babel/preset-env), https://github.com/babel/babel/tree/master/packages/babel-runtime (@babel/runtime), https://github.com/babel/babel/tree/master/packages/babel-runtime-corejs2 (@babel/runtime-corejs2). This software contains the following license and notice below: +The following software may be included in this product: @babel/core, @babel/helper-builder-binary-assignment-operator-visitor, @babel/helper-explode-assignable-expression, @babel/helper-function-name, @babel/helper-remap-async-to-generator, @babel/helper-simple-access, @babel/helper-wrap-function, @babel/plugin-external-helpers, @babel/plugin-proposal-async-generator-functions, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-json-strings, @babel/plugin-proposal-optional-catch-binding, @babel/plugin-syntax-async-generators, @babel/plugin-syntax-class-properties, @babel/plugin-syntax-decorators, @babel/plugin-syntax-dynamic-import, @babel/plugin-syntax-export-default-from, @babel/plugin-syntax-flow, @babel/plugin-syntax-json-strings, @babel/plugin-syntax-jsx, @babel/plugin-syntax-nullish-coalescing-operator, @babel/plugin-syntax-object-rest-spread, @babel/plugin-syntax-optional-catch-binding, @babel/plugin-syntax-optional-chaining, @babel/plugin-transform-arrow-functions, @babel/plugin-transform-block-scoped-functions, @babel/plugin-transform-computed-properties, @babel/plugin-transform-exponentiation-operator, @babel/plugin-transform-literals, @babel/plugin-transform-member-expression-literals, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-modules-umd, @babel/plugin-transform-property-literals, @babel/plugin-transform-react-display-name, @babel/plugin-transform-react-jsx-self, @babel/plugin-transform-reserved-words, @babel/plugin-transform-runtime, @babel/plugin-transform-shorthand-properties, @babel/plugin-transform-spread, @babel/plugin-transform-sticky-regex, @babel/plugin-transform-typeof-symbol, @babel/preset-env, @babel/runtime, @babel/runtime-corejs2. A copy of the source code may be downloaded from https://github.com/babel/babel/tree/master/packages/babel-core (@babel/core), https://github.com/babel/babel/tree/master/packages/babel-helper-builder-binary-assignment-operator-visitor (@babel/helper-builder-binary-assignment-operator-visitor), https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression (@babel/helper-explode-assignable-expression), https://github.com/babel/babel/tree/master/packages/babel-helper-function-name (@babel/helper-function-name), https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator (@babel/helper-remap-async-to-generator), https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access (@babel/helper-simple-access), https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function (@babel/helper-wrap-function), https://github.com/babel/babel/tree/master/packages/babel-plugin-external-helpers (@babel/plugin-external-helpers), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions (@babel/plugin-proposal-async-generator-functions), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties (@babel/plugin-proposal-class-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-json-strings (@babel/plugin-proposal-json-strings), https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-catch-binding (@babel/plugin-proposal-optional-catch-binding), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators (@babel/plugin-syntax-async-generators), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-class-properties (@babel/plugin-syntax-class-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-decorators (@babel/plugin-syntax-decorators), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-dynamic-import (@babel/plugin-syntax-dynamic-import), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-default-from (@babel/plugin-syntax-export-default-from), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-flow (@babel/plugin-syntax-flow), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-json-strings (@babel/plugin-syntax-json-strings), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx (@babel/plugin-syntax-jsx), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-nullish-coalescing-operator (@babel/plugin-syntax-nullish-coalescing-operator), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread (@babel/plugin-syntax-object-rest-spread), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding (@babel/plugin-syntax-optional-catch-binding), https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining (@babel/plugin-syntax-optional-chaining), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-arrow-functions (@babel/plugin-transform-arrow-functions), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoped-functions (@babel/plugin-transform-block-scoped-functions), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-computed-properties (@babel/plugin-transform-computed-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator (@babel/plugin-transform-exponentiation-operator), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-literals (@babel/plugin-transform-literals), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-member-expression-literals (@babel/plugin-transform-member-expression-literals), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs (@babel/plugin-transform-modules-commonjs), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd (@babel/plugin-transform-modules-umd), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-property-literals (@babel/plugin-transform-property-literals), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name (@babel/plugin-transform-react-display-name), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-self (@babel/plugin-transform-react-jsx-self), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-reserved-words (@babel/plugin-transform-reserved-words), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime (@babel/plugin-transform-runtime), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-shorthand-properties (@babel/plugin-transform-shorthand-properties), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread (@babel/plugin-transform-spread), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-sticky-regex (@babel/plugin-transform-sticky-regex), https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typeof-symbol (@babel/plugin-transform-typeof-symbol), https://github.com/babel/babel/tree/master/packages/babel-preset-env (@babel/preset-env), https://github.com/babel/babel/tree/master/packages/babel-runtime (@babel/runtime), https://github.com/babel/babel/tree/master/packages/babel-runtime-corejs2 (@babel/runtime-corejs2). This software contains the following license and notice below: MIT License @@ -584,7 +584,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----- -The following software may be included in this product: @evocateur/npm-registry-fetch, cacache, figgy-pudding, make-fetch-happen, npm-pick-manifest, ssri. A copy of the source code may be downloaded from https://github.com/evocateur/npm-registry-fetch (@evocateur/npm-registry-fetch), https://github.com/zkat/cacache (cacache), https://github.com/zkat/figgy-pudding (figgy-pudding), https://github.com/zkat/make-fetch-happen (make-fetch-happen), https://github.com/zkat/npm-pick-manifest (npm-pick-manifest), https://github.com/zkat/ssri (ssri). This software contains the following license and notice below: +The following software may be included in this product: @evocateur/npm-registry-fetch, cacache, figgy-pudding, make-fetch-happen, npm-pick-manifest, ssri. A copy of the source code may be downloaded from https://github.com/evocateur/npm-registry-fetch (@evocateur/npm-registry-fetch), https://github.com/npm/cacache (cacache), https://github.com/zkat/figgy-pudding (figgy-pudding), https://github.com/zkat/make-fetch-happen (make-fetch-happen), https://github.com/npm/npm-pick-manifest (npm-pick-manifest), https://github.com/zkat/ssri (ssri). This software contains the following license and notice below: ISC License @@ -1766,6 +1766,32 @@ THE SOFTWARE. ----- +The following software may be included in this product: @nodelib/fs.scandir, @nodelib/fs.stat, @nodelib/fs.walk, fast-glob. A copy of the source code may be downloaded from https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir (@nodelib/fs.scandir), https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat (@nodelib/fs.stat), https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk (@nodelib/fs.walk), https://github.com/mrmlnc/fast-glob.git (fast-glob). This software contains the following license and notice below: + +The MIT License (MIT) + +Copyright (c) Denis Malinochkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +----- + The following software may be included in this product: @octokit/endpoint, @octokit/plugin-enterprise-rest, @octokit/request. A copy of the source code may be downloaded from git+https://github.com/octokit/endpoint.js.git (@octokit/endpoint), https://github.com/octokit/plugin-enterprise-rest.js.git (@octokit/plugin-enterprise-rest), https://github.com/octokit/request.js.git (@octokit/request). This software contains the following license and notice below: The MIT License @@ -2006,6 +2032,40 @@ SOFTWARE. ----- +The following software may be included in this product: @sentry/browser, @sentry/core, @sentry/hub, @sentry/minimal, @sentry/node, @sentry/types, @sentry/utils. A copy of the source code may be downloaded from git://github.com/getsentry/sentry-javascript.git (@sentry/browser), git://github.com/getsentry/sentry-javascript.git (@sentry/core), git://github.com/getsentry/sentry-javascript.git (@sentry/hub), git://github.com/getsentry/sentry-javascript.git (@sentry/minimal), git://github.com/getsentry/sentry-javascript.git (@sentry/node), git://github.com/getsentry/sentry-javascript.git (@sentry/types), git://github.com/getsentry/sentry-javascript.git (@sentry/utils). This software contains the following license and notice below: + +BSD 3-Clause License + +Copyright (c) 2019, Sentry +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +----- + The following software may be included in this product: @sentry/cli. A copy of the source code may be downloaded from https://github.com/getsentry/sentry-cli. This software contains the following license and notice below: Copyright (c) 2016 Sentry (https://sentry.io/) and individual contributors. @@ -2064,7 +2124,7 @@ SOFTWARE. ----- -The following software may be included in this product: @sindresorhus/is, @sindresorhus/slugify, ansi-escapes, ansi-regex, ansi-styles, any-observable, array-union, arrify, auto-bind, ava, ava-init, binary-extensions, boxen, callsites, camelcase, chalk, clean-stack, cli-cursor, cli-spinners, cli-truncate, decamelize, del, detect-indent, execa, figures, file-type, find-up, get-port, get-stdin, get-stream, global-dirs, globals, globby, got, has-flag, import-fresh, import-local, indent-string, invert-kv, irregular-plurals, is-fullwidth-code-point, is-generator-fn, is-installed-globally, is-observable, is-plain-obj, is-stream, is-text-path, lcid, leven, load-json-file, locate-path, log-symbols, log-update, lowercase-keys, macos-release, make-dir, matcher, mem, meow, mimic-fn, mimic-response, multimatch, normalize-url, onetime, open, opn, ora, os-locale, os-name, p-cancelable, p-is-promise, p-limit, p-locate, p-map, p-pipe, p-queue, p-reflect, p-settle, p-timeout, p-try, parent-module, parse-json, path-exists, path-type, pify, pkg-conf, pkg-dir, prepend-http, pretty-ms, query-string, quick-lru, read-pkg, read-pkg-up, resolve-from, restore-cursor, run-node, slash, sort-keys, split-on-first, string-length, string-width, strip-ansi, strip-bom, supports-color, temp-write, text-extensions, to-readable-stream, type-fest, url-parse-lax, widest-line, windows-release, wrap-ansi, write-json-file, write-pkg, yn. A copy of the source code may be downloaded from https://github.com/sindresorhus/is.git (@sindresorhus/is), https://github.com/sindresorhus/slugify.git (@sindresorhus/slugify), https://github.com/sindresorhus/ansi-escapes.git (ansi-escapes), https://github.com/chalk/ansi-regex.git (ansi-regex), https://github.com/chalk/ansi-styles.git (ansi-styles), https://github.com/sindresorhus/any-observable.git (any-observable), https://github.com/sindresorhus/array-union.git (array-union), https://github.com/sindresorhus/arrify.git (arrify), https://github.com/sindresorhus/auto-bind.git (auto-bind), https://github.com/avajs/ava.git (ava), https://github.com/avajs/ava-init.git (ava-init), https://github.com/sindresorhus/binary-extensions.git (binary-extensions), https://github.com/sindresorhus/boxen.git (boxen), https://github.com/sindresorhus/callsites.git (callsites), https://github.com/sindresorhus/camelcase.git (camelcase), https://github.com/chalk/chalk.git (chalk), https://github.com/sindresorhus/clean-stack.git (clean-stack), https://github.com/sindresorhus/cli-cursor.git (cli-cursor), https://github.com/sindresorhus/cli-spinners.git (cli-spinners), https://github.com/sindresorhus/cli-truncate.git (cli-truncate), https://github.com/sindresorhus/decamelize.git (decamelize), https://github.com/sindresorhus/del.git (del), https://github.com/sindresorhus/detect-indent.git (detect-indent), https://github.com/sindresorhus/execa.git (execa), https://github.com/sindresorhus/figures.git (figures), https://github.com/sindresorhus/file-type.git (file-type), https://github.com/sindresorhus/find-up.git (find-up), https://github.com/sindresorhus/get-port.git (get-port), https://github.com/sindresorhus/get-stdin.git (get-stdin), https://github.com/sindresorhus/get-stream.git (get-stream), https://github.com/sindresorhus/global-dirs.git (global-dirs), https://github.com/sindresorhus/globals.git (globals), https://github.com/sindresorhus/globby.git (globby), https://github.com/sindresorhus/got.git (got), https://github.com/sindresorhus/has-flag.git (has-flag), https://github.com/sindresorhus/import-fresh.git (import-fresh), https://github.com/sindresorhus/import-local.git (import-local), https://github.com/sindresorhus/indent-string.git (indent-string), https://github.com/sindresorhus/invert-kv.git (invert-kv), https://github.com/sindresorhus/irregular-plurals.git (irregular-plurals), https://github.com/sindresorhus/is-fullwidth-code-point.git (is-fullwidth-code-point), https://github.com/sindresorhus/is-generator-fn.git (is-generator-fn), https://github.com/sindresorhus/is-installed-globally.git (is-installed-globally), https://github.com/sindresorhus/is-observable.git (is-observable), https://github.com/sindresorhus/is-plain-obj.git (is-plain-obj), https://github.com/sindresorhus/is-stream.git (is-stream), https://github.com/sindresorhus/is-text-path.git (is-text-path), https://github.com/sindresorhus/lcid.git (lcid), https://github.com/sindresorhus/leven.git (leven), https://github.com/sindresorhus/load-json-file.git (load-json-file), https://github.com/sindresorhus/locate-path.git (locate-path), https://github.com/sindresorhus/log-symbols.git (log-symbols), https://github.com/sindresorhus/log-update.git (log-update), https://github.com/sindresorhus/lowercase-keys.git (lowercase-keys), https://github.com/sindresorhus/macos-release.git (macos-release), https://github.com/sindresorhus/make-dir.git (make-dir), https://github.com/sindresorhus/matcher.git (matcher), https://github.com/sindresorhus/mem.git (mem), https://github.com/sindresorhus/meow.git (meow), https://github.com/sindresorhus/mimic-fn.git (mimic-fn), https://github.com/sindresorhus/mimic-response.git (mimic-response), https://github.com/sindresorhus/multimatch.git (multimatch), https://github.com/sindresorhus/normalize-url.git (normalize-url), https://github.com/sindresorhus/onetime.git (onetime), https://github.com/sindresorhus/open.git (open), https://github.com/sindresorhus/opn.git (opn), https://github.com/sindresorhus/ora.git (ora), https://github.com/sindresorhus/os-locale.git (os-locale), https://github.com/sindresorhus/os-name.git (os-name), https://github.com/sindresorhus/p-cancelable.git (p-cancelable), https://github.com/sindresorhus/p-is-promise.git (p-is-promise), https://github.com/sindresorhus/p-limit.git (p-limit), https://github.com/sindresorhus/p-locate.git (p-locate), https://github.com/sindresorhus/p-map.git (p-map), https://github.com/sindresorhus/p-pipe.git (p-pipe), https://github.com/sindresorhus/p-queue.git (p-queue), https://github.com/sindresorhus/p-reflect.git (p-reflect), https://github.com/sindresorhus/p-settle.git (p-settle), https://github.com/sindresorhus/p-timeout.git (p-timeout), https://github.com/sindresorhus/p-try.git (p-try), https://github.com/sindresorhus/parent-module.git (parent-module), https://github.com/sindresorhus/parse-json.git (parse-json), https://github.com/sindresorhus/path-exists.git (path-exists), https://github.com/sindresorhus/path-type.git (path-type), https://github.com/sindresorhus/pify.git (pify), https://github.com/sindresorhus/pkg-conf.git (pkg-conf), https://github.com/sindresorhus/pkg-dir.git (pkg-dir), https://github.com/sindresorhus/prepend-http.git (prepend-http), https://github.com/sindresorhus/pretty-ms.git (pretty-ms), https://github.com/sindresorhus/query-string.git (query-string), https://github.com/sindresorhus/quick-lru.git (quick-lru), https://github.com/sindresorhus/read-pkg.git (read-pkg), https://github.com/sindresorhus/read-pkg-up.git (read-pkg-up), https://github.com/sindresorhus/resolve-from.git (resolve-from), https://github.com/sindresorhus/restore-cursor.git (restore-cursor), https://github.com/sindresorhus/run-node.git (run-node), https://github.com/sindresorhus/slash.git (slash), https://github.com/sindresorhus/sort-keys.git (sort-keys), https://github.com/sindresorhus/split-on-first.git (split-on-first), https://github.com/sindresorhus/string-length.git (string-length), https://github.com/sindresorhus/string-width.git (string-width), https://github.com/chalk/strip-ansi.git (strip-ansi), https://github.com/sindresorhus/strip-bom.git (strip-bom), https://github.com/chalk/supports-color.git (supports-color), https://github.com/sindresorhus/temp-write.git (temp-write), https://github.com/sindresorhus/text-extensions.git (text-extensions), https://github.com/sindresorhus/to-readable-stream.git (to-readable-stream), https://github.com/sindresorhus/type-fest.git (type-fest), https://github.com/sindresorhus/url-parse-lax.git (url-parse-lax), https://github.com/sindresorhus/widest-line.git (widest-line), https://github.com/sindresorhus/windows-release.git (windows-release), https://github.com/chalk/wrap-ansi.git (wrap-ansi), https://github.com/sindresorhus/write-json-file.git (write-json-file), https://github.com/sindresorhus/write-pkg.git (write-pkg), https://github.com/sindresorhus/yn.git (yn). This software contains the following license and notice below: +The following software may be included in this product: @sindresorhus/is, @sindresorhus/slugify, ansi-escapes, ansi-regex, ansi-styles, any-observable, array-union, arrify, auto-bind, ava, ava-init, binary-extensions, boxen, callsites, camelcase, chalk, clean-stack, cli-spinners, cli-truncate, del, detect-indent, execa, file-type, find-up, get-port, get-stdin, get-stream, global-dirs, globals, globby, got, has-flag, import-fresh, import-local, indent-string, invert-kv, irregular-plurals, is-generator-fn, is-installed-globally, is-observable, is-plain-obj, is-stream, is-text-path, lcid, leven, load-json-file, locate-path, log-symbols, log-update, lowercase-keys, macos-release, make-dir, matcher, mem, meow, mimic-fn, mimic-response, multimatch, normalize-url, onetime, open, opn, ora, os-locale, os-name, p-cancelable, p-is-promise, p-limit, p-locate, p-map, p-pipe, p-queue, p-reflect, p-settle, p-timeout, p-try, parent-module, parse-json, path-exists, path-type, pify, pkg-conf, pkg-dir, prepend-http, pretty-ms, query-string, quick-lru, read-pkg, read-pkg-up, resolve-from, run-node, slash, sort-keys, split-on-first, string-length, string-width, strip-ansi, strip-bom, supports-color, temp-write, text-extensions, to-readable-stream, type-fest, url-parse-lax, widest-line, windows-release, wrap-ansi, write-json-file, write-pkg, yn. A copy of the source code may be downloaded from https://github.com/sindresorhus/is.git (@sindresorhus/is), https://github.com/sindresorhus/slugify.git (@sindresorhus/slugify), https://github.com/sindresorhus/ansi-escapes.git (ansi-escapes), https://github.com/chalk/ansi-regex.git (ansi-regex), https://github.com/chalk/ansi-styles.git (ansi-styles), https://github.com/sindresorhus/any-observable.git (any-observable), https://github.com/sindresorhus/array-union.git (array-union), https://github.com/sindresorhus/arrify.git (arrify), https://github.com/sindresorhus/auto-bind.git (auto-bind), https://github.com/avajs/ava.git (ava), https://github.com/avajs/ava-init.git (ava-init), https://github.com/sindresorhus/binary-extensions.git (binary-extensions), https://github.com/sindresorhus/boxen.git (boxen), https://github.com/sindresorhus/callsites.git (callsites), https://github.com/sindresorhus/camelcase.git (camelcase), https://github.com/chalk/chalk.git (chalk), https://github.com/sindresorhus/clean-stack.git (clean-stack), https://github.com/sindresorhus/cli-spinners.git (cli-spinners), https://github.com/sindresorhus/cli-truncate.git (cli-truncate), https://github.com/sindresorhus/del.git (del), https://github.com/sindresorhus/detect-indent.git (detect-indent), https://github.com/sindresorhus/execa.git (execa), https://github.com/sindresorhus/file-type.git (file-type), https://github.com/sindresorhus/find-up.git (find-up), https://github.com/sindresorhus/get-port.git (get-port), https://github.com/sindresorhus/get-stdin.git (get-stdin), https://github.com/sindresorhus/get-stream.git (get-stream), https://github.com/sindresorhus/global-dirs.git (global-dirs), https://github.com/sindresorhus/globals.git (globals), https://github.com/sindresorhus/globby.git (globby), https://github.com/sindresorhus/got.git (got), https://github.com/sindresorhus/has-flag.git (has-flag), https://github.com/sindresorhus/import-fresh.git (import-fresh), https://github.com/sindresorhus/import-local.git (import-local), https://github.com/sindresorhus/indent-string.git (indent-string), https://github.com/sindresorhus/invert-kv.git (invert-kv), https://github.com/sindresorhus/irregular-plurals.git (irregular-plurals), https://github.com/sindresorhus/is-generator-fn.git (is-generator-fn), https://github.com/sindresorhus/is-installed-globally.git (is-installed-globally), https://github.com/sindresorhus/is-observable.git (is-observable), https://github.com/sindresorhus/is-plain-obj.git (is-plain-obj), https://github.com/sindresorhus/is-stream.git (is-stream), https://github.com/sindresorhus/is-text-path.git (is-text-path), https://github.com/sindresorhus/lcid.git (lcid), https://github.com/sindresorhus/leven.git (leven), https://github.com/sindresorhus/load-json-file.git (load-json-file), https://github.com/sindresorhus/locate-path.git (locate-path), https://github.com/sindresorhus/log-symbols.git (log-symbols), https://github.com/sindresorhus/log-update.git (log-update), https://github.com/sindresorhus/lowercase-keys.git (lowercase-keys), https://github.com/sindresorhus/macos-release.git (macos-release), https://github.com/sindresorhus/make-dir.git (make-dir), https://github.com/sindresorhus/matcher.git (matcher), https://github.com/sindresorhus/mem.git (mem), https://github.com/sindresorhus/meow.git (meow), https://github.com/sindresorhus/mimic-fn.git (mimic-fn), https://github.com/sindresorhus/mimic-response.git (mimic-response), https://github.com/sindresorhus/multimatch.git (multimatch), https://github.com/sindresorhus/normalize-url.git (normalize-url), https://github.com/sindresorhus/onetime.git (onetime), https://github.com/sindresorhus/open.git (open), https://github.com/sindresorhus/opn.git (opn), https://github.com/sindresorhus/ora.git (ora), https://github.com/sindresorhus/os-locale.git (os-locale), https://github.com/sindresorhus/os-name.git (os-name), https://github.com/sindresorhus/p-cancelable.git (p-cancelable), https://github.com/sindresorhus/p-is-promise.git (p-is-promise), https://github.com/sindresorhus/p-limit.git (p-limit), https://github.com/sindresorhus/p-locate.git (p-locate), https://github.com/sindresorhus/p-map.git (p-map), https://github.com/sindresorhus/p-pipe.git (p-pipe), https://github.com/sindresorhus/p-queue.git (p-queue), https://github.com/sindresorhus/p-reflect.git (p-reflect), https://github.com/sindresorhus/p-settle.git (p-settle), https://github.com/sindresorhus/p-timeout.git (p-timeout), https://github.com/sindresorhus/p-try.git (p-try), https://github.com/sindresorhus/parent-module.git (parent-module), https://github.com/sindresorhus/parse-json.git (parse-json), https://github.com/sindresorhus/path-exists.git (path-exists), https://github.com/sindresorhus/path-type.git (path-type), https://github.com/sindresorhus/pify.git (pify), https://github.com/sindresorhus/pkg-conf.git (pkg-conf), https://github.com/sindresorhus/pkg-dir.git (pkg-dir), https://github.com/sindresorhus/prepend-http.git (prepend-http), https://github.com/sindresorhus/pretty-ms.git (pretty-ms), https://github.com/sindresorhus/query-string.git (query-string), https://github.com/sindresorhus/quick-lru.git (quick-lru), https://github.com/sindresorhus/read-pkg.git (read-pkg), https://github.com/sindresorhus/read-pkg-up.git (read-pkg-up), https://github.com/sindresorhus/resolve-from.git (resolve-from), https://github.com/sindresorhus/run-node.git (run-node), https://github.com/sindresorhus/slash.git (slash), https://github.com/sindresorhus/sort-keys.git (sort-keys), https://github.com/sindresorhus/split-on-first.git (split-on-first), https://github.com/sindresorhus/string-length.git (string-length), https://github.com/sindresorhus/string-width.git (string-width), https://github.com/chalk/strip-ansi.git (strip-ansi), https://github.com/sindresorhus/strip-bom.git (strip-bom), https://github.com/chalk/supports-color.git (supports-color), https://github.com/sindresorhus/temp-write.git (temp-write), https://github.com/sindresorhus/text-extensions.git (text-extensions), https://github.com/sindresorhus/to-readable-stream.git (to-readable-stream), https://github.com/sindresorhus/type-fest.git (type-fest), https://github.com/sindresorhus/url-parse-lax.git (url-parse-lax), https://github.com/sindresorhus/widest-line.git (widest-line), https://github.com/sindresorhus/windows-release.git (windows-release), https://github.com/chalk/wrap-ansi.git (wrap-ansi), https://github.com/sindresorhus/write-json-file.git (write-json-file), https://github.com/sindresorhus/write-pkg.git (write-pkg), https://github.com/sindresorhus/yn.git (yn). This software contains the following license and notice below: MIT License @@ -2444,7 +2504,31 @@ SOFTWARE. ----- -The following software may be included in this product: @types/accepts, @types/airtable, @types/anymatch, @types/async-polling, @types/babel__core, @types/babel__generator, @types/babel__template, @types/babel__traverse, @types/babel-types, @types/babylon, @types/bignumber.js, @types/bip32, @types/bip39, @types/bn.js, @types/body-parser, @types/caseless, @types/chai, @types/cheerio, @types/cli-table, @types/connect, @types/cookiejar, @types/cookies, @types/cors, @types/country-data, @types/debug, @types/dotenv, @types/duplexify, @types/elliptic, @types/enzyme, @types/enzyme-adapter-react-16, @types/eth-lightwallet, @types/ethereum-protocol, @types/ethereumjs-util, @types/events, @types/express, @types/express-serve-static-core, @types/fs-capacitor, @types/fs-extra, @types/glob, @types/google-libphonenumber, @types/graphql, @types/graphql-upload, @types/hdkey, @types/hoist-non-react-statics, @types/http-assert, @types/i18next, @types/invariant, @types/is-glob, @types/isomorphic-fetch, @types/istanbul-lib-coverage, @types/istanbul-lib-report, @types/istanbul-reports, @types/jest, @types/jest-diff, @types/jsonwebtoken, @types/koa, @types/koa-compose, @types/lodash, @types/lodash.zipobject, @types/long, @types/mailgun-js, @types/mathjs, @types/mime, @types/minimatch, @types/mkdirp, @types/mocha, @types/next, @types/next-server, @types/node, @types/node-fetch, @types/nodemailer, @types/normalize-package-data, @types/p-defer, @types/prettier, @types/prompts, @types/prop-types, @types/q, @types/qs, @types/range-parser, @types/react, @types/react-css-modules, @types/react-google-recaptcha, @types/react-loadable, @types/react-native, @types/react-native-autocomplete-input, @types/react-native-fs, @types/react-native-keep-awake, @types/react-redux, @types/react-test-renderer, @types/redux-mock-store, @types/request, @types/resolve, @types/serve-static, @types/source-list-map, @types/stack-utils, @types/superagent, @types/supertest, @types/tapable, @types/tough-cookie, @types/twilio, @types/uglify-js, @types/underscore, @types/utf8, @types/uuid-js, @types/web3, @types/web3-provider-engine, @types/webpack, @types/webpack-sources, @types/ws, @types/yargs, @types/yargs-parser, @types/zen-observable. A copy of the source code may be downloaded from https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/accepts), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/airtable), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/anymatch), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/async-polling), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__core), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__generator), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__template), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__traverse), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel-types), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babylon), https://github.com/MikeMcl/bignumber.js/ (@types/bignumber.js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bip32), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bip39), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bn.js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/body-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/caseless), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/chai), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cheerio), https://github.com/DefinitelyTyped/DefinitelyTyped.git.git (@types/cli-table), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/connect), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cookiejar), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cookies), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cors), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/country-data), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/debug), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/dotenv), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/duplexify), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/elliptic), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/enzyme), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/enzyme-adapter-react-16), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/eth-lightwallet), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/ethereum-protocol), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/ethereumjs-util), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/events), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/express), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/express-serve-static-core), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/fs-capacitor), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/fs-extra), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/glob), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/google-libphonenumber), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/graphql), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/graphql-upload), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/hdkey), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/hoist-non-react-statics), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/http-assert), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/i18next), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/invariant), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/is-glob), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/isomorphic-fetch), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-lib-coverage), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-lib-report), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-reports), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest-diff), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jsonwebtoken), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/koa), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/koa-compose), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/lodash), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/lodash.zipobject), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/long), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mailgun-js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mathjs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mime), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/minimatch), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mkdirp), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mocha), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/next), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/next-server), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node-fetch), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/nodemailer), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/normalize-package-data), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/p-defer), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prettier), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prompts), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prop-types), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/q), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/qs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/range-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-css-modules), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-google-recaptcha), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-loadable), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-native), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-native-autocomplete-input), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-native-fs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-native-keep-awake), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-redux), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-test-renderer), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/redux-mock-store), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/request), https://github.com/DefinitelyTyped/DefinitelyTyped.git.git (@types/resolve), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/serve-static), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/source-list-map), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/stack-utils), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/superagent), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/supertest), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/tapable), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/tough-cookie), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/twilio), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/uglify-js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/underscore), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/utf8), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/uuid-js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/web3), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/web3-provider-engine), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/webpack), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/webpack-sources), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/ws), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yargs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yargs-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/zen-observable). This software contains the following license and notice below: +The following software may be included in this product: @truffle/blockchain-utils, @truffle/contract-schema, @truffle/error, @truffle/expect, truffle-artifactor, truffle-compile, truffle-config, truffle-contract, truffle-contract-sources, truffle-provider, truffle-provisioner, truffle-resolver. A copy of the source code may be downloaded from https://github.com/trufflesuite/truffle/tree/master/packages/blockchain-utils (@truffle/blockchain-utils), https://github.com/trufflesuite/truffle/tree/master/packages/contract-schema (@truffle/contract-schema), https://github.com/trufflesuite/truffle/tree/master/packages/error (@truffle/error), https://github.com/trufflesuite/truffle/tree/master/packages/expect (@truffle/expect), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-artifactor (truffle-artifactor), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-compile (truffle-compile), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-config (truffle-config), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-contract (truffle-contract), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-contract-sources (truffle-contract-sources), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-provider (truffle-provider), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-provisioner (truffle-provisioner), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-resolver (truffle-resolver). This software contains the following license and notice below: + +Copyright (c) 2017-2019 Truffle Blockchain Group, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +----- + +The following software may be included in this product: @types/accepts, @types/airtable, @types/anymatch, @types/async-polling, @types/babel__core, @types/babel__generator, @types/babel__template, @types/babel__traverse, @types/babel-types, @types/babylon, @types/bignumber.js, @types/bip32, @types/bip39, @types/bn.js, @types/body-parser, @types/bytebuffer, @types/caseless, @types/chai, @types/cheerio, @types/cli-table, @types/connect, @types/cookiejar, @types/cookies, @types/cors, @types/country-data, @types/debug, @types/dotenv, @types/duplexify, @types/elliptic, @types/enzyme, @types/enzyme-adapter-react-16, @types/eth-lightwallet, @types/ethereum-protocol, @types/ethereumjs-util, @types/events, @types/express, @types/express-serve-static-core, @types/fs-capacitor, @types/fs-extra, @types/glob, @types/google-libphonenumber, @types/graphql, @types/graphql-upload, @types/hdkey, @types/hoist-non-react-statics, @types/http-assert, @types/i18next, @types/invariant, @types/is-glob, @types/isomorphic-fetch, @types/istanbul-lib-coverage, @types/istanbul-lib-report, @types/istanbul-reports, @types/jest, @types/jest-diff, @types/jsonwebtoken, @types/koa, @types/koa-compose, @types/lodash, @types/lodash.zipobject, @types/long, @types/mailgun-js, @types/mathjs, @types/mime, @types/minimatch, @types/mkdirp, @types/mocha, @types/next, @types/next-server, @types/node, @types/node-fetch, @types/nodemailer, @types/normalize-package-data, @types/p-defer, @types/prettier, @types/prompts, @types/prop-types, @types/q, @types/qs, @types/range-parser, @types/react, @types/react-css-modules, @types/react-google-recaptcha, @types/react-loadable, @types/react-native, @types/react-native-autocomplete-input, @types/react-native-fs, @types/react-native-keep-awake, @types/react-redux, @types/react-test-renderer, @types/redux-mock-store, @types/request, @types/resolve, @types/serve-static, @types/source-list-map, @types/stack-utils, @types/superagent, @types/supertest, @types/tapable, @types/tough-cookie, @types/twilio, @types/uglify-js, @types/underscore, @types/utf8, @types/uuid-js, @types/web3, @types/web3-provider-engine, @types/webpack, @types/webpack-sources, @types/ws, @types/yargs, @types/yargs-parser, @types/zen-observable. A copy of the source code may be downloaded from https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/accepts), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/airtable), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/anymatch), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/async-polling), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__core), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__generator), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__template), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel__traverse), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babel-types), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/babylon), https://github.com/MikeMcl/bignumber.js/ (@types/bignumber.js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bip32), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bip39), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bn.js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/body-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/bytebuffer), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/caseless), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/chai), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cheerio), https://github.com/DefinitelyTyped/DefinitelyTyped.git.git (@types/cli-table), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/connect), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cookiejar), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cookies), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/cors), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/country-data), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/debug), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/dotenv), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/duplexify), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/elliptic), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/enzyme), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/enzyme-adapter-react-16), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/eth-lightwallet), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/ethereum-protocol), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/ethereumjs-util), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/events), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/express), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/express-serve-static-core), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/fs-capacitor), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/fs-extra), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/glob), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/google-libphonenumber), https://github.com/graphql/graphql-js (@types/graphql), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/graphql-upload), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/hdkey), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/hoist-non-react-statics), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/http-assert), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/i18next), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/invariant), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/is-glob), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/isomorphic-fetch), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-lib-coverage), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-lib-report), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/istanbul-reports), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jest-diff), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/jsonwebtoken), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/koa), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/koa-compose), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/lodash), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/lodash.zipobject), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/long), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mailgun-js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mathjs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mime), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/minimatch), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mkdirp), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/mocha), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/next), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/next-server), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/node-fetch), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/nodemailer), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/normalize-package-data), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/p-defer), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prettier), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prompts), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/prop-types), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/q), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/qs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/range-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-css-modules), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-google-recaptcha), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-loadable), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-native), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-native-autocomplete-input), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-native-fs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-native-keep-awake), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-redux), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/react-test-renderer), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/redux-mock-store), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/request), https://github.com/DefinitelyTyped/DefinitelyTyped.git.git (@types/resolve), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/serve-static), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/source-list-map), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/stack-utils), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/superagent), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/supertest), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/tapable), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/tough-cookie), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/twilio), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/uglify-js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/underscore), https://www.github.com/DefinitelyTyped/DefinitelyTyped.git (@types/utf8), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/uuid-js), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/web3), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/web3-provider-engine), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/webpack), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/webpack-sources), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/ws), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yargs), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/yargs-parser), https://github.com/DefinitelyTyped/DefinitelyTyped.git (@types/zen-observable). This software contains the following license and notice below: MIT License @@ -2884,6 +2968,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The following software may be included in this product: abab. A copy of the source code may be downloaded from git+https://github.com/jsdom/abab.git. This software contains the following license and notice below: +Copyright © 2019 W3C and Jeff Carpenter \ + Both the original source code and new contributions in this repository are released under the [W3C 3-clause BSD license](https://github.com/w3c/web-platform-tests/blob/master/LICENSE.md#w3c-3-clause-bsd-license). # W3C 3-clause BSD License @@ -4703,7 +4789,7 @@ Apache License ----- -The following software may be included in this product: ansi-regex, ansi-styles, arr-exclude, array-differ, array-find-index, array-union, array-uniq, arrify, buf-compare, builtin-modules, caller-callsite, caller-path, callsites, camelcase, camelcase-keys, chalk, clean-stack, cli-boxes, cli-cursor, cli-spinners, cli-truncate, code-point-at, core-assert, crypto-random-string, dargs, date-time, debug-log, decamelize, deep-assign, del, detect-indent, detect-newline, dot-prop, elegant-spinner, env-paths, escape-string-regexp, extract-stack, figures, file-type, find-up, fn-name, get-port, get-stream, git-remote-origin-url, globals, globby, got, has-ansi, has-flag, has-yarn, home-or-tmp, import-cwd, import-fresh, import-from, import-lazy, import-local, indent-string, ip-regex, is-binary-path, is-builtin-module, is-finite, is-fn, is-fullwidth-code-point, is-generator-fn, is-obj, is-observable, is-path-in-cwd, is-path-inside, is-plain-obj, is-redirect, is-stream, is-wsl, junk, latest-version, lcid, load-json-file, locate-path, log-symbols, loud-rejection, lowercase-keys, map-obj, md5-hex, mem, meow, modify-values, npm-run-path, number-is-nan, object-assign, observable-to-promise, onetime, ora, os-homedir, os-locale, os-tmpdir, p-cancelable, p-defer, p-each-series, p-finally, p-locate, p-map-series, p-reduce, p-try, p-waterfall, package-json, parse-json, parse-ms, path-exists, path-is-absolute, path-key, path-type, pify, pkg-dir, pkg-up, plur, prepend-http, pretty-bytes, read-pkg, read-pkg-up, redent, registry-url, repeating, req-cwd, req-from, require-uncached, resolve-cwd, resolve-from, restore-cursor, semver-diff, serialize-error, shebang-regex, string-length, string-width, strip-ansi, strip-bom, strip-bom-buf, strip-eof, strip-indent, strip-json-comments, supports-color, temp-dir, tempfile, term-size, time-zone, trim-newlines, trim-right, unique-string, url-parse-lax, user-home, wrap-ansi, xdg-basedir, yn. A copy of the source code may be downloaded from https://github.com/chalk/ansi-regex.git (ansi-regex), https://github.com/chalk/ansi-styles.git (ansi-styles), https://github.com/sindresorhus/arr-exclude.git (arr-exclude), https://github.com/sindresorhus/array-differ.git (array-differ), https://github.com/sindresorhus/array-find-index.git (array-find-index), https://github.com/sindresorhus/array-union.git (array-union), https://github.com/sindresorhus/array-uniq.git (array-uniq), https://github.com/sindresorhus/arrify.git (arrify), https://github.com/sindresorhus/buf-compare.git (buf-compare), https://github.com/sindresorhus/builtin-modules.git (builtin-modules), https://github.com/sindresorhus/caller-callsite.git (caller-callsite), https://github.com/sindresorhus/caller-path.git (caller-path), https://github.com/sindresorhus/callsites.git (callsites), https://github.com/sindresorhus/camelcase.git (camelcase), https://github.com/sindresorhus/camelcase-keys.git (camelcase-keys), https://github.com/chalk/chalk.git (chalk), https://github.com/sindresorhus/clean-stack.git (clean-stack), https://github.com/sindresorhus/cli-boxes.git (cli-boxes), https://github.com/sindresorhus/cli-cursor.git (cli-cursor), https://github.com/sindresorhus/cli-spinners.git (cli-spinners), https://github.com/sindresorhus/cli-truncate.git (cli-truncate), https://github.com/sindresorhus/code-point-at.git (code-point-at), https://github.com/sindresorhus/core-assert.git (core-assert), https://github.com/sindresorhus/crypto-random-string.git (crypto-random-string), https://github.com/sindresorhus/dargs.git (dargs), https://github.com/sindresorhus/date-time.git (date-time), https://github.com/sindresorhus/debug-log.git (debug-log), https://github.com/sindresorhus/decamelize.git (decamelize), https://github.com/sindresorhus/deep-assign.git (deep-assign), https://github.com/sindresorhus/del.git (del), https://github.com/sindresorhus/detect-indent.git (detect-indent), https://github.com/sindresorhus/detect-newline.git (detect-newline), https://github.com/sindresorhus/dot-prop.git (dot-prop), https://github.com/sindresorhus/elegant-spinner.git (elegant-spinner), https://github.com/sindresorhus/env-paths.git (env-paths), https://github.com/sindresorhus/escape-string-regexp.git (escape-string-regexp), https://github.com/sindresorhus/extract-stack.git (extract-stack), https://github.com/sindresorhus/figures.git (figures), https://github.com/sindresorhus/file-type.git (file-type), https://github.com/sindresorhus/find-up.git (find-up), https://github.com/sindresorhus/fn-name.git (fn-name), https://github.com/sindresorhus/get-port.git (get-port), https://github.com/sindresorhus/get-stream.git (get-stream), https://github.com/sindresorhus/git-remote-origin-url.git (git-remote-origin-url), https://github.com/sindresorhus/globals.git (globals), https://github.com/sindresorhus/globby.git (globby), https://github.com/sindresorhus/got.git (got), https://github.com/sindresorhus/has-ansi.git (has-ansi), https://github.com/sindresorhus/has-flag.git (has-flag), https://github.com/sindresorhus/has-yarn.git (has-yarn), https://github.com/sindresorhus/home-or-tmp.git (home-or-tmp), https://github.com/sindresorhus/import-cwd.git (import-cwd), https://github.com/sindresorhus/import-fresh.git (import-fresh), https://github.com/sindresorhus/import-from.git (import-from), https://github.com/sindresorhus/import-lazy.git (import-lazy), https://github.com/sindresorhus/import-local.git (import-local), https://github.com/sindresorhus/indent-string.git (indent-string), https://github.com/sindresorhus/ip-regex.git (ip-regex), https://github.com/sindresorhus/is-binary-path.git (is-binary-path), https://github.com/sindresorhus/is-builtin-module.git (is-builtin-module), https://github.com/sindresorhus/is-finite.git (is-finite), https://github.com/sindresorhus/is-fn.git (is-fn), https://github.com/sindresorhus/is-fullwidth-code-point.git (is-fullwidth-code-point), https://github.com/sindresorhus/is-generator-fn.git (is-generator-fn), https://github.com/sindresorhus/is-obj.git (is-obj), https://github.com/sindresorhus/is-observable.git (is-observable), https://github.com/sindresorhus/is-path-in-cwd.git (is-path-in-cwd), https://github.com/sindresorhus/is-path-inside.git (is-path-inside), https://github.com/sindresorhus/is-plain-obj.git (is-plain-obj), https://github.com/sindresorhus/is-redirect.git (is-redirect), https://github.com/sindresorhus/is-stream.git (is-stream), https://github.com/sindresorhus/is-wsl.git (is-wsl), https://github.com/sindresorhus/junk.git (junk), https://github.com/sindresorhus/latest-version.git (latest-version), https://github.com/sindresorhus/lcid.git (lcid), https://github.com/sindresorhus/load-json-file.git (load-json-file), https://github.com/sindresorhus/locate-path.git (locate-path), https://github.com/sindresorhus/log-symbols.git (log-symbols), https://github.com/sindresorhus/loud-rejection.git (loud-rejection), https://github.com/sindresorhus/lowercase-keys.git (lowercase-keys), https://github.com/sindresorhus/map-obj.git (map-obj), https://github.com/sindresorhus/md5-hex.git (md5-hex), https://github.com/sindresorhus/mem.git (mem), https://github.com/sindresorhus/meow.git (meow), https://github.com/sindresorhus/modify-values.git (modify-values), https://github.com/sindresorhus/npm-run-path.git (npm-run-path), https://github.com/sindresorhus/number-is-nan.git (number-is-nan), https://github.com/sindresorhus/object-assign.git (object-assign), https://github.com/sindresorhus/observable-to-promise.git (observable-to-promise), https://github.com/sindresorhus/onetime.git (onetime), https://github.com/sindresorhus/ora.git (ora), https://github.com/sindresorhus/os-homedir.git (os-homedir), https://github.com/sindresorhus/os-locale.git (os-locale), https://github.com/sindresorhus/os-tmpdir.git (os-tmpdir), https://github.com/sindresorhus/p-cancelable.git (p-cancelable), https://github.com/sindresorhus/p-defer.git (p-defer), https://github.com/sindresorhus/p-each-series.git (p-each-series), https://github.com/sindresorhus/p-finally.git (p-finally), https://github.com/sindresorhus/p-locate.git (p-locate), https://github.com/sindresorhus/p-map-series.git (p-map-series), https://github.com/sindresorhus/p-reduce.git (p-reduce), https://github.com/sindresorhus/p-try.git (p-try), https://github.com/sindresorhus/p-waterfall.git (p-waterfall), https://github.com/sindresorhus/package-json.git (package-json), https://github.com/sindresorhus/parse-json.git (parse-json), https://github.com/sindresorhus/parse-ms.git (parse-ms), https://github.com/sindresorhus/path-exists.git (path-exists), https://github.com/sindresorhus/path-is-absolute.git (path-is-absolute), https://github.com/sindresorhus/path-key.git (path-key), https://github.com/sindresorhus/path-type.git (path-type), https://github.com/sindresorhus/pify.git (pify), https://github.com/sindresorhus/pkg-dir.git (pkg-dir), https://github.com/sindresorhus/pkg-up.git (pkg-up), https://github.com/sindresorhus/plur.git (plur), https://github.com/sindresorhus/prepend-http.git (prepend-http), https://github.com/sindresorhus/pretty-bytes.git (pretty-bytes), https://github.com/sindresorhus/read-pkg.git (read-pkg), https://github.com/sindresorhus/read-pkg-up.git (read-pkg-up), https://github.com/sindresorhus/redent.git (redent), https://github.com/sindresorhus/registry-url.git (registry-url), https://github.com/sindresorhus/repeating.git (repeating), https://github.com/sindresorhus/req-cwd.git (req-cwd), https://github.com/sindresorhus/req-from.git (req-from), https://github.com/sindresorhus/require-uncached.git (require-uncached), https://github.com/sindresorhus/resolve-cwd.git (resolve-cwd), https://github.com/sindresorhus/resolve-from.git (resolve-from), https://github.com/sindresorhus/restore-cursor.git (restore-cursor), https://github.com/sindresorhus/semver-diff.git (semver-diff), https://github.com/sindresorhus/serialize-error.git (serialize-error), https://github.com/sindresorhus/shebang-regex.git (shebang-regex), https://github.com/sindresorhus/string-length.git (string-length), https://github.com/sindresorhus/string-width.git (string-width), https://github.com/chalk/strip-ansi.git (strip-ansi), https://github.com/sindresorhus/strip-bom.git (strip-bom), https://github.com/sindresorhus/strip-bom-buf.git (strip-bom-buf), https://github.com/sindresorhus/strip-eof.git (strip-eof), https://github.com/sindresorhus/strip-indent.git (strip-indent), https://github.com/sindresorhus/strip-json-comments.git (strip-json-comments), https://github.com/chalk/supports-color.git (supports-color), https://github.com/sindresorhus/temp-dir.git (temp-dir), https://github.com/sindresorhus/tempfile.git (tempfile), https://github.com/sindresorhus/term-size.git (term-size), https://github.com/sindresorhus/time-zone.git (time-zone), https://github.com/sindresorhus/trim-newlines.git (trim-newlines), https://github.com/sindresorhus/trim-right.git (trim-right), https://github.com/sindresorhus/unique-string.git (unique-string), https://github.com/sindresorhus/url-parse-lax.git (url-parse-lax), https://github.com/sindresorhus/user-home.git (user-home), https://github.com/chalk/wrap-ansi.git (wrap-ansi), https://github.com/sindresorhus/xdg-basedir.git (xdg-basedir), https://github.com/sindresorhus/yn.git (yn). This software contains the following license and notice below: +The following software may be included in this product: ansi-regex, ansi-styles, arr-exclude, array-differ, array-find-index, array-union, array-uniq, arrify, buf-compare, builtin-modules, caller-callsite, caller-path, callsites, camelcase, camelcase-keys, chalk, clean-stack, cli-boxes, cli-cursor, cli-spinners, cli-truncate, code-point-at, core-assert, crypto-random-string, dargs, date-time, debug-log, decamelize, deep-assign, del, detect-indent, detect-newline, dot-prop, elegant-spinner, env-paths, escape-string-regexp, extract-stack, figures, file-type, find-up, fn-name, get-port, get-stream, git-remote-origin-url, globals, globby, got, has-ansi, has-flag, has-yarn, home-or-tmp, import-cwd, import-fresh, import-from, import-lazy, import-local, indent-string, ip-regex, is-binary-path, is-builtin-module, is-finite, is-fn, is-fullwidth-code-point, is-generator-fn, is-obj, is-observable, is-path-in-cwd, is-path-inside, is-plain-obj, is-redirect, is-stream, is-wsl, junk, latest-version, lcid, load-json-file, locate-path, log-symbols, loud-rejection, lowercase-keys, map-obj, md5-hex, mem, meow, modify-values, npm-run-path, number-is-nan, object-assign, observable-to-promise, onetime, ora, os-homedir, os-locale, os-tmpdir, p-cancelable, p-defer, p-each-series, p-finally, p-locate, p-map-series, p-reduce, p-try, p-waterfall, package-json, parse-json, parse-ms, path-exists, path-is-absolute, path-key, path-type, pify, pkg-dir, pkg-up, plur, prepend-http, pretty-bytes, read-pkg, read-pkg-up, redent, registry-url, repeating, req-cwd, req-from, require-uncached, resolve-cwd, resolve-from, restore-cursor, semver-diff, serialize-error, shebang-regex, string-length, string-width, strip-ansi, strip-bom, strip-bom-buf, strip-eof, strip-indent, strip-json-comments, supports-color, temp-dir, tempfile, term-size, time-zone, trim-newlines, trim-right, unique-string, url-parse-lax, user-home, wrap-ansi, xdg-basedir. A copy of the source code may be downloaded from https://github.com/chalk/ansi-regex.git (ansi-regex), https://github.com/chalk/ansi-styles.git (ansi-styles), https://github.com/sindresorhus/arr-exclude.git (arr-exclude), https://github.com/sindresorhus/array-differ.git (array-differ), https://github.com/sindresorhus/array-find-index.git (array-find-index), https://github.com/sindresorhus/array-union.git (array-union), https://github.com/sindresorhus/array-uniq.git (array-uniq), https://github.com/sindresorhus/arrify.git (arrify), https://github.com/sindresorhus/buf-compare.git (buf-compare), https://github.com/sindresorhus/builtin-modules.git (builtin-modules), https://github.com/sindresorhus/caller-callsite.git (caller-callsite), https://github.com/sindresorhus/caller-path.git (caller-path), https://github.com/sindresorhus/callsites.git (callsites), https://github.com/sindresorhus/camelcase.git (camelcase), https://github.com/sindresorhus/camelcase-keys.git (camelcase-keys), https://github.com/chalk/chalk.git (chalk), https://github.com/sindresorhus/clean-stack.git (clean-stack), https://github.com/sindresorhus/cli-boxes.git (cli-boxes), https://github.com/sindresorhus/cli-cursor.git (cli-cursor), https://github.com/sindresorhus/cli-spinners.git (cli-spinners), https://github.com/sindresorhus/cli-truncate.git (cli-truncate), https://github.com/sindresorhus/code-point-at.git (code-point-at), https://github.com/sindresorhus/core-assert.git (core-assert), https://github.com/sindresorhus/crypto-random-string.git (crypto-random-string), https://github.com/sindresorhus/dargs.git (dargs), https://github.com/sindresorhus/date-time.git (date-time), https://github.com/sindresorhus/debug-log.git (debug-log), https://github.com/sindresorhus/decamelize.git (decamelize), https://github.com/sindresorhus/deep-assign.git (deep-assign), https://github.com/sindresorhus/del.git (del), https://github.com/sindresorhus/detect-indent.git (detect-indent), https://github.com/sindresorhus/detect-newline.git (detect-newline), https://github.com/sindresorhus/dot-prop.git (dot-prop), https://github.com/sindresorhus/elegant-spinner.git (elegant-spinner), https://github.com/sindresorhus/env-paths.git (env-paths), https://github.com/sindresorhus/escape-string-regexp.git (escape-string-regexp), https://github.com/sindresorhus/extract-stack.git (extract-stack), https://github.com/sindresorhus/figures.git (figures), https://github.com/sindresorhus/file-type.git (file-type), https://github.com/sindresorhus/find-up.git (find-up), https://github.com/sindresorhus/fn-name.git (fn-name), https://github.com/sindresorhus/get-port.git (get-port), https://github.com/sindresorhus/get-stream.git (get-stream), https://github.com/sindresorhus/git-remote-origin-url.git (git-remote-origin-url), https://github.com/sindresorhus/globals.git (globals), https://github.com/sindresorhus/globby.git (globby), https://github.com/sindresorhus/got.git (got), https://github.com/sindresorhus/has-ansi.git (has-ansi), https://github.com/sindresorhus/has-flag.git (has-flag), https://github.com/sindresorhus/has-yarn.git (has-yarn), https://github.com/sindresorhus/home-or-tmp.git (home-or-tmp), https://github.com/sindresorhus/import-cwd.git (import-cwd), https://github.com/sindresorhus/import-fresh.git (import-fresh), https://github.com/sindresorhus/import-from.git (import-from), https://github.com/sindresorhus/import-lazy.git (import-lazy), https://github.com/sindresorhus/import-local.git (import-local), https://github.com/sindresorhus/indent-string.git (indent-string), https://github.com/sindresorhus/ip-regex.git (ip-regex), https://github.com/sindresorhus/is-binary-path.git (is-binary-path), https://github.com/sindresorhus/is-builtin-module.git (is-builtin-module), https://github.com/sindresorhus/is-finite.git (is-finite), https://github.com/sindresorhus/is-fn.git (is-fn), https://github.com/sindresorhus/is-fullwidth-code-point.git (is-fullwidth-code-point), https://github.com/sindresorhus/is-generator-fn.git (is-generator-fn), https://github.com/sindresorhus/is-obj.git (is-obj), https://github.com/sindresorhus/is-observable.git (is-observable), https://github.com/sindresorhus/is-path-in-cwd.git (is-path-in-cwd), https://github.com/sindresorhus/is-path-inside.git (is-path-inside), https://github.com/sindresorhus/is-plain-obj.git (is-plain-obj), https://github.com/sindresorhus/is-redirect.git (is-redirect), https://github.com/sindresorhus/is-stream.git (is-stream), https://github.com/sindresorhus/is-wsl.git (is-wsl), https://github.com/sindresorhus/junk.git (junk), https://github.com/sindresorhus/latest-version.git (latest-version), https://github.com/sindresorhus/lcid.git (lcid), https://github.com/sindresorhus/load-json-file.git (load-json-file), https://github.com/sindresorhus/locate-path.git (locate-path), https://github.com/sindresorhus/log-symbols.git (log-symbols), https://github.com/sindresorhus/loud-rejection.git (loud-rejection), https://github.com/sindresorhus/lowercase-keys.git (lowercase-keys), https://github.com/sindresorhus/map-obj.git (map-obj), https://github.com/sindresorhus/md5-hex.git (md5-hex), https://github.com/sindresorhus/mem.git (mem), https://github.com/sindresorhus/meow.git (meow), https://github.com/sindresorhus/modify-values.git (modify-values), https://github.com/sindresorhus/npm-run-path.git (npm-run-path), https://github.com/sindresorhus/number-is-nan.git (number-is-nan), https://github.com/sindresorhus/object-assign.git (object-assign), https://github.com/sindresorhus/observable-to-promise.git (observable-to-promise), https://github.com/sindresorhus/onetime.git (onetime), https://github.com/sindresorhus/ora.git (ora), https://github.com/sindresorhus/os-homedir.git (os-homedir), https://github.com/sindresorhus/os-locale.git (os-locale), https://github.com/sindresorhus/os-tmpdir.git (os-tmpdir), https://github.com/sindresorhus/p-cancelable.git (p-cancelable), https://github.com/sindresorhus/p-defer.git (p-defer), https://github.com/sindresorhus/p-each-series.git (p-each-series), https://github.com/sindresorhus/p-finally.git (p-finally), https://github.com/sindresorhus/p-locate.git (p-locate), https://github.com/sindresorhus/p-map-series.git (p-map-series), https://github.com/sindresorhus/p-reduce.git (p-reduce), https://github.com/sindresorhus/p-try.git (p-try), https://github.com/sindresorhus/p-waterfall.git (p-waterfall), https://github.com/sindresorhus/package-json.git (package-json), https://github.com/sindresorhus/parse-json.git (parse-json), https://github.com/sindresorhus/parse-ms.git (parse-ms), https://github.com/sindresorhus/path-exists.git (path-exists), https://github.com/sindresorhus/path-is-absolute.git (path-is-absolute), https://github.com/sindresorhus/path-key.git (path-key), https://github.com/sindresorhus/path-type.git (path-type), https://github.com/sindresorhus/pify.git (pify), https://github.com/sindresorhus/pkg-dir.git (pkg-dir), https://github.com/sindresorhus/pkg-up.git (pkg-up), https://github.com/sindresorhus/plur.git (plur), https://github.com/sindresorhus/prepend-http.git (prepend-http), https://github.com/sindresorhus/pretty-bytes.git (pretty-bytes), https://github.com/sindresorhus/read-pkg.git (read-pkg), https://github.com/sindresorhus/read-pkg-up.git (read-pkg-up), https://github.com/sindresorhus/redent.git (redent), https://github.com/sindresorhus/registry-url.git (registry-url), https://github.com/sindresorhus/repeating.git (repeating), https://github.com/sindresorhus/req-cwd.git (req-cwd), https://github.com/sindresorhus/req-from.git (req-from), https://github.com/sindresorhus/require-uncached.git (require-uncached), https://github.com/sindresorhus/resolve-cwd.git (resolve-cwd), https://github.com/sindresorhus/resolve-from.git (resolve-from), https://github.com/sindresorhus/restore-cursor.git (restore-cursor), https://github.com/sindresorhus/semver-diff.git (semver-diff), https://github.com/sindresorhus/serialize-error.git (serialize-error), https://github.com/sindresorhus/shebang-regex.git (shebang-regex), https://github.com/sindresorhus/string-length.git (string-length), https://github.com/sindresorhus/string-width.git (string-width), https://github.com/chalk/strip-ansi.git (strip-ansi), https://github.com/sindresorhus/strip-bom.git (strip-bom), https://github.com/sindresorhus/strip-bom-buf.git (strip-bom-buf), https://github.com/sindresorhus/strip-eof.git (strip-eof), https://github.com/sindresorhus/strip-indent.git (strip-indent), https://github.com/sindresorhus/strip-json-comments.git (strip-json-comments), https://github.com/chalk/supports-color.git (supports-color), https://github.com/sindresorhus/temp-dir.git (temp-dir), https://github.com/sindresorhus/tempfile.git (tempfile), https://github.com/sindresorhus/term-size.git (term-size), https://github.com/sindresorhus/time-zone.git (time-zone), https://github.com/sindresorhus/trim-newlines.git (trim-newlines), https://github.com/sindresorhus/trim-right.git (trim-right), https://github.com/sindresorhus/unique-string.git (unique-string), https://github.com/sindresorhus/url-parse-lax.git (url-parse-lax), https://github.com/sindresorhus/user-home.git (user-home), https://github.com/chalk/wrap-ansi.git (wrap-ansi), https://github.com/sindresorhus/xdg-basedir.git (xdg-basedir). This software contains the following license and notice below: The MIT License (MIT) @@ -4781,6 +4867,26 @@ THE SOFTWARE. ----- +The following software may be included in this product: anymatch. A copy of the source code may be downloaded from https://github.com/micromatch/anymatch. This software contains the following license and notice below: + +The ISC License + +Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com) + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +----- + The following software may be included in this product: anymatch. A copy of the source code may be downloaded from https://github.com/es128/anymatch. This software contains the following license and notice below: The ISC License @@ -4951,7 +5057,7 @@ OTHER DEALINGS IN THE SOFTWARE. ----- -The following software may be included in this product: archy, array-map, array-reduce, atob-lite, btoa-lite, buffer-equal, camelize, concat-map, dasherize, deep-equal, defined, ent, fast-json-stable-stringify, github-from-package, https-browserify, is-typedarray, json-stable-stringify, json-stable-stringify-without-jsonify, minimist, object-inspect, path-browserify, resolve, resumer, safe-regex, semver-compare, snakeize, text-table, tty-browserify, vm-browserify, wordwrap. A copy of the source code may be downloaded from http://github.com/substack/node-archy.git (archy), git://github.com/substack/array-map.git (array-map), git://github.com/substack/array-reduce.git (array-reduce), git://github.com/hughsk/atob-lite.git (atob-lite), git://github.com/hughsk/btoa-lite.git (btoa-lite), git://github.com/substack/node-buffer-equal.git (buffer-equal), git://github.com/substack/camelize.git (camelize), git://github.com/substack/node-concat-map.git (concat-map), git://github.com/shahata/dasherize.git (dasherize), http://github.com/substack/node-deep-equal.git (deep-equal), git://github.com/substack/defined.git (defined), https://github.com/substack/node-ent.git (ent), git://github.com/epoberezkin/fast-json-stable-stringify.git (fast-json-stable-stringify), git://github.com/substack/github-from-package.git (github-from-package), git://github.com/substack/https-browserify.git (https-browserify), git://github.com/hughsk/is-typedarray.git (is-typedarray), git://github.com/substack/json-stable-stringify.git (json-stable-stringify), git://github.com/samn/json-stable-stringify.git (json-stable-stringify-without-jsonify), git://github.com/substack/minimist.git (minimist), git://github.com/substack/object-inspect.git (object-inspect), git://github.com/substack/path-browserify.git (path-browserify), git://github.com/substack/node-resolve.git (resolve), git://github.com/substack/resumer.git (resumer), git://github.com/substack/safe-regex.git (safe-regex), git://github.com/substack/semver-compare.git (semver-compare), git://github.com/nathan7/snakeize.git (snakeize), git://github.com/substack/text-table.git (text-table), git://github.com/substack/tty-browserify.git (tty-browserify), http://github.com/substack/vm-browserify.git (vm-browserify), git://github.com/substack/node-wordwrap.git (wordwrap). This software contains the following license and notice below: +The following software may be included in this product: archy, array-map, array-reduce, atob-lite, btoa-lite, buffer-equal, camelize, concat-map, dasherize, deep-equal, defined, ent, fast-json-stable-stringify, github-from-package, https-browserify, is-typedarray, json-stable-stringify, json-stable-stringify-without-jsonify, minimist, object-inspect, path-browserify, resolve, resumer, safe-regex, semver-compare, snakeize, text-table, tty-browserify, vm-browserify, wordwrap. A copy of the source code may be downloaded from http://github.com/substack/node-archy.git (archy), git://github.com/substack/array-map.git (array-map), git://github.com/substack/array-reduce.git (array-reduce), git://github.com/hughsk/atob-lite.git (atob-lite), git://github.com/hughsk/btoa-lite.git (btoa-lite), git://github.com/substack/node-buffer-equal.git (buffer-equal), git://github.com/substack/camelize.git (camelize), git://github.com/substack/node-concat-map.git (concat-map), git://github.com/shahata/dasherize.git (dasherize), http://github.com/substack/node-deep-equal.git (deep-equal), git://github.com/substack/defined.git (defined), https://github.com/substack/node-ent.git (ent), git://github.com/epoberezkin/fast-json-stable-stringify.git (fast-json-stable-stringify), git://github.com/substack/github-from-package.git (github-from-package), git://github.com/substack/https-browserify.git (https-browserify), git://github.com/hughsk/is-typedarray.git (is-typedarray), git://github.com/substack/json-stable-stringify.git (json-stable-stringify), git://github.com/samn/json-stable-stringify.git (json-stable-stringify-without-jsonify), git://github.com/substack/minimist.git (minimist), git://github.com/substack/object-inspect.git (object-inspect), git://github.com/substack/path-browserify.git (path-browserify), git://github.com/browserify/resolve.git (resolve), git://github.com/substack/resumer.git (resumer), git://github.com/substack/safe-regex.git (safe-regex), git://github.com/substack/semver-compare.git (semver-compare), git://github.com/nathan7/snakeize.git (snakeize), git://github.com/substack/text-table.git (text-table), git://github.com/substack/tty-browserify.git (tty-browserify), http://github.com/substack/vm-browserify.git (vm-browserify), git://github.com/substack/node-wordwrap.git (wordwrap). This software contains the following license and notice below: This software is released under the MIT license: @@ -5097,11 +5203,11 @@ SOFTWARE. ----- -The following software may be included in this product: arr-diff, clone-deep, fill-range, for-in, has-value, has-values, kind-of, normalize-path, set-value. A copy of the source code may be downloaded from https://github.com/jonschlinkert/arr-diff.git (arr-diff), https://github.com/jonschlinkert/clone-deep.git (clone-deep), https://github.com/jonschlinkert/fill-range.git (fill-range), https://github.com/jonschlinkert/for-in.git (for-in), https://github.com/jonschlinkert/has-value.git (has-value), https://github.com/jonschlinkert/has-values.git (has-values), https://github.com/jonschlinkert/kind-of.git (kind-of), https://github.com/jonschlinkert/normalize-path.git (normalize-path), https://github.com/jonschlinkert/set-value.git (set-value). This software contains the following license and notice below: +The following software may be included in this product: arr-diff, arr-union, array-unique, extend-shallow, get-value, is-extglob, is-glob, is-number, is-primitive, isobject, longest, micromatch, mixin-object, object.omit, parse-filepath, relative, set-value, write. A copy of the source code may be downloaded from https://github.com/jonschlinkert/arr-diff.git (arr-diff), git://github.com/jonschlinkert/arr-union.git (arr-union), git://github.com/jonschlinkert/array-unique.git (array-unique), https://github.com/jonschlinkert/extend-shallow.git (extend-shallow), https://github.com/jonschlinkert/get-value.git (get-value), https://github.com/jonschlinkert/is-extglob.git (is-extglob), https://github.com/jonschlinkert/is-glob.git (is-glob), https://github.com/jonschlinkert/is-number.git (is-number), git://github.com/jonschlinkert/is-primitive.git (is-primitive), git://github.com/jonschlinkert/isobject.git (isobject), https://github.com/jonschlinkert/longest.git (longest), https://github.com/jonschlinkert/micromatch.git (micromatch), https://github.com/jonschlinkert/mixin-object.git (mixin-object), git://github.com/jonschlinkert/object.omit.git (object.omit), https://github.com/jonschlinkert/parse-filepath.git (parse-filepath), https://github.com/jonschlinkert/relative.git (relative), git://github.com/jonschlinkert/set-value.git (set-value), https://github.com/jonschlinkert/write.git (write). This software contains the following license and notice below: The MIT License (MIT) -Copyright (c) 2014-2017, Jon Schlinkert +Copyright (c) 2014-2015, Jon Schlinkert. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -5123,11 +5229,11 @@ THE SOFTWARE. ----- -The following software may be included in this product: arr-diff, arr-union, array-unique, extend-shallow, get-value, is-extglob, is-glob, is-number, is-primitive, isobject, longest, micromatch, mixin-object, object.omit, parse-filepath, relative, set-value, write. A copy of the source code may be downloaded from https://github.com/jonschlinkert/arr-diff.git (arr-diff), git://github.com/jonschlinkert/arr-union.git (arr-union), git://github.com/jonschlinkert/array-unique.git (array-unique), git://github.com/jonschlinkert/extend-shallow.git (extend-shallow), https://github.com/jonschlinkert/get-value.git (get-value), https://github.com/jonschlinkert/is-extglob.git (is-extglob), https://github.com/jonschlinkert/is-glob.git (is-glob), https://github.com/jonschlinkert/is-number.git (is-number), git://github.com/jonschlinkert/is-primitive.git (is-primitive), https://github.com/jonschlinkert/isobject.git (isobject), https://github.com/jonschlinkert/longest.git (longest), https://github.com/jonschlinkert/micromatch.git (micromatch), https://github.com/jonschlinkert/mixin-object.git (mixin-object), git://github.com/jonschlinkert/object.omit.git (object.omit), https://github.com/jonschlinkert/parse-filepath.git (parse-filepath), https://github.com/jonschlinkert/relative.git (relative), git://github.com/jonschlinkert/set-value.git (set-value), https://github.com/jonschlinkert/write.git (write). This software contains the following license and notice below: +The following software may be included in this product: arr-diff, clone-deep, fill-range, for-in, has-value, has-values, kind-of, normalize-path, set-value. A copy of the source code may be downloaded from https://github.com/jonschlinkert/arr-diff.git (arr-diff), https://github.com/jonschlinkert/clone-deep.git (clone-deep), https://github.com/jonschlinkert/fill-range.git (fill-range), https://github.com/jonschlinkert/for-in.git (for-in), https://github.com/jonschlinkert/has-value.git (has-value), https://github.com/jonschlinkert/has-values.git (has-values), https://github.com/jonschlinkert/kind-of.git (kind-of), https://github.com/jonschlinkert/normalize-path.git (normalize-path), https://github.com/jonschlinkert/set-value.git (set-value). This software contains the following license and notice below: The MIT License (MIT) -Copyright (c) 2014-2015, Jon Schlinkert. +Copyright (c) 2014-2017, Jon Schlinkert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -5204,7 +5310,7 @@ THE SOFTWARE. ----- -The following software may be included in this product: arr-flatten, array-last, array-slice, is-glob, is-number, is-plain-object, is-relative, kind-of. A copy of the source code may be downloaded from https://github.com/jonschlinkert/arr-flatten.git (arr-flatten), https://github.com/jonschlinkert/array-last.git (array-last), https://github.com/jonschlinkert/array-slice.git (array-slice), https://github.com/micromatch/is-glob.git (is-glob), https://github.com/jonschlinkert/is-number.git (is-number), https://github.com/jonschlinkert/is-plain-object.git (is-plain-object), https://github.com/jonschlinkert/is-relative.git (is-relative), https://github.com/jonschlinkert/kind-of.git (kind-of). This software contains the following license and notice below: +The following software may be included in this product: arr-flatten, array-last, array-slice, is-glob, is-number, is-plain-object, is-relative, kind-of. A copy of the source code may be downloaded from https://github.com/jonschlinkert/arr-flatten.git (arr-flatten), https://github.com/jonschlinkert/array-last.git (array-last), https://github.com/jonschlinkert/array-slice.git (array-slice), https://github.com/jonschlinkert/is-glob.git (is-glob), https://github.com/jonschlinkert/is-number.git (is-number), https://github.com/jonschlinkert/is-plain-object.git (is-plain-object), https://github.com/jonschlinkert/is-relative.git (is-relative), https://github.com/jonschlinkert/kind-of.git (kind-of). This software contains the following license and notice below: The MIT License (MIT) @@ -5282,11 +5388,11 @@ THE SOFTWARE. ----- -The following software may be included in this product: array-back, test-value. A copy of the source code may be downloaded from https://github.com/75lb/array-back.git (array-back), https://github.com/75lb/test-value.git (test-value). This software contains the following license and notice below: +The following software may be included in this product: array-back, find-replace. A copy of the source code may be downloaded from https://github.com/75lb/array-back.git (array-back), https://github.com/75lb/find-replace.git (find-replace). This software contains the following license and notice below: The MIT License (MIT) -Copyright (c) 2015-16 Lloyd Brookes <75pound@gmail.com> +Copyright (c) 2015-17 Lloyd Brookes <75pound@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -5308,11 +5414,11 @@ SOFTWARE. ----- -The following software may be included in this product: array-back, find-replace. A copy of the source code may be downloaded from https://github.com/75lb/array-back.git (array-back), https://github.com/75lb/find-replace.git (find-replace). This software contains the following license and notice below: +The following software may be included in this product: array-back, test-value. A copy of the source code may be downloaded from https://github.com/75lb/array-back.git (array-back), https://github.com/75lb/test-value.git (test-value). This software contains the following license and notice below: The MIT License (MIT) -Copyright (c) 2015-17 Lloyd Brookes <75pound@gmail.com> +Copyright (c) 2015-16 Lloyd Brookes <75pound@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -7529,7 +7635,7 @@ The following software may be included in this product: bl. A copy of the source The MIT License (MIT) ===================== -Copyright (c) 2013-2018 bl contributors +Copyright (c) 2014 bl contributors ---------------------------------- *bl contributors listed at * @@ -7547,7 +7653,7 @@ The following software may be included in this product: bl. A copy of the source The MIT License (MIT) ===================== -Copyright (c) 2014 bl contributors +Copyright (c) 2013-2018 bl contributors ---------------------------------- *bl contributors listed at * @@ -7716,6 +7822,50 @@ The complete list of contributors can be found at: https://github.com/hapijs/boo ----- +The following software may be included in this product: bowser. A copy of the source code may be downloaded from git+https://github.com/lancedikson/bowser.git. This software contains the following license and notice below: + +Copyright 2015, Dustin Diaz (the "Original Author") +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +Distributions of all or part of the Software intended to be used +by the recipients as they would use the unmodified Software, +containing modifications that substantially alter, remove, or +disable functionality of the Software, outside of the documented +configuration mechanisms provided by the Software, shall be +modified such that the Original Author's bug reporting email +addresses and urls are either replaced with the contact information +of the parties responsible for the changes, or removed entirely. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + +Except where noted, this license applies to any and all software +programs and associated documentation files created by the +Original Author, when distributed with the Software. + +----- + The following software may be included in this product: brace-expansion, isarray. A copy of the source code may be downloaded from git://github.com/juliangruber/brace-expansion.git (brace-expansion), git://github.com/juliangruber/isarray.git (isarray). This software contains the following license and notice below: MIT License @@ -8528,7 +8678,7 @@ SOFTWARE. ----- -The following software may be included in this product: cachedown, react-native-randombytes, react-native-secure-randombytes. This software contains the following license and notice below: +The following software may be included in this product: cachedown, react-native-randombytes, react-native-secure-randombytes. A copy of the source code may be downloaded from https://github.com/mvayngrib/react-native-randombytes.git (react-native-randombytes). This software contains the following license and notice below: The MIT License (MIT) @@ -9159,7 +9309,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. The following software may be included in this product: chardet. A copy of the source code may be downloaded from git@github.com:runk/node-chardet.git. This software contains the following license and notice below: -Copyright (C) 2018 Dmitry Shirokov +Copyright (C) 2017 Dmitry Shirokov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9183,7 +9333,7 @@ THE SOFTWARE. The following software may be included in this product: chardet. A copy of the source code may be downloaded from git@github.com:runk/node-chardet.git. This software contains the following license and notice below: -Copyright (C) 2017 Dmitry Shirokov +Copyright (C) 2018 Dmitry Shirokov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9876,6 +10026,8 @@ THE SOFTWARE. The following software may be included in this product: colors. A copy of the source code may be downloaded from http://github.com/Marak/colors.js.git. This software contains the following license and notice below: +MIT License + Original Library - Copyright (c) Marak Squires @@ -9904,8 +10056,6 @@ THE SOFTWARE. The following software may be included in this product: colors. A copy of the source code may be downloaded from http://github.com/Marak/colors.js.git. This software contains the following license and notice below: -MIT License - Original Library - Copyright (c) Marak Squires @@ -10456,11 +10606,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----- -The following software may be included in this product: content-disposition, depd, forwarded, vary. A copy of the source code may be downloaded from https://github.com/jshttp/content-disposition.git (content-disposition), https://github.com/dougwilson/nodejs-depd.git (depd), https://github.com/jshttp/forwarded.git (forwarded), https://github.com/jshttp/vary.git (vary). This software contains the following license and notice below: +The following software may be included in this product: content-disposition, media-typer, on-headers. A copy of the source code may be downloaded from https://github.com/jshttp/content-disposition.git (content-disposition), https://github.com/jshttp/media-typer.git (media-typer), https://github.com/jshttp/on-headers.git (on-headers). This software contains the following license and notice below: (The MIT License) -Copyright (c) 2014-2017 Douglas Christopher Wilson +Copyright (c) 2014 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -10483,11 +10633,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----- -The following software may be included in this product: content-disposition, media-typer, on-headers. A copy of the source code may be downloaded from https://github.com/jshttp/content-disposition.git (content-disposition), https://github.com/jshttp/media-typer.git (media-typer), https://github.com/jshttp/on-headers.git (on-headers). This software contains the following license and notice below: +The following software may be included in this product: content-disposition, depd, forwarded, vary. A copy of the source code may be downloaded from https://github.com/jshttp/content-disposition.git (content-disposition), https://github.com/dougwilson/nodejs-depd.git (depd), https://github.com/jshttp/forwarded.git (forwarded), https://github.com/jshttp/vary.git (vary). This software contains the following license and notice below: (The MIT License) -Copyright (c) 2014 Douglas Christopher Wilson +Copyright (c) 2014-2017 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -10800,9 +10950,9 @@ SOFTWARE. ----- -The following software may be included in this product: core-js, core-js-compat. A copy of the source code may be downloaded from https://github.com/zloirock/core-js.git (core-js), https://github.com/zloirock/core-js.git (core-js-compat). This software contains the following license and notice below: +The following software may be included in this product: core-js. A copy of the source code may be downloaded from https://github.com/zloirock/core-js.git. This software contains the following license and notice below: -Copyright (c) 2014-2019 Denis Pushkarev +Copyright (c) 2015 Denis Pushkarev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -10824,9 +10974,9 @@ THE SOFTWARE. ----- -The following software may be included in this product: core-js. A copy of the source code may be downloaded from https://github.com/zloirock/core-js.git. This software contains the following license and notice below: +The following software may be included in this product: core-js, core-js-compat. A copy of the source code may be downloaded from https://github.com/zloirock/core-js.git (core-js), https://github.com/zloirock/core-js.git (core-js-compat). This software contains the following license and notice below: -Copyright (c) 2015 Denis Pushkarev +Copyright (c) 2014-2019 Denis Pushkarev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -11108,19 +11258,21 @@ SOFTWARE. ----- -The following software may be included in this product: cross-spawn, promise-retry. A copy of the source code may be downloaded from git://github.com/IndigoUnited/node-cross-spawn.git (cross-spawn), git://github.com/IndigoUnited/node-promise-retry.git (promise-retry). This software contains the following license and notice below: +The following software may be included in this product: cross-spawn, proper-lockfile. A copy of the source code may be downloaded from git@github.com:moxystudio/node-cross-spawn.git (cross-spawn), git@github.com:moxystudio/node-proper-lockfile.git (proper-lockfile). This software contains the following license and notice below: -Copyright (c) 2014 IndigoUnited +The MIT License (MIT) + +Copyright (c) 2018 Made With MOXY Lda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -11132,21 +11284,19 @@ THE SOFTWARE. ----- -The following software may be included in this product: cross-spawn, proper-lockfile. A copy of the source code may be downloaded from git@github.com:moxystudio/node-cross-spawn.git (cross-spawn), git@github.com:moxystudio/node-proper-lockfile.git (proper-lockfile). This software contains the following license and notice below: - -The MIT License (MIT) +The following software may be included in this product: cross-spawn, promise-retry. A copy of the source code may be downloaded from git://github.com/IndigoUnited/node-cross-spawn.git (cross-spawn), git://github.com/IndigoUnited/node-promise-retry.git (promise-retry). This software contains the following license and notice below: -Copyright (c) 2018 Made With MOXY Lda +Copyright (c) 2014 IndigoUnited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, @@ -11289,7 +11439,7 @@ SOFTWARE. ----- -The following software may be included in this product: css-loader, enhanced-resolve, file-loader, loader-utils, mini-css-extract-plugin, schema-utils, terser-webpack-plugin, uglifyjs-webpack-plugin, url-loader, watchpack, webpack, webpack-dev-middleware, webpack-hot-middleware. A copy of the source code may be downloaded from https://github.com/webpack-contrib/css-loader.git (css-loader), git://github.com/webpack/enhanced-resolve.git (enhanced-resolve), https://github.com/webpack-contrib/file-loader.git (file-loader), https://github.com/webpack/loader-utils.git (loader-utils), https://github.com/webpack-contrib/mini-css-extract-plugin.git (mini-css-extract-plugin), https://github.com/webpack-contrib/schema-utils.git (schema-utils), https://github.com/webpack-contrib/terser-webpack-plugin.git (terser-webpack-plugin), https://github.com/webpack-contrib/uglifyjs-webpack-plugin.git (uglifyjs-webpack-plugin), https://github.com/webpack-contrib/url-loader.git (url-loader), https://github.com/webpack/watchpack.git (watchpack), https://github.com/webpack/webpack.git (webpack), https://github.com/webpack/webpack-dev-middleware.git (webpack-dev-middleware), https://github.com/webpack-contrib/webpack-hot-middleware.git (webpack-hot-middleware). This software contains the following license and notice below: +The following software may be included in this product: css-loader, enhanced-resolve, file-loader, loader-utils, mini-css-extract-plugin, schema-utils, terser-webpack-plugin, uglifyjs-webpack-plugin, url-loader, watchpack, webpack, webpack-dev-middleware, webpack-hot-middleware. A copy of the source code may be downloaded from https://github.com/webpack-contrib/css-loader.git (css-loader), git://github.com/webpack/enhanced-resolve.git (enhanced-resolve), https://github.com/webpack-contrib/file-loader.git (file-loader), https://github.com/webpack/loader-utils.git (loader-utils), https://github.com/webpack-contrib/mini-css-extract-plugin.git (mini-css-extract-plugin), https://github.com/webpack/schema-utils.git (schema-utils), https://github.com/webpack-contrib/terser-webpack-plugin.git (terser-webpack-plugin), https://github.com/webpack-contrib/uglifyjs-webpack-plugin.git (uglifyjs-webpack-plugin), https://github.com/webpack-contrib/url-loader.git (url-loader), https://github.com/webpack/watchpack.git (watchpack), https://github.com/webpack/webpack.git (webpack), https://github.com/webpack/webpack-dev-middleware.git (webpack-dev-middleware), https://github.com/webpack-contrib/webpack-hot-middleware.git (webpack-hot-middleware). This software contains the following license and notice below: Copyright JS Foundation and other contributors @@ -11502,7 +11652,33 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----- -The following software may be included in this product: d. A copy of the source code may be downloaded from git://github.com/medikoo/d.git. This software contains the following license and notice below: +The following software may be included in this product: cyclist, flush-write-stream, prebuild-install, stream-each, stream-iterate. A copy of the source code may be downloaded from git://github.com/mafintosh/cyclist (cyclist), https://github.com/mafintosh/flush-write-stream.git (flush-write-stream), https://github.com/prebuild/prebuild-install.git (prebuild-install), https://github.com/mafintosh/stream-each.git (stream-each), https://github.com/mafintosh/stream-iterate.git (stream-iterate). This software contains the following license and notice below: + +The MIT License (MIT) + +Copyright (c) 2015 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +----- + +The following software may be included in this product: d, es6-symbol. A copy of the source code may be downloaded from git://github.com/medikoo/d.git (d), git://github.com/medikoo/es6-symbol.git (es6-symbol). This software contains the following license and notice below: ISC License @@ -11884,6 +12060,32 @@ THE SOFTWARE. ----- +The following software may be included in this product: deep-equal. A copy of the source code may be downloaded from http://github.com/substack/node-deep-equal.git. This software contains the following license and notice below: + +MIT License + +Copyright (c) 2012, 2013, 2014 James Halliday , 2009 Thomas Robinson <280north.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +----- + The following software may be included in this product: deep-extend. A copy of the source code may be downloaded from git://github.com/unclechu/node-deep-extend.git. This software contains the following license and notice below: The MIT License (MIT) @@ -11962,32 +12164,6 @@ THE SOFTWARE. ----- -The following software may be included in this product: deepmerge. A copy of the source code may be downloaded from git://github.com/TehShrike/deepmerge.git. This software contains the following license and notice below: - -The MIT License (MIT) - -Copyright (c) 2012 James Halliday, Josh Duff, and other contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ------ - The following software may be included in this product: default-require-extensions. A copy of the source code may be downloaded from https://github.com/jamestalmage/default-require-extensions.git. This software contains the following license and notice below: The MIT License (MIT) @@ -12040,12 +12216,12 @@ THE SOFTWARE. ----- -The following software may be included in this product: deferred-leveldown. A copy of the source code may be downloaded from https://github.com/Level/deferred-leveldown.git. This software contains the following license and notice below: +The following software may be included in this product: deferred-leveldown, prr. A copy of the source code may be downloaded from https://github.com/Level/deferred-leveldown.git (deferred-leveldown), https://github.com/rvagg/prr.git (prr). This software contains the following license and notice below: The MIT License (MIT) ===================== -Copyright (c) 2013-2018 Rod Vagg +Copyright (c) 2014 Rod Vagg --------------------------- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -12056,12 +12232,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ----- -The following software may be included in this product: deferred-leveldown, prr. A copy of the source code may be downloaded from https://github.com/Level/deferred-leveldown.git (deferred-leveldown), https://github.com/rvagg/prr.git (prr). This software contains the following license and notice below: +The following software may be included in this product: deferred-leveldown. A copy of the source code may be downloaded from https://github.com/Level/deferred-leveldown.git. This software contains the following license and notice below: The MIT License (MIT) ===================== -Copyright (c) 2014 Rod Vagg +Copyright (c) 2013-2018 Rod Vagg --------------------------- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -12185,7 +12361,7 @@ The following software may be included in this product: detect-file. A copy of t The MIT License (MIT) -Copyright (c) 2016, . +Copyright (c) 2016-2017, Brian Woodward. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -12211,7 +12387,7 @@ The following software may be included in this product: detect-file. A copy of t The MIT License (MIT) -Copyright (c) 2016-2017, Brian Woodward. +Copyright (c) 2016, . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -12465,6 +12641,30 @@ SOFTWARE. ----- +The following software may be included in this product: doctrine, escodegen, estraverse, esutils, regjsparser. A copy of the source code may be downloaded from http://github.com/eslint/doctrine.git (doctrine), http://github.com/estools/escodegen.git (escodegen), http://github.com/estools/estraverse.git (estraverse), http://github.com/estools/esutils.git (esutils), git@github.com:jviereck/regjsparser.git (regjsparser). This software contains the following license and notice below: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +----- + The following software may be included in this product: doctrine. A copy of the source code may be downloaded from https://github.com/eslint/doctrine.git. This software contains the following license and notice below: Apache License @@ -12646,30 +12846,6 @@ END OF TERMS AND CONDITIONS ----- -The following software may be included in this product: doctrine, escodegen, estraverse, esutils, regjsparser. A copy of the source code may be downloaded from http://github.com/eslint/doctrine.git (doctrine), http://github.com/estools/escodegen.git (escodegen), http://github.com/estools/estraverse.git (estraverse), http://github.com/Constellation/esutils.git (esutils), git@github.com:jviereck/regjsparser.git (regjsparser). This software contains the following license and notice below: - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------ - The following software may be included in this product: doctrine. A copy of the source code may be downloaded from https://github.com/eslint/doctrine.git. This software contains the following license and notice below: Doctrine @@ -13690,7 +13866,7 @@ THE SOFTWARE. ----- -The following software may be included in this product: es-to-primitive, is-boolean-object, is-callable, is-date-object, is-number-object, is-string, is-symbol, object.entries, object.getownpropertydescriptors, object.values. A copy of the source code may be downloaded from git://github.com/ljharb/es-to-primitive.git (es-to-primitive), git://github.com/ljharb/is-boolean-object.git (is-boolean-object), git://github.com/ljharb/is-callable.git (is-callable), git://github.com/ljharb/is-date-object.git (is-date-object), git://github.com/ljharb/is-number-object.git (is-number-object), git://github.com/ljharb/is-string.git (is-string), git://github.com/ljharb/is-symbol.git (is-symbol), git://github.com/es-shims/Object.entries.git (object.entries), git://github.com/ljharb/object.getownpropertydescriptors.git (object.getownpropertydescriptors), git://github.com/es-shims/Object.values.git (object.values). This software contains the following license and notice below: +The following software may be included in this product: es-to-primitive, is-boolean-object, is-callable, is-date-object, is-number-object, is-string, is-symbol, object.entries, object.getownpropertydescriptors, object.values, string.prototype.trimleft, string.prototype.trimright. A copy of the source code may be downloaded from git://github.com/ljharb/es-to-primitive.git (es-to-primitive), git://github.com/ljharb/is-boolean-object.git (is-boolean-object), git://github.com/ljharb/is-callable.git (is-callable), git://github.com/ljharb/is-date-object.git (is-date-object), git://github.com/ljharb/is-number-object.git (is-number-object), git://github.com/ljharb/is-string.git (is-string), git://github.com/ljharb/is-symbol.git (is-symbol), git://github.com/es-shims/Object.entries.git (object.entries), git://github.com/ljharb/object.getownpropertydescriptors.git (object.getownpropertydescriptors), git://github.com/es-shims/Object.values.git (object.values), git://github.com/es-shims/String.prototype.trimLeft.git (string.prototype.trimleft), git://github.com/es-shims/String.prototype.trimRight.git (string.prototype.trimright). This software contains the following license and notice below: The MIT License (MIT) @@ -14452,7 +14628,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The following software may be included in this product: esprima. A copy of the source code may be downloaded from https://github.com/jquery/esprima.git. This software contains the following license and notice below: -Copyright JS Foundation and other contributors, https://js.foundation/ +Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -14478,7 +14654,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The following software may be included in this product: esprima. A copy of the source code may be downloaded from https://github.com/jquery/esprima.git. This software contains the following license and notice below: -Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. +Copyright JS Foundation and other contributors, https://js.foundation/ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16004,32 +16180,6 @@ SOFTWARE. ----- -The following software may be included in this product: fast-glob. A copy of the source code may be downloaded from https://github.com/mrmlnc/fast-glob.git. This software contains the following license and notice below: - -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - ------ - The following software may be included in this product: fast-levenshtein. A copy of the source code may be downloaded from https://github.com/hiddentao/fast-levenshtein.git. This software contains the following license and notice below: (MIT License) @@ -16925,32 +17075,6 @@ SOFTWARE. ----- -The following software may be included in this product: flush-write-stream, prebuild-install, stream-each, stream-iterate. A copy of the source code may be downloaded from https://github.com/mafintosh/flush-write-stream.git (flush-write-stream), https://github.com/prebuild/prebuild-install.git (prebuild-install), https://github.com/mafintosh/stream-each.git (stream-each), https://github.com/mafintosh/stream-iterate.git (stream-iterate). This software contains the following license and notice below: - -The MIT License (MIT) - -Copyright (c) 2015 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ------ - The following software may be included in this product: fontfaceobserver. A copy of the source code may be downloaded from git+https://github.com/bramstein/fontfaceobserver.git. This software contains the following license and notice below: Copyright (c) 2014 - Bram Stein @@ -17243,7 +17367,7 @@ The following software may be included in this product: fs-extra. A copy of the (The MIT License) -Copyright (c) 2011-2016 JP Richardson +Copyright (c) 2011-2015 JP Richardson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, @@ -17263,7 +17387,7 @@ The following software may be included in this product: fs-extra. A copy of the (The MIT License) -Copyright (c) 2011-2015 JP Richardson +Copyright (c) 2011-2016 JP Richardson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, @@ -17395,12 +17519,12 @@ the licensed code: ----- -The following software may be included in this product: fsevents. A copy of the source code may be downloaded from https://github.com/fsevents/fsevents.git. This software contains the following license and notice below: +The following software may be included in this product: fsevents. A copy of the source code may be downloaded from https://github.com/strongloop/fsevents.git. This software contains the following license and notice below: MIT License ----------- -Copyright (C) 2010-2019 by Philipp Dunkel, Ben Noordhuis, Elan Shankar +Copyright (C) 2010-2014 Philipp Dunkel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -17422,12 +17546,12 @@ THE SOFTWARE. ----- -The following software may be included in this product: fsevents. A copy of the source code may be downloaded from https://github.com/strongloop/fsevents.git. This software contains the following license and notice below: +The following software may be included in this product: fsevents. A copy of the source code may be downloaded from https://github.com/fsevents/fsevents.git. This software contains the following license and notice below: MIT License ----------- -Copyright (C) 2010-2014 Philipp Dunkel +Copyright (C) 2010-2019 by Philipp Dunkel, Ben Noordhuis, Elan Shankar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18344,11 +18468,11 @@ https://creativecommons.org/licenses/by-sa/4.0/ ----- -The following software may be included in this product: glob-parent. A copy of the source code may be downloaded from https://github.com/gulpjs/glob-parent.git. This software contains the following license and notice below: +The following software may be included in this product: glob-parent. A copy of the source code may be downloaded from https://github.com/es128/glob-parent. This software contains the following license and notice below: The ISC License -Copyright (c) 2015, 2019 Elan Shanker +Copyright (c) 2015 Elan Shanker Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -18364,11 +18488,11 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----- -The following software may be included in this product: glob-parent. A copy of the source code may be downloaded from https://github.com/es128/glob-parent. This software contains the following license and notice below: +The following software may be included in this product: glob-parent. A copy of the source code may be downloaded from https://github.com/gulpjs/glob-parent.git. This software contains the following license and notice below: The ISC License -Copyright (c) 2015 Elan Shanker +Copyright (c) 2015, 2019 Elan Shanker Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -18778,7 +18902,7 @@ The bundled Google Closure Library is licensed under Apache 2.0: ----- -The following software may be included in this product: google-p12-pem. This software contains the following license and notice below: +The following software may be included in this product: google-p12-pem. A copy of the source code may be downloaded from https://github.com/google/google-p12-pem. This software contains the following license and notice below: The MIT License (MIT) @@ -19150,6 +19274,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ----- +The following software may be included in this product: hammerjs. A copy of the source code may be downloaded from git://github.com/hammerjs/hammer.js.git. This software contains the following license and notice below: + +The MIT License (MIT) + +Copyright (C) 2011-2014 by Jorik Tangelder (Eight Media) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +----- + The following software may be included in this product: handlebars. A copy of the source code may be downloaded from https://github.com/wycats/handlebars.js.git. This software contains the following license and notice below: Copyright (C) 2011-2017 by Yehuda Katz @@ -20504,7 +20654,8 @@ The following software may be included in this product: is-absolute. A copy of t The MIT License (MIT) -Copyright (c) 2014-2016, Jon Schlinkert.Copyright (c) 2009-2016, TJ Holowaychuk. +Copyright (c) 2014-2017, Jon Schlinkert. +Copyright (c) 2009-2014, TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20530,8 +20681,7 @@ The following software may be included in this product: is-absolute. A copy of t The MIT License (MIT) -Copyright (c) 2014-2017, Jon Schlinkert. -Copyright (c) 2009-2014, TJ Holowaychuk +Copyright (c) 2014-2016, Jon Schlinkert.Copyright (c) 2009-2016, TJ Holowaychuk. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20553,6 +20703,31 @@ THE SOFTWARE. ----- +The following software may be included in this product: is-arguments, is-regex, object-is. A copy of the source code may be downloaded from git://github.com/ljharb/is-arguments.git (is-arguments), git://github.com/ljharb/is-regex.git (is-regex), git://github.com/ljharb/object-is.git (object-is). This software contains the following license and notice below: + +The MIT License (MIT) + +Copyright (c) 2014 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +----- + The following software may be included in this product: is-buffer, safe-buffer, typedarray-to-buffer. A copy of the source code may be downloaded from git://github.com/feross/is-buffer.git (is-buffer), git://github.com/feross/safe-buffer.git (safe-buffer), git://github.com/feross/typedarray-to-buffer.git (typedarray-to-buffer). This software contains the following license and notice below: The MIT License (MIT) @@ -20728,31 +20903,6 @@ THE SOFTWARE. ----- -The following software may be included in this product: is-regex, object-is. A copy of the source code may be downloaded from git://github.com/ljharb/is-regex.git (is-regex), git://github.com/ljharb/object-is.git (object-is). This software contains the following license and notice below: - -The MIT License (MIT) - -Copyright (c) 2014 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------ - The following software may be included in this product: is-relative. A copy of the source code may be downloaded from https://github.com/jonschlinkert/is-relative.git. This software contains the following license and notice below: The MIT License (MIT) @@ -21301,6 +21451,31 @@ SOFTWARE. The following software may be included in this product: js-sha3. A copy of the source code may be downloaded from https://github.com/emn178/js-sha3.git. This software contains the following license and notice below: +Copyright 2015-2017 Chen, Yi-Cyuan + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +----- + +The following software may be included in this product: js-sha3. A copy of the source code may be downloaded from https://github.com/emn178/js-sha3.git. This software contains the following license and notice below: + Copyright 2015-2016 Chen, Yi-Cyuan Permission is hereby granted, free of charge, to any person obtaining @@ -21326,31 +21501,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following software may be included in this product: js-sha3. A copy of the source code may be downloaded from https://github.com/emn178/js-sha3.git. This software contains the following license and notice below: -Copyright 2015-2017 Chen, Yi-Cyuan - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------ - -The following software may be included in this product: js-sha3. A copy of the source code may be downloaded from https://github.com/emn178/js-sha3.git. This software contains the following license and notice below: - Copyright 2015-2018 Chen, Yi-Cyuan Permission is hereby granted, free of charge, to any person obtaining @@ -21400,11 +21550,11 @@ THE SOFTWARE. ----- -The following software may be included in this product: js-tokens. A copy of the source code may be downloaded from https://github.com/lydell/js-tokens.git. This software contains the following license and notice below: +The following software may be included in this product: js-tokens, source-map-resolve. A copy of the source code may be downloaded from https://github.com/lydell/js-tokens.git (js-tokens), https://github.com/lydell/source-map-resolve.git (source-map-resolve). This software contains the following license and notice below: The MIT License (MIT) -Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell +Copyright (c) 2014, 2015, 2016, 2017 Simon Lydell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -21426,11 +21576,11 @@ THE SOFTWARE. ----- -The following software may be included in this product: js-tokens, source-map-resolve. A copy of the source code may be downloaded from https://github.com/lydell/js-tokens.git (js-tokens), https://github.com/lydell/source-map-resolve.git (source-map-resolve). This software contains the following license and notice below: +The following software may be included in this product: js-tokens. A copy of the source code may be downloaded from https://github.com/lydell/js-tokens.git. This software contains the following license and notice below: The MIT License (MIT) -Copyright (c) 2014, 2015, 2016, 2017 Simon Lydell +Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -22082,7 +22232,7 @@ SOFTWARE. ----- -The following software may be included in this product: keccakjs, scrypt.js. A copy of the source code may be downloaded from https://github.com/axic/keccakjs (keccakjs), https://github.com/axic/scrypt.js (scrypt.js). This software contains the following license and notice below: +The following software may be included in this product: keccakjs, scrypt.js. A copy of the source code may be downloaded from https://github.com/axic/keccakjs (keccakjs), https://github.com/axic/scryptjs (scrypt.js). This software contains the following license and notice below: The MIT License (MIT) @@ -22207,24 +22357,6 @@ THE SOFTWARE. ----- -The following software may be included in this product: level-codec, level-iterator-stream. A copy of the source code may be downloaded from https://github.com/Level/codec.git (level-codec), https://github.com/Level/iterator-stream.git (level-iterator-stream). This software contains the following license and notice below: - -The MIT License (MIT) -===================== - -Copyright (c) 2012-2015 LevelUP contributors ---------------------------------------- - -*LevelUP contributors listed at * - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------ - The following software may be included in this product: level-codec, level-errors. A copy of the source code may be downloaded from https://github.com/Level/codec.git (level-codec), https://github.com/Level/errors.git (level-errors). This software contains the following license and notice below: # The MIT License (MIT) @@ -22251,6 +22383,24 @@ SOFTWARE. ----- +The following software may be included in this product: level-codec, level-iterator-stream. A copy of the source code may be downloaded from https://github.com/Level/codec.git (level-codec), https://github.com/Level/iterator-stream.git (level-iterator-stream). This software contains the following license and notice below: + +The MIT License (MIT) +===================== + +Copyright (c) 2012-2015 LevelUP contributors +--------------------------------------- + +*LevelUP contributors listed at * + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +----- + The following software may be included in this product: level-errors. A copy of the source code may be downloaded from https://github.com/level/errors.git. This software contains the following license and notice below: The MIT License (MIT) @@ -22385,9 +22535,13 @@ Original Author, when distributed with the Software. The following software may be included in this product: levelup. A copy of the source code may be downloaded from https://github.com/level/levelup.git. This software contains the following license and notice below: -# The MIT License (MIT) +The MIT License (MIT) +===================== -**Copyright © 2012-present `levelup` [Contributors](CONTRIBUTORS.md).** +Copyright (c) 2012-2016 LevelUP contributors +--------------------------------------- + +*LevelUP contributors listed at * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -22399,13 +22553,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI The following software may be included in this product: levelup. A copy of the source code may be downloaded from https://github.com/level/levelup.git. This software contains the following license and notice below: -The MIT License (MIT) -===================== - -Copyright (c) 2012-2016 LevelUP contributors ---------------------------------------- +# The MIT License (MIT) -*LevelUP contributors listed at * +**Copyright © 2012-present `levelup` [Contributors](CONTRIBUTORS.md).** Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -22602,33 +22752,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----- -The following software may be included in this product: lodash, lodash._baseeach, lodash._bindcallback, lodash._cacheindexof, lodash._createcache, lodash._getnative, lodash.foreach, lodash.isarray, lodash.isobject, lodash.keys, lodash.restparam. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash), https://github.com/lodash/lodash.git (lodash._baseeach), https://github.com/lodash/lodash.git (lodash._bindcallback), https://github.com/lodash/lodash.git (lodash._cacheindexof), https://github.com/lodash/lodash.git (lodash._createcache), https://github.com/lodash/lodash.git (lodash._getnative), https://github.com/lodash/lodash.git (lodash.foreach), https://github.com/lodash/lodash.git (lodash.isarray), https://github.com/lodash/lodash.git (lodash.isobject), https://github.com/lodash/lodash.git (lodash.keys), https://github.com/lodash/lodash.git (lodash.restparam). This software contains the following license and notice below: - -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------ - The following software may be included in this product: lodash, lodash.isequal, lodash.isfunction. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash), https://github.com/lodash/lodash.git (lodash.isequal), https://github.com/lodash/lodash.git (lodash.isfunction). This software contains the following license and notice below: Copyright JS Foundation and other contributors @@ -22681,7 +22804,7 @@ terms above. ----- -The following software may be included in this product: lodash, lodash-es, lodash.merge, lodash.template, lodash.templatesettings. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash), https://github.com/lodash/lodash.git (lodash-es), https://github.com/lodash/lodash.git (lodash.merge), https://github.com/lodash/lodash.git (lodash.template), https://github.com/lodash/lodash.git (lodash.templatesettings). This software contains the following license and notice below: +The following software may be included in this product: lodash, lodash.merge, lodash.template, lodash.templatesettings. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash), https://github.com/lodash/lodash.git (lodash.merge), https://github.com/lodash/lodash.git (lodash.template), https://github.com/lodash/lodash.git (lodash.templatesettings). This software contains the following license and notice below: Copyright OpenJS Foundation and other contributors @@ -22733,6 +22856,33 @@ terms above. ----- +The following software may be included in this product: lodash, lodash._baseeach, lodash._bindcallback, lodash._cacheindexof, lodash._createcache, lodash._getnative, lodash.foreach, lodash.isarray, lodash.isobject, lodash.keys, lodash.restparam. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash), https://github.com/lodash/lodash.git (lodash._baseeach), https://github.com/lodash/lodash.git (lodash._bindcallback), https://github.com/lodash/lodash.git (lodash._cacheindexof), https://github.com/lodash/lodash.git (lodash._createcache), https://github.com/lodash/lodash.git (lodash._getnative), https://github.com/lodash/lodash.git (lodash.foreach), https://github.com/lodash/lodash.git (lodash.isarray), https://github.com/lodash/lodash.git (lodash.isobject), https://github.com/lodash/lodash.git (lodash.keys), https://github.com/lodash/lodash.git (lodash.restparam). This software contains the following license and notice below: + +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +----- + The following software may be included in this product: lodash._arrayeach, lodash._baseindexof, lodash._reinterpolate. A copy of the source code may be downloaded from https://github.com/lodash/lodash.git (lodash._arrayeach), https://github.com/lodash/lodash.git (lodash._baseindexof), https://github.com/lodash/lodash.git (lodash._reinterpolate). This software contains the following license and notice below: Copyright 2012-2015 The Dojo Foundation @@ -23863,7 +24013,7 @@ The following software may be included in this product: mocha. A copy of the sou (The MIT License) -Copyright (c) 2011-2017 JS Foundation and contributors, https://js.foundation +Copyright (c) 2011-2018 JS Foundation and contributors, https://js.foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -23890,7 +24040,7 @@ The following software may be included in this product: mocha. A copy of the sou (The MIT License) -Copyright (c) 2011-2018 JS Foundation and contributors, https://js.foundation +Copyright (c) 2011-2017 JS Foundation and contributors, https://js.foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -26640,7 +26790,7 @@ The following software may be included in this product: os-browserify. A copy of The MIT License (MIT) -Copyright (c) 2016 CoderPuppy +Copyright (c) 2017 CoderPuppy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -26666,7 +26816,7 @@ The following software may be included in this product: os-browserify. A copy of The MIT License (MIT) -Copyright (c) 2017 CoderPuppy +Copyright (c) 2016 CoderPuppy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -27715,32 +27865,6 @@ THE SOFTWARE. ----- -The following software may be included in this product: platform. A copy of the source code may be downloaded from https://github.com/bestiejs/platform.js.git. This software contains the following license and notice below: - -Copyright 2014-2018 Benjamin Tan -Copyright 2011-2013 John-David Dalton - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------ - The following software may be included in this product: plist. A copy of the source code may be downloaded from git://github.com/TooTallNate/node-plist.git. This software contains the following license and notice below: (The MIT License) @@ -28208,11 +28332,11 @@ SOFTWARE.** ----- -The following software may be included in this product: progress. A copy of the source code may be downloaded from git://github.com/visionmedia/node-progress. This software contains the following license and notice below: +The following software may be included in this product: progress, supertest. A copy of the source code may be downloaded from git://github.com/visionmedia/node-progress (progress), https://github.com/visionmedia/supertest.git (supertest). This software contains the following license and notice below: (The MIT License) -Copyright (c) 2017 TJ Holowaychuk +Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -28235,11 +28359,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----- -The following software may be included in this product: progress, supertest. A copy of the source code may be downloaded from git://github.com/visionmedia/node-progress (progress), https://github.com/visionmedia/supertest.git (supertest). This software contains the following license and notice below: +The following software may be included in this product: progress. A copy of the source code may be downloaded from git://github.com/visionmedia/node-progress. This software contains the following license and notice below: (The MIT License) -Copyright (c) 2014 TJ Holowaychuk +Copyright (c) 2017 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -28804,7 +28928,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following software may be included in this product: q. A copy of the source code may be downloaded from git://github.com/kriskowal/q.git. This software contains the following license and notice below: -Copyright 2009–2014 Kristopher Michael Kowal. All rights reserved. +Copyright 2009–2017 Kristopher Michael Kowal. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the @@ -28827,7 +28951,7 @@ IN THE SOFTWARE. The following software may be included in this product: q. A copy of the source code may be downloaded from git://github.com/kriskowal/q.git. This software contains the following license and notice below: -Copyright 2009–2017 Kristopher Michael Kowal. All rights reserved. +Copyright 2009–2014 Kristopher Michael Kowal. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the @@ -29437,32 +29561,6 @@ SOFTWARE. ----- -The following software may be included in this product: react-native-android-broadcast-receiver-for-referrer. A copy of the source code may be downloaded from git+https://github.com/shivam-aditya/AndroidBroadcastReceiverForReferrer.git. This software contains the following license and notice below: - -MIT License - -Copyright (c) 2018 Shivam Aditya - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - ------ - The following software may be included in this product: react-native-animatable, react-native-progress. A copy of the source code may be downloaded from git://github.com/oblador/react-native-animatable.git (react-native-animatable), git://github.com/oblador/react-native-progress.git (react-native-progress). This software contains the following license and notice below: The MIT License (MIT) @@ -30063,6 +30161,17 @@ SOFTWARE. ----- +The following software may be included in this product: react-native-secure-key-store. A copy of the source code may be downloaded from git+https://github.com/pradeep1991singh/react-native-secure-key-store.git. This software contains the following license and notice below: + +ISC License (ISC) +Copyright (c) 2016 pradeep singh + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +----- + The following software may be included in this product: react-native-shadow. A copy of the source code may be downloaded from https://github.com/879479119/react-native-shadow. This software contains the following license and notice below: MIT License @@ -30406,7 +30515,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----- -The following software may be included in this product: react-redux, redux, redux-thunk. A copy of the source code may be downloaded from https://github.com/reduxjs/react-redux.git (react-redux), https://github.com/reactjs/redux.git (redux), https://github.com/reduxjs/redux-thunk.git (redux-thunk). This software contains the following license and notice below: +The following software may be included in this product: react-redux, redux, redux-thunk. A copy of the source code may be downloaded from https://github.com/reduxjs/react-redux.git (react-redux), https://github.com/reduxjs/redux.git (redux), https://github.com/reduxjs/redux-thunk.git (redux-thunk). This software contains the following license and notice below: The MIT License (MIT) @@ -30982,6 +31091,32 @@ SOFTWARE. ----- +The following software may be included in this product: regexp.prototype.flags. A copy of the source code may be downloaded from git://github.com/es-shims/RegExp.prototype.flags.git. This software contains the following license and notice below: + +The MIT License (MIT) + +Copyright (C) 2014 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +----- + The following software may be included in this product: registry-auth-token. A copy of the source code may be downloaded from git+ssh://git@github.com/rexxars/registry-auth-token.git. This software contains the following license and notice below: The MIT License (MIT) @@ -31689,7 +31824,7 @@ SOFTWARE. ----- -The following software may be included in this product: rxjs. A copy of the source code may be downloaded from git@github.com:ReactiveX/RxJS.git. This software contains the following license and notice below: +The following software may be included in this product: rxjs. A copy of the source code may be downloaded from https://github.com/reactivex/rxjs.git. This software contains the following license and notice below: Apache License Version 2.0, January 2004 @@ -31879,7 +32014,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2015-2017 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors + Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -31895,7 +32030,7 @@ Apache License ----- -The following software may be included in this product: rxjs. A copy of the source code may be downloaded from https://github.com/reactivex/rxjs.git. This software contains the following license and notice below: +The following software may be included in this product: rxjs. A copy of the source code may be downloaded from git@github.com:ReactiveX/RxJS.git. This software contains the following license and notice below: Apache License Version 2.0, January 2004 @@ -32085,7 +32220,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors + Copyright (c) 2015-2017 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -35209,6 +35344,21 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following software may be included in this product: to-fast-properties. A copy of the source code may be downloaded from https://github.com/sindresorhus/to-fast-properties.git. This software contains the following license and notice below: +MIT License + +Copyright (c) 2014 Petka Antonov + 2015 Sindre Sorhus + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +----- + +The following software may be included in this product: to-fast-properties. A copy of the source code may be downloaded from https://github.com/sindresorhus/to-fast-properties.git. This software contains the following license and notice below: + The MIT License (MIT) Copyright (c) 2014 Petka Antonov @@ -35234,21 +35384,6 @@ THE SOFTWARE. ----- -The following software may be included in this product: to-fast-properties. A copy of the source code may be downloaded from https://github.com/sindresorhus/to-fast-properties.git. This software contains the following license and notice below: - -MIT License - -Copyright (c) 2014 Petka Antonov - 2015 Sindre Sorhus - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------ - The following software may be included in this product: toidentifier. A copy of the source code may be downloaded from https://github.com/component/toidentifier.git. This software contains the following license and notice below: MIT License @@ -35497,30 +35632,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ----- -The following software may be included in this product: truffle-artifactor, truffle-blockchain-utils, truffle-compile, truffle-config, truffle-contract, truffle-contract-schema, truffle-contract-sources, truffle-error, truffle-expect, truffle-provider, truffle-provisioner, truffle-resolver. A copy of the source code may be downloaded from https://github.com/trufflesuite/truffle/tree/master/packages/truffle-artifactor (truffle-artifactor), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-blockchain-utils (truffle-blockchain-utils), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-compile (truffle-compile), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-config (truffle-config), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-contract (truffle-contract), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-contract-schema (truffle-contract-schema), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-contract-sources (truffle-contract-sources), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-error (truffle-error), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-expect (truffle-expect), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-provider (truffle-provider), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-provisioner (truffle-provisioner), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-resolver (truffle-resolver). This software contains the following license and notice below: - -Copyright (c) 2017-2019 Truffle Blockchain Group, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - ------ - The following software may be included in this product: truffle-compile-vyper, truffle-external-compile. A copy of the source code may be downloaded from https://github.com/trufflesuite/truffle/tree/master/packages/truffle-compile-vyper (truffle-compile-vyper), https://github.com/trufflesuite/truffle/tree/master/packages/truffle-external-compile (truffle-external-compile). This software contains the following license and notice below: Copyright (c) 2018-2019 Truffle Blockchain Group, Inc. @@ -36563,7 +36674,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following software may be included in this product: upath. A copy of the source code may be downloaded from git://github.com/anodynos/upath. This software contains the following license and notice below: -Copyright(c) 2014-2017 Angelos Pikoulas (agelos.pikoulas@gmail.com) +Copyright(c) 2014-2019 Angelos Pikoulas (agelos.pikoulas@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation @@ -36653,36 +36764,6 @@ OR OTHER DEALINGS IN THE SOFTWARE. ----- -The following software may be included in this product: url-template. A copy of the source code may be downloaded from git://github.com/bramstein/url-template.git. This software contains the following license and notice below: - -Copyright (c) 2012-2014, Bram Stein -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------ - The following software may be included in this product: usb. A copy of the source code may be downloaded from https://github.com/tessel/node-usb.git. This software contains the following license and notice below: Copyright (c) 2012 Nonolith Labs, LLC @@ -38884,7 +38965,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ----- -The following software may be included in this product: workspace-aggregator-18a8e193-8d27-45b7-a3f2-f6ffa337d6a4. This software contains the following license and notice below: +The following software may be included in this product: workspace-aggregator-9511c4b6-efe9-452b-a6bb-1eeaf34f0010. This software contains the following license and notice below: Apache License Version 2.0, January 2004 @@ -39550,32 +39631,6 @@ SOFTWARE. ----- -The following software may be included in this product: xregexp. A copy of the source code may be downloaded from https://github.com/slevithan/xregexp.git. This software contains the following license and notice below: - -The MIT License - -Copyright (c) 2007-2017 Steven Levithan - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ------ - The following software may be included in this product: xtend. A copy of the source code may be downloaded from git://github.com/Raynos/xtend.git. This software contains the following license and notice below: The MIT License (MIT) diff --git a/packages/mobile/android/app/src/main/java/org/celo/mobile/MainApplication.java b/packages/mobile/android/app/src/main/java/org/celo/mobile/MainApplication.java index ab57acb4af5..472c27add20 100644 --- a/packages/mobile/android/app/src/main/java/org/celo/mobile/MainApplication.java +++ b/packages/mobile/android/app/src/main/java/org/celo/mobile/MainApplication.java @@ -1,8 +1,7 @@ package org.celo.mobile; import android.content.Context; -import android.support.multidex.MultiDex; -import android.support.multidex.MultiDexApplication; +import android.app.Application; import org.reactnative.camera.RNCameraPackage; import com.chirag.RNMail.RNMail; @@ -50,7 +49,7 @@ import me.furtado.smsretriever.RNSmsRetrieverPackage; import cl.json.RNSharePackage; import cl.json.ShareApplication; -import com.reactlibrary.RNInstallReferrerPackage; +import com.rninstallreferrer.RNInstallReferrerPackage; import com.reactlibrary.securekeystore.RNSecureKeyStorePackage; import android.util.Log; @@ -68,7 +67,7 @@ // import com.instabug.library.invocation.InstabugInvocationEvent; // import com.instabug.reactlibrary.RNInstabugReactnativePackage; -public class MainApplication extends MultiDexApplication implements ShareApplication, ReactApplication { +public class MainApplication extends Application implements ShareApplication, ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override @@ -164,14 +163,6 @@ public void onCreate() { initNdkCrashHandler(); } - @Override - protected void attachBaseContext(Context base) { - super.attachBaseContext(base); - if (BuildConfig.DEBUG) { - MultiDex.install(this); - } - } - @Override public String getFileProviderAuthority() { return BuildConfig.APPLICATION_ID + ".provider"; diff --git a/packages/mobile/android/app/src/pilot/google-services.json.enc b/packages/mobile/android/app/src/pilot/google-services.json.enc new file mode 100644 index 00000000000..69a1e35a795 Binary files /dev/null and b/packages/mobile/android/app/src/pilot/google-services.json.enc differ diff --git a/packages/mobile/android/app/src/pilot/res/mipmap-hdpi/ic_launcher.png b/packages/mobile/android/app/src/pilot/res/mipmap-hdpi/ic_launcher.png new file mode 100755 index 00000000000..6e02f6201c8 Binary files /dev/null and b/packages/mobile/android/app/src/pilot/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/mobile/android/app/src/pilot/res/mipmap-mdpi/ic_launcher.png b/packages/mobile/android/app/src/pilot/res/mipmap-mdpi/ic_launcher.png new file mode 100755 index 00000000000..f6d22e48743 Binary files /dev/null and b/packages/mobile/android/app/src/pilot/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/mobile/android/app/src/pilot/res/mipmap-xhdpi/ic_launcher.png b/packages/mobile/android/app/src/pilot/res/mipmap-xhdpi/ic_launcher.png new file mode 100755 index 00000000000..553a01603e1 Binary files /dev/null and b/packages/mobile/android/app/src/pilot/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/mobile/android/app/src/pilot/res/mipmap-xxhdpi/ic_launcher.png b/packages/mobile/android/app/src/pilot/res/mipmap-xxhdpi/ic_launcher.png new file mode 100755 index 00000000000..f249053b491 Binary files /dev/null and b/packages/mobile/android/app/src/pilot/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/mobile/android/app/src/pilot/res/mipmap-xxxhdpi/ic_launcher.png b/packages/mobile/android/app/src/pilot/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100755 index 00000000000..5d0f4a8e099 Binary files /dev/null and b/packages/mobile/android/app/src/pilot/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/mobile/android/app/src/pilot/res/values/strings.xml b/packages/mobile/android/app/src/pilot/res/values/strings.xml new file mode 100644 index 00000000000..aac28efc8ab --- /dev/null +++ b/packages/mobile/android/app/src/pilot/res/values/strings.xml @@ -0,0 +1,3 @@ + + Monedero Celo + diff --git a/packages/mobile/android/app/src/staging/google-services.json.enc b/packages/mobile/android/app/src/staging/google-services.json.enc index 30ea3407ea5..f4b24e6d9af 100644 Binary files a/packages/mobile/android/app/src/staging/google-services.json.enc and b/packages/mobile/android/app/src/staging/google-services.json.enc differ diff --git a/packages/mobile/android/gradle.properties b/packages/mobile/android/gradle.properties index 47aa3c0a94c..49c852efb0c 100644 --- a/packages/mobile/android/gradle.properties +++ b/packages/mobile/android/gradle.properties @@ -20,4 +20,4 @@ CELO_RELEASE_STORE_FILE=celo-release-key.keystore CELO_RELEASE_KEY_ALIAS=celo-key-alias # Setting this manually based on version number until we have this deploying via Cloud Build -VERSION_CODE=100400100 \ No newline at end of file +VERSION_CODE=100400201 \ No newline at end of file diff --git a/packages/mobile/fastlane/Fastfile b/packages/mobile/fastlane/Fastfile index 5edd80a1029..935c56e1a09 100644 --- a/packages/mobile/fastlane/Fastfile +++ b/packages/mobile/fastlane/Fastfile @@ -20,7 +20,8 @@ def fastlane_supply(env, track, bundle_suffix) track: track, track_promote_to: track, package_name: get_bundle(bundle_suffix), - mapping: get_mapping_path(env) + mapping: get_mapping_path(env), + skip_upload_apk: true ) end @@ -78,6 +79,15 @@ platform :android do build(environment: env, sdkEnv: sdkEnv) fastlane_supply(env, 'internal', env) end + + desc 'Ship Pilot to Playstore Internal' + lane :pilotapp do + env = 'pilot' + sdkEnv = 'pilot' + clean + build(environment: env, sdkEnv: sdkEnv) + fastlane_supply(env, 'internal', env) + end end diff --git a/packages/mobile/fastlane/README.md b/packages/mobile/fastlane/README.md index d8463966f90..58877c7e308 100644 --- a/packages/mobile/fastlane/README.md +++ b/packages/mobile/fastlane/README.md @@ -68,6 +68,14 @@ fastlane android alfajores Ship Alfajores to Playstore Internal +### android pilotapp + +``` +fastlane android pilotapp +``` + +Ship Pilot to Playstore Internal + --- This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. diff --git a/packages/mobile/ios/celo-tvOS/Info.plist b/packages/mobile/ios/celo-tvOS/Info.plist index d526899a060..f841c2c0bd7 100644 --- a/packages/mobile/ios/celo-tvOS/Info.plist +++ b/packages/mobile/ios/celo-tvOS/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.4.1 + 1.4.2 CFBundleSignature ???? CFBundleVersion - 6 + 7 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/packages/mobile/ios/celo-tvOSTests/Info.plist b/packages/mobile/ios/celo-tvOSTests/Info.plist index 5676fee33e2..18a4a24bfad 100644 --- a/packages/mobile/ios/celo-tvOSTests/Info.plist +++ b/packages/mobile/ios/celo-tvOSTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.4.1 + 1.4.2 CFBundleSignature ???? CFBundleVersion - 6 + 7 diff --git a/packages/mobile/ios/celo/Info.plist b/packages/mobile/ios/celo/Info.plist index 8d9352c1b6a..c61a26a1d6c 100644 --- a/packages/mobile/ios/celo/Info.plist +++ b/packages/mobile/ios/celo/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.4.1 + 1.4.2 CFBundleSignature ???? CFBundleVersion - 6 + 7 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/packages/mobile/ios/celoTests/Info.plist b/packages/mobile/ios/celoTests/Info.plist index 5676fee33e2..18a4a24bfad 100644 --- a/packages/mobile/ios/celoTests/Info.plist +++ b/packages/mobile/ios/celoTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.4.1 + 1.4.2 CFBundleSignature ???? CFBundleVersion - 6 + 7 diff --git a/packages/mobile/jest.config.js b/packages/mobile/jest.config.js index 105e439a2a8..ca0841ac944 100644 --- a/packages/mobile/jest.config.js +++ b/packages/mobile/jest.config.js @@ -4,6 +4,11 @@ module.exports = { ...defaultConfig, globals: { navigator: true, + 'ts-jest': { + // Disables type-check when running tests as it takes valuable time + // and is redundant with the tsc build step + isolatedModules: true, + }, window: true, }, moduleNameMapper: { @@ -15,5 +20,7 @@ module.exports = { preset: 'react-native', setupFilesAfterEnv: ['/jest_setup.ts'], snapshotSerializers: ['enzyme-to-json/serializer'], - transformIgnorePatterns: ['node_modules/(?!react-native|react-navigation|)'], + transformIgnorePatterns: [ + 'node_modules/(?!(@celo/)?react-native|@react-navigation|redux-persist|date-fns)', + ], } diff --git a/packages/mobile/jest_setup.ts b/packages/mobile/jest_setup.ts index 665198769a1..fa0dd1cda9d 100644 --- a/packages/mobile/jest_setup.ts +++ b/packages/mobile/jest_setup.ts @@ -18,3 +18,8 @@ if (typeof window !== 'object') { // @ts-ignore global.window.navigator = {} } + +jest.mock('./src/config', () => ({ + ...jest.requireActual('./src/config'), + LOCAL_CURRENCY_SYMBOL: 'MXN', +})) diff --git a/packages/mobile/locales/en-US/dappkit.json b/packages/mobile/locales/en-US/dappkit.json index a8d803e27da..fce8eefec2f 100644 --- a/packages/mobile/locales/en-US/dappkit.json +++ b/packages/mobile/locales/en-US/dappkit.json @@ -1,5 +1,5 @@ { - "connectToWallet": "Savings Circle would like to connect to Celo Wallet", + "connectToWallet": "{{dappname}} would like to connect to Celo Wallet", "connect": "Connect", "cancel": "Cancel", "allow": "Allow", diff --git a/packages/mobile/locales/en-US/exchangeFlow9.json b/packages/mobile/locales/en-US/exchangeFlow9.json index ab30c5cfded..d0bb74a1967 100644 --- a/packages/mobile/locales/en-US/exchangeFlow9.json +++ b/packages/mobile/locales/en-US/exchangeFlow9.json @@ -3,6 +3,7 @@ "whatIsGold": "Gold is where you can choose to store {{CeloDollars}} you have", "manageCelo": "Manage {{CeloDollars}}", "activity": "Activity", + "goldActivity": "Gold Activity", "exchangeRate": "Estimated Exchange Rate", "history": "History", "exchange": "Exchange", diff --git a/packages/mobile/locales/en-US/global.json b/packages/mobile/locales/en-US/global.json index c03a508dbac..cdc6f3bf8b2 100644 --- a/packages/mobile/locales/en-US/global.json +++ b/packages/mobile/locales/en-US/global.json @@ -69,7 +69,7 @@ "escrowTransferFailed": "Transfer to escrow failed", "escrowWithdrawalFailed": "Withdrawal from escrow failed", "reclaimingEscrowedPaymentFailed": "Payment could not be reclaimed", - "connectingToCelo": "Connecting to the Celo Network...", + "connectingToCelo": "Connecting to Celo…", "poorConnection": { "0": "Bad Connection", "1": "some features disabled" @@ -86,5 +86,6 @@ "corruptedChainDeleted": "Corrupted chain data has been deleted, please restart the app", "web3FailedToSync": "Failing to sync, check your network connection", "errorDuringSync": "Error occurred during sync, please try again later", - "calculateFeeFailed": "Could not calculate fee" + "calculateFeeFailed": "Could not calculate fee", + "gold": "Gold" } diff --git a/packages/mobile/locales/en-US/nuxNamePin1.json b/packages/mobile/locales/en-US/nuxNamePin1.json index 42f5fa8b9db..e2baa4f75d0 100644 --- a/packages/mobile/locales/en-US/nuxNamePin1.json +++ b/packages/mobile/locales/en-US/nuxNamePin1.json @@ -12,8 +12,7 @@ "chooseCountryCode": "Country Code", "chooseCountry": "Country", "joinText": { - "0": - "Welcome to Celo Wallet, a digital wallet that allows you to easily send, receive, and save value.", + "0": "The Celo Wallet helps you to send, receive, and save value on the Celo Network.", "1": "By joining this network, you give us permission to collect anonymous information about how you use the app. Additionally, if you verify your phone number, an obfuscated copy of it will be stored on the Celo Network. Learn more at ", "2": "celo.org/terms" @@ -42,9 +41,8 @@ }, "inviteAccepted": "🎉 Invite Accepted!", "askForInvite": { - "0": "Don't have a code? ", - "1": "Ask someone with Celo Wallet for an invite or sign up for an account at ", - "2": "celo.org/build/wallet" + "0": "Request an invite from someone with Celo Wallet or sign up for the Testnet at ", + "1": "celo.org/build/wallet" } }, "enterFullName": "Please enter your first and last name", @@ -52,8 +50,7 @@ "InvitationCode": "Invitation Code", "optIn": "Opt In", "submitting": "Submitting ...", - "haveWallet": "Already have a Celo wallet? ", - "importIt": "Import it", + "importIt": "Import Existing Wallet", "cancel": "Cancel", "important": "Important", "createPin": { @@ -75,12 +72,14 @@ "submit": "Submit" }, "systemAuth": { - "title": "Set up Security", + "title": "Secure Your Phone", "secure": "Adding a PIN to your phone helps to keep your funds in Celo safe and secure.", "intro": "We will need you to input your device's lockscreen PIN or thumbprint, if your device supports it.", "why": - "We need this additional level of protection to ensure that the value in your wallet stays secure." + "We need this additional level of protection to ensure that the value in your wallet stays secure.", + "summary": + "Celo requires phones to be secured with a PIN or fingerprint. Your device’s lock helps ensure that the funds in your wallet are protected." }, "goToSystemSecuritySettingsActionLabel": "Go to security", "enableSystemScreenLockFailedMessage": "Failed to enable screen lock", @@ -90,9 +89,9 @@ "Please enable lockscreen to use Celo. If you disable lock-screen in the future, you will need your backup key to access your account.", "importContactsPermission": { "title": "Import Contacts", - "0": "Celo is better with others.", - "1": - "Importing your contacts allows you to easily send and request payments from your community and see who is already using Celo.", + "0": + "Connecting your address book makes it easy to send and request payments with your friends. Otherwise, you’ll have to enter their info individually.", + "1": "Don’t worry—connecting does not send invites to your contacts.", "enable": "Enable Contact Access", "loading": "Finding friends on Celo..." }, diff --git a/packages/mobile/locales/en-US/walletFlow5.json b/packages/mobile/locales/en-US/walletFlow5.json index de0de51186d..f1ca130b298 100644 --- a/packages/mobile/locales/en-US/walletFlow5.json +++ b/packages/mobile/locales/en-US/walletFlow5.json @@ -11,9 +11,7 @@ "wallet": "Wallet", "send": "Send", "sent": "Sent", - "sentTo": "Sent to {{address}}", "received": "Received", - "receivedFrom": "Received from {{address}}", "pending": "Pending", "exchange": "Exchange", "review": "Review", @@ -29,17 +27,14 @@ "at": "at", "bikeParts": "Bike Parts", "groceryRun": "Grocery run", - "verifyReward": "Verifier Reward", "transactionsAreLoading": "Transactions are loading!", "pleaseHoldOn": "Please hold on", "welcomeToCeloPayments": "Welcome to Celo Payments", "letsGetStartedByFirstTransaction": "Let’s get started by sending your first transaction", "sendMoney": "Send Money", "verificationFee": "Verification Fee", - "invited": "Invited", - "verifierReward": "Verifier Reward", - "confirmingPayment": "Confirming Payment", - "confirmingExchange": "Confirming Exchange", + "confirmingPayment": "Confirming…", + "confirmingExchange": "Confirming…", "paymentFailed": "Payment Failed", "exchangeFailed": "Exchange Failed", "loadingActivity": "Loading your activity feed", @@ -59,5 +54,21 @@ "0": "Testnet", "1": "A friendly reminder you're using a Testnet build - the balances here are not real." }, - "dismiss": "Dismiss" + "dismiss": "Dismiss", + "localCurrencyEqual": "Equal to <2>{{localValue}} {{localCurrencySymbol}}", + "localCurrencyValue": "{{localValue}} {{localCurrencySymbol}}", + "feedItemVerificationFeeTitle": "Celo", + "feedItemVerificationFeeInfo": "$t(verificationFee)", + "feedItemVerificationRewardTitle": "Celo", + "feedItemVerificationRewardInfo": "Verifier Reward", + "feedItemFaucetTitle": "Celo", + "feedItemFaucetInfo": "{{faucet}} Faucet", + "feedItemFaucetInfo_missingTestnet": "Faucet", + "feedItemInviteSentTitle": "Celo", + "feedItemInviteSentInfo": "Invited {{nameOrNumber}}", + "feedItemInviteSentInfo_missingInviteeDetails": "$t(inviteFlow11:inviteSent)", + "feedItemInviteReceivedTitle": "Celo", + "feedItemInviteReceivedInfo": "$t(inviteFlow11:inviteReceived)", + "feedItemReceivedTitle_missingSenderDetails": "Payment Received", + "feedItemSentTitle_missingReceiverDetails": "Payment Sent" } diff --git a/packages/mobile/locales/es-AR/accountScreen10.json b/packages/mobile/locales/es-419/accountScreen10.json similarity index 100% rename from packages/mobile/locales/es-AR/accountScreen10.json rename to packages/mobile/locales/es-419/accountScreen10.json diff --git a/packages/mobile/locales/es-AR/backupKeyFlow6.json b/packages/mobile/locales/es-419/backupKeyFlow6.json similarity index 52% rename from packages/mobile/locales/es-AR/backupKeyFlow6.json rename to packages/mobile/locales/es-419/backupKeyFlow6.json index 22b3f0e8602..4d5d956ae4e 100755 --- a/packages/mobile/locales/es-AR/backupKeyFlow6.json +++ b/packages/mobile/locales/es-419/backupKeyFlow6.json @@ -2,7 +2,7 @@ "readOnlyMode": "Modo de solo lectura: cree la clave de respaldo para seguir enviando y recibiendo {{CeloDollars}}", "getBackupKey": "Obtener clave de respaldo", - "learnBackupKey": "Aprenda su clave de respaldo", + "learnBackupKey": "Aprenda tu clave de respaldo", "editProfile": "Editar perfil", "backupKey": "Clave de respaldo", "delayBackup": "Despedir por una hora", @@ -12,11 +12,11 @@ "cancel": "Cancelar", "backupKeyImportance": { "0": - "Si pierde su teléfono o elimina la aplicación de Celo, perderá todo el oro y los {{dollars}} de su monedero.", + "Si pierde tu teléfono o elimina la aplicación de Celo, perderá todo el oro y los {{dollars}} de tu monedero.", "1": "Puede hacer un respaldo del monedero si escribe una clave de respaldo en un papel y la guarda en algún sitio seguro. Así, podrá restaurar el monedero en el futuro de ser necesario.", "2": - "No haga una captura de pantalla ni la guarde en las notas de su teléfono. Asegúrese de escribir la clave de respaldo a mano y mantenerla segura." + "No haga una captura de pantalla ni la guarde en las notas de tu teléfono. Asegúrese de escribir la clave de respaldo a mano y mantenerla segura." }, "setBackupKey": "Crear clave de respaldo", "skip": "Saltar paso", @@ -33,55 +33,55 @@ "securityTips": "Consejos de seguridad", "backupKeySummary": { "0": "Escriba esta frase en un papel y guárdela en algún sitio seguro.", - "1": "No le muestre la frase a nadie. Si alguien la sabe, podrá acceder a su monedero." + "1": "No le muestre la frase a nadie. Si alguien la sabe, podrá acceder a tu monedero." }, - "learnYourKey": "Escriba o memorice su clave de respaldo.", + "learnYourKey": "Escriba o memorice tu clave de respaldo.", "keyWillBeVerified": "Una vez que haya terminado, verificaremos que conoce la clave correctamente.", "question": "Pregunta", "questionPhrase": { "0": "¿Cuál es la ", - "1": " palabra de su clave de respaldo?" + "1": " palabra de tu clave de respaldo?" }, - "question1": "¿Cuál es la 1.ª palabra de su clave de respaldo?", - "question2": "¿Cuál es la 2.ª palabra de su clave de respaldo?", - "question3": "¿Cuál es la 3.ª palabra de su clave de respaldo?", - "question4": "¿Cuál es la 4.ª palabra de su clave de respaldo?", - "question5": "¿Cuál es la 5.ª palabra de su clave de respaldo?", - "question6": "¿Cuál es la 6.ª palabra de su clave de respaldo?", - "question7": "¿Cuál es la 7.ª palabra de su clave de respaldo?", - "question8": "¿Cuál es la 8.ª palabra de su clave de respaldo?", - "question9": "¿Cuál es la 9.ª palabra de su clave de respaldo?", - "question10": "¿Cuál es la 10.ª palabra de su clave de respaldo?", - "question11": "¿Cuál es la 11.ª palabra de su clave de respaldo?", - "question12": "¿Cuál es la 12.ª palabra de su clave de respaldo?", - "question13": "¿Cuál es la 13.ª palabra de su clave de respaldo?", - "question14": "¿Cuál es la 14.ª palabra de su clave de respaldo?", - "question15": "¿Cuál es la 15.ª palabra de su clave de respaldo?", - "question16": "¿Cuál es la 16.ª palabra de su clave de respaldo?", - "question17": "¿Cuál es la 17.ª palabra de su clave de respaldo?", - "question18": "¿Cuál es la 18.ª palabra de su clave de respaldo?", - "question19": "¿Cuál es la 19.ª palabra de su clave de respaldo?", - "question20": "¿Cuál es la 20.ª palabra de su clave de respaldo?", - "question21": "¿Cuál es la 21.ª palabra de su clave de respaldo?", - "question22": "¿Cuál es la 22.ª palabra de su clave de respaldo?", - "question23": "¿Cuál es la 23.ª palabra de su clave de respaldo?", - "question24": "¿Cuál es la 24.ª palabra de su clave de respaldo?", + "question1": "¿Cuál es la 1.ª palabra de tu clave de respaldo?", + "question2": "¿Cuál es la 2.ª palabra de tu clave de respaldo?", + "question3": "¿Cuál es la 3.ª palabra de tu clave de respaldo?", + "question4": "¿Cuál es la 4.ª palabra de tu clave de respaldo?", + "question5": "¿Cuál es la 5.ª palabra de tu clave de respaldo?", + "question6": "¿Cuál es la 6.ª palabra de tu clave de respaldo?", + "question7": "¿Cuál es la 7.ª palabra de tu clave de respaldo?", + "question8": "¿Cuál es la 8.ª palabra de tu clave de respaldo?", + "question9": "¿Cuál es la 9.ª palabra de tu clave de respaldo?", + "question10": "¿Cuál es la 10.ª palabra de tu clave de respaldo?", + "question11": "¿Cuál es la 11.ª palabra de tu clave de respaldo?", + "question12": "¿Cuál es la 12.ª palabra de tu clave de respaldo?", + "question13": "¿Cuál es la 13.ª palabra de tu clave de respaldo?", + "question14": "¿Cuál es la 14.ª palabra de tu clave de respaldo?", + "question15": "¿Cuál es la 15.ª palabra de tu clave de respaldo?", + "question16": "¿Cuál es la 16.ª palabra de tu clave de respaldo?", + "question17": "¿Cuál es la 17.ª palabra de tu clave de respaldo?", + "question18": "¿Cuál es la 18.ª palabra de tu clave de respaldo?", + "question19": "¿Cuál es la 19.ª palabra de tu clave de respaldo?", + "question20": "¿Cuál es la 20.ª palabra de tu clave de respaldo?", + "question21": "¿Cuál es la 21.ª palabra de tu clave de respaldo?", + "question22": "¿Cuál es la 22.ª palabra de tu clave de respaldo?", + "question23": "¿Cuál es la 23.ª palabra de tu clave de respaldo?", + "question24": "¿Cuál es la 24.ª palabra de tu clave de respaldo?", "submit": "Enviar", "dontKnow": "¿No la sabe? ", "return": "Vuelva a la clave de respaldo", "tryAgain": "Reintentar", "backToKey": - "Le llevaremos a la pantalla con su clave de respaldo para que verifique que la escribió correctamente.", + "Le llevaremos a la pantalla con tu clave de respaldo para que verifique que la escribió correctamente.", "seeBackupKey": "Ver clave de respaldo", "backupKeySet": "Clave de respaldo creada", "dontLoseIt": - "No pierda esta clave. Es de suma importancia que la mantenga en un lugar seguro, ya que es la única forma de desbloquear su monedero si pierde su celular.", + "No pierda esta clave. Es de suma importancia que la mantenga en un lugar seguro, ya que es la única forma de desbloquear tu monedero si pierde tu celular.", "done": "Listo", "whatsappMessage": "Importante: por favor mantenga esto privado. \n\nTe estoy enviando la frase de respaldo a mi Monedero Celo: ", "backupPrompt": - "Para la seguridad de sus fondos, su cuenta está congelada hasta que obtenga su clave de respaldo", + "Para la seguridad de sus fondos, tu cuenta está congelada hasta que obtenga tu clave de respaldo", "copyToClipboard": "Copiar al portapapeles", "copiedToClipboard": "Copiada al portapapeles" } diff --git a/packages/mobile/locales/es-AR/dappkit.json b/packages/mobile/locales/es-419/dappkit.json similarity index 100% rename from packages/mobile/locales/es-AR/dappkit.json rename to packages/mobile/locales/es-419/dappkit.json diff --git a/packages/mobile/locales/es-AR/dev.json b/packages/mobile/locales/es-419/dev.json similarity index 100% rename from packages/mobile/locales/es-AR/dev.json rename to packages/mobile/locales/es-419/dev.json diff --git a/packages/mobile/locales/es-AR/exchangeFlow9.json b/packages/mobile/locales/es-419/exchangeFlow9.json similarity index 95% rename from packages/mobile/locales/es-AR/exchangeFlow9.json rename to packages/mobile/locales/es-419/exchangeFlow9.json index a89575b02b2..43032ced7f5 100755 --- a/packages/mobile/locales/es-AR/exchangeFlow9.json +++ b/packages/mobile/locales/es-419/exchangeFlow9.json @@ -3,6 +3,7 @@ "whatIsGold": "Puede elegir guardar sus {{CeloDollars}} en Celo Oro", "manageCelo": "Administrar {{CeloDollars}}", "activity": "Actividad", + "goldActivity": "Actividad de Oro", "exchangeRate": "Estimada tasa de cambio", "history": "Historial", "exchange": "Cambio", diff --git a/packages/mobile/locales/es-AR/global.json b/packages/mobile/locales/es-419/global.json similarity index 92% rename from packages/mobile/locales/es-AR/global.json rename to packages/mobile/locales/es-419/global.json index ae6b0db21d2..4fa53b36023 100755 --- a/packages/mobile/locales/es-AR/global.json +++ b/packages/mobile/locales/es-419/global.json @@ -1,7 +1,7 @@ { - "yourClockIsBroke": "La fecha y hora de su teléfono son incorrectos", + "yourClockIsBroke": "La fecha y hora de tu teléfono son incorrectos", "adjustYourClock": - "Ajuste su reloj para leer la hora automáticamente y vuelva a intentarlo. Si el problema persiste, puede que sea necesario reiniciar la aplicación", + "Ajusta tu reloj para leer la hora automáticamente y vuelva a intentarlo. Si el problema persiste, puede que sea necesario reiniciar la aplicación", "adjustDate": "Arreglar hora", "submit": "Enviar", "continue": "Continuar", @@ -19,7 +19,7 @@ "transactionFailed": "Transacción fallido, por favor vuelva a intentarlo", "notEnoughDollarsError": "No hay suficientes {{CeloDollars}} para cambiarlos", "notEnoughGoldError": "No hay suficiente Celo Oro para cambiarlo", - "refreshFailedUnexpectedly": "Error al actualizar, por favor revise su conectividad", + "refreshFailedUnexpectedly": "Error al actualizar, por favor revise tu conectividad", "edit": "Editar", "needMoreFundsToSend": "Necesita más fondos para enviar el pago", "receivedPayment": "Pago recibido", @@ -69,12 +69,12 @@ "escrowTransferFailed": "Transferencia a la custodia falló", "escrowWithdrawalFailed": "Retirada de la custodia fallida", "reclaimingEscrowedPaymentFailed": "El pago no pudo ser reclamado", - "connectingToCelo": "Conectando a la red de Celo...", + "connectingToCelo": "Conectando al Celo…", "poorConnection": { "0": "Mala Conexión", "1": "algunas funciones no disponible" }, - "networkConnectionFailed": "No se pudo conectar a la red, por favor verifique su conexión", + "networkConnectionFailed": "No se pudo conectar a la red, por favor verifica tu conexión", "firebaseFailed": "No se pudo conectar al servicio de notificaciones", "gasPriceUpdateFailed": "No se pudo actualizar la comisión", "appHasToBeUpdated": "La aplicación tiene que ser actualizada", @@ -85,7 +85,8 @@ "qrFailedInvalidAddress": "Código QR no se pudo leer. Razón: la dirección de la cartera no es válida.", "corruptedChainDeleted": "Se ha borrado información corrupta, por favor reinicie la applicación", - "web3FailedToSync": "Fallo la sincronización, por favor verifique su conexión", + "web3FailedToSync": "Fallo la sincronización, por favor verifica tu conexión", "errorDuringSync": "Ocurrió un error duranet la sincronización, por favor intente más tarde", - "calculateFeeFailed": "No se pudo calcular la comisión" + "calculateFeeFailed": "No se pudo calcular la comisión", + "gold": "Oro" } diff --git a/packages/mobile/locales/es-419/index.ts b/packages/mobile/locales/es-419/index.ts new file mode 100644 index 00000000000..c1815826c8e --- /dev/null +++ b/packages/mobile/locales/es-419/index.ts @@ -0,0 +1,29 @@ +import accountScreen10 from '@celo/mobile/locales/es-419/accountScreen10.json' +import backupKeyFlow6 from '@celo/mobile/locales/es-419/backupKeyFlow6.json' +import exchangeFlow9 from '@celo/mobile/locales/es-419/exchangeFlow9.json' +import global from '@celo/mobile/locales/es-419/global.json' +import inviteFlow11 from '@celo/mobile/locales/es-419/inviteFlow11.json' +import nuxCurrencyPhoto4 from '@celo/mobile/locales/es-419/nuxCurrencyPhoto4.json' +import nuxNamePin1 from '@celo/mobile/locales/es-419/nuxNamePin1.json' +import nuxRestoreWallet3 from '@celo/mobile/locales/es-419/nuxRestoreWallet3.json' +import nuxVerification2 from '@celo/mobile/locales/es-419/nuxVerification2.json' +import paymentRequestFlow from '@celo/mobile/locales/es-419/paymentRequestFlow.json' +import receiveFlow8 from '@celo/mobile/locales/es-419/receiveFlow8.json' +import sendFlow7 from '@celo/mobile/locales/es-419/sendFlow7.json' +import walletFlow5 from '@celo/mobile/locales/es-419/walletFlow5.json' + +export default { + accountScreen10, + backupKeyFlow6, + exchangeFlow9, + global, + inviteFlow11, + nuxCurrencyPhoto4, + nuxNamePin1, + nuxRestoreWallet3, + nuxVerification2, + paymentRequestFlow, + receiveFlow8, + sendFlow7, + walletFlow5, +} diff --git a/packages/mobile/locales/es-AR/inviteFlow11.json b/packages/mobile/locales/es-419/inviteFlow11.json similarity index 78% rename from packages/mobile/locales/es-AR/inviteFlow11.json rename to packages/mobile/locales/es-419/inviteFlow11.json index 2a436dbc4f8..1a75b3c52d9 100755 --- a/packages/mobile/locales/es-AR/inviteFlow11.json +++ b/packages/mobile/locales/es-419/inviteFlow11.json @@ -16,11 +16,11 @@ "redeemFailed": "No pudimos validar el código de invitación", "redeemInviteTimeout": "Canjear invitación agotada", "withdrawGoldFromEscrow": "Retirarndo el oro de la cuenta...", - "transferGoldToAccount": "Oro transferido a su cuenta!", - "withdrawDollarsFromEscrow": "Retirando los {{dollars}} de su cuenta...", - "transferDollarsToAccount": "{{Dollars}} transferidos a su cuenta!", + "transferGoldToAccount": "Oro transferido a tu cuenta!", + "withdrawDollarsFromEscrow": "Retirando los {{dollars}} de tu cuenta...", + "transferDollarsToAccount": "{{Dollars}} transferidos a tu cuenta!", "inviteFriendsToCelo": "Invitar amigos a Celo", - "inviteAnyone": "Invite a cualquiera en su libreta de direcciones para enviar y recibir valor", + "inviteAnyone": "Invite a cualquiera en tu lista de contactos para enviar y recibir valor", "inviteComplete": "Invitación completa", "inviteReceived": "Invitación recibida" } diff --git a/packages/mobile/locales/es-AR/nuxCurrencyPhoto4.json b/packages/mobile/locales/es-419/nuxCurrencyPhoto4.json similarity index 83% rename from packages/mobile/locales/es-AR/nuxCurrencyPhoto4.json rename to packages/mobile/locales/es-419/nuxCurrencyPhoto4.json index ab569499582..5ae308d2ccf 100755 --- a/packages/mobile/locales/es-AR/nuxCurrencyPhoto4.json +++ b/packages/mobile/locales/es-419/nuxCurrencyPhoto4.json @@ -2,7 +2,7 @@ "getStarted": "Primeros pasos", "getBackupKey": "Obtener clave de respaldo", "setYourBackupKey": - "Cree su clave de respaldo para mejorar la seguridad y habilitar la recuperación de la cuenta", + "Crea tu clave de respaldo para mejorar la seguridad y habilitar la recuperación de la cuenta", "activity": "Actividad", "cancel": "Cancelar", "stableDollar": @@ -11,12 +11,12 @@ "sendCelo": "Enviar {{CeloDollars}} a cualquier persona con un celular", "backToWallet": "Volver a el Monedero", "celoLikeGold": "Celo Oro es como el oro real", - "goldFluctuates": "Hay una cantidad limitada de Celo Oro, y su valor puede aumentar o disminuir", + "goldFluctuates": "Hay una cantidad limitada de Celo Oro, y tu valor puede aumentar o disminuir", "exchange": "Cambie Oro a {{Dollars}} cuando quiera", "exchangeGold": "Cambiar a Oro", "addressPhotos": "Celo usa sus contactos para mostrar fotos", "changePhotos": "Puede cambiar una foto si actualiza los contactos", - "localPhotos": "Solo usted puede ver estas fotos desde su teléfono", + "localPhotos": "Solo usted puede ver estas fotos desde tu teléfono", "allowContactAccess": "Permita que el Monedero Celo tenga acceso a las fotos de sus contactos", "deny": "Denegar", "allow": "Permitir" diff --git a/packages/mobile/locales/es-AR/nuxNamePin1.json b/packages/mobile/locales/es-419/nuxNamePin1.json similarity index 72% rename from packages/mobile/locales/es-AR/nuxNamePin1.json rename to packages/mobile/locales/es-419/nuxNamePin1.json index 16c6653d972..81b64d7d0a7 100755 --- a/packages/mobile/locales/es-AR/nuxNamePin1.json +++ b/packages/mobile/locales/es-419/nuxNamePin1.json @@ -3,20 +3,19 @@ "chooseLanguage": "Elegir idioma", "continue": "Continuar", "secureAsset": - "Celo mantiene su patrimonio seguro y le permite enviar capital a quien quiera y recibirlos de cualquier persona", + "Celo mantiene tu patrimonio seguro y le permite enviar capital a quien quiera y recibirlos de cualquier persona", "stableAsset": "Los {{CeloDollars}} constituyen un activo digital estable que está alineado con el valor del dólar estadounidense", "verifyNumber": - "Verifique su número de teléfono para conectarse con otros usuarios y recibir dinero", + "Verifique tu número de teléfono para conectarse con otros usuarios y recibir dinero", "syncNetwork": "Sincronizando con la red", "welcomeCelo": "Te damos la bienvenida a Celo", "chooseCountryCode": "Código de país", "chooseCountry": "País", "joinText": { - "0": - "Bienvenido a Celo Wallet, una billetera digital que te permite enviar, recibir y guardar valor fácilmente.", + "0": "El Monedero Celo te ayuda a enviar, recibir y guardar valor en la red de Celo.", "1": - "Al unirte a esta red, nos das permiso para recopilar información anónima sobre cómo utilizas la aplicación. Adrmás, si verificas tu número de teléfono, se almacenará una copia ofuscada en la Red de Celo. Más información en ", + "Al unirte a esta red, nos das permiso para recopilar información anónima sobre cómo utilizas la aplicación. Además, si verificas tu número de teléfono, se almacenará una copia ofuscada en la Red de Celo. Más información en ", "2": "celo.org/terms" }, "phoneNumber": "000 000 0000", @@ -29,7 +28,7 @@ "openMessages": { "message": "Abrir mensajes", "hint": { - "0": "Pista ", + "0": "Pista: ", "1": "Copia el mensaje SMS completo" } }, @@ -43,27 +42,24 @@ }, "inviteAccepted": "🎉 Invitación aceptada!", "askForInvite": { - "0": "¿No tienes un código? ", - "1": - "Solicita una invitación a alguien con la Celo Wallet o regístrate para obtener una cuenta de testnet en", - "2": "celo.org/build/wallet" + "0": "Solicite una invitación de alguien con Celo Monedero o regístrese en Testnet en ", + "1": "celo.org/build/wallet" } }, - "enterFullName": "Ingrese su nombre y apellido", + "enterFullName": "Ingresa tu nombre y apellido", "fullName": "Nombre completo", "InvitationCode": "Código de invitación", "optIn": "Inscribirse", "submitting": "Enviando ...", - "haveWallet": "¿Ya tienes una billetera de Celo? ", - "importIt": "Impórtala", + "importIt": "Importa tu monedero existente", "cancel": "Cancelar", "important": "Importante", "createPin": { "title": "Crear un código PIN de 6 dígitos", - "intro": "Cree un PIN para proteger su Monedero Celo.", + "intro": "Cree un PIN para proteger tu Monedero Celo.", "why": "En ciertos casos, necesitará este PIN para enviar {{CeloDollars}} a sus amigos.", "warn": - "escriba su código PIN de 6 dígitos en un papel y guárdelo en algún sitio seguro. Se lo solicitaremos más tarde para acceder a su monedero.", + "escribe tu código PIN de 6 dígitos en un papel y guárdelo en algún sitio seguro. Se lo solicitaremos más tarde para acceder a tu monedero.", "yourPin": "Su PIN" }, "enableSecurity": "Habilitar seguridad", @@ -76,13 +72,15 @@ "submit": "Enviar" }, "systemAuth": { - "title": "Configura la seguridad Celo", + "title": "Asegura tu celular", "secure": "Agregar un PIN a tu teléfono ayuda a que tus fondos en Celo se mantengan seguros y protegidos.", "intro": "Necesitaremos que ingreses el código de bloqueo de pantalla de tu dispositivo o tu huella, si el mismo lo soporta.", "why": - "Necesitamos este nivel de protección adicional para asegurar que el contenido de tu monedero se encuentra a salvo." + "Necesitamos este nivel de protección adicional para asegurar que el contenido de tu monedero se encuentra a salvo.", + "summary": + "Celo requiere que los teléfonos estén protegidos con un PIN o huella digital. Bloquear de tu dispositivo ayuda a garantizar que los fondos en tu billetera estén protegidos." }, "goToSystemSecuritySettingsActionLabel": "Vaya a seguridad", "enableSystemScreenLockFailedMessage": "Error al intentar habilitar el bloqueo de pantalla", @@ -92,9 +90,9 @@ "Por favor habilitá el bloqueo de pantalla para usar Celo. Si deshabilitás el bloqueo de pantalla en el futuro, vas a necesitar tu clave de respaldo para acceder a tu cuenta", "importContactsPermission": { "title": "Importar contactos", - "0": "Celo es mejor con los demás.", - "1": - "Importar tus contactos te permite enviar y solicitar pagos fácilmente a tu comunidad y ver quién ya está usando Celo", + "0": + "Conectar tu lista de contactos facilita el envío y la solicitud de pagos con tus amigos. De lo contrario, deberás ingresar tu información individualmente.", + "1": "No se preocupe: la conexión no envía invitaciones a sus contactos.", "enable": "Habilitar acceso a contactos", "loading": "Encontrar amigos en Celo..." }, diff --git a/packages/mobile/locales/es-AR/nuxRestoreWallet3.json b/packages/mobile/locales/es-419/nuxRestoreWallet3.json similarity index 60% rename from packages/mobile/locales/es-AR/nuxRestoreWallet3.json rename to packages/mobile/locales/es-419/nuxRestoreWallet3.json index f3bbdb5250c..f9046d0fb25 100755 --- a/packages/mobile/locales/es-AR/nuxRestoreWallet3.json +++ b/packages/mobile/locales/es-419/nuxRestoreWallet3.json @@ -1,16 +1,16 @@ { "welcomeCelo": "Te damos la bienvenida a Celo", "enterInvite": - "Ingrese su código de invitación. Si no tiene uno, pídale a alguien de la comunidad de Celo que lo invite.\n\nAl unirse a esta aplicación, acuerda compartir su nombre y número telefónico con nosotros. Obtenga más información en celo.org", + "Ingresegcódigo de invitación. Si no tiene uno, pídale a alguien de la comunidad de Celo que lo invite.\n\nAl unirse a esta aplicación, acuerda compartir tu nombre y número telefónico con nosotros. Obtenga más información en celo.org", "fullName": "Nombre completo", "invitationCode": "Código de invitación", "submit": "Enviar", "alreadyHaveWallet": "¿Ya tiene un Monedero Celo? Restáurelo", "restoreWallet": "Restaurar el Monedero Celo", "restoreYourWallet": { - "title": "Restaurar su Monedero Celo", + "title": "Restaurar tu Monedero Celo", "userYourBackupKey": - "¿Ya tiene un Monedero Celo? Use su clave de respaldo segura para restaurar su monedero a este teléfono.", + "¿Ya tiene un Monedero Celo? Use tu clave de respaldo segura para restaurar tu monedero a este teléfono.", "warning": "¡Cuidado! ", "restoreInPrivate": "Hágalo en privado" }, diff --git a/packages/mobile/locales/es-AR/nuxVerification2.json b/packages/mobile/locales/es-419/nuxVerification2.json similarity index 78% rename from packages/mobile/locales/es-AR/nuxVerification2.json rename to packages/mobile/locales/es-419/nuxVerification2.json index ede9a0cb343..7164517b535 100755 --- a/packages/mobile/locales/es-AR/nuxVerification2.json +++ b/packages/mobile/locales/es-419/nuxVerification2.json @@ -1,14 +1,14 @@ { "verifyPhone": "Verificar teléfono", "otherCeloUsersFindYou": - "Otros usuarios de Celo pueden utilizar su número telefónico para encontrarlo", - "findOtherCeloUsers": "Aproveche sus contactos para encontrar otros usuarios de Celo verificados", - "verificationCodes": "Recibirá 3 códigos de verificación en poco tiempo", + "Otros usuarios de Celo pueden utilizar tu número de teléfono para encontrarte", + "findOtherCeloUsers": "Aproveche tus contactos para encontrar otros usuarios de Celo verificados", + "verificationCodes": "Recibirás 3 códigos de verificación en poco tiempo", "continue": "Continuar", "enterPhoneToVerify": "Ingrese el número de teléfono y comience la verificación", "smsPermissionsLabel": "Importante ", "smsPermissions": - "Celo le pedirá autorización para ver sus mensajes de texto con el fin de leer los códigos de verificación de manera automática. Quizás corran cargos de su compañía de telefonía celular.", + "Celo le pedirá autorización para ver sus mensajes de texto con el fin de leer los códigos de verificación de manera automática. Quizás corran cargos de tu compañía de telefonía celular.", "enterManually": "Ingresar manualmente", "startVerification": "Empezar a verificar", "country": "País", @@ -19,7 +19,7 @@ "deny": "Denegar", "allow": "Permitir", "mustDoManualLabel": "Nota: ", - "mustDoManual": "¿su teléfono no lee los mensajes de texto? Ingréselos manualmente.", + "mustDoManual": "¿Su teléfono no lee los mensajes de texto? Ingrésalos manualmente.", "waitingForSms": "Solicitud de verificación enviada. Esperando SMS.", "getting1": "Recibiendo código de verificación 1", "getting2": "Recibiendo código de verificación 2", @@ -35,21 +35,21 @@ "invalidVerificationCode": "Código de Verification Inválido", "repeatVerificationCode": "Código de Verificación Repetido", "verificationFailure": "Fallo en la Verificación", - "verificationTimeout": "Verificación se Acabó el Tiempo", + "verificationTimeout": "Verificación no pudo ser verificada a tiempo", "submit": "Enviar", "messages": "Mensajes", "now": "ahora", "garnetVerification": "Código de verificación de Garnet:", "markRead": "Marcar como leído", "reply": "Responder", - "congratsVerified": "¡Felicitaciones se ha verificado su usuario!", + "congratsVerified": "¡Felicitaciones se ha verificadotusuario!", "copyPaste": "Copiar y Pegar ", "entireSmsMessage": "Mensaje completo desde tu SMS", "pasteCode": "Pegar código de verificación {{codeNumber}}", - "startingVerification": "Verificando su número de teléfono", + "startingVerification": "Verificando tu número de teléfono", "nextCode": "Recibiendo el Siguiente Código", "verificationComplete": "Verificación completa", - "leaveOpen": "Por favor dejá la aplicación abierta", + "leaveOpen": "Por favor deja la aplicación abierta", "thisWillTakeTime": "Este proceso llevará unos minutos", "errorRequestCode": "Error al solicitar los códigos.", "errorRedeemingCode": "Error al canjear el código.", diff --git a/packages/mobile/locales/es-AR/paymentRequestFlow.json b/packages/mobile/locales/es-419/paymentRequestFlow.json similarity index 100% rename from packages/mobile/locales/es-AR/paymentRequestFlow.json rename to packages/mobile/locales/es-419/paymentRequestFlow.json diff --git a/packages/mobile/locales/es-AR/receiveFlow8.json b/packages/mobile/locales/es-419/receiveFlow8.json similarity index 100% rename from packages/mobile/locales/es-AR/receiveFlow8.json rename to packages/mobile/locales/es-419/receiveFlow8.json diff --git a/packages/mobile/locales/es-AR/sendFlow7.json b/packages/mobile/locales/es-419/sendFlow7.json similarity index 93% rename from packages/mobile/locales/es-AR/sendFlow7.json rename to packages/mobile/locales/es-419/sendFlow7.json index f20b971cf36..b752a64068d 100755 --- a/packages/mobile/locales/es-AR/sendFlow7.json +++ b/packages/mobile/locales/es-419/sendFlow7.json @@ -22,7 +22,7 @@ "feeEducation": "~Sending payments and making exchanges include a small fee for service security and maintenance.", "learnMore": "Saber más", - "inviteMoneyEscrow": "Mantendremos este dinero seguro hasta que su amigo cree una cuenta en Celo", + "inviteMoneyEscrow": "Mantendremos este dinero seguro hasta que tu amigo cree una cuenta en Celo", "reviewPayment": "Revisar pago", "requestPayment": "Solicitud pago", "continue": "Continuar", @@ -30,7 +30,7 @@ "activity": "Actividad", "exchange": "Cambio", "inviteSendTo": "Invitar y enviar a", - "keepMoneySafe": "Mantendremos este dinero seguro hasta que su amigo cree una cuenta en Celo", + "keepMoneySafe": "Mantendremos este dinero seguro hasta que tu amigo cree una cuenta en Celo", "searchFriends": "Ingrese un número de teléfono si no encuentra a la persona que busca", "inviteVerifyPayment": "Invitar y verificar el pago", "total": "Total", @@ -56,14 +56,14 @@ "ScanCodeByPlacingItInTheBox": "Escanee el código colocándolo en la caja", "needCameraPermissionToScan": "La aplicación necesita permiso de la cámara para escanear códigos QR", - "showYourQRCode": "Muestra su código QR", + "showYourQRCode": "Muestra tu código QR", "toSentOrRequestPayment": "enviar o solicitar pago", "requestSent": "Solicitud Enviada", "reclaimPayment": "Reclamar el Pago", "totalSent": "Total Enviado", "totalRefunded": "Total Reembolsado", "loadingVerificationStatus": "Comprobando la verificación del destinatario", - "askForContactsPermissionAction": "Recuperar mis contactos", + "askForContactsPermissionAction": "Accede a tus contactos", "newAccountBalance": "Nuevo saldo de cuenta: ", "estimatingFee": "Estimando tarifa ", "estimatedFee": "Tarifa estimada: " diff --git a/packages/mobile/locales/es-AR/walletFlow5.json b/packages/mobile/locales/es-419/walletFlow5.json similarity index 66% rename from packages/mobile/locales/es-AR/walletFlow5.json rename to packages/mobile/locales/es-419/walletFlow5.json index 6af69a4286b..b9a9857d939 100755 --- a/packages/mobile/locales/es-AR/walletFlow5.json +++ b/packages/mobile/locales/es-419/walletFlow5.json @@ -7,21 +7,19 @@ "notifications": "Notificaciones", "getBackupKey": "Obtener clave de respaldo", "setBackupKey": - "Configure su clave de respaldo para mejorar la seguridad y habilitar la recuperación de la cuenta", + "Configure tu clave de respaldo para mejorar la seguridad y habilitar la recuperación de la cuenta", "activity": "Actividad", "wallet": "Monedero", "send": "Envío", "sent": "Envió", - "sentTo": "Enviado a {{address}}", "received": "Recibido", - "receivedFrom": "Recibido de {{address}}", "pending": "Pendiente", "exchange": "Cambio", "review": "Revisión", "thanksForVerifying": "Gracias por completar la verificación", "earnCeloRewards": "Gana Recompensas Celo por verificar a otros", "earnCeloGold": - "Gane Celo Oro al permitir que la red envíe mensajes de verificación desde su teléfono", + "Gane Celo Oro al permitir que la red envíe mensajes de verificación desde tu teléfono", "startEarning": "Comenzar a ganar", "learnMore": "Saber más", "goldIsWhereYouSave": "Convierta sus {{CeloDollars}} en Celo Oro", @@ -30,20 +28,17 @@ "at": "a las", "bikeParts": "Repuestos de bicicleta", "groceryRun": "Supermercado", - "verifyReward": "Recompensa por verificar", "transactionsAreLoading": "Las transacciones están cargando!", "pleaseHoldOn": "Por favor esperá un momento", "welcomeToCeloPayments": "Bienvenido a Pagos Celo", "letsGetStartedByFirstTransaction": "Empezemos enviando tu primera transacción", "sendMoney": "Enviar Dinero", "verificationFee": "Tasa de Verificación", - "invited": "Invitado", - "verifierReward": "Recompensa del Verificador", - "confirmingPayment": "Confirmando el Pago", - "confirmingExchange": "Confirmando el Intercambio", + "confirmingPayment": "Confirmando…", + "confirmingExchange": "Confirmando…", "paymentFailed": "Pago Falló", "exchangeFailed": "Intercambio Falló", - "loadingActivity": "Cargando su Actividad", + "loadingActivity": "Cargando tu Actividad", "errorLoadingActivity": { "0": "No se puede cargar tu actividad", "1": "Por favor inténtalo de nuevo más tarde" @@ -61,5 +56,21 @@ "1": "Un recordatorio amistoso de que está utilizando una compilación de Testnet - los saldos aquí no son reales." }, - "dismiss": "Ocultar" + "dismiss": "Ocultar", + "localCurrencyEqual": "Igual a <2>{{localValue}} {{localCurrencySymbol}}", + "localCurrencyValue": "{{localValue}} {{localCurrencySymbol}}", + "feedItemVerificationFeeTitle": "Celo", + "feedItemVerificationFeeInfo": "$t(verificationFee)", + "feedItemVerificationRewardTitle": "Celo", + "feedItemVerificationRewardInfo": "Recompensa del Verificador", + "feedItemFaucetTitle": "Celo", + "feedItemFaucetInfo": "{{faucet}} Faucet", + "feedItemFaucetInfo_missingTestnet": "Faucet", + "feedItemInviteSentTitle": "Celo", + "feedItemInviteSentInfo": "Invitado {{nameOrNumber}}", + "feedItemInviteSentInfo_missingInviteeDetails": "$t(inviteFlow11:inviteSent)", + "feedItemInviteReceivedTitle": "Celo", + "feedItemInviteReceivedInfo": "$t(inviteFlow11:inviteReceived)", + "feedItemReceivedTitle_missingSenderDetails": "Pago Recibido", + "feedItemSentTitle_missingReceiverDetails": "Pago Enviado" } diff --git a/packages/mobile/locales/es-AR/index.ts b/packages/mobile/locales/es-AR/index.ts deleted file mode 100644 index a90360f7c2e..00000000000 --- a/packages/mobile/locales/es-AR/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import accountScreen10 from '@celo/mobile/locales/es-AR/accountScreen10.json' -import backupKeyFlow6 from '@celo/mobile/locales/es-AR/backupKeyFlow6.json' -import exchangeFlow9 from '@celo/mobile/locales/es-AR/exchangeFlow9.json' -import global from '@celo/mobile/locales/es-AR/global.json' -import inviteFlow11 from '@celo/mobile/locales/es-AR/inviteFlow11.json' -import nuxCurrencyPhoto4 from '@celo/mobile/locales/es-AR/nuxCurrencyPhoto4.json' -import nuxNamePin1 from '@celo/mobile/locales/es-AR/nuxNamePin1.json' -import nuxRestoreWallet3 from '@celo/mobile/locales/es-AR/nuxRestoreWallet3.json' -import nuxVerification2 from '@celo/mobile/locales/es-AR/nuxVerification2.json' -import paymentRequestFlow from '@celo/mobile/locales/es-AR/paymentRequestFlow.json' -import receiveFlow8 from '@celo/mobile/locales/es-AR/receiveFlow8.json' -import sendFlow7 from '@celo/mobile/locales/es-AR/sendFlow7.json' -import walletFlow5 from '@celo/mobile/locales/es-AR/walletFlow5.json' - -export default { - accountScreen10, - backupKeyFlow6, - exchangeFlow9, - global, - inviteFlow11, - nuxCurrencyPhoto4, - nuxNamePin1, - nuxRestoreWallet3, - nuxVerification2, - paymentRequestFlow, - receiveFlow8, - sendFlow7, - walletFlow5, -} diff --git a/packages/mobile/locales/index.ts b/packages/mobile/locales/index.ts index 888b222492d..0549415a6b3 100644 --- a/packages/mobile/locales/index.ts +++ b/packages/mobile/locales/index.ts @@ -1,4 +1,4 @@ import enUS from 'locales/en-US' -import esAR from 'locales/es-AR' +import es_419 from 'locales/es-419' -export default { enUS, esAR } +export default { enUS, es_419 } diff --git a/packages/mobile/package.json b/packages/mobile/package.json index cfb6988720d..fd39c536f7e 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@celo/mobile", - "version": "1.4.1", + "version": "1.4.2", "author": "Celo", "license": "Apache-2.0", "private": true, @@ -47,7 +47,7 @@ ] }, "dependencies": { - "@celo/client": "db08804", + "@celo/client": "288e163", "@celo/react-native-sms-retriever": "git+https://github.com/celo-org/react-native-sms-retriever#d3a2fdb", "@celo/utils": "^0.0.6-beta5", "@celo/walletkit": "^0.0.14", @@ -66,7 +66,7 @@ "dot-prop-immutable": "^1.4.0", "ethereumjs-util": "^5.2.0", "fuzzysort": "^1.1.4", - "google-libphonenumber": "^3.2.1", + "google-libphonenumber": "^3.2.4", "graphql": "^14.1.1", "i18next": "^11.9.1", "instabug-reactnative": "^8.4.3", @@ -95,7 +95,7 @@ "react-native-fs": "^2.12.1", "react-native-gesture-handler": "^1.1.0", "react-native-geth": "git+https://github.com/celo-org/react-native-geth#51dc4f1", - "react-native-install-referrer": "^1.0.1", + "react-native-install-referrer": "git://github.com/celo-org/react-native-install-referrer#343bf3d", "react-native-keep-awake": "^3.0.1", "react-native-keyboard-aware-scroll-view": "^0.6.0", "react-native-languages": "^3.0.1", @@ -114,7 +114,7 @@ "react-native-shadow": "^1.2.2", "react-native-share": "^1.1.3", "react-native-splash-screen": "^3.1.1", - "react-native-svg": "^9.3.6", + "react-native-svg": "^9.8.4", "react-native-swiper": "^1.5.13", "react-native-system-clock": "^1.0.0", "react-native-tcp": "git://github.com/cmcewen/react-native-tcp#08f03c2", @@ -129,7 +129,7 @@ "redux-thunk": "^2.2.0", "reselect": "^3.0.1", "sleep-promise": "^8.0.1", - "svgs": "^3.2.1", + "svgs": "^4.1.0", "tslib": "^1.9.1", "utf8": "^3.0.0", "vm-browserify": "^1.0.1", diff --git a/packages/mobile/scripts/verify_locales.sh b/packages/mobile/scripts/verify_locales.sh index 8710a934f99..2314000d399 100755 --- a/packages/mobile/scripts/verify_locales.sh +++ b/packages/mobile/scripts/verify_locales.sh @@ -10,7 +10,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")" filter='paths | join(".") | [(input_filename | gsub(".*/|\\.json$";"")), .] | join("/")' en_keys=$(jq -r "$filter" ../locales/en-US/*.json | sort) -es_keys=$(jq -r "$filter" ../locales/es-AR/*.json | sort) +es_keys=$(jq -r "$filter" ../locales/es-419/*.json | sort) diff <(echo "$en_keys") <(echo "$es_keys") diff --git a/packages/mobile/src/account/Account.tsx b/packages/mobile/src/account/Account.tsx index c128276c142..19daafe8cff 100644 --- a/packages/mobile/src/account/Account.tsx +++ b/packages/mobile/src/account/Account.tsx @@ -9,11 +9,12 @@ import { Clipboard, ScrollView, StyleSheet, Text, TouchableOpacity, View } from import DeviceInfo from 'react-native-device-info' import { Sentry } from 'react-native-sentry' import { connect } from 'react-redux' -import AccountInfo from 'src/account/AccountInfo' +import { devModeTriggerClicked } from 'src/account/actions' import SettingsItem from 'src/account/SettingsItem' import CeloAnalytics from 'src/analytics/CeloAnalytics' import { CustomEventNames } from 'src/analytics/constants' import { resetAppOpenedState, setAnalyticsEnabled, setNumberVerified } from 'src/app/actions' +import { AvatarSelf } from 'src/components/AvatarSelf' import { FAQ_LINK, TOS_LINK } from 'src/config' import { features } from 'src/flags' import { Namespaces } from 'src/i18n' @@ -32,6 +33,7 @@ interface DispatchProps { setNumberVerified: typeof setNumberVerified resetAppOpenedState: typeof resetAppOpenedState setAnalyticsEnabled: typeof setAnalyticsEnabled + devModeTriggerClicked: typeof devModeTriggerClicked } interface StateProps { @@ -61,6 +63,7 @@ const mapDispatchToProps = { setNumberVerified, resetAppOpenedState, setAnalyticsEnabled, + devModeTriggerClicked, } export class Account extends React.Component { @@ -137,7 +140,7 @@ export class Account extends React.Component { } } - onCopyAddressClick = () => { + onPressAddress = () => { const { account, t } = this.props if (!account) { return @@ -146,6 +149,10 @@ export class Account extends React.Component { Logger.showMessage(t('addressCopied')) } + onPressAvatar = () => { + this.props.devModeTriggerClicked() + } + getDevSettingsComp() { const { devModeActive } = this.props const { verified } = this.state @@ -195,9 +202,11 @@ export class Account extends React.Component { - + + + - + {account} diff --git a/packages/mobile/src/account/AccountInfo.test.tsx b/packages/mobile/src/account/AccountInfo.test.tsx deleted file mode 100644 index 5fb8939b550..00000000000 --- a/packages/mobile/src/account/AccountInfo.test.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import * as React from 'react' -import 'react-native' -import { Provider } from 'react-redux' -import * as renderer from 'react-test-renderer' -import AccountInfo from 'src/account/AccountInfo' -import { createMockStore } from 'test/utils' - -describe('AccountInfo', () => { - it('renders correctly', () => { - const store = createMockStore({ - account: { photosNUXClicked: true }, - }) - const tree = renderer.create( - - - - ) - expect(tree).toMatchSnapshot() - }) - - it('renders correctly', () => { - const store = createMockStore({ - account: { name: '' }, - }) - const tree = renderer.create( - - - - ) - expect(tree).toMatchSnapshot() - }) - - it('renders correctly', () => { - const store = createMockStore({ - account: { e164PhoneNumber: '' }, - }) - const tree = renderer.create( - - - - ) - expect(tree).toMatchSnapshot() - }) - - it('renders correctly', () => { - const store = createMockStore({ - account: { name: '', e164PhoneNumber: '' }, - }) - const tree = renderer.create( - - - - ) - expect(tree).toMatchSnapshot() - }) -}) diff --git a/packages/mobile/src/account/AccountInfo.tsx b/packages/mobile/src/account/AccountInfo.tsx deleted file mode 100644 index c9472e0e0ba..00000000000 --- a/packages/mobile/src/account/AccountInfo.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import ContactCircle from '@celo/react-components/components/ContactCircle' -import PhoneNumberWithFlag from '@celo/react-components/components/PhoneNumberWithFlag' -import QRCode from '@celo/react-components/icons/QRCode' -import { fontStyles } from '@celo/react-components/styles/fonts' -import * as React from 'react' -import { StyleSheet, Text, TouchableOpacity, View } from 'react-native' -import { connect } from 'react-redux' -import { devModeTriggerClicked } from 'src/account/actions' -import { getUserContactDetails, UserContactDetails } from 'src/account/reducer' -import CeloAnalytics from 'src/analytics/CeloAnalytics' -import { CustomEventNames } from 'src/analytics/constants' -import { componentWithAnalytics } from 'src/analytics/wrapper' -import { navigate } from 'src/navigator/NavigationService' -import { Screens } from 'src/navigator/Screens' -import { RootState } from 'src/redux/reducers' - -interface DispatchProps { - devModeTriggerClicked: typeof devModeTriggerClicked -} - -interface StateProps { - name: string - e164Number: string - photosNUXClicked: boolean - userContact: UserContactDetails - devModeActive: boolean - defaultCountryCode: string -} - -type Props = StateProps & DispatchProps - -const mapStateToProps = (state: RootState) => { - return { - name: state.account.name, - e164Number: state.account.e164PhoneNumber, - photosNUXClicked: state.account.photosNUXClicked, - userContact: getUserContactDetails(state), - devModeActive: state.account.devModeActive || false, - defaultCountryCode: state.account.defaultCountryCode, - } -} - -export class AccountInfo extends React.Component { - handleNameClicked = () => { - this.props.devModeTriggerClicked() - } - - handlePhotoClicked = () => { - const { photosNUXClicked } = this.props - if (!photosNUXClicked) { - CeloAnalytics.track(CustomEventNames.photos_education) - navigate(Screens.PhotosEducation) - } else { - CeloAnalytics.track(CustomEventNames.qrcode_main_screen_visit) - navigate(Screens.QRCode) - } - } - - render() { - const { name, e164Number, userContact, defaultCountryCode } = this.props - - return ( - - - - - - - - {!!name && ( - - {name} - - )} - {!!e164Number && ( - - )} - - ) - } -} - -const style = StyleSheet.create({ - accountProfile: { - alignItems: 'center', - }, - photosNUX: { - flexDirection: 'row', - alignItems: 'flex-end', - overflow: 'visible', - padding: 10, - }, - qrcode: { - position: 'absolute', - right: 5, - bottom: 5, - zIndex: 10, - }, - nameText: { - paddingTop: 10, - }, - dot: { - position: 'absolute', - right: -15, - bottom: 25, - zIndex: 20, - }, -}) - -export default componentWithAnalytics( - connect( - mapStateToProps, - { devModeTriggerClicked } - )(AccountInfo) -) diff --git a/packages/mobile/src/account/DollarEducation.tsx b/packages/mobile/src/account/DollarEducation.tsx index bd5b0b66848..ecd97d49cd2 100644 --- a/packages/mobile/src/account/DollarEducation.tsx +++ b/packages/mobile/src/account/DollarEducation.tsx @@ -6,7 +6,7 @@ import { CustomEventNames } from 'src/analytics/constants' import { componentWithAnalytics } from 'src/analytics/wrapper' import { sendBetweenPhones, sendFee, stabilityScale } from 'src/images/Images' import { navigate, navigateHome } from 'src/navigator/NavigationService' -import { Screens } from 'src/navigator/Screens' +import { Stacks } from 'src/navigator/Screens' import { setEducationCompleted } from 'src/stableToken/actions' interface DispatchProps { @@ -21,7 +21,7 @@ export class DollarEducation extends React.Component { goToSend = () => { this.props.setEducationCompleted() CeloAnalytics.track(CustomEventNames.send_dollar_nux) - navigate(Screens.Send) + navigate(Stacks.SendStack) } goToWalletHome = () => { diff --git a/packages/mobile/src/account/InviteReview.tsx b/packages/mobile/src/account/InviteReview.tsx index 3e0f8f82ba0..79d4edd9add 100644 --- a/packages/mobile/src/account/InviteReview.tsx +++ b/packages/mobile/src/account/InviteReview.tsx @@ -182,6 +182,7 @@ export class InviteReview extends React.Component { return ( { return { name: state.account.name, - userContact: getUserContactDetails(state), + userContact: userContactDetailsSelector(state), } } diff --git a/packages/mobile/src/account/__snapshots__/Account.test.tsx.snap b/packages/mobile/src/account/__snapshots__/Account.test.tsx.snap index 42d029fc3d5..3caa9563788 100644 --- a/packages/mobile/src/account/__snapshots__/Account.test.tsx.snap +++ b/packages/mobile/src/account/__snapshots__/Account.test.tsx.snap @@ -20,28 +20,26 @@ exports[`Account renders correctly 1`] = ` } > @@ -53,7 +51,10 @@ exports[`Account renders correctly 1`] = ` "flexDirection": "row", "justifyContent": "center", }, - undefined, + Object { + "alignSelf": "center", + "margin": "auto", + }, ] } > @@ -66,175 +67,54 @@ exports[`Account renders correctly 1`] = ` }, Object { "backgroundColor": "#7AD6FE", - "borderRadius": 27.5, - "height": 55, - "width": 55, + "borderRadius": 20, + "height": 40, + "width": 40, }, ] } > - - J - - - - - - - - - - - - - - + - - - John Doe - - - +1 - - - (415) 555-6666 + John Doe @@ -956,28 +836,26 @@ exports[`Account when dev mode active renders correctly 1`] = ` } > @@ -989,7 +867,10 @@ exports[`Account when dev mode active renders correctly 1`] = ` "flexDirection": "row", "justifyContent": "center", }, - undefined, + Object { + "alignSelf": "center", + "margin": "auto", + }, ] } > @@ -1002,175 +883,54 @@ exports[`Account when dev mode active renders correctly 1`] = ` }, Object { "backgroundColor": "#7AD6FE", - "borderRadius": 27.5, - "height": 55, - "width": 55, + "borderRadius": 20, + "height": 40, + "width": 40, }, ] } > - - J - - - - - - - - - - - - - - + - - - John Doe - - - +1 - - - (415) 555-6666 + John Doe diff --git a/packages/mobile/src/account/__snapshots__/AccountInfo.test.tsx.snap b/packages/mobile/src/account/__snapshots__/AccountInfo.test.tsx.snap deleted file mode 100644 index 104f9e429c8..00000000000 --- a/packages/mobile/src/account/__snapshots__/AccountInfo.test.tsx.snap +++ /dev/null @@ -1,759 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AccountInfo renders correctly 1`] = ` - - - - - - J - - - - - - - - - - - - - - - - - - John Doe - - - - +1 - - - (415) 555-6666 - - - -`; - -exports[`AccountInfo renders correctly 2`] = ` - - - - - - # - - - - - - - - - - - - - - - - - - - +1 - - - (415) 555-6666 - - - -`; - -exports[`AccountInfo renders correctly 3`] = ` - - - - - - J - - - - - - - - - - - - - - - - - - John Doe - - -`; - -exports[`AccountInfo renders correctly 4`] = ` - - - - - - # - - - - - - - - - - - - - - - - - -`; diff --git a/packages/mobile/src/account/__snapshots__/DollarEducation.test.tsx.snap b/packages/mobile/src/account/__snapshots__/DollarEducation.test.tsx.snap index eaa09c57711..2ee94f54cad 100644 --- a/packages/mobile/src/account/__snapshots__/DollarEducation.test.tsx.snap +++ b/packages/mobile/src/account/__snapshots__/DollarEducation.test.tsx.snap @@ -133,6 +133,7 @@ exports[`DollarEducation renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -177,6 +178,7 @@ exports[`DollarEducation renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -221,6 +223,7 @@ exports[`DollarEducation renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, diff --git a/packages/mobile/src/account/__snapshots__/Education.test.tsx.snap b/packages/mobile/src/account/__snapshots__/Education.test.tsx.snap index ec9852ccb9b..43c130c752e 100644 --- a/packages/mobile/src/account/__snapshots__/Education.test.tsx.snap +++ b/packages/mobile/src/account/__snapshots__/Education.test.tsx.snap @@ -129,6 +129,7 @@ exports[`Education renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, diff --git a/packages/mobile/src/account/__snapshots__/GoldEducation.test.tsx.snap b/packages/mobile/src/account/__snapshots__/GoldEducation.test.tsx.snap index a6c38fa31e3..daea167ba0f 100644 --- a/packages/mobile/src/account/__snapshots__/GoldEducation.test.tsx.snap +++ b/packages/mobile/src/account/__snapshots__/GoldEducation.test.tsx.snap @@ -133,6 +133,7 @@ exports[`GoldEducation renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -177,6 +178,7 @@ exports[`GoldEducation renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -221,6 +223,7 @@ exports[`GoldEducation renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, diff --git a/packages/mobile/src/account/__snapshots__/Invite.test.tsx.snap b/packages/mobile/src/account/__snapshots__/Invite.test.tsx.snap index 849499fbf47..957f764b21f 100644 --- a/packages/mobile/src/account/__snapshots__/Invite.test.tsx.snap +++ b/packages/mobile/src/account/__snapshots__/Invite.test.tsx.snap @@ -529,22 +529,21 @@ exports[`Invite renders correctly with recipients 1`] = ` ] } > - - J - + /> - - # - + /> - #000000000000000... + John Doe = 5, + devModeActive: newClickCount >= 3, } case Actions.PHOTOSNUX_CLICKED: return { @@ -124,7 +124,8 @@ export const reducer = (state: State | undefined = initialState, action: ActionT } export const devModeSelector = (state: RootState) => state.account.devModeActive +export const nameSelector = (state: RootState) => state.account.name export const e164NumberSelector = (state: RootState) => state.account.e164PhoneNumber export const defaultCountryCodeSelector = (state: RootState) => state.account.defaultCountryCode -export const getUserContactDetails = (state: RootState) => state.account.contactDetails +export const userContactDetailsSelector = (state: RootState) => state.account.contactDetails export const pincodeSelector = (state: RootState) => state.account.pincodeSet diff --git a/packages/mobile/src/analytics/constants.ts b/packages/mobile/src/analytics/constants.ts index c3af3f0c3ac..31c7370b351 100644 --- a/packages/mobile/src/analytics/constants.ts +++ b/packages/mobile/src/analytics/constants.ts @@ -31,6 +31,12 @@ export enum CustomEventNames { send_invite = 'send_invite', edit_send_invite = 'edit_send_invite', + // Send events, separate from button tracking above + send_dollar_transaction = 'send_dollar_transaction', + send_dollar_transaction_confirmed = 'send_dollar_transaction_confirmed', + + fetch_balance = 'fetch_balance', + // Verification event and sub-events verification = 'verification', verification_setup = 'verification_setup', @@ -50,6 +56,11 @@ export enum CustomEventNames { verification_success = 'verification_success', verification_timed_out = 'verification_timed_out', + verification_actionable_attestation_start = 'verification_actionable_attestation_start', + verification_actionable_attestation_finish = 'verification_actionable_attestation_finish', + verification_validate_code_start = 'verification_validate_code_start', + verification_validate_code_finish = 'verification_validate_code_finish', + redeem_invite_success = 'redeem_invite_success', redeem_invite_timed_out = 'redeem_invite_timed_out', redeem_invite_failed = 'redeem_invite_failed', @@ -153,6 +164,12 @@ export enum CustomEventNames { // QR Code qrcode_main_screen_visit = 'qrcode_main_screen_visit', + + // Performance + transaction_send_start = 'transaction_send_start', + transaction_send_gas_estimated = 'transaction_send_gas_estimated', + transaction_send_gas_hash_received = 'transaction_send_gas_hash_received', + transaction_send_gas_receipt = 'transaction_send_gas_receipt', } export enum CommonValues { @@ -179,6 +196,7 @@ export const PROPERTY_PATH_WHITELIST = [ 'goldPendingBalance', 'inviteCode', 'isCorrect', + 'issuer', 'label', 'language', 'makerAmount', @@ -209,6 +227,7 @@ export const PROPERTY_PATH_WHITELIST = [ 'testnet', 'timeElapsed', 'title', + 'txId', 'verificationIndex', 'verificationsRemaining', ] diff --git a/packages/mobile/src/apollo/__mockData__.ts b/packages/mobile/src/apollo/__mockData__.ts index 34b149059bb..7ed67551a4d 100644 --- a/packages/mobile/src/apollo/__mockData__.ts +++ b/packages/mobile/src/apollo/__mockData__.ts @@ -5,12 +5,13 @@ import { UserTransactionsData, } from 'src/apollo/types' import { SENTINEL_INVITE_COMMENT } from 'src/invite/actions' +import { TransactionTypes } from 'src/transactions/reducer' export const invitedAddress = '0x1b173' const exchangeDollar: HomeExchangeFragment = { __typename: EventTypeNames.Exchange, - type: 'Exchange', + type: 'EXCHANGE' as TransactionTypes, hash: '1', inValue: 19080, timestamp: Date.now(), @@ -21,7 +22,7 @@ const exchangeDollar: HomeExchangeFragment = { const exchangeGold: HomeExchangeFragment = { __typename: EventTypeNames.Exchange, - type: 'Exchange', + type: 'EXCHANGE' as TransactionTypes, hash: '1', inValue: 190, timestamp: Date.now(), @@ -32,7 +33,7 @@ const exchangeGold: HomeExchangeFragment = { const sent: HomeTransferFragment = { __typename: EventTypeNames.Transfer, - type: 'SENT', + type: 'SENT' as TransactionTypes, value: 987161, symbol: 'Celo Gold', timestamp: Date.now(), @@ -43,7 +44,7 @@ const sent: HomeTransferFragment = { const sentInvite: HomeTransferFragment = { __typename: EventTypeNames.Transfer, - type: 'SENT', + type: 'SENT' as TransactionTypes, value: 0.33, symbol: 'Celo Dollar', timestamp: Date.now(), @@ -54,7 +55,7 @@ const sentInvite: HomeTransferFragment = { const recieved: HomeTransferFragment = { __typename: EventTypeNames.Transfer, - type: 'RECEIVED', + type: 'RECEIVED' as TransactionTypes, value: 587161, symbol: 'Celo Gold', timestamp: Date.now(), @@ -64,7 +65,7 @@ const recieved: HomeTransferFragment = { } const faucet: HomeTransferFragment = { __typename: EventTypeNames.Transfer, - type: 'FAUCET', + type: 'FAUCET' as TransactionTypes, value: 387161, symbol: 'Celo Dollar', timestamp: Date.now(), @@ -74,7 +75,7 @@ const faucet: HomeTransferFragment = { } const verificationFee: HomeTransferFragment = { __typename: EventTypeNames.Transfer, - type: 'VERIFICATION_FEE', + type: 'VERIFICATION_FEE' as TransactionTypes, value: 0.3, symbol: 'Celo Gold', timestamp: Date.now(), @@ -84,7 +85,7 @@ const verificationFee: HomeTransferFragment = { } const verificationReward: HomeTransferFragment = { __typename: EventTypeNames.Transfer, - type: 'VERIFICATION_REWARD', + type: 'VERIFICATION_REWARD' as TransactionTypes, value: 9371, symbol: 'Celo Dollar', timestamp: Date.now(), diff --git a/packages/mobile/src/apollo/types.ts b/packages/mobile/src/apollo/types.ts index a8e17b9a156..d3d57b23ad0 100644 --- a/packages/mobile/src/apollo/types.ts +++ b/packages/mobile/src/apollo/types.ts @@ -1,4 +1,5 @@ import { Query } from 'react-apollo' +import { TransactionTypes } from 'src/transactions/reducer' export interface UserTransactionsVariables { address: string @@ -11,7 +12,7 @@ export enum EventTypeNames { export interface HomeExchangeFragment { __typename: EventTypeNames.Exchange - type: string + type: TransactionTypes hash: string inValue: number outValue: number @@ -22,7 +23,7 @@ export interface HomeExchangeFragment { export interface HomeTransferFragment { __typename: EventTypeNames.Transfer - type: string + type: TransactionTypes hash: string value: number symbol: string diff --git a/packages/mobile/src/app/__snapshots__/ErrorScreen.test.tsx.snap b/packages/mobile/src/app/__snapshots__/ErrorScreen.test.tsx.snap index e821806bc4b..90f5d12f6ab 100644 --- a/packages/mobile/src/app/__snapshots__/ErrorScreen.test.tsx.snap +++ b/packages/mobile/src/app/__snapshots__/ErrorScreen.test.tsx.snap @@ -22,6 +22,7 @@ exports[`ErrorScreen with errorMessage renders correctly 1`] = ` { this.props.exitBackupFlow() } - // TODO(Rossy): Move out of here into a saga retrieveMnemonic = async () => { if (this.state.mnemonic) { return } try { - const mnemonic = await getKey('mnemonic') + const mnemonic = await getStoredMnemonic() if (!mnemonic) { throw new Error('Mnemonic not stored in key store') } diff --git a/packages/mobile/src/backup/BackupComplete.tsx b/packages/mobile/src/backup/BackupComplete.tsx index 3cb97979ead..fcdf6b38339 100644 --- a/packages/mobile/src/backup/BackupComplete.tsx +++ b/packages/mobile/src/backup/BackupComplete.tsx @@ -87,7 +87,7 @@ const styles = StyleSheet.create({ }, h1: { color: colors.dark, - paddingTop: 35, + paddingTop: 25, }, copyToClipboardButton: { marginTop: 50, diff --git a/packages/mobile/src/backup/__snapshots__/Backup.test.tsx.snap b/packages/mobile/src/backup/__snapshots__/Backup.test.tsx.snap index b4b24b3c612..42c07ec8412 100644 --- a/packages/mobile/src/backup/__snapshots__/Backup.test.tsx.snap +++ b/packages/mobile/src/backup/__snapshots__/Backup.test.tsx.snap @@ -25,8 +25,7 @@ exports[`Backup renders correctly if backup completed 1`] = ` Array [ Object { "alignItems": "center", - "marginBottom": 25, - "marginTop": 25, + "marginBottom": 20, }, Object {}, ] @@ -41,8 +40,8 @@ exports[`Backup renders correctly if backup completed 1`] = ` } style={ Object { - "height": 50, - "width": 50, + "height": 35, + "width": 35, } } /> @@ -51,6 +50,7 @@ exports[`Backup renders correctly if backup completed 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -58,7 +58,7 @@ exports[`Backup renders correctly if backup completed 1`] = ` }, Object { "color": "#2E3338", - "paddingTop": 35, + "paddingTop": 25, }, ] } @@ -92,6 +92,7 @@ exports[`Backup renders correctly if backup completed 1`] = ` @@ -326,6 +327,7 @@ exports[`Backup renders correctly if backup not completed 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, diff --git a/packages/mobile/src/backup/__snapshots__/BackupComplete.test.tsx.snap b/packages/mobile/src/backup/__snapshots__/BackupComplete.test.tsx.snap index a7277c3dcca..5c3ac68713d 100644 --- a/packages/mobile/src/backup/__snapshots__/BackupComplete.test.tsx.snap +++ b/packages/mobile/src/backup/__snapshots__/BackupComplete.test.tsx.snap @@ -25,8 +25,7 @@ exports[`BackupComplete renders correctly if backup completed 1`] = ` Array [ Object { "alignItems": "center", - "marginBottom": 25, - "marginTop": 25, + "marginBottom": 20, }, Object {}, ] @@ -41,8 +40,8 @@ exports[`BackupComplete renders correctly if backup completed 1`] = ` } style={ Object { - "height": 50, - "width": 50, + "height": 35, + "width": 35, } } /> @@ -51,6 +50,7 @@ exports[`BackupComplete renders correctly if backup completed 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -58,7 +58,7 @@ exports[`BackupComplete renders correctly if backup completed 1`] = ` }, Object { "color": "#2E3338", - "paddingTop": 35, + "paddingTop": 25, }, ] } @@ -92,6 +92,7 @@ exports[`BackupComplete renders correctly if backup completed 1`] = ` @@ -290,6 +290,7 @@ exports[`BackupComplete renders correctly if backup not completed 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -297,7 +298,7 @@ exports[`BackupComplete renders correctly if backup not completed 1`] = ` }, Object { "color": "#2E3338", - "paddingTop": 35, + "paddingTop": 25, }, ] } diff --git a/packages/mobile/src/backup/__snapshots__/BackupIntroduction.test.tsx.snap b/packages/mobile/src/backup/__snapshots__/BackupIntroduction.test.tsx.snap index b32b7a674a2..fbd6ebfd629 100644 --- a/packages/mobile/src/backup/__snapshots__/BackupIntroduction.test.tsx.snap +++ b/packages/mobile/src/backup/__snapshots__/BackupIntroduction.test.tsx.snap @@ -14,7 +14,7 @@ exports[`BackupIntroduction renders correctly when backup is not too late 1`] = @@ -87,6 +87,7 @@ exports[`BackupIntroduction renders correctly when backup is not too late 1`] = style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -510,7 +511,7 @@ exports[`BackupIntroduction renders correctly when backup too late and delayed 1 @@ -583,6 +584,7 @@ exports[`BackupIntroduction renders correctly when backup too late and delayed 1 style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -934,7 +936,7 @@ exports[`BackupIntroduction renders correctly when backup too late and no delay @@ -1007,6 +1009,7 @@ exports[`BackupIntroduction renders correctly when backup too late and no delay style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, diff --git a/packages/mobile/src/backup/__snapshots__/BackupPhrase.test.tsx.snap b/packages/mobile/src/backup/__snapshots__/BackupPhrase.test.tsx.snap index 86fff093ecf..86ed645f2b0 100644 --- a/packages/mobile/src/backup/__snapshots__/BackupPhrase.test.tsx.snap +++ b/packages/mobile/src/backup/__snapshots__/BackupPhrase.test.tsx.snap @@ -13,7 +13,7 @@ exports[`renders correctly 1`] = ` @@ -91,6 +91,7 @@ exports[`renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -148,6 +149,7 @@ exports[`renders correctly 1`] = ` @@ -82,6 +82,7 @@ exports[`renders correctly on 1st question 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -685,7 +686,7 @@ exports[`renders correctly on 2nd word 1`] = ` @@ -754,6 +755,7 @@ exports[`renders correctly on 2nd word 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -1357,7 +1359,7 @@ exports[`renders correctly on 3rd word 1`] = ` @@ -1426,6 +1428,7 @@ exports[`renders correctly on 3rd word 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -2029,7 +2032,7 @@ exports[`renders correctly on 3rd word 2`] = ` @@ -2098,6 +2101,7 @@ exports[`renders correctly on 3rd word 2`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -2701,7 +2705,7 @@ exports[`renders correctly on 3rd word 3`] = ` @@ -2770,6 +2774,7 @@ exports[`renders correctly on 3rd word 3`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, diff --git a/packages/mobile/src/backup/utils.ts b/packages/mobile/src/backup/utils.ts index dbf7e760270..5257160009a 100644 --- a/packages/mobile/src/backup/utils.ts +++ b/packages/mobile/src/backup/utils.ts @@ -1,5 +1,10 @@ import { sampleSize } from 'lodash' +import { AsyncStorage } from 'react-native' import { generateMnemonic, wordlists } from 'react-native-bip39' +import { getKey, setKey } from 'src/utils/keyStore' +import Logger from 'src/utils/Logger' + +const TAG = 'Backup/utils' export async function createQuizWordList(mnemonic: string, language: string | null) { const disallowedWordSet = new Set(mnemonic.split(' ')) @@ -42,3 +47,28 @@ export function getWordlist(language: string | null) { } return wordlist } + +// TODO(Rossy) Remove after the next alfa testnet reset +export async function getStoredMnemonic(): Promise { + try { + Logger.debug(TAG, 'Checking keystore for mnemonic') + let mnemonic = await getKey('mnemonic') + if (mnemonic) { + return mnemonic + } + + Logger.debug(TAG, 'Mnemonic not found in keystore, checking async storage') + mnemonic = await AsyncStorage.getItem('mnemonic') + if (mnemonic) { + await setKey('mnemonic', mnemonic) + await AsyncStorage.removeItem('mnemonic') + return mnemonic + } + + Logger.error(TAG, 'No mnemonic found') + return null + } catch (error) { + Logger.error(TAG, 'Failed to retrieve mnemonic', error) + return null + } +} diff --git a/packages/mobile/src/components/AccountOverview.tsx b/packages/mobile/src/components/AccountOverview.tsx index a11604f0f94..4bf959fa09d 100644 --- a/packages/mobile/src/components/AccountOverview.tsx +++ b/packages/mobile/src/components/AccountOverview.tsx @@ -1,6 +1,7 @@ import colors from '@celo/react-components/styles/colors' import fontStyles, { estimateFontSize } from '@celo/react-components/styles/fonts' import variables from '@celo/react-components/styles/variables' +import BigNumber from 'bignumber.js' import * as React from 'react' import { withNamespaces, WithNamespaces } from 'react-i18next' import { StyleSheet, Text, TouchableOpacity, View } from 'react-native' @@ -9,7 +10,7 @@ import componentWithAnalytics from 'src/analytics/wrapper' import CurrencyDisplay from 'src/components/CurrencyDisplay' import Styles from 'src/components/Styles' import { ExchangeRatePair } from 'src/exchange/reducer' -import { CURRENCIES, CURRENCY_ENUM as Tokens } from 'src/geth/consts' +import { CURRENCIES, CURRENCY_ENUM } from 'src/geth/consts' import { startBalanceAutorefresh, stopBalanceAutorefresh } from 'src/home/actions' import { Namespaces } from 'src/i18n' import { navigate } from 'src/navigator/NavigationService' @@ -39,8 +40,9 @@ type Props = StateProps & DispatchProps & WithNamespaces & OwnProps const mapStateToProps = (state: RootState): StateProps => { return { exchangeRatePair: state.exchange.exchangeRatePair, - goldEducationCompleted: state.goldToken.educationCompleted, - stableEducationCompleted: state.stableToken.educationCompleted, + // Disable education for now + goldEducationCompleted: true, // state.goldToken.educationCompleted, + stableEducationCompleted: true, // state.stableToken.educationCompleted, goldBalance: state.goldToken.balance, dollarBalance: state.stableToken.balance, } @@ -81,7 +83,7 @@ export class AccountOverview extends React.Component { - {t('global:celoDollars') + ' ' + CURRENCIES[Tokens.DOLLAR].code} + {t('global:celoDollars') + ' ' + CURRENCIES[CURRENCY_ENUM.DOLLAR].code} { style={[style.education, !this.props.stableEducationCompleted && style.dotOffset]} > - {t('global:celoGold') + ' ' + CURRENCIES[Tokens.GOLD].code} + {t('global:celoGold') + ' ' + CURRENCIES[CURRENCY_ENUM.GOLD].code} { style={[style.education, !this.props.goldEducationCompleted && style.dotOffset]} > diff --git a/packages/mobile/src/components/Avatar.tsx b/packages/mobile/src/components/Avatar.tsx index a632019a2df..df4e07974e3 100644 --- a/packages/mobile/src/components/Avatar.tsx +++ b/packages/mobile/src/components/Avatar.tsx @@ -1,34 +1,73 @@ +/** + * Essentially the same as @celo/react-components/components/Avatar but + * retrieves the defaultCountryCode from redux and a fallback to an unknown user + * icon. Must be in mobile since redux & images are in the mobile package. + */ + import { Avatar as BaseAvatar } from '@celo/react-components/components/Avatar' import * as React from 'react' -import { MinimalContact } from 'react-native-contacts' -import { connect } from 'react-redux' -import { RootState } from 'src/redux/reducers' +import { withNamespaces, WithNamespaces } from 'react-i18next' +import { Image, StyleSheet } from 'react-native' +import { useSelector } from 'react-redux' +import { defaultCountryCodeSelector } from 'src/account/reducer' +import { Namespaces } from 'src/i18n' +import { unknownUserIcon } from 'src/images/Images' +import { getRecipientThumbnail, Recipient } from 'src/recipients/recipient' const DEFAULT_ICON_SIZE = 40 -interface Props { - contact?: MinimalContact +interface OwnProps { + recipient?: Recipient + e164Number?: string name?: string address?: string - e164Number?: string - defaultCountryCode: string iconSize?: number } -interface StateProps { - defaultCountryCode: string -} +type Props = OwnProps & WithNamespaces -const mapStateToProps = (state: RootState): StateProps => { - return { - defaultCountryCode: state.account.defaultCountryCode, +function getDisplayName({ name, recipient, e164Number, address, t }: Props) { + if (name) { + return name + } + if (recipient && recipient.displayName) { + return recipient.displayName } + if (e164Number) { + return t('mobileNumber') + } + if (address) { + return t('walletAddress') + } + throw new Error('Invalid avatar props, cannot determine display name') } -// Just a wrapper for convinience which retrieves the defaultCountryCode from redux -function Avatar(props: Props & StateProps) { - return +export function Avatar(props: Props) { + const defaultCountryCode = useSelector(defaultCountryCodeSelector) + const { recipient, e164Number, iconSize = DEFAULT_ICON_SIZE } = props + + return ( + + + + ) } -// TODO(Rossy + Jean) simplify this file with useSelector -export default connect(mapStateToProps)(Avatar) +const style = StyleSheet.create({ + defaultIcon: { + alignSelf: 'center', + margin: 'auto', + }, +}) + +export default withNamespaces(Namespaces.sendFlow7)(Avatar) diff --git a/packages/mobile/src/components/AvatarSelf.tsx b/packages/mobile/src/components/AvatarSelf.tsx new file mode 100644 index 00000000000..1d0e04f7e64 --- /dev/null +++ b/packages/mobile/src/components/AvatarSelf.tsx @@ -0,0 +1,23 @@ +import * as React from 'react' +import { useSelector } from 'react-redux' +import { e164NumberSelector, nameSelector, userContactDetailsSelector } from 'src/account/reducer' +import Avatar from 'src/components/Avatar' +import { RecipientKind, RecipientWithContact } from 'src/recipients/recipient' + +// An avatar for the wallet user themselves +export function AvatarSelf() { + const displayName = useSelector(nameSelector) + const e164PhoneNumber = useSelector(e164NumberSelector) + const contactDetails = useSelector(userContactDetailsSelector) + + // Recipient refering to the wallet user, used for the avatar + const recipient: RecipientWithContact = { + kind: RecipientKind.Contact, + contactId: contactDetails.contactId || 'none', + thumbnailPath: contactDetails.thumbnailPath || undefined, + displayName, + e164PhoneNumber, + } + + return +} diff --git a/packages/mobile/src/components/CurrencyDisplay.tsx b/packages/mobile/src/components/CurrencyDisplay.tsx index 189fa4436ed..30b6107e05b 100644 --- a/packages/mobile/src/components/CurrencyDisplay.tsx +++ b/packages/mobile/src/components/CurrencyDisplay.tsx @@ -1,19 +1,20 @@ import colors from '@celo/react-components/styles/colors' import fontStyles from '@celo/react-components/styles/fonts' +import BigNumber from 'bignumber.js' import * as React from 'react' import { StyleSheet, Text, View } from 'react-native' import { CURRENCIES, CURRENCY_ENUM } from 'src/geth/consts' import { getMoneyDisplayValue } from 'src/utils/formatting' interface Props { - // TODO: Should be Bignumber - amount: string | null | number + amount: BigNumber size: number type: CURRENCY_ENUM } const symbolRatio = 0.6 +// TODO(Rossy) This is mostly duped by MoneyAmount, converge the two export default class CurrencyDisplay extends React.PureComponent { color() { return this.props.type === CURRENCY_ENUM.DOLLAR ? colors.celoGreen : colors.celoGold @@ -28,12 +29,9 @@ export default class CurrencyDisplay extends React.PureComponent { transform: [{ translateY: Math.round(size * 0.1) }], } } - amount() { - return this.props.amount == null ? '0.00' : getMoneyDisplayValue(this.props.amount || 0) - } render() { - const { size, type } = this.props + const { size, type, amount } = this.props const fontSize = size const dollarStyle = { fontSize, lineHeight: Math.round(fontSize * 1.3), color: this.color() } const currencySymbol = CURRENCIES[type].symbol @@ -43,7 +41,7 @@ export default class CurrencyDisplay extends React.PureComponent { {currencySymbol} - {this.amount()} + {getMoneyDisplayValue(amount)} ) diff --git a/packages/mobile/src/components/__snapshots__/AccountOverview.test.tsx.snap b/packages/mobile/src/components/__snapshots__/AccountOverview.test.tsx.snap index 5b3edfbf978..d04e4e73564 100644 --- a/packages/mobile/src/components/__snapshots__/AccountOverview.test.tsx.snap +++ b/packages/mobile/src/components/__snapshots__/AccountOverview.test.tsx.snap @@ -10,7 +10,7 @@ exports[`renders correctly when Dollar education NUX flow hasn't been completed Object { "flexDirection": "row", "paddingBottom": 5, - "paddingHorizontal": 20, + "paddingHorizontal": 32, "paddingTop": 15, "position": "relative", } @@ -249,7 +249,7 @@ exports[`renders correctly when Gold education NUX flow hasn't been completed 1` Object { "flexDirection": "row", "paddingBottom": 5, - "paddingHorizontal": 20, + "paddingHorizontal": 32, "paddingTop": 15, "position": "relative", } @@ -488,7 +488,7 @@ exports[`renders correctly when not ready 1`] = ` Object { "flexDirection": "row", "paddingBottom": 5, - "paddingHorizontal": 20, + "paddingHorizontal": 32, "paddingTop": 15, "position": "relative", } @@ -726,7 +726,7 @@ exports[`renders correctly when ready 1`] = ` Object { "flexDirection": "row", "paddingBottom": 5, - "paddingHorizontal": 20, + "paddingHorizontal": 32, "paddingTop": 15, "position": "relative", } @@ -964,7 +964,7 @@ exports[`renders correctly when transaction pending 1`] = ` Object { "flexDirection": "row", "paddingBottom": 5, - "paddingHorizontal": 20, + "paddingHorizontal": 32, "paddingTop": 15, "position": "relative", } diff --git a/packages/mobile/src/components/__snapshots__/Field.test.tsx.snap b/packages/mobile/src/components/__snapshots__/Field.test.tsx.snap index 30643f03c92..77234ded017 100644 --- a/packages/mobile/src/components/__snapshots__/Field.test.tsx.snap +++ b/packages/mobile/src/components/__snapshots__/Field.test.tsx.snap @@ -39,7 +39,7 @@ exports[`renders correctly blank 1`] = ` Object { "color": "rgba(0, 0, 0, 0.3)", "fontSize": 16, - "marginHorizontal": 20, + "marginHorizontal": 32, } } > @@ -110,7 +110,7 @@ exports[`renders correctly when filled and last 1`] = ` Object { "color": "rgba(0, 0, 0, 0.3)", "fontSize": 16, - "marginHorizontal": 20, + "marginHorizontal": 32, } } > diff --git a/packages/mobile/src/config.ts b/packages/mobile/src/config.ts index f6d0b2a5da5..aaedda792b4 100644 --- a/packages/mobile/src/config.ts +++ b/packages/mobile/src/config.ts @@ -1,6 +1,8 @@ import { stringToBoolean } from '@celo/utils/src/parsing' import { Platform } from 'react-native' import Config from 'react-native-config' +import config from 'src/geth/network-config' +import { Testnets } from 'src/web3/testnets' // if I use @celo/utils breaks all the tests for some reason // tslint:disable-next-line import * as secretsFile from '../secrets.json' @@ -15,6 +17,11 @@ const keyOrUndefined = (file: any, secretsKey: any, attribute: any) => { return undefined } +export const AVAILABLE_LANGUAGES = [ + { name: 'English', code: 'en-US' }, + { name: 'Español (América Latina)', code: 'es-419' }, +] + export const isE2EEnv = Config.IS_E2E || false export const CELO_VERIFIER_DOWNLOAD_LINK = 'https://celo.org/rewards' export const CELO_VERIFIER_START_MINING_LINK = 'celo://verifier/start' @@ -43,8 +50,10 @@ export const DEV_SETTINGS_ACTIVE_INITIALLY = stringToBoolean( export const FIREBASE_ENABLED = stringToBoolean(Config.FIREBASE_ENABLED || 'true') -export const DEFAULT_TESTNET = Config.DEFAULT_TESTNET -export const BLOCKCHAIN_API_URL = Config.BLOCKCHAIN_API_URL +// We need to fallback to `integration` for testing under jest where +// react-native-config is undefined. +export const DEFAULT_TESTNET: Testnets = Config.DEFAULT_TESTNET || 'integration' +export const BLOCKCHAIN_API_URL = config[DEFAULT_TESTNET].blockchainApiUrl export const SEGMENT_API_KEY = keyOrUndefined(secretsFile, Config.SECRETS_KEY, 'SEGMENT_API_KEY') export const FIREBASE_WEB_KEY = keyOrUndefined(secretsFile, Config.SECRETS_KEY, 'FIREBASE_WEB_KEY') @@ -52,3 +61,14 @@ export const FIREBASE_WEB_KEY = keyOrUndefined(secretsFile, Config.SECRETS_KEY, export const SENTRY_URL = keyOrUndefined(secretsFile, Config.SECRETS_KEY, 'SENTRY_URL') export const PROMOTE_REWARDS_APP = false + +export const LOCAL_CURRENCY_SYMBOL = Config.LOCAL_CURRENCY_SYMBOL || null + +// The number of seconds before the sender can reclaim the payment. +export const ESCROW_PAYMENT_EXPIRY_SECONDS = 172800 // 2 days + +export const SHOW_TESTNET_BANNER = stringToBoolean(Config.SHOW_TESTNET_BANNER || 'false') + +// The minimum allowed value for a transaction such as a transfer +export const DOLLAR_TRANSACTION_MIN_AMOUNT = 0.01 +export const GOLD_TRANSACTION_MIN_AMOUNT = 0.001 diff --git a/packages/mobile/src/dappkit/DappKitAccountScreen.tsx b/packages/mobile/src/dappkit/DappKitAccountScreen.tsx index 3e8537ec90d..30550cbe903 100644 --- a/packages/mobile/src/dappkit/DappKitAccountScreen.tsx +++ b/packages/mobile/src/dappkit/DappKitAccountScreen.tsx @@ -18,6 +18,9 @@ import { currentAccountSelector } from 'src/web3/selectors' const TAG = 'dappkit/DappKitAccountScreen' +interface State { + dappName: string +} interface OwnProps { errorMessage?: string navigation?: NavigationScreenProp @@ -35,9 +38,25 @@ const mapStateToProps = (state: RootState): StateProps => ({ phoneNumber: e164NumberSelector(state), }) -class DappKitAccountAuthScreen extends React.Component { +class DappKitAccountAuthScreen extends React.Component { static navigationOptions = { header: null } + componentDidMount() { + if (!this.props.navigation) { + Logger.error(TAG, 'Missing navigation props') + return + } + + const request: AccountAuthRequest = this.props.navigation.getParam('dappKitRequest', null) + + if (!request) { + Logger.error(TAG, 'No request found in navigation props') + return + } + + this.setState({ dappName: request.dappName }) + } + getErrorMessage() { return ( this.props.errorMessage || @@ -84,7 +103,9 @@ class DappKitAccountAuthScreen extends React.Component { - {t('connectToWallet')} + + {t('connectToWallet', { dappname: this.state.dappName })} + {t('shareInfo')} diff --git a/packages/mobile/src/dappkit/DappKitSignTxScreen.tsx b/packages/mobile/src/dappkit/DappKitSignTxScreen.tsx index 1ac04beed05..17083579fb7 100644 --- a/packages/mobile/src/dappkit/DappKitSignTxScreen.tsx +++ b/packages/mobile/src/dappkit/DappKitSignTxScreen.tsx @@ -83,7 +83,9 @@ class DappKitSignTxScreen extends React.Component { - {t('connectToWallet')} + + {t('connectToWallet', { dappname: this.state.request.dappName })} + {t('shareInfo')} diff --git a/packages/mobile/src/dappkit/dappkit.ts b/packages/mobile/src/dappkit/dappkit.ts index 25ca473635d..6c863a54c85 100644 --- a/packages/mobile/src/dappkit/dappkit.ts +++ b/packages/mobile/src/dappkit/dappkit.ts @@ -60,9 +60,8 @@ function* produceTxSignature(action: RequestTxSignatureAction) { yield call(getConnectedUnlockedAccount) const rawTxs = yield Promise.all( action.request.txs.map(async (tx) => { - const signedTx = await web3.eth.signTransaction({ + const params: any = { from: tx.from, - to: tx.to, gasPrice: '0', gas: tx.estimatedGas, data: tx.txData, @@ -70,7 +69,11 @@ function* produceTxSignature(action: RequestTxSignatureAction) { value: tx.value, // @ts-ignore gasCurrency: action.request.gasCurrency, - }) + } + if (tx.to) { + params.to = tx.to + } + const signedTx = await web3.eth.signTransaction(params) return signedTx.raw }) ) diff --git a/packages/mobile/src/escrow/ReclaimPaymentConfirmationCard.tsx b/packages/mobile/src/escrow/ReclaimPaymentConfirmationCard.tsx index 0b1e0c08dc4..9032fe5851e 100644 --- a/packages/mobile/src/escrow/ReclaimPaymentConfirmationCard.tsx +++ b/packages/mobile/src/escrow/ReclaimPaymentConfirmationCard.tsx @@ -10,7 +10,7 @@ import { withNamespaces, WithNamespaces } from 'react-i18next' import { StyleSheet, Text, View } from 'react-native' import { connect } from 'react-redux' import LineItemRow from 'src/components/LineItemRow' -import { CURRENCIES, CURRENCY_ENUM as Tokens } from 'src/geth/consts' +import { CURRENCIES, CURRENCY_ENUM } from 'src/geth/consts' import { Namespaces } from 'src/i18n' import Logo from 'src/icons/Logo' import { RecipientWithContact } from 'src/recipients/recipient' @@ -25,7 +25,7 @@ export interface OwnProps { fee?: BigNumber isLoadingFee?: boolean feeError?: Error - currency: Tokens + currency: CURRENCY_ENUM } interface StateProps { diff --git a/packages/mobile/src/escrow/ReclaimPaymentConfirmationScreen.tsx b/packages/mobile/src/escrow/ReclaimPaymentConfirmationScreen.tsx index 4da7fc709df..9705220f7f6 100644 --- a/packages/mobile/src/escrow/ReclaimPaymentConfirmationScreen.tsx +++ b/packages/mobile/src/escrow/ReclaimPaymentConfirmationScreen.tsx @@ -12,7 +12,7 @@ import CeloAnalytics from 'src/analytics/CeloAnalytics' import { CustomEventNames } from 'src/analytics/constants' import componentWithAnalytics from 'src/analytics/wrapper' import { ErrorMessages } from 'src/app/ErrorMessages' -import { EscrowedPayment, reclaimPayment } from 'src/escrow/actions' +import { EscrowedPayment, reclaimEscrowPayment } from 'src/escrow/actions' import ReclaimPaymentConfirmationCard from 'src/escrow/ReclaimPaymentConfirmationCard' import { FeeType } from 'src/fees/actions' import CalculateFee, { CalculateFeeChildren } from 'src/fees/CalculateFee' @@ -37,12 +37,12 @@ interface StateProps { } interface DispatchProps { - reclaimPayment: typeof reclaimPayment + reclaimPayment: typeof reclaimEscrowPayment showError: typeof showError } const mapDispatchToProps = { - reclaimPayment, + reclaimPayment: reclaimEscrowPayment, showError, } diff --git a/packages/mobile/src/escrow/__snapshots__/ReclaimPaymentConfirmationScreen.test.tsx.snap b/packages/mobile/src/escrow/__snapshots__/ReclaimPaymentConfirmationScreen.test.tsx.snap index 3fbf6dd6e90..f3c37cc98a8 100644 --- a/packages/mobile/src/escrow/__snapshots__/ReclaimPaymentConfirmationScreen.test.tsx.snap +++ b/packages/mobile/src/escrow/__snapshots__/ReclaimPaymentConfirmationScreen.test.tsx.snap @@ -52,6 +52,7 @@ exports[`ReclaimPaymentConfirmationScreen renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -668,6 +669,7 @@ exports[`ReclaimPaymentConfirmationScreen renders correctly when fee calculation style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -1284,6 +1286,7 @@ exports[`ReclaimPaymentConfirmationScreen renders correctly when fee calculation style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, diff --git a/packages/mobile/src/escrow/actions.ts b/packages/mobile/src/escrow/actions.ts index f651d721436..bc6594747ba 100644 --- a/packages/mobile/src/escrow/actions.ts +++ b/packages/mobile/src/escrow/actions.ts @@ -15,9 +15,6 @@ export interface EscrowedPayment { expirySeconds: BigNumber } -// The number of seconds before the sender can reclaim the payment. -export const EXPIRY_SECONDS = 432000 // 5 days in seconds - export enum Actions { TRANSFER_PAYMENT = 'ESCROW/TRANSFER_PAYMENT', RECLAIM_PAYMENT = 'ESCROW/RECLAIM_PAYMENT', @@ -28,84 +25,88 @@ export enum Actions { RECLAIM_PAYMENT_FAILURE = 'ESCROW/RECLAIM_PAYMENT_FAILURE', } -export interface TransferPaymentAction { +export interface EscrowTransferPaymentAction { type: Actions.TRANSFER_PAYMENT phoneHash: string amount: BigNumber tempWalletAddress: string } -export interface ReclaimPaymentAction { +export interface EscrowReclaimPaymentAction { type: Actions.RECLAIM_PAYMENT paymentID: string } -export interface FetchSentPaymentsAction { +export interface EscrowFetchSentPaymentsAction { type: Actions.FETCH_SENT_PAYMENTS + forceRefresh: boolean } -export interface StoreSentPaymentsAction { +export interface EscrowStoreSentPaymentsAction { type: Actions.STORE_SENT_PAYMENTS sentPayments: EscrowedPayment[] } -export interface ResendPaymentAction { +export interface EscrowResendPaymentAction { type: Actions.RESEND_PAYMENT paymentId: string } -export interface ReclaimPaymentSuccessAction { +export interface EscrowReclaimPaymentSuccessAction { type: Actions.RECLAIM_PAYMENT_SUCCESS } -export interface ReclaimFailureAction { +export interface EscrowReclaimFailureAction { type: Actions.RECLAIM_PAYMENT_FAILURE error: ErrorMessages } export type ActionTypes = - | TransferPaymentAction - | ReclaimPaymentAction - | FetchSentPaymentsAction - | StoreSentPaymentsAction - | ResendPaymentAction - | ReclaimPaymentSuccessAction - | ReclaimFailureAction + | EscrowTransferPaymentAction + | EscrowReclaimPaymentAction + | EscrowFetchSentPaymentsAction + | EscrowStoreSentPaymentsAction + | EscrowResendPaymentAction + | EscrowReclaimPaymentSuccessAction + | EscrowReclaimFailureAction export const transferEscrowedPayment = ( phoneHash: string, amount: BigNumber, tempWalletAddress: string -): TransferPaymentAction => ({ +): EscrowTransferPaymentAction => ({ type: Actions.TRANSFER_PAYMENT, phoneHash, amount, tempWalletAddress, }) -export const reclaimPayment = (paymentID: string): ReclaimPaymentAction => ({ +export const reclaimEscrowPayment = (paymentID: string): EscrowReclaimPaymentAction => ({ type: Actions.RECLAIM_PAYMENT, paymentID, }) -export const fetchSentPayments = (): FetchSentPaymentsAction => ({ +export const fetchSentEscrowPayments = (forceRefresh = false): EscrowFetchSentPaymentsAction => ({ type: Actions.FETCH_SENT_PAYMENTS, + forceRefresh, }) -export const storeSentPayments = (sentPayments: EscrowedPayment[]): StoreSentPaymentsAction => ({ +export const storeSentEscrowPayments = ( + sentPayments: EscrowedPayment[] +): EscrowStoreSentPaymentsAction => ({ type: Actions.STORE_SENT_PAYMENTS, sentPayments, }) -export const resendPayment = (paymentId: string): ResendPaymentAction => ({ +export const resendEscrowPayment = (paymentId: string): EscrowResendPaymentAction => ({ type: Actions.RESEND_PAYMENT, paymentId, }) -export const reclaimPaymentSuccess = (): ReclaimPaymentSuccessAction => ({ +export const reclaimEscrowPaymentSuccess = (): EscrowReclaimPaymentSuccessAction => ({ type: Actions.RECLAIM_PAYMENT_SUCCESS, }) -export const reclaimPaymentFailure = (error: ErrorMessages): ReclaimFailureAction => ({ +export const reclaimEscrowPaymentFailure = (error: ErrorMessages): EscrowReclaimFailureAction => ({ type: Actions.RECLAIM_PAYMENT_FAILURE, error, }) diff --git a/packages/mobile/src/escrow/saga.ts b/packages/mobile/src/escrow/saga.ts index 18376bd0c4b..367bb4deb6a 100644 --- a/packages/mobile/src/escrow/saga.ts +++ b/packages/mobile/src/escrow/saga.ts @@ -5,16 +5,17 @@ import BigNumber from 'bignumber.js' import { all, call, put, select, spawn, takeLeading } from 'redux-saga/effects' import { showError } from 'src/alert/actions' import { ErrorMessages } from 'src/app/ErrorMessages' +import { ESCROW_PAYMENT_EXPIRY_SECONDS } from 'src/config' import { Actions, EscrowedPayment, - EXPIRY_SECONDS, - fetchSentPayments, - ReclaimPaymentAction, - reclaimPaymentFailure, - reclaimPaymentSuccess, - storeSentPayments, - TransferPaymentAction, + EscrowFetchSentPaymentsAction, + EscrowReclaimPaymentAction, + EscrowTransferPaymentAction, + fetchSentEscrowPayments, + reclaimEscrowPaymentFailure, + reclaimEscrowPaymentSuccess, + storeSentEscrowPayments, } from 'src/escrow/actions' import { sentEscrowedPaymentsSelector } from 'src/escrow/reducer' import { calculateFee } from 'src/fees/saga' @@ -40,7 +41,7 @@ import { getConnectedAccount, getConnectedUnlockedAccount } from 'src/web3/saga' const TAG = 'escrow/saga' -function* transferStableTokenToEscrow(action: TransferPaymentAction) { +function* transferStableTokenToEscrow(action: EscrowTransferPaymentAction) { Logger.debug(TAG + '@transferToEscrow', 'Begin transfer to escrow') try { const { phoneHash, amount, tempWalletAddress } = action @@ -63,13 +64,13 @@ function* transferStableTokenToEscrow(action: TransferPaymentAction) { phoneHash, stableToken.options.address, convertedAmount, - EXPIRY_SECONDS, + ESCROW_PAYMENT_EXPIRY_SECONDS, tempWalletAddress, NUM_ATTESTATIONS_REQUIRED ) yield call(sendAndMonitorTransaction, transferTxId, transferTx, account) - yield put(fetchSentPayments()) + yield put(fetchSentEscrowPayments()) } catch (e) { Logger.error(TAG + '@transferToEscrow', 'Error transfering to escrow', e) if (e.message === ErrorMessages.INCORRECT_PIN) { @@ -175,21 +176,20 @@ export async function getReclaimEscrowFee(account: string, paymentID: string) { return calculateFee(gas) } -function* reclaimFromEscrow(action: ReclaimPaymentAction) { +function* reclaimFromEscrow({ paymentID }: EscrowReclaimPaymentAction) { Logger.debug(TAG + '@reclaimFromEscrow', 'Reclaiming escrowed payment') try { - const { paymentID } = action const account = yield call(getConnectedUnlockedAccount) const reclaimTx = yield call(createReclaimTransaction, paymentID) yield call(sendTransaction, reclaimTx, account, TAG, 'escrow reclaim') yield put(fetchDollarBalance()) - yield put(fetchSentPayments()) + yield put(fetchSentEscrowPayments(true)) yield call(navigate, Screens.WalletHome) - yield put(reclaimPaymentSuccess()) + yield put(reclaimEscrowPaymentSuccess()) } catch (e) { Logger.error(TAG + '@reclaimFromEscrow', 'Error reclaiming payment from escrow', e) if (e.message === ErrorMessages.INCORRECT_PIN) { @@ -197,7 +197,8 @@ function* reclaimFromEscrow(action: ReclaimPaymentAction) { } else { yield put(showError(ErrorMessages.RECLAIMING_ESCROWED_PAYMENT_FAILED)) } - yield put(reclaimPaymentFailure(e)) + yield put(reclaimEscrowPaymentFailure(e)) + yield put(fetchSentEscrowPayments(true)) } } @@ -213,7 +214,7 @@ async function getEscrowedPayment(escrow: Escrow, paymentID: string) { } } -function* doFetchSentPayments() { +function* doFetchSentPayments({ forceRefresh }: EscrowFetchSentPaymentsAction) { Logger.debug(TAG + '@doFetchSentPayments', 'Fetching valid sent escrowed payments') try { @@ -222,25 +223,41 @@ function* doFetchSentPayments() { const existingPayments: EscrowedPayment[] = yield select(sentEscrowedPaymentsSelector) const existingPaymentsIds = new Set(existingPayments.map((p) => p.paymentID)) - const sentPaymentIDs: string[] = yield escrow.methods.getSentPaymentIds(account).call() // Note: payment ids are currently temp wallet addresses + const sentPaymentIDs: string[] = yield call(escrow.methods.getSentPaymentIds(account).call) // Note: payment ids are currently temp wallet addresses + if (!sentPaymentIDs || !sentPaymentIDs.length) { + Logger.debug(TAG + '@doFetchSentPayments', 'No payments ids found, clearing stored payments') + yield put(storeSentEscrowPayments([])) + return + } - const newPaymentIds = sentPaymentIDs.filter((id) => !existingPaymentsIds.has(id.toLowerCase())) - if (!newPaymentIds.length) { + const paymentIdsToFetch = forceRefresh + ? sentPaymentIDs + : sentPaymentIDs.filter((id) => !existingPaymentsIds.has(id.toLowerCase())) + if (!paymentIdsToFetch.length) { Logger.debug(TAG + '@doFetchSentPayments', 'No new payments found') return } - const sentPayments = yield all( - newPaymentIds.map((paymentID) => call(getEscrowedPayment, escrow, paymentID)) + Logger.debug( + TAG + '@doFetchSentPayments', + `Fetching data for ${paymentIdsToFetch.length} payments` + ) + const sentPaymentsRaw = yield all( + paymentIdsToFetch.map((paymentID) => call(getEscrowedPayment, escrow, paymentID)) ) const tempAddresstoRecipientPhoneNumber: Invitees = yield select(inviteesSelector) - const sentPaymentsNotifications: EscrowedPayment[] = [] - for (let i = 0; i < sentPayments.length; i++) { + const sentPayments: EscrowedPayment[] = [] + for (let i = 0; i < sentPaymentsRaw.length; i++) { const id = sentPaymentIDs[i].toLowerCase() - const payment = sentPayments[i] const recipientPhoneNumber = tempAddresstoRecipientPhoneNumber[id] - const transformedPayment: EscrowedPayment = { + + const payment = sentPaymentsRaw[i] + if (!payment) { + continue + } + + const escrowPaymentWithRecipient: EscrowedPayment = { paymentID: id, senderAddress: payment[1], recipientPhone: recipientPhoneNumber, @@ -249,14 +266,25 @@ function* doFetchSentPayments() { timestamp: payment[6], expirySeconds: payment[7], } - sentPaymentsNotifications.push(transformedPayment) + sentPayments.push(escrowPaymentWithRecipient) } - yield put(storeSentPayments([...existingPayments, ...sentPaymentsNotifications])) + + yield put( + storeSentEscrowPayments(forceRefresh ? sentPayments : [...existingPayments, ...sentPayments]) + ) } catch (e) { Logger.error(TAG + '@doFetchSentPayments', 'Error fetching sent escrowed payments', e) } } +export function getReclaimableEscrowPayments(allPayments: EscrowedPayment[]) { + const currUnixTime = Date.now() / 1000 + return allPayments.filter((payment) => { + const paymentExpiryTime = +payment.timestamp + +payment.expirySeconds + return currUnixTime >= paymentExpiryTime + }) +} + export function* watchTransferPayment() { yield takeLeading(Actions.TRANSFER_PAYMENT, transferStableTokenToEscrow) } diff --git a/packages/mobile/src/exchange/Activity.tsx b/packages/mobile/src/exchange/Activity.tsx index ef8010489aa..7e430ec9f3f 100644 --- a/packages/mobile/src/exchange/Activity.tsx +++ b/packages/mobile/src/exchange/Activity.tsx @@ -23,7 +23,7 @@ const mapStateToProps = (state: RootState): StateProps => ({ }) function filterToExchangeTxs(tx: StandbyTransaction) { - return tx.type === TransactionTypes.EXCHANGED + return tx.type === TransactionTypes.EXCHANGE } export class Activity extends React.Component { diff --git a/packages/mobile/src/exchange/ExchangeConfirmationCard.test.tsx b/packages/mobile/src/exchange/ExchangeConfirmationCard.test.tsx index 57d389ccb8c..756d5a4ee2b 100644 --- a/packages/mobile/src/exchange/ExchangeConfirmationCard.test.tsx +++ b/packages/mobile/src/exchange/ExchangeConfirmationCard.test.tsx @@ -5,21 +5,21 @@ import 'react-native' import * as renderer from 'react-test-renderer' import ExchangeConfirmationCard from 'src/exchange/ExchangeConfirmationCard' -const newDollarBalance = '189.9' -const newGoldBalance = '207.81' -const leftCurrencyAmount = new BigNumber('20') -const rightCurrencyAmount = new BigNumber('1.99') -const exchangeRate = '2' +const newDollarBalance = new BigNumber('189.9') +const newGoldBalance = new BigNumber('207.81') +const makerAmount = new BigNumber('20') +const takerAmount = new BigNumber('1.99') +const exchangeRate = new BigNumber('2') const fee = '0.01' it('renders correctly with no exchange rate', () => { const tree = renderer.create( @@ -30,12 +30,12 @@ it('renders correctly with no exchange rate', () => { it('renders correctly with giant numbers', () => { const tree = renderer.create( ) diff --git a/packages/mobile/src/exchange/ExchangeConfirmationCard.tsx b/packages/mobile/src/exchange/ExchangeConfirmationCard.tsx index 3c1b73c8b80..9b00e3a1405 100644 --- a/packages/mobile/src/exchange/ExchangeConfirmationCard.tsx +++ b/packages/mobile/src/exchange/ExchangeConfirmationCard.tsx @@ -9,25 +9,39 @@ import ExchangeRate from 'src/exchange/ExchangeRate' import { CURRENCY_ENUM } from 'src/geth/consts' import { Namespaces } from 'src/i18n' import RoundedArrow from 'src/shared/RoundedArrow' +import { getMoneyDisplayValue } from 'src/utils/formatting' export interface ExchangeConfirmationCardProps { - token: CURRENCY_ENUM - newDollarBalance: string - newGoldBalance: string - leftCurrencyAmount: BigNumber - rightCurrencyAmount: BigNumber - exchangeRate: string | null - fee: string + makerToken: CURRENCY_ENUM + makerAmount: BigNumber + takerAmount: BigNumber + fee?: string + exchangeRate?: BigNumber + newDollarBalance?: BigNumber + newGoldBalance?: BigNumber } type Props = ExchangeConfirmationCardProps & WithNamespaces class ExchangeConfirmationCard extends React.PureComponent { - takerToken() { - return this.props.token === CURRENCY_ENUM.DOLLAR ? CURRENCY_ENUM.GOLD : CURRENCY_ENUM.DOLLAR + getTakerToken() { + return this.props.makerToken === CURRENCY_ENUM.DOLLAR + ? CURRENCY_ENUM.GOLD + : CURRENCY_ENUM.DOLLAR } - renderNewBalances = (newDollarBalance: string, newGoldBalance: string) => { + getExchangeRate() { + const { makerAmount, takerAmount, exchangeRate } = this.props + + if (exchangeRate) { + return exchangeRate + } + + // For feed drilldown, the exchange rate has not been provided + return makerAmount.dividedBy(takerAmount) + } + + renderNewBalances = (newDollarBalance: BigNumber, newGoldBalance: BigNumber) => { const { t } = this.props return ( @@ -39,66 +53,52 @@ class ExchangeConfirmationCard extends React.PureComponent { {t('global:celoDollars')} - - ${newDollarBalance} + + {getMoneyDisplayValue(newDollarBalance, CURRENCY_ENUM.DOLLAR, true)} {t('global:celoGold')} - - {newGoldBalance} + + {getMoneyDisplayValue(newGoldBalance, CURRENCY_ENUM.GOLD, true)} ) } - exchangeRateToDisplay() { - const { leftCurrencyAmount, rightCurrencyAmount, exchangeRate } = this.props - - if (exchangeRate && exchangeRate.length > 0) { - return new BigNumber(exchangeRate) - } - - return rightCurrencyAmount.dividedBy(leftCurrencyAmount) - } - render() { - const { newDollarBalance, newGoldBalance, leftCurrencyAmount, rightCurrencyAmount } = this.props + const { + newDollarBalance, + newGoldBalance, + makerAmount, + takerAmount, + makerToken: token, + } = this.props - const shouldRenderBalance = newDollarBalance.length > 0 && newGoldBalance.length > 0 return ( - + - - + - + - {shouldRenderBalance && this.renderNewBalances(newDollarBalance, newGoldBalance)} + {newDollarBalance && + newGoldBalance && + this.renderNewBalances(newDollarBalance, newGoldBalance)} ) } } -export default withNamespaces(Namespaces.exchangeFlow9)(ExchangeConfirmationCard) - const styles = StyleSheet.create({ container: { minHeight: 300, @@ -131,9 +131,6 @@ const styles = StyleSheet.create({ justifyContent: 'center', alignItems: 'center', }, - fee: { - color: colors.dark, - }, titleContainer: { paddingTop: 30, paddingBottom: 20, @@ -154,3 +151,5 @@ const styles = StyleSheet.create({ color: colors.celoGreen, }, }) + +export default withNamespaces(Namespaces.exchangeFlow9)(ExchangeConfirmationCard) diff --git a/packages/mobile/src/exchange/ExchangeHomeScreen.tsx b/packages/mobile/src/exchange/ExchangeHomeScreen.tsx index 89c796aa62c..f801774bbf3 100644 --- a/packages/mobile/src/exchange/ExchangeHomeScreen.tsx +++ b/packages/mobile/src/exchange/ExchangeHomeScreen.tsx @@ -1,5 +1,5 @@ import ScrollContainer from '@celo/react-components/components/ScrollContainer' -import SectionHead from '@celo/react-components/components/SectionHead' +import SectionHeadNew from '@celo/react-components/components/SectionHeadNew' import SmallButton from '@celo/react-components/components/SmallButton' import BigNumber from 'bignumber.js' import * as React from 'react' @@ -68,7 +68,7 @@ export class ExchangeHomeScreen extends React.Component { /> - + diff --git a/packages/mobile/src/exchange/ExchangeRate.test.tsx b/packages/mobile/src/exchange/ExchangeRate.test.tsx index 7cdb9f4b3bb..a9427e7b064 100644 --- a/packages/mobile/src/exchange/ExchangeRate.test.tsx +++ b/packages/mobile/src/exchange/ExchangeRate.test.tsx @@ -1,15 +1,15 @@ -import { CURRENCY_ENUM as Tokens } from '@celo/utils' import BigNumber from 'bignumber.js' import * as React from 'react' import 'react-native' import * as renderer from 'react-test-renderer' import ExchangeRate from 'src/exchange/ExchangeRate' +import { CURRENCY_ENUM } from 'src/geth/consts' const EXCHANGE_RATE = '0.1' it('renders correctly with no exchange rate', () => { const tree = renderer.create( - + ) expect(tree).toMatchSnapshot() }) @@ -18,7 +18,7 @@ it('renders correctly with infinity exchange rate', () => { const tree = renderer.create( ) @@ -29,7 +29,7 @@ it('renders correctly with an exchange rate and show fine print', () => { const tree = renderer.create( ) @@ -40,7 +40,7 @@ it('isnt overly precise, it rounds', () => { const tree = renderer.create( ) diff --git a/packages/mobile/src/exchange/ExchangeRate.tsx b/packages/mobile/src/exchange/ExchangeRate.tsx index d4c1548e740..95521fdaba0 100644 --- a/packages/mobile/src/exchange/ExchangeRate.tsx +++ b/packages/mobile/src/exchange/ExchangeRate.tsx @@ -1,16 +1,16 @@ import colors from '@celo/react-components/styles/colors' import fontStyles from '@celo/react-components/styles/fonts' -import { CURRENCIES, CURRENCY_ENUM as Tokens } from '@celo/utils' import BigNumber from 'bignumber.js' import * as React from 'react' import { withNamespaces, WithNamespaces } from 'react-i18next' import { StyleSheet, Text, View } from 'react-native' +import { CURRENCIES, CURRENCY_ENUM } from 'src/geth/consts' import { Namespaces } from 'src/i18n' import { getExchangeRateDisplayValue } from 'src/utils/formatting' interface ExchangeRateProps { showFinePrint?: boolean - makerToken: Tokens + makerToken: CURRENCY_ENUM rate: BigNumber } @@ -20,7 +20,8 @@ export class ExchangeRate extends React.PureComponent { render() { const { t, rate, showFinePrint } = this.props const isRateValid = !rate.isZero() && rate.isFinite() - const takerToken = this.props.makerToken === Tokens.DOLLAR ? Tokens.GOLD : Tokens.DOLLAR + const takerToken = + this.props.makerToken === CURRENCY_ENUM.DOLLAR ? CURRENCY_ENUM.GOLD : CURRENCY_ENUM.DOLLAR const makerTokenCode = CURRENCIES[this.props.makerToken].code const takerTokenCode = CURRENCIES[takerToken].code diff --git a/packages/mobile/src/exchange/ExchangeReview.tsx b/packages/mobile/src/exchange/ExchangeReview.tsx index 5bf651ff2d1..8032b8df7a4 100644 --- a/packages/mobile/src/exchange/ExchangeReview.tsx +++ b/packages/mobile/src/exchange/ExchangeReview.tsx @@ -36,7 +36,7 @@ interface StateProps { appConnected: boolean } -interface ExchangeInfo { +interface ConfirmationInput { makerAmount: BigNumber makerToken: Token } @@ -59,42 +59,42 @@ const mapStateToProps = (state: RootState): StateProps => ({ class ExchangeReview extends React.Component { static navigationOptions = { header: null } - confirm = () => { - const exchangeProps = this.getExchangeProps() - this.props.exchangeTokens(exchangeProps.makerToken, exchangeProps.makerAmount) + onPressConfirm = () => { + const confirmationInput = this.getConfirmationInput() + this.props.exchangeTokens(confirmationInput.makerToken, confirmationInput.makerAmount) CeloAnalytics.track(CustomEventNames.exchange_confirm, { - makerToken: exchangeProps.makerToken, - makerAmount: exchangeProps.makerAmount, + makerToken: confirmationInput.makerToken, + makerAmount: confirmationInput.makerAmount, }) navigate(Screens.ExchangeHomeScreen) } - editExchange = () => { + onPressEdit = () => { CeloAnalytics.track(CustomEventNames.exchange_edit) navigateBack() } - getExchangeProps(): ExchangeInfo { - const info = this.props.navigation.getParam('exchangeInfo', '') + getConfirmationInput(): ConfirmationInput { + const confirmationInput = this.props.navigation.getParam('confirmationInput', '') - if (info === '') { + if (confirmationInput === '') { throw new Error('Expected exchangeInfo ') } - return info - } - - renderHeader = () => { - return + return confirmationInput } componentDidMount() { - const { makerToken, makerAmount } = this.getExchangeProps() + const { makerToken, makerAmount } = this.getConfirmationInput() this.props.fetchExchangeRate(makerAmount, makerToken) } + renderHeader = () => { + return + } + render() { const { exchangeRatePair, fee, t, appConnected, dollarBalance, goldBalance } = this.props - const { makerToken, makerAmount } = this.getExchangeProps() + const { makerToken, makerAmount } = this.getConfirmationInput() const rate = getRateForMakerToken(exchangeRatePair, makerToken) const takerAmount = getTakerAmount(makerAmount, rate) const newGoldBalance = getNewGoldBalance(goldBalance, makerToken, makerAmount, takerAmount) @@ -111,19 +111,19 @@ class ExchangeReview extends React.Component { diff --git a/packages/mobile/src/exchange/ExchangeTradeScreen.test.tsx b/packages/mobile/src/exchange/ExchangeTradeScreen.test.tsx index c8ea082cbb7..3d6945a0d0f 100644 --- a/packages/mobile/src/exchange/ExchangeTradeScreen.test.tsx +++ b/packages/mobile/src/exchange/ExchangeTradeScreen.test.tsx @@ -41,7 +41,6 @@ describe(ExchangeTradeScreen, () => { }) describe('methods:', () => { it('setExchangeAmount updates Errors', () => { - // const { component, mockShowError, mockhideAlert } = setup() const mockShowError = jest.fn() const mockhideAlert = jest.fn() const component = renderer.create( @@ -57,12 +56,34 @@ describe(ExchangeTradeScreen, () => { /> ) - component.root.instance.setExchangeAmount('500') + component.root.instance.onChangeExchangeAmount('500') expect(mockShowError).toBeCalledWith(ErrorMessages.NSF_DOLLARS) - component.root.instance.switchTokens() + component.root.instance.onPressSwapIcon() expect(mockShowError).toBeCalledWith(ErrorMessages.NSF_GOLD) - component.root.instance.setExchangeAmount('5') + component.root.instance.onChangeExchangeAmount('5') expect(mockhideAlert).toBeCalled() }) + + it.only('validates amount', () => { + const component = renderer.create( + + ) + + component.root.instance.onChangeExchangeAmount('500') + expect(component.root.instance.isExchangeInvalid()).toBe(true) + component.root.instance.onChangeExchangeAmount('0.0001') + expect(component.root.instance.isExchangeInvalid()).toBe(true) + component.root.instance.onChangeExchangeAmount('0.01') + expect(component.root.instance.isExchangeInvalid()).toBe(false) + }) }) }) diff --git a/packages/mobile/src/exchange/ExchangeTradeScreen.tsx b/packages/mobile/src/exchange/ExchangeTradeScreen.tsx index 6e8d384002f..64e3e8fb67d 100644 --- a/packages/mobile/src/exchange/ExchangeTradeScreen.tsx +++ b/packages/mobile/src/exchange/ExchangeTradeScreen.tsx @@ -17,10 +17,11 @@ import CeloAnalytics from 'src/analytics/CeloAnalytics' import { CustomEventNames, DefaultEventNames } from 'src/analytics/constants' import componentWithAnalytics from 'src/analytics/wrapper' import { ErrorMessages } from 'src/app/ErrorMessages' +import { DOLLAR_TRANSACTION_MIN_AMOUNT, GOLD_TRANSACTION_MIN_AMOUNT } from 'src/config' import { fetchExchangeRate } from 'src/exchange/actions' import ExchangeRate from 'src/exchange/ExchangeRate' import { ExchangeRatePair } from 'src/exchange/reducer' -import { CURRENCIES, CURRENCY_ENUM as Token } from 'src/geth/consts' +import { CURRENCIES, CURRENCY_ENUM } from 'src/geth/consts' import i18n, { Namespaces } from 'src/i18n' import { headerWithCancelButton } from 'src/navigator/Headers' import { navigate, navigateBack } from 'src/navigator/NavigationService' @@ -35,10 +36,8 @@ import { } from 'src/utils/currencyExchange' import { getMoneyDisplayValue } from 'src/utils/formatting' -const numeral = require('numeral') - interface State { - makerToken: Token + makerToken: CURRENCY_ENUM makerTokenAmount: string } @@ -71,7 +70,7 @@ export class ExchangeTradeScreen extends React.Component { }) state = { - makerToken: Token.DOLLAR, + makerToken: CURRENCY_ENUM.DOLLAR, makerTokenAmount: '', } @@ -79,17 +78,18 @@ export class ExchangeTradeScreen extends React.Component { this.props.fetchExchangeRate() } - switchTokens = () => { - const makerToken = this.state.makerToken === Token.DOLLAR ? Token.GOLD : Token.DOLLAR + onPressSwapIcon = () => { + const makerToken = + this.state.makerToken === CURRENCY_ENUM.DOLLAR ? CURRENCY_ENUM.GOLD : CURRENCY_ENUM.DOLLAR this.setState({ makerToken }, () => { this.updateError(this.state.makerTokenAmount) }) CeloAnalytics.track(CustomEventNames.currency_swap) } - setExchangeAmount = (amount: string) => { + onChangeExchangeAmount = (amount: string) => { // remove $ we inserted for display purposes - const currencySymbol = new RegExp('\\' + CURRENCIES[Token.DOLLAR].symbol, 'g') + const currencySymbol = new RegExp('\\' + CURRENCIES[CURRENCY_ENUM.DOLLAR].symbol, 'g') amount = amount.replace(currencySymbol, '') this.setState({ makerTokenAmount: amount }, () => { @@ -99,7 +99,9 @@ export class ExchangeTradeScreen extends React.Component { updateError(amount: string) { if (this.getMakerBalance().isLessThan(amount)) { - this.props.showError(this.isDollar() ? ErrorMessages.NSF_DOLLARS : ErrorMessages.NSF_GOLD) + this.props.showError( + this.isDollarToGold() ? ErrorMessages.NSF_DOLLARS : ErrorMessages.NSF_GOLD + ) } else { this.props.hideAlert() } @@ -107,14 +109,14 @@ export class ExchangeTradeScreen extends React.Component { onEndEditing = () => { CeloAnalytics.track( - this.state.makerToken === Token.DOLLAR + this.state.makerToken === CURRENCY_ENUM.DOLLAR ? CustomEventNames.exchange_dollar_input : CustomEventNames.exchange_gold_input, { exchangeInputAmount: this.state.makerTokenAmount } ) } - recordFocus = () => { + onInputFocus = () => { CeloAnalytics.track(DefaultEventNames.fieldFocused, { ...this.props, label: 'Exchange Amount', @@ -130,15 +132,15 @@ export class ExchangeTradeScreen extends React.Component { const { makerToken, makerTokenAmount } = this.state CeloAnalytics.track(CustomEventNames.exchange_continue) navigate(Screens.ExchangeReview, { - exchangeInfo: { makerToken, makerAmount: parseInputAmount(makerTokenAmount) }, + confirmationInput: { makerToken, makerAmount: parseInputAmount(makerTokenAmount) }, }) } - newBalance = (isDollar: boolean, takerTokenAmount: BigNumber) => { + getNewTakerBalance = (takerTokenAmount: BigNumber) => { const { dollarBalance, goldBalance } = this.props - return isDollar + return this.isDollarToGold() ? getNewTakerBalance(goldBalance, takerTokenAmount) - : CURRENCIES[Token.DOLLAR].symbol + getNewTakerBalance(dollarBalance, takerTokenAmount) + : getNewTakerBalance(dollarBalance, takerTokenAmount) } hasError = () => { @@ -146,30 +148,36 @@ export class ExchangeTradeScreen extends React.Component { } isExchangeInvalid = () => { - // convert to numeral.value so cases like null/undefined, or a string of zeros '0000' or empty string are all treated as invalid - const amount = new BigNumber(numeral(this.state.makerTokenAmount).value()) const makerBalance = this.getMakerBalance() - const amountIsInvalid = amount.isGreaterThan(makerBalance) || amount.isLessThan(0.01) - const exchangeRateIsInvalid = getRateForMakerToken( - this.props.exchangeRatePair, - this.state.makerToken - ).isZero() - return amountIsInvalid || exchangeRateIsInvalid || this.hasError() + const amount = parseInputAmount(this.state.makerTokenAmount) + const amountIsInvalid = + amount.isGreaterThan(makerBalance) || + amount.isLessThan( + this.isDollarToGold() ? DOLLAR_TRANSACTION_MIN_AMOUNT : GOLD_TRANSACTION_MIN_AMOUNT + ) + const exchangeRate = getRateForMakerToken(this.props.exchangeRatePair, this.state.makerToken) + const exchangeRateIsInvalid = exchangeRate.isLessThanOrEqualTo(0) + const takerToken = this.isDollarToGold() ? CURRENCY_ENUM.GOLD : CURRENCY_ENUM.DOLLAR + const takerAmountIsInvalid = getTakerAmount( + amount, + exchangeRate, + CURRENCIES[takerToken].displayDecimals + ).isLessThanOrEqualTo(0) + + return amountIsInvalid || exchangeRateIsInvalid || takerAmountIsInvalid || this.hasError() } getMakerBalance = () => { - return new BigNumber((this.isDollar() ? this.props.dollarBalance : this.props.goldBalance) || 0) - } - - getFormattedMakerBalance = () => { - return getMoneyDisplayValue(this.getMakerBalance()) + return new BigNumber( + (this.isDollarToGold() ? this.props.dollarBalance : this.props.goldBalance) || 0 + ) } - isDollar = () => { - return this.state.makerToken === Token.DOLLAR + isDollarToGold = () => { + return this.state.makerToken === CURRENCY_ENUM.DOLLAR } - inputValue = () => { + getInputValue = () => { if (this.state.makerTokenAmount) { return CURRENCIES[this.state.makerToken].symbol + this.state.makerTokenAmount } else { @@ -177,28 +185,48 @@ export class ExchangeTradeScreen extends React.Component { } } - render() { + getMakerTakerProps = () => { const { t } = this.props + const dollarProps = { + token: CURRENCY_ENUM.DOLLAR, + tokenText: t('global:celoDollars') + ' (cUSD)', + style: styles.green, + symbol: CURRENCIES[CURRENCY_ENUM.DOLLAR].symbol, + } + const goldProps = { + token: CURRENCY_ENUM.GOLD, + tokenText: t('global:celoGold') + ' (cGLD)', + style: styles.gold, + symbol: CURRENCIES[CURRENCY_ENUM.GOLD].symbol, + } - const dollarText = t('global:celoDollars') + ' (cUSD)' - const goldText = t('global:celoGold') + ' (cGLD)' - - const makerTokenText = this.isDollar() ? dollarText : goldText - const takerTokenText = this.isDollar() ? goldText : dollarText + if (this.isDollarToGold()) { + return { + maker: dollarProps, + taker: goldProps, + placeholderColor: colors.celoGreenInactive, + } + } else { + return { + maker: goldProps, + taker: dollarProps, + placeholderColor: colors.celoGoldInactive, + } + } + } - const exchangeRate = getRateForMakerToken(this.props.exchangeRatePair, this.state.makerToken) - const takerTokenAmount = getTakerAmount( - numeral(this.state.makerTokenAmount).value(), - exchangeRate - ) + render() { + const { makerTokenAmount } = this.state + const { t } = this.props - const inputStyle = this.isDollar() ? styles.green : styles.gold - const takerStyle = this.isDollar() ? styles.gold : styles.green - const placeholderColor = this.isDollar() ? colors.celoGreenInactive : colors.celoGoldInactive + const { maker, taker, placeholderColor } = this.getMakerTakerProps() + const makerBalance = this.getMakerBalance() + const exchangeRate = getRateForMakerToken(this.props.exchangeRatePair, maker.token) + const takerTokenAmount = getTakerAmount(parseInputAmount(makerTokenAmount), exchangeRate) + const newTakerBalance = this.getNewTakerBalance(takerTokenAmount) const borderStyle = { borderColor: this.hasError() ? colors.errorRed : colors.dark } - const makerSymbol = CURRENCIES[this.state.makerToken].symbol return ( @@ -208,23 +236,23 @@ export class ExchangeTradeScreen extends React.Component { keyboardShouldPersistTaps={'always'} > - {makerTokenText} + {maker.tokenText} { /> {t('available')} - - {makerSymbol + this.getFormattedMakerBalance()} + + {getMoneyDisplayValue(makerBalance, maker.token, true)} - {takerTokenText} - + {taker.tokenText} + - - {getMoneyDisplayValue(takerTokenAmount)} + + {getMoneyDisplayValue(takerTokenAmount, taker.token, true)} - + * {t('newBalance')} - - {this.newBalance(this.isDollar(), takerTokenAmount)} + + {getMoneyDisplayValue(newTakerBalance, taker.token, true)} @@ -278,7 +311,7 @@ export class ExchangeTradeScreen extends React.Component { accessibilityLabel={t('continue')} standard={false} disabled={this.isExchangeInvalid()} - type={BtnTypes.SECONDARY} + type={BtnTypes.PRIMARY} /> @@ -330,30 +363,27 @@ const styles = StyleSheet.create({ marginHorizontal: 15, marginVertical: 15 + 18, }, - input: { + amountText: { fontSize: 22, - lineHeight: 28, }, ioBox: { flexDirection: 'row', alignItems: 'center', - alignContent: 'center', justifyContent: 'center', textAlign: 'center', width: '100%', marginHorizontal: 15, marginVertical: 10, paddingHorizontal: 15, + paddingTop: 10, + paddingBottom: 22, }, inputBox: { borderWidth: 1, borderRadius: 3, - paddingTop: 15, - paddingBottom: 12, - }, - outputBox: { - paddingVertical: 18, + paddingBottom: 10, + height: 54, // setting height manually b.c. of bug causing text to jump }, outputText: { paddingTop: 2, diff --git a/packages/mobile/src/exchange/__snapshots__/ExchangeConfirmationCard.test.tsx.snap b/packages/mobile/src/exchange/__snapshots__/ExchangeConfirmationCard.test.tsx.snap index ff201cc1615..7612fa4b60d 100644 --- a/packages/mobile/src/exchange/__snapshots__/ExchangeConfirmationCard.test.tsx.snap +++ b/packages/mobile/src/exchange/__snapshots__/ExchangeConfirmationCard.test.tsx.snap @@ -270,11 +270,10 @@ exports[`renders correctly with giant numbers 1`] = ` style={ Array [ Object { - "color": "#81868B", + "color": "#2E3338", "fontFamily": "Hind-Regular", "fontSize": 16, - "letterSpacing": -0.75, - "lineHeight": 20, + "lineHeight": 24, }, Object { "color": "#42D689", @@ -282,8 +281,7 @@ exports[`renders correctly with giant numbers 1`] = ` ] } > - $ - 10000000 + $10,000,000.00 - 10030000 + 10,030,000.000 @@ -604,11 +601,10 @@ exports[`renders correctly with no exchange rate 1`] = ` style={ Array [ Object { - "color": "#81868B", + "color": "#2E3338", "fontFamily": "Hind-Regular", "fontSize": 16, - "letterSpacing": -0.75, - "lineHeight": 20, + "lineHeight": 24, }, Object { "color": "#42D689", @@ -616,8 +612,7 @@ exports[`renders correctly with no exchange rate 1`] = ` ] } > - $ - 189.9 + $189.90 - 207.81 + 207.810 diff --git a/packages/mobile/src/exchange/__snapshots__/ExchangeTradeScreen.test.tsx.snap b/packages/mobile/src/exchange/__snapshots__/ExchangeTradeScreen.test.tsx.snap index bb3f45b6c85..746b17e6270 100644 --- a/packages/mobile/src/exchange/__snapshots__/ExchangeTradeScreen.test.tsx.snap +++ b/packages/mobile/src/exchange/__snapshots__/ExchangeTradeScreen.test.tsx.snap @@ -95,7 +95,6 @@ exports[`ExchangeTradeScreen renders correctly 1`] = ` Array [ Object { "fontSize": 22, - "lineHeight": 28, }, Object { "fontFamily": "Hind-Regular", @@ -104,20 +103,22 @@ exports[`ExchangeTradeScreen renders correctly 1`] = ` "color": "#42D689", }, Object { - "alignContent": "center", "alignItems": "center", "flexDirection": "row", "justifyContent": "center", "marginHorizontal": 15, "marginVertical": 10, + "paddingBottom": 22, "paddingHorizontal": 15, + "paddingTop": 10, "textAlign": "center", "width": "100%", }, Object { "borderRadius": 3, "borderWidth": 1, - "paddingBottom": 12, + "height": 54, + "paddingBottom": 10, "paddingTop": 15, }, Object { @@ -248,22 +249,18 @@ exports[`ExchangeTradeScreen renders correctly 1`] = ` - 0.00 + 0.000 - 100.00 + 100.000 @@ -429,7 +424,7 @@ exports[`ExchangeTradeScreen renders correctly 1`] = ` null, undefined, Object { - "backgroundColor": "transparent", + "backgroundColor": "#A3EBC6", }, ] } @@ -446,7 +441,7 @@ exports[`ExchangeTradeScreen renders correctly 1`] = ` style={ Object { "alignItems": "center", - "backgroundColor": "transparent", + "backgroundColor": "#A3EBC6", "borderWidth": 0, "flex": 1, "height": 50, @@ -474,7 +469,7 @@ exports[`ExchangeTradeScreen renders correctly 1`] = ` "fontSize": 16, }, Object { - "color": "#42D689", + "color": "#FFFFFF", }, Object { "paddingLeft": 5, diff --git a/packages/mobile/src/exchange/actions.ts b/packages/mobile/src/exchange/actions.ts index 05a82793311..6b8a0ffea80 100644 --- a/packages/mobile/src/exchange/actions.ts +++ b/packages/mobile/src/exchange/actions.ts @@ -12,7 +12,7 @@ import { call, put, select } from 'redux-saga/effects' import { showError } from 'src/alert/actions' import { ErrorMessages } from 'src/app/ErrorMessages' import { ExchangeRatePair } from 'src/exchange/reducer' -import { CURRENCY_ENUM as Tokens } from 'src/geth/consts' +import { CURRENCY_ENUM } from 'src/geth/consts' import { RootState } from 'src/redux/reducers' import { addStandbyTransaction, @@ -39,7 +39,7 @@ export enum Actions { EXCHANGE_TOKENS = 'EXCHANGE/EXCHANGE_TOKENS', } -export const fetchExchangeRate = (makerAmount?: BigNumber, makerToken?: Tokens) => ({ +export const fetchExchangeRate = (makerAmount?: BigNumber, makerToken?: CURRENCY_ENUM) => ({ type: Actions.FETCH_EXCHANGE_RATE, makerAmount, makerToken, @@ -57,12 +57,12 @@ export const setExchangeRate = (exchangeRatePair: ExchangeRatePair): SetExchange export interface ExchangeTokensAction { type: Actions.EXCHANGE_TOKENS - makerToken: Tokens + makerToken: CURRENCY_ENUM makerAmount: BigNumber } export const exchangeTokens = ( - makerToken: Tokens, + makerToken: CURRENCY_ENUM, makerAmount: BigNumber ): ExchangeTokensAction => ({ type: Actions.EXCHANGE_TOKENS, @@ -72,15 +72,15 @@ export const exchangeTokens = ( export type ActionTypes = SetExchangeRateAction | ExchangeTokensAction -export function* doFetchExchangeRate(makerAmount?: BigNumber, makerToken?: Tokens) { +export function* doFetchExchangeRate(makerAmount?: BigNumber, makerToken?: CURRENCY_ENUM) { Logger.debug(TAG, 'Calling @doFetchExchangeRate') let dollarMakerAmount: BigNumber let goldMakerAmount: BigNumber - if (makerAmount && makerToken === Tokens.GOLD) { + if (makerAmount && makerToken === CURRENCY_ENUM.GOLD) { dollarMakerAmount = LARGE_DOLLARS_SELL_AMOUNT_IN_WEI goldMakerAmount = makerAmount - } else if (makerAmount && makerToken === Tokens.DOLLAR) { + } else if (makerAmount && makerToken === CURRENCY_ENUM.DOLLAR) { dollarMakerAmount = makerAmount goldMakerAmount = LARGE_GOLD_SELL_AMOUNT_IN_WEI } else { @@ -100,13 +100,13 @@ export function* doFetchExchangeRate(makerAmount?: BigNumber, makerToken?: Token const dollarMakerExchangeRate: BigNumber = yield call( ContractUtils.getExchangeRate, web3, - Tokens.DOLLAR, + CURRENCY_ENUM.DOLLAR, new BigNumber(dollarMakerAmount) ) const goldMakerExchangeRate: BigNumber = yield call( ContractUtils.getExchangeRate, web3, - Tokens.GOLD, + CURRENCY_ENUM.GOLD, new BigNumber(goldMakerAmount) ) @@ -135,9 +135,9 @@ export function* doFetchExchangeRate(makerAmount?: BigNumber, makerToken?: Token } export function* exchangeGoldAndStableTokens(action: ExchangeTokensAction) { - Logger.debug(`${TAG}@exchangeGoldAndStableTokens`, 'Exchanging gold and stable tokens') + Logger.debug(`${TAG}@exchangeGoldAndStableTokens`, 'Exchanging gold and stable CURRENCY_ENUM') const { makerToken, makerAmount } = action - Logger.debug(TAG, `Exchanging ${makerAmount.toString()} of Tokens ${makerToken}`) + Logger.debug(TAG, `Exchanging ${makerAmount.toString()} of CURRENCY_ENUM ${makerToken}`) let txId: string | null = null try { const account: string = yield call(getConnectedUnlockedAccount) @@ -161,14 +161,14 @@ export function* exchangeGoldAndStableTokens(action: ExchangeTokensAction) { const exchangeContract: ExchangeType = yield call(getExchangeContract, web3) const makerTokenContract = - makerToken === Tokens.DOLLAR ? stableTokenContract : goldTokenContract + makerToken === CURRENCY_ENUM.DOLLAR ? stableTokenContract : goldTokenContract const convertedMakerAmount: BigNumber = yield call( convertToContractDecimals, makerAmount, makerTokenContract ) - const sellGold = makerToken === Tokens.GOLD + const sellGold = makerToken === CURRENCY_ENUM.GOLD const updatedExchangeRate: BigNumber = yield call( // Updating with actual makerAmount, rather than conservative estimate displayed @@ -179,7 +179,7 @@ export function* exchangeGoldAndStableTokens(action: ExchangeTokensAction) { ) const exceedsExpectedSize = - makerToken === Tokens.GOLD + makerToken === CURRENCY_ENUM.GOLD ? convertedMakerAmount.isGreaterThan(LARGE_GOLD_SELL_AMOUNT_IN_WEI) : convertedMakerAmount.isGreaterThan(LARGE_DOLLARS_SELL_AMOUNT_IN_WEI) @@ -206,7 +206,7 @@ export function* exchangeGoldAndStableTokens(action: ExchangeTokensAction) { } const takerTokenContract = - makerToken === Tokens.DOLLAR ? goldTokenContract : stableTokenContract + makerToken === CURRENCY_ENUM.DOLLAR ? goldTokenContract : stableTokenContract const convertedTakerAmount: BigNumber = roundDown( yield call(convertToContractDecimals, minimumTakerAmount, takerTokenContract), 0 @@ -218,12 +218,12 @@ export function* exchangeGoldAndStableTokens(action: ExchangeTokensAction) { ) let approveTx - if (makerToken === Tokens.GOLD) { + if (makerToken === CURRENCY_ENUM.GOLD) { approveTx = goldTokenContract.methods.approve( exchangeContract._address, convertedMakerAmount.toString() ) - } else if (makerToken === Tokens.DOLLAR) { + } else if (makerToken === CURRENCY_ENUM.DOLLAR) { approveTx = stableTokenContract.methods.approve( exchangeContract._address, convertedMakerAmount.toString() @@ -256,7 +256,7 @@ export function* exchangeGoldAndStableTokens(action: ExchangeTokensAction) { } function* createStandbyTx( - makerToken: Tokens, + makerToken: CURRENCY_ENUM, makerAmount: BigNumber, exchangeRate: BigNumber, account: string @@ -266,11 +266,11 @@ function* createStandbyTx( yield put( addStandbyTransaction({ id: txId, - type: TransactionTypes.EXCHANGED, + type: TransactionTypes.EXCHANGE, status: TransactionStatus.Pending, inSymbol: makerToken, inValue: makerAmount.toString(), - outSymbol: makerToken === Tokens.DOLLAR ? Tokens.GOLD : Tokens.DOLLAR, + outSymbol: makerToken === CURRENCY_ENUM.DOLLAR ? CURRENCY_ENUM.GOLD : CURRENCY_ENUM.DOLLAR, outValue: takerAmount.toString(), timestamp: Math.floor(Date.now() / 1000), }) diff --git a/packages/mobile/src/geth/network-config.ts b/packages/mobile/src/geth/network-config.ts index 90167d80021..9148cd3d303 100644 --- a/packages/mobile/src/geth/network-config.ts +++ b/packages/mobile/src/geth/network-config.ts @@ -5,21 +5,26 @@ export default { [Testnets.integration]: { nodeDir: `.${Testnets.integration}`, syncMode: SYNC_MODE_ULTRALIGHT, + blockchainApiUrl: 'https://integration-dot-celo-testnet.appspot.com/', }, [Testnets.alfajoresstaging]: { nodeDir: `.${Testnets.alfajoresstaging}`, syncMode: SYNC_MODE_ULTRALIGHT, + blockchainApiUrl: 'https://alfajoresstaging-dot-celo-testnet.appspot.com/', }, [Testnets.alfajores]: { nodeDir: `.${Testnets.alfajores}`, syncMode: SYNC_MODE_ULTRALIGHT, + blockchainApiUrl: 'https://alfajores-dot-celo-testnet-production.appspot.com/', }, [Testnets.pilot]: { nodeDir: `.${Testnets.pilot}`, syncMode: SYNC_MODE_ULTRALIGHT, + blockchainApiUrl: 'https://pilot-dot-celo-testnet-production.appspot.com/', }, [Testnets.pilotstaging]: { nodeDir: `.${Testnets.pilotstaging}`, syncMode: SYNC_MODE_ULTRALIGHT, + blockchainApiUrl: 'https://pilotstaging-dot-celo-testnet.appspot.com/', }, } diff --git a/packages/mobile/src/home/CeloDollarsOverview.test.tsx b/packages/mobile/src/home/CeloDollarsOverview.test.tsx new file mode 100644 index 00000000000..fee9ed981e0 --- /dev/null +++ b/packages/mobile/src/home/CeloDollarsOverview.test.tsx @@ -0,0 +1,16 @@ +import * as React from 'react' +import { Provider } from 'react-redux' +import * as renderer from 'react-test-renderer' +import CeloDollarsOverview from 'src/home/CeloDollarsOverview' +import { createMockStore } from 'test/utils' + +describe('CeloDollarsOverview', () => { + it('renders correctly', () => { + const tree = renderer.create( + + + + ) + expect(tree).toMatchSnapshot() + }) +}) diff --git a/packages/mobile/src/home/CeloDollarsOverview.tsx b/packages/mobile/src/home/CeloDollarsOverview.tsx new file mode 100644 index 00000000000..e52656d0ec4 --- /dev/null +++ b/packages/mobile/src/home/CeloDollarsOverview.tsx @@ -0,0 +1,68 @@ +import colors from '@celo/react-components/styles/colors' +import fontStyles from '@celo/react-components/styles/fonts' +import variables from '@celo/react-components/styles/variables' +import * as React from 'react' +import { Trans, withNamespaces, WithNamespaces } from 'react-i18next' +import { StyleSheet, Text, View } from 'react-native' +import componentWithAnalytics from 'src/analytics/wrapper' +import { LOCAL_CURRENCY_SYMBOL } from 'src/config' +import useBalanceAutoRefresh from 'src/home/useBalanceAutoRefresh' +import { Namespaces } from 'src/i18n' +import useLocalAmount from 'src/localCurrency/useLocalAmount' +import useSelector from 'src/redux/useSelector' +import { getMoneyDisplayValue } from 'src/utils/formatting' + +type Props = WithNamespaces + +function CeloDollarsOverview({ t }: Props) { + useBalanceAutoRefresh() + const dollarBalance = useSelector((state) => state.stableToken.balance) + const localBalance = useLocalAmount(dollarBalance) + const localValue = + localBalance || dollarBalance === null ? getMoneyDisplayValue(localBalance || 0) : '---' + const localCurrencySymbol = LOCAL_CURRENCY_SYMBOL + + return ( + + {t('global:celoDollars')} + + {getMoneyDisplayValue(dollarBalance || 0)} + + {LOCAL_CURRENCY_SYMBOL && ( + + + Equal to{' '} + + {{ localValue }} {{ localCurrencySymbol }} + + + + )} + + ) +} + +const styles = StyleSheet.create({ + container: { + paddingHorizontal: variables.contentPadding, + paddingVertical: 20, + }, + label: { + fontSize: 18, + color: colors.dark, + }, + balance: { + fontSize: 44, + // TODO: figure out why specifying the lineHeight with the font we're using + // breaks the vertical centering. Then remove the hardcoded height here! + lineHeight: 62, + height: 48, + color: colors.dark, + }, + localBalance: { + fontSize: 18, + color: '#B0B5B9', + }, +}) + +export default componentWithAnalytics(withNamespaces(Namespaces.walletFlow5)(CeloDollarsOverview)) diff --git a/packages/mobile/src/home/HeaderButton.tsx b/packages/mobile/src/home/HeaderButton.tsx new file mode 100644 index 00000000000..872fd918181 --- /dev/null +++ b/packages/mobile/src/home/HeaderButton.tsx @@ -0,0 +1,8 @@ +import Touchable, { Props } from '@celo/react-components/components/Touchable' +import React from 'react' + +const HIT_SLOP = { left: 15, bottom: 15, top: 15, right: 15 } + +export default function HeaderButton(props: Props) { + return +} diff --git a/packages/mobile/src/home/NotificationBox.tsx b/packages/mobile/src/home/NotificationBox.tsx index f8ee4f368df..0df3f067432 100644 --- a/packages/mobile/src/home/NotificationBox.tsx +++ b/packages/mobile/src/home/NotificationBox.tsx @@ -11,6 +11,7 @@ import { CustomEventNames } from 'src/analytics/constants' import { componentWithAnalytics } from 'src/analytics/wrapper' import { PROMOTE_REWARDS_APP } from 'src/config' import { EscrowedPayment } from 'src/escrow/actions' +import { getReclaimableEscrowPayments } from 'src/escrow/saga' import { setEducationCompleted as setGoldEducationCompleted } from 'src/goldToken/actions' import i18n, { Namespaces } from 'src/i18n' import { backupIcon, homeIcon, inviteFriendsIcon, rewardsAppIcon } from 'src/images/Images' @@ -30,7 +31,7 @@ interface StateProps { dismissedInviteFriends: boolean paymentRequests: PaymentRequest[] backupTooLate: boolean - sentPayments: EscrowedPayment[] + sentEscrowPayments: EscrowedPayment[] } interface DispatchProps { @@ -48,7 +49,7 @@ const mapStateToProps = (state: RootState): StateProps => ({ dismissedEarnRewards: state.account.dismissedEarnRewards, dismissedInviteFriends: state.account.dismissedInviteFriends, backupTooLate: isBackupTooLate(state), - sentPayments: state.escrow.sentEscrowedPayments, + sentEscrowPayments: state.escrow.sentEscrowedPayments, }) const mapDispatchToProps = { @@ -66,25 +67,10 @@ export class NotificationBox extends React.Component { currentIndex: 0, } - escrowedPaymentReminderNotification = (): Array> => { - const activeSentPayments = this.filterValidPayments() - const activeSentPaymentNotifications: Array> = activeSentPayments.map( - (payment) => - ) - return activeSentPaymentNotifications - } - - filterValidPayments = (): EscrowedPayment[] => { - const { sentPayments } = this.props - const validSentPayments: EscrowedPayment[] = [] - sentPayments.forEach((payment) => { - const paymentExpiryTime = +payment.timestamp + +payment.expirySeconds - const currUnixTime = Date.now() / 1000 - if (currUnixTime >= paymentExpiryTime) { - validSentPayments.push(payment) - } - }) - return validSentPayments + escrowedPaymentReminderNotification = () => { + return getReclaimableEscrowPayments(this.props.sentEscrowPayments).map((payment) => ( + + )) } paymentRequestsNotification = (): Array> => { diff --git a/packages/mobile/src/home/WalletHome.tsx b/packages/mobile/src/home/WalletHome.tsx index 244f7d34c83..b6d9ba3ef10 100644 --- a/packages/mobile/src/home/WalletHome.tsx +++ b/packages/mobile/src/home/WalletHome.tsx @@ -1,5 +1,5 @@ -import SectionHead from '@celo/react-components/components/SectionHead' -import Touchable from '@celo/react-components/components/Touchable' +import SectionHeadNew from '@celo/react-components/components/SectionHeadNew' +import QRCodeBorderlessIcon from '@celo/react-components/icons/QRCodeBorderless' import SettingsIcon from '@celo/react-components/icons/Settings' import colors from '@celo/react-components/styles/colors' import fontStyles from '@celo/react-components/styles/fonts' @@ -19,13 +19,13 @@ import { import { BoxShadow } from 'react-native-shadow' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' -import AccountInfo from 'src/account/AccountInfo' import { hideAlert, showMessage } from 'src/alert/actions' import componentWithAnalytics from 'src/analytics/wrapper' import { exitBackupFlow } from 'src/app/actions' -import AccountOverview from 'src/components/AccountOverview' -import { ALERT_BANNER_DURATION } from 'src/config' +import { ALERT_BANNER_DURATION, SHOW_TESTNET_BANNER } from 'src/config' import { refreshAllBalances, setLoading } from 'src/home/actions' +import CeloDollarsOverview from 'src/home/CeloDollarsOverview' +import HeaderButton from 'src/home/HeaderButton' import NotificationBox from 'src/home/NotificationBox' import { callToActNotificationSelector, getActiveNotificationCount } from 'src/home/selectors' import TransactionsList from 'src/home/TransactionsList' @@ -44,6 +44,8 @@ import { resetStandbyTransactions } from 'src/transactions/actions' import { currentAccountSelector } from 'src/web3/selectors' const SCREEN_WIDTH = variables.width +const HEADER_ICON_SIZE = 24 +const HEADER_BUTTON_MARGIN = 12 interface StateProps { loading: boolean @@ -93,30 +95,6 @@ const mapStateToProps = (state: RootState): StateProps => ({ appConnected: isAppConnected(state), }) -const Header = () => { - return ( - <> - - - - ) -} - -const settings = () => { - navigate(Screens.Account) -} - -const HeaderIcon = () => ( - - - -) - const AnimatedSectionList: SectionList = Animated.createAnimatedComponent(SectionList) const HEADER_FADE_HEIGHT = 100 @@ -165,13 +143,18 @@ export class WalletHome extends React.Component { componentDidMount() { this.props.resetStandbyTransactions() this.props.initializeSentryUserContext() - this.showTestnetBanner() this.importContactsIfNeeded() + if (SHOW_TESTNET_BANNER) { + this.showTestnetBanner() + } } - renderSection = ({ section: { title, bubbleText } }: { section: SectionListData }) => ( - - ) + renderSection = ({ section: { title, bubbleText } }: { section: SectionListData }) => { + if (!title) { + return null + } + return + } keyExtractor = (_item: any, index: number) => { return index.toString() @@ -190,6 +173,14 @@ export class WalletHome extends React.Component { } } + onPressQrCode = () => { + navigate(Screens.QRCode) + } + + onPressSettings = () => { + navigate(Screens.Account) + } + render() { const { t, activeNotificationCount, callToActNotification } = this.props @@ -205,7 +196,6 @@ export class WalletHome extends React.Component { if (activeNotificationCount > 0 || callToActNotification) { sections.push({ - title: t('notifications'), data: [{}], renderItem: () => , bubbleText: activeNotificationCount ? activeNotificationCount.toString() : null, @@ -228,7 +218,7 @@ export class WalletHome extends React.Component { - + {this.props.appConnected ? ( {t('wallet')} @@ -238,7 +228,14 @@ export class WalletHome extends React.Component { )} - + + + + + + + + { sections={sections} stickySectionHeadersEnabled={true} renderSectionHeader={this.renderSection} - ListHeaderComponent={Header} + ListHeaderComponent={CeloDollarsOverview} keyExtractor={this.keyExtractor} /> @@ -267,20 +264,25 @@ const styles = StyleSheet.create({ containerFeed: { paddingBottom: 40, }, - settingsIcon: { - justifyContent: 'flex-end', - margin: 5, - position: 'absolute', - top: 10, - right: 10, - }, - head: { + header: { backgroundColor: colors.background, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', zIndex: 2, }, + headerRight: { + position: 'absolute', + top: 0, + right: variables.contentPadding - HEADER_BUTTON_MARGIN, + bottom: 0, + flexDirection: 'row', + alignItems: 'center', + }, + headerButton: { + justifyContent: 'flex-end', + margin: HEADER_BUTTON_MARGIN, + }, shadowContainer: { height: TOP_BAR_HEIGHT, position: 'absolute', diff --git a/packages/mobile/src/home/__snapshots__/CeloDollarsOverview.test.tsx.snap b/packages/mobile/src/home/__snapshots__/CeloDollarsOverview.test.tsx.snap new file mode 100644 index 00000000000..b305c726686 --- /dev/null +++ b/packages/mobile/src/home/__snapshots__/CeloDollarsOverview.test.tsx.snap @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CeloDollarsOverview renders correctly 1`] = ` + + + global:celoDollars + + + 0.00 + + + Equal to + + + 0.00 + + MXN + + + +`; diff --git a/packages/mobile/src/home/__snapshots__/NotificationBox.test.tsx.snap b/packages/mobile/src/home/__snapshots__/NotificationBox.test.tsx.snap index b81681abe00..7271da378e7 100644 --- a/packages/mobile/src/home/__snapshots__/NotificationBox.test.tsx.snap +++ b/packages/mobile/src/home/__snapshots__/NotificationBox.test.tsx.snap @@ -19,8 +19,8 @@ exports[`NotificationBox Backup too late test 1`] = ` @@ -30,7 +30,7 @@ exports[`NotificationBox Backup too late test 1`] = ` Object { "flexDirection": "row", "justifyContent": "space-between", - "padding": 10, + "padding": 16, "width": "100%", }, Object { @@ -46,7 +46,7 @@ exports[`NotificationBox Backup too late test 1`] = ` Object { "alignItems": "center", "flexDirection": "column", - "paddingRight": 10, + "paddingRight": 16, } } > @@ -170,8 +170,8 @@ exports[`NotificationBox Backup too late test 1`] = ` @@ -181,7 +181,7 @@ exports[`NotificationBox Backup too late test 1`] = ` Object { "flexDirection": "row", "justifyContent": "space-between", - "padding": 10, + "padding": 16, "width": "100%", }, Object { @@ -197,7 +197,7 @@ exports[`NotificationBox Backup too late test 1`] = ` Object { "alignItems": "center", "flexDirection": "column", - "paddingRight": 10, + "paddingRight": 16, } } > @@ -366,7 +366,7 @@ exports[`NotificationBox Backup too late test 1`] = ` "display": "flex", "flexDirection": "row", "justifyContent": "center", - "paddingBottom": 10, + "paddingBottom": 16, } } > @@ -417,8 +417,8 @@ exports[`NotificationBox Educations not completed yet 1`] = ` @@ -428,7 +428,7 @@ exports[`NotificationBox Educations not completed yet 1`] = ` Object { "flexDirection": "row", "justifyContent": "space-between", - "padding": 10, + "padding": 16, "width": "100%", }, Object { @@ -444,7 +444,7 @@ exports[`NotificationBox Educations not completed yet 1`] = ` Object { "alignItems": "center", "flexDirection": "column", - "paddingRight": 10, + "paddingRight": 16, } } > @@ -628,8 +628,8 @@ exports[`NotificationBox Payment Requests exist 1`] = ` @@ -639,7 +639,7 @@ exports[`NotificationBox Payment Requests exist 1`] = ` Object { "flexDirection": "row", "justifyContent": "space-between", - "padding": 10, + "padding": 16, "width": "100%", }, Object { @@ -655,7 +655,7 @@ exports[`NotificationBox Payment Requests exist 1`] = ` Object { "alignItems": "center", "flexDirection": "column", - "paddingRight": 10, + "paddingRight": 16, } } > @@ -841,8 +841,8 @@ exports[`NotificationBox Simple test 1`] = ` @@ -852,7 +852,7 @@ exports[`NotificationBox Simple test 1`] = ` Object { "flexDirection": "row", "justifyContent": "space-between", - "padding": 10, + "padding": 16, "width": "100%", }, Object { @@ -868,7 +868,7 @@ exports[`NotificationBox Simple test 1`] = ` Object { "alignItems": "center", "flexDirection": "column", - "paddingRight": 10, + "paddingRight": 16, } } > @@ -992,8 +992,8 @@ exports[`NotificationBox Simple test 1`] = ` @@ -1003,7 +1003,7 @@ exports[`NotificationBox Simple test 1`] = ` Object { "flexDirection": "row", "justifyContent": "space-between", - "padding": 10, + "padding": 16, "width": "100%", }, Object { @@ -1019,7 +1019,7 @@ exports[`NotificationBox Simple test 1`] = ` Object { "alignItems": "center", "flexDirection": "column", - "paddingRight": 10, + "paddingRight": 16, } } > @@ -1188,7 +1188,7 @@ exports[`NotificationBox Simple test 1`] = ` "display": "flex", "flexDirection": "row", "justifyContent": "center", - "paddingBottom": 10, + "paddingBottom": 16, } } > diff --git a/packages/mobile/src/home/__snapshots__/WalletHome.test.tsx.snap b/packages/mobile/src/home/__snapshots__/WalletHome.test.tsx.snap index 900c2df9a57..110284e8395 100644 --- a/packages/mobile/src/home/__snapshots__/WalletHome.test.tsx.snap +++ b/packages/mobile/src/home/__snapshots__/WalletHome.test.tsx.snap @@ -13,7 +13,7 @@ exports[`Testnet banner Shows testnet banner for 5 seconds 1`] = ` - - - + width={24} + > + + + + + + + + + + + + + + + + + - - - - - J - - - - - - - - - - - - - - - - + global:celoDollars + - John Doe + 0.00 - - - +1 - + Equal to + - (415) 555-6666 + 0.00 + + MXN - + activity + { test('ask for balance when geth and account are ready', () => expectSaga(refreshBalances) @@ -17,7 +27,7 @@ describe('refreshBalances', () => { describe('watchRefreshBalances', () => { test('reacts on REFRESH_BALANCES', async () => { - const p = expectSaga(_watchRefreshBalances) + await expectSaga(_watchRefreshBalances) .put(setLoading(true)) .put(setLoading(false)) .provide([[call(getConnectedAccount), true]]) @@ -25,8 +35,6 @@ describe('watchRefreshBalances', () => { .put(fetchGoldBalance()) .dispatch(refreshAllBalances()) .run() - jest.runAllTimers() - await p }) }) @@ -55,3 +63,28 @@ describe('withLoading Saga', () => { ).rejects.toEqual(expect.any(Error)) }) }) + +describe('autoRefreshSaga', () => { + it('dispatches the appropriate actions', async () => { + let delayCallCount = 0 + // Workaround redux-saga-test-plan not supporting the new `yield delay(x)` syntax + // @ts-ignore + const provideDelayOnce = ({ fn }, next) => { + if (fn.name === 'delayP' && delayCallCount < 1) { + delayCallCount += 1 + return null + } + return next() + } + + await expectSaga(_autoRefreshSaga) + .provide([ + [select(shouldUpdateBalance), true], + [select(shouldFetchCurrentRate), true], + { call: provideDelayOnce }, + ]) + .put(refreshAllBalances()) + .put(fetchCurrentRate()) + .run() + }) +}) diff --git a/packages/mobile/src/home/saga.ts b/packages/mobile/src/home/saga.ts index 7d5165525bc..4aa7c89c2dd 100644 --- a/packages/mobile/src/home/saga.ts +++ b/packages/mobile/src/home/saga.ts @@ -9,9 +9,11 @@ import { take, takeLeading, } from 'redux-saga/effects' -import { fetchSentPayments } from 'src/escrow/actions' +import { fetchSentEscrowPayments } from 'src/escrow/actions' import { fetchGoldBalance } from 'src/goldToken/actions' import { Actions, refreshAllBalances, setLoading } from 'src/home/actions' +import { fetchCurrentRate } from 'src/localCurrency/actions' +import { shouldFetchCurrentRate } from 'src/localCurrency/selectors' import { withTimeout } from 'src/redux/sagas-helpers' import { shouldUpdateBalance } from 'src/redux/selectors' import { fetchDollarBalance } from 'src/stableToken/actions' @@ -38,7 +40,7 @@ export function* refreshBalances() { yield call(getConnectedAccount) yield put(fetchDollarBalance()) yield put(fetchGoldBalance()) - yield put(fetchSentPayments()) + yield put(fetchSentEscrowPayments()) } export function* refreshBalancesWithLoadingSaga() { @@ -50,10 +52,13 @@ export function* refreshBalancesWithLoadingSaga() { function* autoRefreshSaga() { while (true) { - yield delay(10 * 1000) // sleep 10 seconds if (yield select(shouldUpdateBalance)) { - put(refreshAllBalances()) + yield put(refreshAllBalances()) + } + if (yield select(shouldFetchCurrentRate)) { + yield put(fetchCurrentRate()) } + yield delay(10 * 1000) // sleep 10 seconds } } @@ -83,3 +88,4 @@ export function* homeSaga() { } export const _watchRefreshBalances = watchRefreshBalances +export const _autoRefreshSaga = autoRefreshSaga diff --git a/packages/mobile/src/home/useBalanceAutoRefresh.ts b/packages/mobile/src/home/useBalanceAutoRefresh.ts new file mode 100644 index 00000000000..61b4bd40a2e --- /dev/null +++ b/packages/mobile/src/home/useBalanceAutoRefresh.ts @@ -0,0 +1,15 @@ +import { useEffect } from 'react' +import { useDispatch } from 'react-redux' +import { startBalanceAutorefresh, stopBalanceAutorefresh } from 'src/home/actions' + +export default function useBalanceAutoRefresh() { + const dispatch = useDispatch() + + useEffect(() => { + dispatch(startBalanceAutorefresh()) + + return () => { + dispatch(stopBalanceAutorefresh()) + } + }, []) +} diff --git a/packages/mobile/src/i18n.ts b/packages/mobile/src/i18n.ts index e7b17c3b62d..be2ad4fdf63 100644 --- a/packages/mobile/src/i18n.ts +++ b/packages/mobile/src/i18n.ts @@ -41,7 +41,8 @@ const languageDetector = { const currencyInterpolator = (text: string, value: any) => { const key = value[1] const translations = currencyTranslations[i18n.language] - if (key in translations) { + + if (translations && key in translations) { return translations[key] } else { Logger.warn( @@ -65,9 +66,9 @@ i18n common: en_US, ...locales.enUS, }, - 'es-AR': { + 'es-419': { common: es_LA, - ...locales.esAR, + ...locales.es_419, }, }, ns: ['common', ...Object.keys(Namespaces)], diff --git a/packages/mobile/src/icons/Exchange.tsx b/packages/mobile/src/icons/Exchange.tsx deleted file mode 100644 index 61c850cc660..00000000000 --- a/packages/mobile/src/icons/Exchange.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import colors from '@celo/react-components/styles/colors' -import * as React from 'react' -import Svg, { Path } from 'svgs' - -interface Props { - height?: number - color?: string -} - -export default class WordLogo extends React.Component { - static defaultProps = { - width: 29, - height: 28, - color: colors.darkSecondary, - } - - render() { - return ( - - - - ) - } -} diff --git a/packages/mobile/src/icons/FindUser.tsx b/packages/mobile/src/icons/FindUser.tsx index 19f3d031269..b3430aad26f 100644 --- a/packages/mobile/src/icons/FindUser.tsx +++ b/packages/mobile/src/icons/FindUser.tsx @@ -9,8 +9,8 @@ interface Props { export default class FindUser extends React.PureComponent { static defaultProps = { - height: 70, - width: 80, + height: 50, + width: 50, } render() { diff --git a/packages/mobile/src/icons/GoldTab.tsx b/packages/mobile/src/icons/GoldTab.tsx new file mode 100644 index 00000000000..01f8876255f --- /dev/null +++ b/packages/mobile/src/icons/GoldTab.tsx @@ -0,0 +1,34 @@ +import colors from '@celo/react-components/styles/colors' +import * as React from 'react' +import Svg, { Circle, Path } from 'svgs' + +interface Props { + height?: number + color?: string +} + +export default class GoldTab extends React.Component { + static defaultProps = { + width: 22.5, + height: 22.5, + color: colors.darkSecondary, + } + + render() { + return ( + + + + + ) + } +} diff --git a/packages/mobile/src/icons/NuxLogo.tsx b/packages/mobile/src/icons/NuxLogo.tsx index 42f25e78edf..e6383bf1ea0 100644 --- a/packages/mobile/src/icons/NuxLogo.tsx +++ b/packages/mobile/src/icons/NuxLogo.tsx @@ -11,7 +11,7 @@ interface Props { export default class NuxLogo extends React.PureComponent { static defaultProps = { style: {}, - height: 50, + height: 35, } render() { @@ -26,7 +26,6 @@ export default class NuxLogo extends React.PureComponent { const styles = StyleSheet.create({ logo: { alignItems: 'center', - marginTop: 25, - marginBottom: 25, + marginBottom: 20, }, }) diff --git a/packages/mobile/src/icons/PaymentsIcon.tsx b/packages/mobile/src/icons/PaymentsIcon.tsx index ab7a4640a4a..d18699d8f7b 100644 --- a/packages/mobile/src/icons/PaymentsIcon.tsx +++ b/packages/mobile/src/icons/PaymentsIcon.tsx @@ -1,6 +1,6 @@ import colors from '@celo/react-components/styles/colors' import * as React from 'react' -import Svg, { Path } from 'svgs' +import Svg, { Line, Rect } from 'svgs' interface Props { height?: number @@ -10,9 +10,9 @@ interface Props { export default class PaymentsIcon extends React.PureComponent { static defaultProps = { - width: 36, - height: 22, - color: colors.darkSecondary, + width: 28, + height: 28, + color: colors.dark, } render() { @@ -21,14 +21,20 @@ export default class PaymentsIcon extends React.PureComponent { xmlns="http://www.w3.org/2000/svg" height={this.props.height} width={this.props.width} - viewBox="0 0 36 22" + viewBox="0 0 34 34" + fill="none" > - + + ) } diff --git a/packages/mobile/src/icons/ThreeChecks.tsx b/packages/mobile/src/icons/ThreeChecks.tsx index 9142a04b4dc..29c8e467ad6 100644 --- a/packages/mobile/src/icons/ThreeChecks.tsx +++ b/packages/mobile/src/icons/ThreeChecks.tsx @@ -9,8 +9,8 @@ interface Props { export default class ThreeChecks extends React.PureComponent { static defaultProps = { - height: 70, - width: 80, + height: 50, + width: 50, } render() { diff --git a/packages/mobile/src/icons/VerifyAddressBook.tsx b/packages/mobile/src/icons/VerifyAddressBook.tsx index c585f07dc4e..44cccee6710 100644 --- a/packages/mobile/src/icons/VerifyAddressBook.tsx +++ b/packages/mobile/src/icons/VerifyAddressBook.tsx @@ -9,8 +9,8 @@ interface Props { export default class VerifyAddressBook extends React.PureComponent { static defaultProps = { - height: 70, - width: 80, + height: 50, + width: 50, } render() { diff --git a/packages/mobile/src/icons/Wallet.tsx b/packages/mobile/src/icons/Wallet.tsx index fb6c9d1bf59..bbca55c172f 100644 --- a/packages/mobile/src/icons/Wallet.tsx +++ b/packages/mobile/src/icons/Wallet.tsx @@ -1,18 +1,17 @@ import colors from '@celo/react-components/styles/colors' import * as React from 'react' -import Svg, { Path } from 'svgs' +import Svg, { Rect } from 'svgs' interface Props { height?: number color?: string width?: number } - export default class Wallet extends React.Component { static defaultProps = { - width: 30, - height: 30, - color: colors.darkSecondary, + width: 27, + height: 18, + color: colors.dark, } render() { @@ -20,13 +19,29 @@ export default class Wallet extends React.Component { - + ) diff --git a/packages/mobile/src/identity/verification.ts b/packages/mobile/src/identity/verification.ts index f038670ea8c..12f6d57f89c 100644 --- a/packages/mobile/src/identity/verification.ts +++ b/packages/mobile/src/identity/verification.ts @@ -233,8 +233,10 @@ export async function requestAndRetrieveAttestations( account ) + CeloAnalytics.track(CustomEventNames.verification_actionable_attestation_start) // Check if we have a sufficient set now by fetching the new total set attestations = await getActionableAttestations(attestationsContract, e164NumberHash, account) + CeloAnalytics.track(CustomEventNames.verification_actionable_attestation_finish) } return attestations @@ -360,6 +362,7 @@ function attestationCodeReceiver( Logger.debug(TAG + '@attestationCodeReceiver', `Received code for issuer ${issuer}`) + CeloAnalytics.track(CustomEventNames.verification_validate_code_start, { issuer }) const isValidRequest = yield call( validateAttestationCode, attestationsContract, @@ -368,6 +371,8 @@ function attestationCodeReceiver( issuer, code ) + CeloAnalytics.track(CustomEventNames.verification_validate_code_finish, { issuer }) + if (isValidRequest === NULL_ADDRESS) { throw new Error('Code is not valid') } diff --git a/packages/mobile/src/images/Images.ts b/packages/mobile/src/images/Images.ts index 73c0217896c..ba36aa04727 100644 --- a/packages/mobile/src/images/Images.ts +++ b/packages/mobile/src/images/Images.ts @@ -30,9 +30,9 @@ export const stabilityScale = require('src/images/stability-scale.png') export const verifyAddressBook = require('src/images/verify-address-book.png') export const verifyPhone = require('src/images/verify-phone.png') export const faucetIcon = require('src/images/coins-logo.png') +export const coinsIcon = require('src/images/coins-logo.png') export const rewardsAppIcon = require('src/images/Rewards-app-icon.png') export const inviteFriendsIcon = require('src/images/Invite-Friends.png') export const sendDollar = require('src/images/send-dollar.png') export const unknownUserIcon = require('src/images/unknown-user-icon.png') -export const inviteVerifyFee = require('src/transactions/InviteVerifyFee.png') // it looks like jests tests fail when a sub component references image via this file rather than require direct diff --git a/packages/mobile/src/images/backup-icon.png b/packages/mobile/src/images/backup-icon.png index eeccc1baf43..6e8f2c31a51 100644 Binary files a/packages/mobile/src/images/backup-icon.png and b/packages/mobile/src/images/backup-icon.png differ diff --git a/packages/mobile/src/images/backup-icon@2x.png b/packages/mobile/src/images/backup-icon@2x.png new file mode 100644 index 00000000000..dd94fcf4950 Binary files /dev/null and b/packages/mobile/src/images/backup-icon@2x.png differ diff --git a/packages/mobile/src/images/backup-icon@3x.png b/packages/mobile/src/images/backup-icon@3x.png new file mode 100644 index 00000000000..3fe1e5144dd Binary files /dev/null and b/packages/mobile/src/images/backup-icon@3x.png differ diff --git a/packages/mobile/src/import/ImportContacts.tsx b/packages/mobile/src/import/ImportContacts.tsx index 8e209bece7f..aaa85360061 100644 --- a/packages/mobile/src/import/ImportContacts.tsx +++ b/packages/mobile/src/import/ImportContacts.tsx @@ -1,6 +1,7 @@ import Button, { BtnTypes } from '@celo/react-components/components/Button' import colors from '@celo/react-components/styles/colors' import { fontStyles } from '@celo/react-components/styles/fonts' +import { componentStyles } from '@celo/react-components/styles/styles' import * as React from 'react' import { WithNamespaces, withNamespaces } from 'react-i18next' import { ActivityIndicator, ScrollView, StyleSheet, Text, View } from 'react-native' @@ -104,19 +105,16 @@ class ImportContacts extends React.Component { {t('importContactsPermission.title')} - - {t('importContactsPermission.0')} - - + + {t('importContactsPermission.0')} + + {t('importContactsPermission.1')} {isSubmitting && ( - - {t('importContactsPermission.loading')} - )} @@ -148,16 +146,17 @@ const style = StyleSheet.create({ justifyContent: 'space-between', }, scrollContainer: { - marginHorizontal: 10, + flex: 1, + padding: 20, + paddingTop: 0, + alignItems: 'center', + justifyContent: 'center', }, contactsLogo: { alignSelf: 'center', marginBottom: 10, marginTop: 10, }, - explanation: { - marginVertical: 10, - }, loadingContainer: { marginVertical: 30, }, diff --git a/packages/mobile/src/import/ImportWallet.tsx b/packages/mobile/src/import/ImportWallet.tsx index 0a901a854d9..33e37a35a57 100644 --- a/packages/mobile/src/import/ImportWallet.tsx +++ b/packages/mobile/src/import/ImportWallet.tsx @@ -126,6 +126,10 @@ export class ImportWallet extends React.Component { } } + isBackupPhraseValid() { + return this.state.backupPhrase.trim().split(/\s+/g).length >= 12 + } + render() { const { backupPhrase, isSubmitting } = this.state const { t, error } = this.props @@ -136,7 +140,7 @@ export class ImportWallet extends React.Component { contentContainerStyle={styles.scrollContainer} keyboardShouldPersistTaps="always" > - + {t('restoreYourWallet.title')} {t('restoreYourWallet.userYourBackupKey')} @@ -177,7 +181,7 @@ export class ImportWallet extends React.Component { )} @@ -62,8 +66,8 @@ exports[`ImportContacts Screen renders correctly 1`] = ` style={ Array [ Object { - "height": 70, - "width": 80, + "height": 50, + "width": 50, }, Object { "alignSelf": "center", @@ -77,6 +81,7 @@ exports[`ImportContacts Screen renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -91,37 +96,37 @@ exports[`ImportContacts Screen renders correctly 1`] = ` > importContactsPermission.title - - - importContactsPermission.0 - - + "fontSize": 17, + "lineHeight": 26, + }, + Object { + "textAlign": "center", + }, + ] + } + > + importContactsPermission.0 + @@ -68,8 +66,8 @@ exports[`ImportWallet renders correctly 1`] = ` } style={ Object { - "height": 50, - "width": 50, + "height": 35, + "width": 35, } } /> @@ -78,6 +76,7 @@ exports[`ImportWallet renders correctly 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, @@ -292,7 +291,8 @@ exports[`ImportWallet renders with an error 1`] = ` automaticallyAdjustContentInsets={false} contentContainerStyle={ Object { - "paddingHorizontal": 10, + "padding": 20, + "paddingTop": 0, } } contentInset={ @@ -328,12 +328,9 @@ exports[`ImportWallet renders with an error 1`] = ` Array [ Object { "alignItems": "center", - "marginBottom": 25, - "marginTop": 25, - }, - Object { - "marginTop": 0, + "marginBottom": 20, }, + Object {}, ] } > @@ -346,8 +343,8 @@ exports[`ImportWallet renders with an error 1`] = ` } style={ Object { - "height": 50, - "width": 50, + "height": 35, + "width": 35, } } /> @@ -356,6 +353,7 @@ exports[`ImportWallet renders with an error 1`] = ` style={ Array [ Object { + "color": "#2E3338", "fontFamily": "Hind-Light", "fontSize": 22, "paddingBottom": 20, diff --git a/packages/mobile/src/invite/EnterInviteCode.tsx b/packages/mobile/src/invite/EnterInviteCode.tsx index cb41b6a7db7..72e61356803 100644 --- a/packages/mobile/src/invite/EnterInviteCode.tsx +++ b/packages/mobile/src/invite/EnterInviteCode.tsx @@ -1,9 +1,9 @@ import Button, { BtnTypes } from '@celo/react-components/components/Button' -import Link from '@celo/react-components/components/Link' import SmallButton from '@celo/react-components/components/SmallButton' import InviteCodeIcon from '@celo/react-components/icons/InviteCodeIcon' import colors from '@celo/react-components/styles/colors' import fontStyles from '@celo/react-components/styles/fonts' +import { componentStyles } from '@celo/react-components/styles/styles' import * as React from 'react' import { WithNamespaces, withNamespaces } from 'react-i18next' import { @@ -166,78 +166,82 @@ export class EnterInviteCode extends React.Component { + {t('inviteCodeText.title')} - - - - - {t('inviteCodeText.copyInvite.0')} - {t('inviteCodeText.copyInvite.1')} - + + + {t('inviteCodeText.copyInvite.0')} + {t('inviteCodeText.copyInvite.1')} + - - {this.props.redeemComplete ? ( - {t('inviteCodeText.inviteAccepted')} - ) : ( - !this.state.isSubmitting && - (!this.state.validCode ? ( - - - - {t('inviteCodeText.openMessages.hint.0')} - - {t('inviteCodeText.openMessages.hint.1')} - - - + {this.props.redeemComplete ? ( + + {t('inviteCodeText.inviteAccepted')} + ) : ( - - - {t('inviteCodeText.pasteInviteCode.hint')} - - - - )) - )} - {this.state.isSubmitting && - !this.props.redeemComplete && ( - - - - {t('inviteCodeText.validating.0')} + !this.state.isSubmitting && + (!this.state.validCode ? ( + + + + {t('inviteCodeText.openMessages.hint.0')} + + {t('inviteCodeText.openMessages.hint.1')} - {t('inviteCodeText.validating.1')} - - - + + + ) : ( + + + {t('inviteCodeText.pasteInviteCode.hint')} + + + + )) )} + {this.state.isSubmitting && + !this.props.redeemComplete && ( + + + + {t('inviteCodeText.validating.0')} + + {t('inviteCodeText.validating.1')} + + + + )} + - - - {t('inviteCodeText.askForInvite.0')} - - {t('inviteCodeText.askForInvite.1')} + + {t('inviteCodeText.askForInvite.0')} - {t('inviteCodeText.askForInvite.2')} + {t('inviteCodeText.askForInvite.1')}