diff --git a/.circleci/config.yml b/.circleci/config.yml index 330deda117..cefc4e8f91 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,12 +19,12 @@ executors: builder: docker: - - image: omisegoimages/elixir-omg-builder:stable-20200410 + - image: omisegoimages/elixir-omg-builder:stable-20201207 working_directory: ~/src builder_pg: docker: - - image: omisegoimages/elixir-omg-builder:stable-20200410 + - image: omisegoimages/elixir-omg-builder:stable-20201207 - image: circleci/postgres:9.6-alpine environment: POSTGRES_USER: omisego_dev @@ -34,7 +34,7 @@ executors: builder_pg_geth: docker: - - image: omisegoimages/elixir-omg-tester:stable-20200410 + - image: omisegoimages/elixir-omg-tester:stable-20201207 - image: circleci/postgres:9.6-alpine environment: POSTGRES_USER: omisego_dev @@ -44,10 +44,24 @@ executors: deployer: docker: - - image: omisegoimages/elixir-omg-deploy:stable-20200410 + - image: omisegoimages/elixir-omg-deploy:stable-20201207 working_directory: ~/src commands: + add_rust_to_path: + description: "Add path to PATH env var" + steps: + - run: + name: Add rust to PATH env + command: echo 'export PATH=~/.cargo/bin/:$PATH' >> $BASH_ENV + install_rust: + description: "Install Rust" + steps: + - run: + name: Install Rust + command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + - add_rust_to_path + setup_elixir-omg_workspace: description: "Setup workspace" steps: @@ -80,19 +94,6 @@ commands: steps: # otherwise docker compose down errors with ERROR: Couldn't find env file - run: touch localchain_contract_addresses.env - - restore_cache: - key: v2-asdf-install - - run: - name: Install Erlang and Elixir - command: | - [ -d ~/.asdf-vm ] || git clone https://github.com/asdf-vm/asdf.git ~/.asdf-vm --branch v0.8.0 - echo 'source ~/.asdf-vm/asdf.sh' >> $BASH_ENV - source $BASH_ENV - asdf plugin-add erlang || asdf plugin-update erlang - asdf plugin-add elixir || asdf plugin-update elixir - asdf install - no_output_timeout: 2400 - - run: make install-hex-rebar - run: docker-compose down - run: sudo rm -rf data/ - run: @@ -138,8 +139,10 @@ commands: source $BASH_ENV asdf plugin-add erlang || asdf plugin-update erlang asdf plugin-add elixir || asdf plugin-update elixir + asdf plugin-add rust || asdf plugin-update rust asdf install no_output_timeout: 2400 + - install_rust - save_cache: key: v2-asdf-install paths: @@ -178,13 +181,13 @@ jobs: no_output_timeout: 2400 - run: make deps-elixir-omg - run: ERLANG_ROCKSDB_BUILDOPTS='-j 2' make build-test - - run: mix test --trace + - run: mix test - run: name: Integration Tests command: | - # Slow, serial integration test, run nightly. Here to make sure the standard `mix test --only integration --trace` works + # Slow, serial integration test, run nightly. Here to make sure the standard `mix test --only integration ` works export SHELL=/bin/bash - mix test --only integration --trace + mix test --only integration no_output_timeout: 30m barebuild_macos: executor: metal_macos @@ -215,7 +218,7 @@ jobs: no_output_timeout: 2400 - run: make deps-elixir-omg - run: ERLANG_ROCKSDB_BUILDOPTS='-j 2' make build-test - - run: mix test --trace + - run: mix test build: executor: builder environment: @@ -295,7 +298,7 @@ jobs: _counter=$(mix credo --only Credo.Check.Readability.SinglePipe | grep -c "Use a function call when a pipeline is only one function long") echo "Current Credo.Check.Readability.SinglePipe occurrences:" echo $_counter - if [ $_counter -gt 295 ]; then + if [ $_counter -gt 289 ]; then echo "Have you been naughty or nice? Find out if Santa knows." exit 1 fi @@ -357,16 +360,16 @@ jobs: # Don't submit coverage report for forks, but let the build succeed export SHELL=/bin/bash if [[ -z "$COVERALLS_REPO_TOKEN" ]]; then - mix coveralls.html --parallel --umbrella --include watcher --exclude watcher_info --exclude common --exclude test --trace + mix coveralls.html --parallel --umbrella --include watcher --exclude watcher_info --exclude common --exclude test else - mix coveralls.circle --parallel --umbrella --include watcher --exclude watcher_info --exclude common --exclude test --trace || + mix coveralls.circle --parallel --umbrella --include watcher --exclude watcher_info --exclude common --exclude test || # if mix failed, then coveralls_report won't run, so signal done here and return original exit status (retval=$? && curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" && exit $retval) fi watcher_mix_based_childchain: machine: - image: ubuntu-1604:201903-01 + image: ubuntu-2004:202010-01 environment: MIX_ENV: test steps: @@ -478,9 +481,9 @@ jobs: # Don't submit coverage report for forks, but let the build succeed export SHELL=/bin/bash if [[ -z "$COVERALLS_REPO_TOKEN" ]]; then - mix coveralls.html --parallel --umbrella --include watcher_info --exclude watcher --exclude common --exclude test --trace + mix coveralls.html --parallel --umbrella --include watcher_info --exclude watcher --exclude common --exclude test else - mix coveralls.circle --parallel --umbrella --include watcher_info --exclude watche --exclude common --exclude test --trace || + mix coveralls.circle --parallel --umbrella --include watcher_info --exclude watche --exclude common --exclude test || # if mix failed, then coveralls_report won't run, so signal done here and return original exit status (retval=$? && curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" && exit $retval) fi @@ -503,9 +506,9 @@ jobs: # Don't submit coverage report for forks, but let the build succeed export SHELL=/bin/bash if [[ -z "$COVERALLS_REPO_TOKEN" ]]; then - mix coveralls.html --parallel --umbrella --include common --exclude watcher --exclude watcher_info --exclude test --trace + mix coveralls.html --parallel --umbrella --include common --exclude watcher --exclude watcher_info --exclude test else - mix coveralls.circle --parallel --umbrella --include common --exclude watcher --exclude watcher_info --exclude test --trace || + mix coveralls.circle --parallel --umbrella --include common --exclude watcher --exclude watcher_info --exclude test || # if mix failed, then coveralls_report won't run, so signal done here and return original exit status (retval=$? && curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" && exit $retval) fi @@ -528,9 +531,9 @@ jobs: # Don't submit coverage report for forks, but let the build succeed export SHELL=/bin/bash if [[ -z "$COVERALLS_REPO_TOKEN" ]]; then - mix coveralls.html --parallel --umbrella --trace --exclude common --exclude watcher --exclude watcher_info + mix coveralls.html --parallel --umbrella --exclude common --exclude watcher --exclude watcher_info else - mix coveralls.circle --parallel --umbrella --trace --exclude common --exclude watcher --exclude watcher_info || + mix coveralls.circle --parallel --umbrella --exclude common --exclude watcher --exclude watcher_info || # if mix failed, then coveralls_report won't run, so signal done here and return original exit status (retval=$? && curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done" && exit $retval) fi @@ -552,7 +555,7 @@ jobs: command: | export SHELL=/bin/bash # no coverage calculation, coverage is on the other tests - mix test --only property --trace + mix test --only property integration_tests: executor: builder_pg_geth @@ -569,9 +572,9 @@ jobs: - run: name: Integration Tests command: | - # Slow, serial integration test, run nightly. Here to make sure the standard `mix test --trace --only integration` works + # Slow, serial integration test, run nightly. Here to make sure the standard `mix test --only integration` works export SHELL=/bin/bash - mix test --trace --only integration + mix test --only integration dialyzer: executor: builder_pg @@ -612,13 +615,12 @@ jobs: test_docker_compose_release: machine: - image: ubuntu-1604:201903-01 + image: ubuntu-2004:202010-01 environment: SNAPSHOT: SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120 parallelism: 4 steps: - checkout - - install_elixir - run: name: "Pull Submodules" command: | @@ -634,13 +636,14 @@ jobs: name: Start daemon services command: | make init_test - cp ./localchain_contract_addresses.env ./priv/cabbage/localchain_contract_addresses.env + cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.specs.yml up -d || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;) - run: name: Log daemon services command: make cabbage-logs background: true - check_docker_status + - install_elixir - run: sh .circleci/status.sh - run: name: Run specs @@ -657,13 +660,12 @@ jobs: test_docker_compose_performance: description: "These are not actually performance tests, we're checking if the scripts work" machine: - image: ubuntu-1604:201903-01 + image: ubuntu-2004:202010-01 environment: PERF_IMAGE_NAME: "omisego/perf:latest" STATIX_TAG: "env:perf_circleci" steps: - checkout - - install_elixir - run: name: Setup data dir command: | @@ -673,6 +675,7 @@ jobs: - run: name: Build perf docker image command: make docker-perf IMAGE_NAME=$PERF_IMAGE_NAME + - install_elixir - run: name: Start daemon services command: | @@ -725,12 +728,11 @@ jobs: test_docker_compose_reorg: machine: - image: ubuntu-1604:201903-01 + image: ubuntu-2004:202010-01 environment: REORG: true steps: - checkout - - install_elixir - run: name: "Pull Submodules" command: | @@ -748,13 +750,14 @@ jobs: name: Start daemon services command: | make init_test_reorg - cp ./localchain_contract_addresses.env ./priv/cabbage/localchain_contract_addresses.env + cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml up -d || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;) - run: name: Log daemon services command: make cabbage-logs-reorg background: true - check_docker_status + - install_elixir - run: sh .circleci/status.sh - run: name: Print watcher logs @@ -788,12 +791,11 @@ jobs: test_barebone_release: machine: - image: ubuntu-1604:201903-01 + image: ubuntu-2004:202010-01 environment: TERM: xterm-256color steps: - checkout - - install_elixir - run: name: "Pull Submodules" command: | @@ -806,6 +808,7 @@ jobs: command: make start-services background: true - run: echo 'export PATH=~/.cargo/bin:$PATH' >> $BASH_ENV + - install_elixir - install_deps - run: make install-hex-rebar - restore_cache: @@ -877,9 +880,9 @@ jobs: publish_watcher: machine: - image: ubuntu-1604:201903-01 + image: ubuntu-2004:202010-01 environment: - WATCHER_IMAGE_NAME: "omisego/watcher2" + WATCHER_IMAGE_NAME: "omisego/watcher" steps: - checkout - run: make docker-watcher WATCHER_IMAGE_NAME=$WATCHER_IMAGE_NAME @@ -887,15 +890,15 @@ jobs: name: "cp release" command: | mkdir current_release/ - cp _build_docker/prod/watcher-$(cat VERSION)+$(git rev-parse --short=7 HEAD).tar.gz current_release/ - md5sum current_release/watcher-$(cat VERSION)+$(git rev-parse --short=7 HEAD).tar.gz | awk '{print $1}' >> current_release/md5 + cp _build_docker/prod/watcher-$(git describe --tags).tar.gz current_release/ + md5sum current_release/watcher-$(git describe --tags).tar.gz | awk '{print $1}' >> current_release/md5 - store_artifacts: path: current_release/ - run: IMAGE_NAME=$WATCHER_IMAGE_NAME sh .circleci/ci_publish.sh publish_perf: machine: - image: ubuntu-1604:201903-01 + image: ubuntu-2004:202010-01 environment: PERF_IMAGE_NAME: "omisego/perf" steps: @@ -905,9 +908,9 @@ jobs: publish_watcher_info: machine: - image: ubuntu-1604:201903-01 + image: ubuntu-2004:202010-01 environment: - WATCHER_INFO_IMAGE_NAME: "omisego/watcher_info2" + WATCHER_INFO_IMAGE_NAME: "omisego/watcher_info" steps: - checkout - run: make docker-watcher_info WATCHER_INFO_IMAGE_NAME=$WATCHER_INFO_IMAGE_NAME @@ -915,8 +918,8 @@ jobs: name: "cp release" command: | mkdir current_release/ - cp _build_docker/prod/watcher_info-$(cat VERSION)+$(git rev-parse --short=7 HEAD).tar.gz current_release/ - md5sum current_release/watcher_info-$(cat VERSION)+$(git rev-parse --short=7 HEAD).tar.gz | awk '{print $1}' >> current_release/md5 + cp _build_docker/prod/watcher_info-$(git describe --tags).tar.gz current_release/ + md5sum current_release/watcher_info-$(git describe --tags).tar.gz | awk '{print $1}' >> current_release/md5 - store_artifacts: path: current_release/ - run: IMAGE_NAME=$WATCHER_INFO_IMAGE_NAME sh .circleci/ci_publish.sh @@ -965,6 +968,13 @@ jobs: - checkout - run: APP_VERSION="${CIRCLE_TAG#*v}" sh .circleci/ci_increase_chart_version.sh + release: + docker: + - image: node:15.2.1 + steps: + - checkout + - run: npx -y semantic-release@17.2.3 + coveralls_report: docker: - image: omisegoimages/elixir-omg-circleci:v1.8-20190129-02 @@ -1099,8 +1109,8 @@ workflows: - publish_watcher: requires: [ - # test_barebone_release, - # test_docker_compose_release, + test_barebone_release, + test_docker_compose_release, watcher_coveralls_and_integration_tests, watcher_info_coveralls_and_integration_tests, common_coveralls_and_integration_tests, @@ -1114,18 +1124,17 @@ workflows: filters: &master_and_version_branches_and_all_tags branches: only: - - master-v2 + - master # vMAJOR.MINOR (e.g. v0.1, v0.2, v1.0, v2.1, etc.) - /^v[0-9]+\.[0-9]+/ - - master-v2 tags: only: - /.+/ - publish_watcher_info: requires: [ - # test_barebone_release, - # test_docker_compose_release, + test_barebone_release, + test_docker_compose_release, watcher_coveralls_and_integration_tests, watcher_info_coveralls_and_integration_tests, common_coveralls_and_integration_tests, @@ -1143,7 +1152,7 @@ workflows: filters: branches: only: - - master-v2 + - master # vMAJOR.MINOR (e.g. v0.1, v0.2, v1.0, v2.1, etc.) - /^v[0-9]+\.[0-9]+/ tags: @@ -1175,3 +1184,24 @@ workflows: - increase_chart_version_watcher_info_release: requires: [publish_watcher, publish_watcher_info] filters: *only_release_tag + - release: + requires: [ + test_barebone_release, + test_docker_compose_release, + watcher_coveralls_and_integration_tests, + watcher_info_coveralls_and_integration_tests, + common_coveralls_and_integration_tests, + test, + property_tests, + dialyzer, + lint, + lint_version, + audit_deps + ] + context: + - shared-semantic-release + filters: + branches: + only: /^master$/ + tags: + ignore: /.*/ diff --git a/.releaserc.yaml b/.releaserc.yaml new file mode 100644 index 0000000000..e5e0fd343a --- /dev/null +++ b/.releaserc.yaml @@ -0,0 +1,24 @@ +plugins: +- - '@semantic-release/commit-analyzer' + - preset: 'angular' + releaseRules: + - type: 'refactor' + release: 'patch' + - type: 'style' + release: 'patch' + - type: 'feat' + release: 'patch' + - type: 'chore' + release: 'patch' + - breaking: true + release: 'minor' +- '@semantic-release/release-notes-generator' +- '@semantic-release/github' +tagFormat: 'v${version}' +dryRun: true +# observing that job would not be running as it was considered as from PR branch +# looks that unfortunately that is how it is designed: +# https://github.com/semantic-release/semantic-release/issues/1166#issuecomment-500094323 +# this workaround is from: +# https://github.com/semantic-release/semantic-release/issues/1074#issuecomment-696922883 +ci: false diff --git a/.tool-versions b/.tool-versions index fb52d45653..65016e49ab 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,3 @@ -erlang 22.3 -elixir 1.10.2 +elixir 1.11.2 +erlang 23.1.4 +rust 1.46.0 diff --git a/AUTHORS b/AUTHORS index af95394d7a..f0e72802a1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1 @@ -OmiseGo Pte Ltd +OMG Network Pte Ltd diff --git a/CHANGELOG.md b/CHANGELOG.md index ddb218baf4..313d8259e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,41 @@ # Changelog -## [Unreleased](https://github.com/omgnetwork/elixir-omg/tree/HEAD) +## [v1.0.5](https://github.com/omgnetwork/elixir-omg/tree/v1.0.5) (2020-10-01) -[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.4...HEAD) +[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.4-pre.2...v1.0.5) ### Enhancements +- deposits performance tests bot [\#1745](https://github.com/omgnetwork/elixir-omg/pull/1745) ([ayrat555](https://github.com/ayrat555)) - feat: handle in-flight exits deletions [\#1701](https://github.com/omgnetwork/elixir-omg/pull/1701) ([pgebal](https://github.com/pgebal)) +- feat: comply with new Infura API [\#1754](https://github.com/omgnetwork/elixir-omg/pull/1754) ([pgebal](https://github.com/pgebal)) ### Bug fixes +- fix: handle metrics for in flight exit deleted processor [\#1742](https://github.com/omgnetwork/elixir-omg/pull/1742) ([pgebal](https://github.com/pgebal)) - revert: reverts ife deletion commits [\#1725](https://github.com/omgnetwork/elixir-omg/pull/1725) ([pgebal](https://github.com/pgebal)) +- fix: set :last\_ife\_exit\_deleted\_eth\_height on deplyment if it's not set yet [\#1720](https://github.com/omgnetwork/elixir-omg/pull/1720) ([pgebal](https://github.com/pgebal)) - fix: fix in-flight exit deleted bug and add tests [\#1714](https://github.com/omgnetwork/elixir-omg/pull/1714) ([pgebal](https://github.com/pgebal)) - fix: block submission stall monitor should ignore block\_submitting that are already mined [\#1703](https://github.com/omgnetwork/elixir-omg/pull/1703) ([unnawut](https://github.com/unnawut)) +- fix: recheck PR label on synchronize and reopen [\#1748](https://github.com/omgnetwork/elixir-omg/pull/1748) ([unnawut](https://github.com/unnawut)) ### Chores +- Chore: parallelize tests by tags [\#1744](https://github.com/omgnetwork/elixir-omg/pull/1744) ([ayrat555](https://github.com/ayrat555)) +- Chore: use exexec from upstream [\#1743](https://github.com/omgnetwork/elixir-omg/pull/1743) ([ayrat555](https://github.com/ayrat555)) +- move dev env deployment job to helm repo [\#1738](https://github.com/omgnetwork/elixir-omg/pull/1738) ([boolafish](https://github.com/boolafish)) +- Inomurko/remove child chain [\#1737](https://github.com/omgnetwork/elixir-omg/pull/1737) ([InoMurko](https://github.com/InoMurko)) +- Kevsul/standard exit perf test [\#1732](https://github.com/omgnetwork/elixir-omg/pull/1732) ([kevsul](https://github.com/kevsul)) +- update change log v1.0.4 [\#1731](https://github.com/omgnetwork/elixir-omg/pull/1731) ([jarindr](https://github.com/jarindr)) +- chore: add test for 64\_000 txs block hash [\#1729](https://github.com/omgnetwork/elixir-omg/pull/1729) ([ayrat555](https://github.com/ayrat555)) - Allow to run docker-compose without feefeed docker [\#1726](https://github.com/omgnetwork/elixir-omg/pull/1726) ([boolafish](https://github.com/boolafish)) +- rm mix based chch part 1 [\#1716](https://github.com/omgnetwork/elixir-omg/pull/1716) ([InoMurko](https://github.com/InoMurko)) - feat: reintroduce automated changelog [\#1708](https://github.com/omgnetwork/elixir-omg/pull/1708) ([unnawut](https://github.com/unnawut)) - add feefeed docker to elixir-omg setup [\#1700](https://github.com/omgnetwork/elixir-omg/pull/1700) ([boolafish](https://github.com/boolafish)) - move omg\_performance json rpc tests to perf project [\#1691](https://github.com/omgnetwork/elixir-omg/pull/1691) ([ayrat555](https://github.com/ayrat555)) +- chore: bump version to 1.0.4 [\#1751](https://github.com/omgnetwork/elixir-omg/pull/1751) ([boolafish](https://github.com/boolafish)) +- Chore: try to fix flaky reorg tests [\#1739](https://github.com/omgnetwork/elixir-omg/pull/1739) ([ayrat555](https://github.com/ayrat555)) +- feat: transaction.create optimisation [\#1683](https://github.com/omgnetwork/elixir-omg/pull/1683) ([okalouti](https://github.com/okalouti)) ## [v1.0.4](https://github.com/omgnetwork/elixir-omg/tree/v1.0.4) (2020-09-03) @@ -39,7 +55,6 @@ - corrrectly serialize PIDs in alarms.get [\#1678](https://github.com/omgnetwork/elixir-omg/pull/1678) ([ayrat555](https://github.com/ayrat555)) - account.get\_exitable\_utxos is unaware of in-flight exited inputs [\#1676](https://github.com/omgnetwork/elixir-omg/pull/1676) ([pnowosie](https://github.com/pnowosie)) -- Fix fee adapter to accept decimal value in fee rules [\#1662](https://github.com/omgnetwork/elixir-omg/pull/1662) ([jarindr](https://github.com/jarindr)) - Add missing clause on witness validation check [\#1656](https://github.com/omgnetwork/elixir-omg/pull/1656) ([mederic-p](https://github.com/mederic-p)) - fix: unexpected http method [\#1651](https://github.com/omgnetwork/elixir-omg/pull/1651) ([ripzery](https://github.com/ripzery)) @@ -91,10 +106,6 @@ - Add reorged docker compose [\#1579](https://github.com/omgnetwork/elixir-omg/pull/1579) ([ayrat555](https://github.com/ayrat555)) - Kevin/load test erc20 token [\#1577](https://github.com/omgnetwork/elixir-omg/pull/1577) ([kevsul](https://github.com/kevsul)) -### Documentation updates - -- Update request body swagger [\#1609](https://github.com/omgnetwork/elixir-omg/pull/1609) ([jarindr](https://github.com/jarindr)) - ## [v1.0.2](https://github.com/omgnetwork/elixir-omg/tree/v1.0.2) (2020-06-30) [Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.2-pre.0...v1.0.2) @@ -122,11 +133,12 @@ ### Documentation updates +- Update request body swagger [\#1609](https://github.com/omgnetwork/elixir-omg/pull/1609) ([jarindr](https://github.com/jarindr)) - Update README.md [\#1564](https://github.com/omgnetwork/elixir-omg/pull/1564) ([InoMurko](https://github.com/InoMurko)) ## [v1.0.1](https://github.com/omgnetwork/elixir-omg/tree/v1.0.1) (2020-06-18) -[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.1-pre.0...v1.0.1) +[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.0-pre.2...v1.0.1) ### Chores diff --git a/Dockerfile.watcher b/Dockerfile.watcher index 6522617eb8..db4d4ca837 100644 --- a/Dockerfile.watcher +++ b/Dockerfile.watcher @@ -1,7 +1,7 @@ FROM alpine:3.11 -LABEL maintainer="OmiseGO Team " -LABEL description="Official image for OmiseGO (Watcher) Plasma Network" +LABEL maintainer="OMG Network Team " +LABEL description="Official image for OMG Network (Watcher) Plasma Network" ENV LANG=C.UTF-8 @@ -54,7 +54,7 @@ RUN set -xe \ #rocksdb from builder image to deployer image RUN mkdir -p /usr/local/rocksdb/lib RUN mkdir /usr/local/rocksdb/include -COPY --from=omisegoimages/elixir-omg-builder:stable-20200410 /usr/local/rocksdb/ /usr/local/rocksdb/ +COPY --from=omisegoimages/elixir-omg-builder:stable-20201207 /usr/local/rocksdb/ /usr/local/rocksdb/ ARG release_version ADD _build_docker/prod/watcher-${release_version}.tar.gz /app diff --git a/Dockerfile.watcher_info b/Dockerfile.watcher_info index 60887abe0a..d760b8261f 100644 --- a/Dockerfile.watcher_info +++ b/Dockerfile.watcher_info @@ -1,7 +1,7 @@ FROM alpine:3.11 -LABEL maintainer="OmiseGO Team " -LABEL description="Official image for OmiseGO (WatcherInfo) Plasma Network" +LABEL maintainer="OMG Network Team " +LABEL description="Official image for OMG Network (WatcherInfo) Plasma Network" ENV LANG=C.UTF-8 @@ -54,7 +54,7 @@ RUN set -xe \ #rocksdb from builder image to deployer image RUN mkdir -p /usr/local/rocksdb/lib RUN mkdir /usr/local/rocksdb/include -COPY --from=omisegoimages/elixir-omg-builder:stable-20200410 /usr/local/rocksdb/ /usr/local/rocksdb/ +COPY --from=omisegoimages/elixir-omg-builder:stable-20201207 /usr/local/rocksdb/ /usr/local/rocksdb/ ARG release_version ADD _build_docker/prod/watcher_info-${release_version}.tar.gz /app diff --git a/LICENSE b/LICENSE index 9b23ea0ab5..3911dcd656 100644 --- a/LICENSE +++ b/LICENSE @@ -175,7 +175,7 @@ of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS -Copyright 2017-2019 OmiseGO +Copyright 2017-2019 OMG Network Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Makefile b/Makefile index cbdeaddfac..77186ae62b 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ all: clean build-watcher-prod build-watcher_info-prod WATCHER_IMAGE_NAME ?= "omisego/watcher:latest" WATCHER_INFO_IMAGE_NAME ?= "omisego/watcher_info:latest" -IMAGE_BUILDER ?= "omisegoimages/elixir-omg-builder:stable-20200410" +IMAGE_BUILDER ?= "omisegoimages/elixir-omg-builder:stable-20201207" IMAGE_BUILD_DIR ?= $(PWD) ENV_DEV ?= env MIX_ENV=dev @@ -293,14 +293,14 @@ docker-watcher_info-prod: docker-watcher-build: docker build -f Dockerfile.watcher \ - --build-arg release_version=$$(cat $(PWD)/VERSION)+$$(git rev-parse --short=7 HEAD) \ + --build-arg release_version=$$(git describe --tags) \ --cache-from $(WATCHER_IMAGE_NAME) \ -t $(WATCHER_IMAGE_NAME) \ . docker-watcher_info-build: docker build -f Dockerfile.watcher_info \ - --build-arg release_version=$$(cat $(PWD)/VERSION)+$$(git rev-parse --short=7 HEAD) \ + --build-arg release_version=$$(git describe --tags) \ --cache-from $(WATCHER_INFO_IMAGE_NAME) \ -t $(WATCHER_INFO_IMAGE_NAME) \ . diff --git a/README.md b/README.md index 7f8baa9429..2bc10dee56 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -The `elixir-omg` repository contains OmiseGO's Elixir implementation of Plasma and forms the basis for the OMG Network. +The `elixir-omg` repository contains OMG Network's Elixir implementation of Plasma and forms the basis for the OMG Network. [![Build Status](https://circleci.com/gh/omgnetwork/elixir-omg.svg?style=svg)](https://circleci.com/gh/omgnetwork/elixir-omg) [![Coverage Status](https://coveralls.io/repos/github/omisego/elixir-omg/badge.svg?branch=master)](https://coveralls.io/github/omisego/elixir-omg?branch=master) @@ -116,10 +116,10 @@ mix test Longer-running integration tests (requires compiling contracts): ```bash -mix test --trace --only integration +mix test --only integration ``` -For other kinds of checks, refer to the CI/CD pipeline (https://circleci.com/gh/omisego/workflows/elixir-omg) or build steps (https://github.com/omisego/elixir-omg/blob/master/.circleci/config.yml). +For other kinds of checks, refer to the CI/CD pipeline (https://app.circleci.com/pipelines/github/omgnetwork/elixir-omg) or build steps (https://github.com/omgnetwork/elixir-omg/blob/master/.circleci/config.yml). To run a development `iex` REPL with all code loaded: ```bash @@ -207,7 +207,7 @@ cd priv/cabbage make install make generate_api_code mix deps.get -REORG=true mix test --only reorg --trace +REORG=true mix test --only reorg ``` # Working with API Spec's @@ -215,7 +215,7 @@ REORG=true mix test --only reorg --trace This repo contains `gh-pages` branch intended to host [Swagger-based](https://docs.omg.network/elixir-omg/) API specification. Branch `gh-pages` is totally diseparated from other development branches and contains just Slate generated page's files. -See [gh-pages README](https://github.com/omisego/elixir-omg/tree/gh-pages) for more details. +See [gh-pages README](https://github.com/omgnetwork/elixir-omg/tree/gh-pages) for more details. # More details about the design and architecture diff --git a/VERSION b/VERSION deleted file mode 100644 index ee90284c27..0000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0.4 diff --git a/apps/omg/lib/omg.ex b/apps/omg/lib/omg.ex index 44b1076bdd..bae0ea7752 100644 --- a/apps/omg/lib/omg.ex +++ b/apps/omg/lib/omg.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/application.ex b/apps/omg/lib/omg/application.ex index 34b1ba42f3..b9b18c890b 100644 --- a/apps/omg/lib/omg/application.ex +++ b/apps/omg/lib/omg/application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/block.ex b/apps/omg/lib/omg/block.ex index 72d0c3f009..745f971958 100644 --- a/apps/omg/lib/omg/block.ex +++ b/apps/omg/lib/omg/block.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/configuration.ex b/apps/omg/lib/omg/configuration.ex index 2041ce047f..1901bf6e3b 100644 --- a/apps/omg/lib/omg/configuration.ex +++ b/apps/omg/lib/omg/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/crypto.ex b/apps/omg/lib/omg/crypto.ex index 057336037a..97bfa8718e 100644 --- a/apps/omg/lib/omg/crypto.ex +++ b/apps/omg/lib/omg/crypto.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ defmodule OMG.Crypto do For unsafe code, limited to `:test` and `:dev` environments and related to private key handling refer to: `OMG.DevCrypto` in `test/support` """ + alias ExPlasma.Crypto alias OMG.Signature @type sig_t() :: <<_::520>> @@ -41,22 +42,22 @@ defmodule OMG.Crypto do 171, 76, 106, 229, 69, 102, 203, 7, 21, 134, 230, 92, 23, 209, 187, 12>> """ @spec hash(binary) :: hash_t() - def hash(message), do: ExthCrypto.Hash.hash(message, ExthCrypto.Hash.kec()) + def hash(message), do: Crypto.keccak_hash(message) @doc """ Recovers the address of the signer from a binary-encoded signature. """ - @spec recover_address(hash_t(), sig_t()) :: {:ok, address_t()} | {:error, :signature_corrupt | binary} + @spec recover_address(hash_t(), sig_t()) :: {:ok, address_t()} | {:error, atom()} def recover_address(<>, <>) do case Signature.recover_public(digest, packed_signature) do {:ok, pub} -> generate_address(pub) - {:error, "Recovery id invalid 0-3"} -> + {:error, :recovery_id_not_u8} -> {:error, :signature_corrupt} - other -> - other + {:error, _} = error -> + error end end diff --git a/apps/omg/lib/omg/ethereum_event_listener.ex b/apps/omg/lib/omg/ethereum_event_listener.ex index ba0e5470cf..4a56c1a85d 100644 --- a/apps/omg/lib/omg/ethereum_event_listener.ex +++ b/apps/omg/lib/omg/ethereum_event_listener.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -146,7 +146,7 @@ defmodule OMG.EthereumEventListener do case RootChainCoordinator.get_sync_info() do :nosync -> - :ok = RootChainCoordinator.check_in(Core.get_height_to_check_in(state), state.service_name) + :ok = RootChainCoordinator.check_in(state.synced_height, state.service_name) {:ok, _} = schedule_get_events(state.ethereum_events_check_interval_ms) {:noreply, {state, callbacks}} @@ -158,31 +158,32 @@ defmodule OMG.EthereumEventListener do end # see `handle_info/2`, clause for `:sync` - @decorate span(service: :ethereum_event_listener, type: :backend, name: "sync_height/2") + @decorate span(service: :ethereum_event_listener, type: :backend, name: "sync_height/3") defp sync_height(state, callbacks, sync_guide) do - {:ok, events, db_updates, height_to_check_in, new_state} = - Core.get_events_range_for_download(state, sync_guide) - |> maybe_update_event_cache(callbacks.get_ethereum_events_callback) - |> Core.get_events(sync_guide.sync_height) + {events, new_state} = + state + |> Core.calc_events_range_set_height(sync_guide) + |> get_events(callbacks.get_ethereum_events_callback) - :ok = :telemetry.execute([:process, __MODULE__], %{events: events}, state) + db_update = [{:put, new_state.synced_height_update_key, new_state.synced_height}] + :ok = :telemetry.execute([:process, __MODULE__], %{events: events}, new_state) {:ok, db_updates_from_callback} = callbacks.process_events_callback.(events) :ok = publish_events(events) - :ok = OMG.DB.multi_update(db_updates ++ db_updates_from_callback) - :ok = RootChainCoordinator.check_in(height_to_check_in, state.service_name) + :ok = OMG.DB.multi_update(db_update ++ db_updates_from_callback) + :ok = RootChainCoordinator.check_in(new_state.synced_height, new_state.service_name) new_state end - @decorate span(service: :ethereum_event_listener, type: :backend, name: "maybe_update_event_cache/2") - defp maybe_update_event_cache({:get_events, {from, to}, %Core{} = state}, get_ethereum_events_callback) do - {:ok, new_events} = get_ethereum_events_callback.(from, to) - Core.add_new_events(state, new_events) + defp get_events({{from, to}, state}, get_events_callback) do + {:ok, new_events} = get_events_callback.(from, to) + {new_events, state} end - @decorate span(service: :ethereum_event_listener, type: :backend, name: "maybe_update_event_cache/2") - defp maybe_update_event_cache({:dont_fetch_events, %Core{} = state}, _callback), do: state + defp get_events({:dont_fetch_events, state}, _callback) do + {[], state} + end defp schedule_get_events(ethereum_events_check_interval_ms) do :timer.send_after(ethereum_events_check_interval_ms, self(), :sync) diff --git a/apps/omg/lib/omg/ethereum_event_listener/core.ex b/apps/omg/lib/omg/ethereum_event_listener/core.ex index 323fd75d06..03f964958c 100644 --- a/apps/omg/lib/omg/ethereum_event_listener/core.ex +++ b/apps/omg/lib/omg/ethereum_event_listener/core.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,29 +28,22 @@ defmodule OMG.EthereumEventListener.Core do use Spandex.Decorators + # synced_height is what's being exchanged with `RootChainCoordinator`. + # The point in root chain until where it processed defstruct synced_height_update_key: nil, service_name: nil, - # what's being exchanged with `RootChainCoordinator` - the point in root chain until where it processed synced_height: 0, ethereum_events_check_interval_ms: nil, - cached: %{ - data: [], - request_max_size: 1000, - # until which height the events have been pulled and cached - events_upper_bound: 0 - } + request_max_size: 1000 @type event :: %{eth_height: non_neg_integer()} @type t() :: %__MODULE__{ synced_height_update_key: atom(), service_name: atom(), - cached: %{ - data: list(event), - request_max_size: pos_integer(), - events_upper_bound: non_neg_integer() - }, - ethereum_events_check_interval_ms: non_neg_integer() + synced_height: integer(), + ethereum_events_check_interval_ms: non_neg_integer(), + request_max_size: pos_integer() } @doc """ @@ -70,89 +63,39 @@ defmodule OMG.EthereumEventListener.Core do synced_height_update_key: update_key, synced_height: last_synced_ethereum_height, service_name: service_name, - cached: %{ - data: [], - request_max_size: request_max_size, - events_upper_bound: last_synced_ethereum_height - }, + request_max_size: request_max_size, ethereum_events_check_interval_ms: ethereum_events_check_interval_ms } - {initial_state, get_height_to_check_in(initial_state)} + {initial_state, last_synced_ethereum_height} end @doc """ - Provides a uniform way to get the height to check in. + Returns the events range - + - from (inclusive!), + - to (inclusive!) + that needs to be scraped and sets synced_height in the state. - Every call to RootChainCoordinator.check_in should use value taken from this, after all mutations to the state """ - @spec get_height_to_check_in(t()) :: non_neg_integer() - def get_height_to_check_in(%__MODULE__{synced_height: synced_height}), do: synced_height - - @doc """ - Returns range Ethereum height to download - """ - @decorate span(service: :ethereum_event_listener, type: :backend, name: "get_events_range_for_download/2") - @spec get_events_range_for_download(t(), SyncGuide.t()) :: - {:dont_fetch_events, t()} | {:get_events, {non_neg_integer, non_neg_integer}, t()} - def get_events_range_for_download(%__MODULE__{cached: %{events_upper_bound: upper}} = state, %SyncGuide{ - sync_height: sync_height - }) - when sync_height <= upper, - do: {:dont_fetch_events, state} - - @decorate span(service: :ethereum_event_listener, type: :backend, name: "get_events_range_for_download/2") - def get_events_range_for_download( - %__MODULE__{ - cached: %{request_max_size: request_max_size, events_upper_bound: old_upper_bound} = cached_data - } = state, - %SyncGuide{root_chain_height: root_chain_height, sync_height: sync_height} - ) do - # grab as much as allowed, but not higher than current root_chain_height and at least as much as needed to sync - # NOTE: both root_chain_height and sync_height are assumed to have any required finality margins applied by caller - next_upper_bound = - min(root_chain_height, old_upper_bound + request_max_size) - |> max(sync_height) - - new_state = %__MODULE__{ - state - | cached: %{cached_data | events_upper_bound: next_upper_bound} - } - - {:get_events, {old_upper_bound + 1, next_upper_bound}, new_state} - end - - @doc """ - Stores the freshly fetched ethereum events into a memory-cache - """ - @decorate span(service: :ethereum_event_listener, type: :backend, name: "add_new_events/2") - @spec add_new_events(t(), list(event)) :: t() - def add_new_events( - %__MODULE__{cached: %{data: data} = cached_data} = state, - new_events - ) do - %__MODULE__{state | cached: %{cached_data | data: data ++ new_events}} - end - - @doc """ - Pop some ethereum events stored in the memory-cache, up to a certain height - """ - @decorate span(service: :ethereum_event_listener, type: :backend, name: "get_events/2") - @spec get_events(t(), non_neg_integer) :: {:ok, list(event), list(), non_neg_integer, t()} - def get_events( - %__MODULE__{synced_height_update_key: update_key, cached: %{data: data}} = state, - new_sync_height - ) do - {events, new_data} = Enum.split_while(data, fn %{eth_height: height} -> height <= new_sync_height end) - - new_state = - state - |> Map.update!(:synced_height, &max(&1, new_sync_height)) - |> Map.update!(:cached, &%{&1 | data: new_data}) - |> struct!() - - height_to_check_in = get_height_to_check_in(new_state) - db_update = [{:put, update_key, height_to_check_in}] - {:ok, events, db_update, height_to_check_in, new_state} + @decorate span(service: :ethereum_event_listener, type: :backend, name: "calc_events_range_set_height/2") + @spec calc_events_range_set_height(t(), SyncGuide.t()) :: + {:dont_fetch_events, t()} | {{non_neg_integer, non_neg_integer}, t()} + def calc_events_range_set_height(state, sync_guide) do + case sync_guide.sync_height <= state.synced_height do + true -> + {:dont_fetch_events, state} + + _ -> + # if sync_guide.sync_height has applied margin (reorg protection) + # the only thing we need to be aware of is that we don't go pass that! + # but we want to move as fast as possible so we try to fetch as much as we can (request_max_size) + first_not_visited = state.synced_height + 1 + # if first not visited = 1, and request max size is 10 + # it means we can scrape AT MOST request_max_size events + max_height = state.request_max_size - 1 + upper_bound = min(sync_guide.sync_height, first_not_visited + max_height) + + {{first_not_visited, upper_bound}, %{state | synced_height: upper_bound}} + end end end diff --git a/apps/omg/lib/omg/ethereum_event_listener/measure.ex b/apps/omg/lib/omg/ethereum_event_listener/measure.ex index a763c8f1fd..ffc7a72307 100644 --- a/apps/omg/lib/omg/ethereum_event_listener/measure.ex +++ b/apps/omg/lib/omg/ethereum_event_listener/measure.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/fees.ex b/apps/omg/lib/omg/fees.ex index 81f304f2d3..da19ab0d7d 100644 --- a/apps/omg/lib/omg/fees.ex +++ b/apps/omg/lib/omg/fees.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/fees/fee_filter.ex b/apps/omg/lib/omg/fees/fee_filter.ex index ed6c0e8f7c..d4a2d1ee01 100644 --- a/apps/omg/lib/omg/fees/fee_filter.ex +++ b/apps/omg/lib/omg/fees/fee_filter.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/merge_transaction_validator.ex b/apps/omg/lib/omg/merge_transaction_validator.ex index caad62f6b6..e84dba62e2 100644 --- a/apps/omg/lib/omg/merge_transaction_validator.ex +++ b/apps/omg/lib/omg/merge_transaction_validator.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/merkle.ex b/apps/omg/lib/omg/merkle.ex index 8ff2c2231b..20121ea09f 100644 --- a/apps/omg/lib/omg/merkle.ex +++ b/apps/omg/lib/omg/merkle.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/output.ex b/apps/omg/lib/omg/output.ex index 45ca1fb08f..1f20feb790 100644 --- a/apps/omg/lib/omg/output.ex +++ b/apps/omg/lib/omg/output.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,16 +30,23 @@ defmodule OMG.Output do currency: Crypto.address_t(), amount: non_neg_integer() } - + @type error_t() :: {:error, atom()} defstruct [:output_type, :owner, :currency, :amount] @doc """ Reconstructs the structure from a list of RLP items """ + @spec reconstruct(any()) :: t() | error_t() + def reconstruct(_rlp_data) + def reconstruct([raw_type, [_owner, _currency, _amount]] = rlp_data) when is_binary(raw_type) do - with :ok <- validate_data(rlp_data), - {:ok, utxo} <- ExPlasma.Utxo.new(rlp_data), - do: %__MODULE__{output_type: utxo.output_type, owner: utxo.owner, currency: utxo.currency, amount: utxo.amount} + with {:ok, type, owner, currency, amont} <- clean_and_validate_data(rlp_data), + do: %__MODULE__{ + output_type: type, + owner: owner, + currency: currency, + amount: amont + } end def reconstruct([_raw_type, [_owner, _currency, _amount]]), do: {:error, :unrecognized_output_type} @@ -60,14 +67,14 @@ defmodule OMG.Output do # TODO(achiurizo) # remove the validation here and port the error tuple response handling into ex_plasma. - defp validate_data([raw_type, [owner, currency, amount]]) do - with {:ok, type} <- RawData.parse_uint256(raw_type), - {:ok, _} <- valid_output_type?(type), - {:ok, _} <- RawData.parse_address(owner), + defp clean_and_validate_data([raw_type, [owner, currency, amount]]) do + with {:ok, parsed_type} <- RawData.parse_uint256(raw_type), + {:ok, _} <- valid_output_type?(parsed_type), + {:ok, parsed_owner} <- RawData.parse_address(owner), {:ok, _} <- non_zero_owner?(owner), - {:ok, _} <- RawData.parse_address(currency), - {:ok, _} <- RawData.parse_amount(amount), - do: :ok + {:ok, parsed_currency} <- RawData.parse_address(currency), + {:ok, parsed_amount} <- RawData.parse_amount(amount), + do: {:ok, parsed_type, parsed_owner, parsed_currency, parsed_amount} end defp non_zero_owner?(<<0::160>>), do: {:error, :output_guard_cant_be_zero} diff --git a/apps/omg/lib/omg/raw_data.ex b/apps/omg/lib/omg/raw_data.ex index 905522ebb7..b571c41ab9 100644 --- a/apps/omg/lib/omg/raw_data.ex +++ b/apps/omg/lib/omg/raw_data.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/release_tasks/set_ethereum_events_check_interval.ex b/apps/omg/lib/omg/release_tasks/set_ethereum_events_check_interval.ex index 206c0970f3..d6649b08a9 100644 --- a/apps/omg/lib/omg/release_tasks/set_ethereum_events_check_interval.ex +++ b/apps/omg/lib/omg/release_tasks/set_ethereum_events_check_interval.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/root_chain_coordinator.ex b/apps/omg/lib/omg/root_chain_coordinator.ex index 7ef5b0e680..f0245d567f 100644 --- a/apps/omg/lib/omg/root_chain_coordinator.ex +++ b/apps/omg/lib/omg/root_chain_coordinator.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/root_chain_coordinator/core.ex b/apps/omg/lib/omg/root_chain_coordinator/core.ex index 5e1a386d0a..19d407af86 100644 --- a/apps/omg/lib/omg/root_chain_coordinator/core.ex +++ b/apps/omg/lib/omg/root_chain_coordinator/core.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/root_chain_coordinator/measure.ex b/apps/omg/lib/omg/root_chain_coordinator/measure.ex index 03665052b0..78a7351e22 100644 --- a/apps/omg/lib/omg/root_chain_coordinator/measure.ex +++ b/apps/omg/lib/omg/root_chain_coordinator/measure.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/root_chain_coordinator/service.ex b/apps/omg/lib/omg/root_chain_coordinator/service.ex index 6a519bd8ae..7a720669ea 100644 --- a/apps/omg/lib/omg/root_chain_coordinator/service.ex +++ b/apps/omg/lib/omg/root_chain_coordinator/service.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/signature.ex b/apps/omg/lib/omg/signature.ex index b06bbab49c..c78011cb9e 100644 --- a/apps/omg/lib/omg/signature.ex +++ b/apps/omg/lib/omg/signature.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ defmodule OMG.Signature do 8, 168, 253, 23, 180, 72, 166, 133, 84, 25, 156, 71, 208, 143, 251, 16, 212, 184>>} """ @spec recover_public(keccak_hash(), hash_v, hash_r, hash_s, integer() | nil) :: - {:ok, public_key} | {:error, String.t()} + {:ok, public_key} | {:error, atom()} def recover_public(hash, v, r, s, chain_id \\ nil) do signature = pad(:binary.encode_unsigned(r), @signature_len) <> @@ -68,9 +68,9 @@ defmodule OMG.Signature do v - @base_recovery_id end - case :libsecp256k1.ecdsa_recover_compact(hash, signature, :uncompressed, recovery_id) do + case ExSecp256k1.recover_compact(hash, signature, recovery_id) do {:ok, <<_byte::8, public_key::binary()>>} -> {:ok, public_key} - {:error, reason} -> {:error, to_string(reason)} + {:error, reason} -> {:error, reason} end end diff --git a/apps/omg/lib/omg/state.ex b/apps/omg/lib/omg/state.ex index 53c7c03a0e..d05c8a2153 100644 --- a/apps/omg/lib/omg/state.ex +++ b/apps/omg/lib/omg/state.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -159,6 +159,20 @@ defmodule OMG.State do @doc """ see `exec/2` + see `deposit/1` + see `exit_utxos/1` + Flow: + - translates the triggers to UTXO positions digestible by the UTXO set + - exits the UTXOs from the ledger if they exists, reports invalidity wherever they don't + - returns the `db_updates` to be applied by the caller + see `utxo_exists/1` + see `get_status/0` + see `close_block/0` + Works exactly like `handle_cast(:form_block)` but: + - is synchronous + - relies on the caller to handle persistence, instead of handling itself + + Someday, one might want to skip some of computations done (like calculating the root hash, which is scrapped) """ def handle_call({:exec, tx, fees}, _from, state) do db_utxos = @@ -178,23 +192,12 @@ defmodule OMG.State do end end - @doc """ - see `deposit/1` - """ def handle_call({:deposit, deposits}, _from, state) do {:ok, db_updates, new_state} = Core.deposit(deposits, state) {:reply, {:ok, db_updates}, new_state} end - @doc """ - see `exit_utxos/1` - - Flow: - - translates the triggers to UTXO positions digestible by the UTXO set - - exits the UTXOs from the ledger if they exists, reports invalidity wherever they don't - - returns the `db_updates` to be applied by the caller - """ def handle_call({:exit_utxos, exiting_utxo_triggers}, _from, state) do exiting_utxos = Core.extract_exiting_utxo_positions(exiting_utxo_triggers, state) @@ -206,9 +209,6 @@ defmodule OMG.State do {:reply, {:ok, db_updates, validities}, new_state} end - @doc """ - see `utxo_exists/1` - """ def handle_call({:utxo_exists, utxo_pos}, _from, state) do db_utxos = fetch_utxos_from_db([utxo_pos], state) new_state = Core.with_utxos(state, db_utxos) @@ -216,22 +216,10 @@ defmodule OMG.State do {:reply, Core.utxo_exists?(utxo_pos, new_state), new_state} end - @doc """ - see `get_status/0` - """ def handle_call(:get_status, _from, state) do {:reply, Core.get_status(state), state} end - @doc """ - see `close_block/0` - - Works exactly like `handle_cast(:form_block)` but: - - is synchronous - - relies on the caller to handle persistence, instead of handling itself - - Someday, one might want to skip some of computations done (like calculating the root hash, which is scrapped) - """ def handle_call(:close_block, _from, state) do {:ok, {block, db_updates}, new_state} = Core.form_block(state) diff --git a/apps/omg/lib/omg/state/core.ex b/apps/omg/lib/omg/state/core.ex index 48fca22358..c0d111e2e2 100644 --- a/apps/omg/lib/omg/state/core.ex +++ b/apps/omg/lib/omg/state/core.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/measure.ex b/apps/omg/lib/omg/state/measure.ex index dfae6a41c2..83d9b11d43 100644 --- a/apps/omg/lib/omg/state/measure.ex +++ b/apps/omg/lib/omg/state/measure.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/measurement_calculation.ex b/apps/omg/lib/omg/state/measurement_calculation.ex index 3c2e70394a..49801a725b 100644 --- a/apps/omg/lib/omg/state/measurement_calculation.ex +++ b/apps/omg/lib/omg/state/measurement_calculation.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/transaction.ex b/apps/omg/lib/omg/state/transaction.ex index 5a58937009..4c869041ee 100644 --- a/apps/omg/lib/omg/state/transaction.ex +++ b/apps/omg/lib/omg/state/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/transaction/fee.ex b/apps/omg/lib/omg/state/transaction/fee.ex index 7c76162e5d..3cea85f7bb 100644 --- a/apps/omg/lib/omg/state/transaction/fee.ex +++ b/apps/omg/lib/omg/state/transaction/fee.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/transaction/payment.ex b/apps/omg/lib/omg/state/transaction/payment.ex index b2a83f3c40..37b39e3c30 100644 --- a/apps/omg/lib/omg/state/transaction/payment.ex +++ b/apps/omg/lib/omg/state/transaction/payment.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -129,7 +129,7 @@ defmodule OMG.State.Transaction.Payment do defp parse_inputs(inputs_rlp) do with true <- Enum.count(inputs_rlp) <= @max_inputs || {:error, :too_many_inputs}, - # NOTE: workaround for https://github.com/omisego/ex_plasma/issues/19. + # NOTE: workaround for https://github.com/omgnetwork/ex_plasma/issues/19. # remove, when this is blocked on `ex_plasma` end true <- Enum.all?(inputs_rlp, &(&1 != <<0::256>>)) || {:error, :malformed_inputs}, do: {:ok, Enum.map(inputs_rlp, &parse_input!/1)} diff --git a/apps/omg/lib/omg/state/transaction/recovered.ex b/apps/omg/lib/omg/state/transaction/recovered.ex index dff60230dd..325409e3d9 100644 --- a/apps/omg/lib/omg/state/transaction/recovered.ex +++ b/apps/omg/lib/omg/state/transaction/recovered.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/transaction/signed.ex b/apps/omg/lib/omg/state/transaction/signed.ex index 76a6cc3bca..34f94c987f 100644 --- a/apps/omg/lib/omg/state/transaction/signed.ex +++ b/apps/omg/lib/omg/state/transaction/signed.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -38,8 +38,7 @@ defmodule OMG.State.Transaction.Signed do """ @spec encode(t()) :: tx_bytes() def encode(%__MODULE__{raw_tx: %{} = raw_tx, sigs: sigs}) do - [sigs | Transaction.Protocol.get_data_for_rlp(raw_tx)] - |> ExRLP.encode() + ExRLP.encode([sigs | Transaction.Protocol.get_data_for_rlp(raw_tx)]) end @doc """ @@ -81,12 +80,14 @@ defmodule OMG.State.Transaction.Signed do end defp get_reversed_witnesses(raw_txhash, raw_tx, raw_witnesses) do - raw_witnesses - |> Enum.reduce_while({:ok, []}, fn raw_witness, acc -> get_witness(raw_txhash, raw_tx, raw_witness, acc) end) + Enum.reduce_while(raw_witnesses, {:ok, []}, fn raw_witness, acc -> + get_witness(raw_txhash, raw_tx, raw_witness, acc) + end) end defp get_witness(raw_txhash, raw_tx, raw_witness, {:ok, witnesses}) do - Witness.recover(raw_witness, raw_txhash, raw_tx) + raw_witness + |> Witness.recover(raw_txhash, raw_tx) |> case do {:ok, witness} -> {:cont, {:ok, [witness | witnesses]}} error -> {:halt, error} diff --git a/apps/omg/lib/omg/state/transaction/validator.ex b/apps/omg/lib/omg/state/transaction/validator.ex index 243022fe3e..dc03297f44 100644 --- a/apps/omg/lib/omg/state/transaction/validator.ex +++ b/apps/omg/lib/omg/state/transaction/validator.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/transaction/validator/fee_claim.ex b/apps/omg/lib/omg/state/transaction/validator/fee_claim.ex index 3777b05369..b10287531c 100644 --- a/apps/omg/lib/omg/state/transaction/validator/fee_claim.ex +++ b/apps/omg/lib/omg/state/transaction/validator/fee_claim.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/transaction/validator/payment.ex b/apps/omg/lib/omg/state/transaction/validator/payment.ex index 745f41199f..c8ab302da8 100644 --- a/apps/omg/lib/omg/state/transaction/validator/payment.ex +++ b/apps/omg/lib/omg/state/transaction/validator/payment.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/transaction/witness.ex b/apps/omg/lib/omg/state/transaction/witness.ex index 80961b5276..169f0ca76e 100644 --- a/apps/omg/lib/omg/state/transaction/witness.ex +++ b/apps/omg/lib/omg/state/transaction/witness.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/state/utxo_set.ex b/apps/omg/lib/omg/state/utxo_set.ex index 229381b51a..5ae1d12103 100644 --- a/apps/omg/lib/omg/state/utxo_set.ex +++ b/apps/omg/lib/omg/state/utxo_set.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/typed_data_hash.ex b/apps/omg/lib/omg/typed_data_hash.ex index cac11882e9..8b2bdad21c 100644 --- a/apps/omg/lib/omg/typed_data_hash.ex +++ b/apps/omg/lib/omg/typed_data_hash.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/typed_data_hash/config.ex b/apps/omg/lib/omg/typed_data_hash/config.ex index bc3037dfdc..679ed208e0 100644 --- a/apps/omg/lib/omg/typed_data_hash/config.ex +++ b/apps/omg/lib/omg/typed_data_hash/config.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/typed_data_hash/tools.ex b/apps/omg/lib/omg/typed_data_hash/tools.ex index 899e888499..b22c1d43b8 100644 --- a/apps/omg/lib/omg/typed_data_hash/tools.ex +++ b/apps/omg/lib/omg/typed_data_hash/tools.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/typed_data_hash/types.ex b/apps/omg/lib/omg/typed_data_hash/types.ex index 9c130956b8..d3e078dce1 100644 --- a/apps/omg/lib/omg/typed_data_hash/types.ex +++ b/apps/omg/lib/omg/typed_data_hash/types.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/utxo.ex b/apps/omg/lib/omg/utxo.ex index 41c40dad5e..fdf907fdc3 100644 --- a/apps/omg/lib/omg/utxo.ex +++ b/apps/omg/lib/omg/utxo.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/lib/omg/utxo/position.ex b/apps/omg/lib/omg/utxo/position.ex index bb3909e686..3a6febd79f 100644 --- a/apps/omg/lib/omg/utxo/position.ex +++ b/apps/omg/lib/omg/utxo/position.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,8 @@ defmodule OMG.Utxo.Position do # these two offset constants are driven by the constants from the RootChain.sol contract @input_pointer_output_type 1 - + alias ExPlasma.Output, as: ExPlasmaOutput + alias ExPlasma.Output.Position, as: ExPlasmaPosition alias OMG.Utxo require Utxo @@ -52,9 +53,10 @@ defmodule OMG.Utxo.Position do iex> OMG.Utxo.Position.encode(utxo_pos) 4_000_050_001 """ - @spec encode(t()) :: non_neg_integer() - def encode(Utxo.position(blknum, txindex, oindex)) when is_position(blknum, txindex, oindex), - do: ExPlasma.Utxo.pos(%{blknum: blknum, txindex: txindex, oindex: oindex}) + @spec encode(t()) :: pos_integer() + def encode(Utxo.position(blknum, txindex, oindex)) when is_position(blknum, txindex, oindex) do + ExPlasmaPosition.pos(%{blknum: blknum, txindex: txindex, oindex: oindex}) + end @doc """ Decode an integer or binary into a utxo position tuple. @@ -167,12 +169,19 @@ defmodule OMG.Utxo.Position do """ @spec get_data_for_rlp(t()) :: binary() def get_data_for_rlp(Utxo.position(blknum, txindex, oindex)) do - utxo = %ExPlasma.Utxo{blknum: blknum, txindex: txindex, oindex: oindex} - ExPlasma.Utxo.to_rlp(utxo) + utxo = ExPlasmaPosition.new(blknum, txindex, oindex) + ExPlasmaPosition.to_rlp(utxo) + end + + defp do_decode(encoded) when is_binary(encoded) do + {:ok, %ExPlasmaOutput{output_id: %{blknum: blknum, txindex: txindex, oindex: oindex}}} = + ExPlasmaOutput.decode_id(encoded) + + {:ok, Utxo.position(blknum, txindex, oindex)} end - defp do_decode(encoded) do - with {:ok, utxo} <- ExPlasma.Utxo.new(encoded), - do: {:ok, Utxo.position(utxo.blknum, utxo.txindex, utxo.oindex)} + defp do_decode(encoded) when is_integer(encoded) do + {:ok, utxo} = ExPlasmaPosition.to_map(encoded) + {:ok, Utxo.position(utxo.blknum, utxo.txindex, utxo.oindex)} end end diff --git a/apps/omg/lib/omg/wire_format_types.ex b/apps/omg/lib/omg/wire_format_types.ex index 97316a3e85..b6f7ab3af0 100644 --- a/apps/omg/lib/omg/wire_format_types.ex +++ b/apps/omg/lib/omg/wire_format_types.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/mix.exs b/apps/omg/mix.exs index 8848c43224..abe32ffaea 100644 --- a/apps/omg/mix.exs +++ b/apps/omg/mix.exs @@ -4,7 +4,7 @@ defmodule OMG.MixProject do def project() do [ app: :omg, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -24,6 +24,14 @@ defmodule OMG.MixProject do ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + # Specifies which paths to compile per environment. # :dev compiles `test/support` to gain access to various `Support.*` helpers defp elixirc_paths(:prod), do: ["lib"] @@ -32,7 +40,7 @@ defmodule OMG.MixProject do defp deps() do [ - {:ex_plasma, git: "https://github.com/omgnetwork/ex_plasma.git", ref: "bd42028341d9232e11a084dbc5adac08c8bf5672"}, + {:ex_plasma, git: "https://github.com/omgnetwork/ex_plasma.git", ref: "867fee97dd930b47d22b5b32c4ef1751424c4206"}, {:ex_rlp, "~> 0.5.3"}, {:merkle_tree, "~> 2.0.0"}, {:telemetry, "~> 0.4.1"}, diff --git a/apps/omg/test/fixtures.exs b/apps/omg/test/fixtures.exs index 0a4159bb7c..5d50d0628f 100644 --- a/apps/omg/test/fixtures.exs +++ b/apps/omg/test/fixtures.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/block_test.exs b/apps/omg/test/omg/block_test.exs index a78fa16c52..9764e58fb9 100644 --- a/apps/omg/test/omg/block_test.exs +++ b/apps/omg/test/omg/block_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,6 +48,7 @@ defmodule OMG.BlockTest do } end + @tag timeout: 60_000 * 3 @tag fixtures: [:stable_alice, :stable_bob] test "correctly calculates hash for a lot of transactions", %{ stable_alice: alice, diff --git a/apps/omg/test/omg/crypto_test.exs b/apps/omg/test/omg/crypto_test.exs index febb3ff414..0902c94bc9 100644 --- a/apps/omg/test/omg/crypto_test.exs +++ b/apps/omg/test/omg/crypto_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/ethereum_event_listener/core_test.exs b/apps/omg/test/omg/ethereum_event_listener/core_test.exs index 2c9ca275e9..9bbb6ee3d5 100644 --- a/apps/omg/test/omg/ethereum_event_listener/core_test.exs +++ b/apps/omg/test/omg/ethereum_event_listener/core_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,165 +24,137 @@ defmodule OMG.EthereumEventListener.CoreTest do @service_name :name @request_max_size 5 - test "asks until root chain height provided" do - create_state(0, request_max_size: 100) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 1, root_chain_height: 10}) + test "respects request_max_size argument" do + create_state(0, request_max_size: 10) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 20, root_chain_height: 10}) + |> assert_range({1, 10}) + + create_state(0, request_max_size: 10) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 11, root_chain_height: 10}) + |> assert_range({1, 10}) + + create_state(0, request_max_size: 10) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 10, root_chain_height: 10}) |> assert_range({1, 10}) end - test "max request size respected" do + test "event range is capped at the SyncGuide sync_height" do + # if request_max_size is taken into account it would + # push the event range above the threshold and would remove the reorg protection create_state(0, request_max_size: 2) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 1, root_chain_height: 10}) - |> assert_range({1, 2}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 1, root_chain_height: 10}) + |> assert_range({1, 1}) end - test "max request size ignored if caller is insiting to get a lot of events" do - # this might be counterintuitive, but to we require that the requested sync_height is never left unhandled + test "get events range is capped at request_max_size and the events range returned is less then SyncGuide sync_height" do create_state(0, request_max_size: 2) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 4, root_chain_height: 10}) - |> assert_range({1, 4}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 4, root_chain_height: 10}) + |> assert_range({1, 2}) end test "works well close to zero" do - create_state(0) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 1, root_chain_height: 10}) + 0 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 1, root_chain_height: 10}) + |> assert_range({1, 1}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 8, root_chain_height: 10}) + |> assert_range({2, 6}) + + 0 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 9, root_chain_height: 10}) |> assert_range({1, 5}) - |> Core.add_new_events([event(1), event(3), event(4), event(5)]) - |> Core.get_events(0) - |> assert_events(events: [], check_in_and_db: 0) - |> Core.get_events(1) - |> assert_events(events: [event(1)], check_in_and_db: 1) - |> Core.get_events(2) - |> assert_events(events: [], check_in_and_db: 2) - |> Core.get_events(3) - |> assert_events(events: [event(3)], check_in_and_db: 3) end test "always returns correct height to check in" do state = - create_state(0) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 1, root_chain_height: 10}) - |> assert_range({1, 5}) - |> Core.get_events(0) - |> assert_events(events: [], check_in_and_db: 0) - - assert 0 == Core.get_height_to_check_in(state) - - state = - state - |> Core.get_events(1) - |> assert_events(events: [], check_in_and_db: 1) + 0 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 1, root_chain_height: 10}) + |> assert_range({1, 1}) - assert 1 == Core.get_height_to_check_in(state) + assert state.synced_height == 1 end test "produces next ethereum height range to get events from" do - create_state(0) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 5, root_chain_height: 10}) + 0 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 5, root_chain_height: 10}) |> assert_range({1, 5}) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 5, root_chain_height: 10}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 5, root_chain_height: 10}) |> assert_range(:dont_fetch_events) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 7, root_chain_height: 10}) - |> assert_range({6, 10}) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 7, root_chain_height: 10}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 7, root_chain_height: 10}) + |> assert_range({6, 7}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 7, root_chain_height: 10}) |> assert_range(:dont_fetch_events) end test "if synced requested higher than root chain height" do # doesn't make too much sense, but still should work well - create_state(0) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 5, root_chain_height: 5}) + 0 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 5, root_chain_height: 5}) |> assert_range({1, 5}) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 7, root_chain_height: 5}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 7, root_chain_height: 5}) |> assert_range({6, 7}) end test "will be eager to get more events, even if none are pulled at first. All will be returned" do - create_state(0) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 2, root_chain_height: 2}) + 0 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 2, root_chain_height: 2}) |> assert_range({1, 2}) - |> Core.add_new_events([event(1), event(2)]) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 4, root_chain_height: 4}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 4, root_chain_height: 4}) |> assert_range({3, 4}) - |> Core.add_new_events([event(3), event(4)]) - |> Core.get_events(4) - |> assert_events(events: [event(1), event(2), event(3), event(4)], check_in_and_db: 4) end test "restart allows to continue with proper bounds" do - create_state(1) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 4, root_chain_height: 10}) - |> assert_range({2, 6}) - |> Core.add_new_events([event(2), event(4), event(5), event(6)]) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 4, root_chain_height: 10}) + 1 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 4, root_chain_height: 10}) + |> assert_range({2, 4}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 4, root_chain_height: 10}) |> assert_range(:dont_fetch_events) - |> Core.get_events(4) - |> assert_events(events: [event(2), event(4)], check_in_and_db: 4) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 5, root_chain_height: 10}) - |> assert_range(:dont_fetch_events) - |> Core.get_events(5) - |> assert_events(events: [event(5)], check_in_and_db: 5) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 5, root_chain_height: 10}) + |> assert_range({5, 5}) - create_state(3) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 3, root_chain_height: 10}) + 3 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 3, root_chain_height: 10}) |> assert_range(:dont_fetch_events) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 5, root_chain_height: 10}) - |> assert_range({4, 8}) - |> Core.add_new_events([event(4), event(5), event(7)]) - |> Core.get_events(3) - |> assert_events(events: [], check_in_and_db: 3) - |> Core.get_events(5) - |> assert_events(events: [event(4), event(5)], check_in_and_db: 5) - - create_state(3) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 7, root_chain_height: 10}) - |> assert_range({4, 8}) - |> Core.add_new_events([event(4), event(5), event(7)]) - |> Core.get_events(7) - |> assert_events(events: [event(4), event(5), event(7)], check_in_and_db: 7) - end + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 5, root_chain_height: 10}) + |> assert_range({4, 5}) - test "can get multiple events from one height" do - create_state(5) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 6, root_chain_height: 10}) - |> assert_range({6, 10}) - |> Core.add_new_events([event(6), event(6), event(7)]) - |> Core.get_events(6) - |> assert_events(events: [event(6), event(6)], check_in_and_db: 6) + 3 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 7, root_chain_height: 10}) + |> assert_range({4, 7}) end - test "can get an empty events list when events too fresh" do - create_state(4) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 6, root_chain_height: 10}) - |> assert_range({5, 9}) - |> Core.add_new_events([event(5), event(5), event(6)]) - |> Core.get_events(4) - |> assert_events(events: [], check_in_and_db: 4) + test "wont move over if not allowed by sync_height" do + 5 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 6, root_chain_height: 10}) + |> assert_range({6, 6}) end - test "doesn't fail when getting events from empty" do - create_state(1) - |> Core.get_events(5) - |> assert_events(events: [], check_in_and_db: 5) + test "can get an empty events list when events too fresh" do + 4 + |> create_state() + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 6, root_chain_height: 10}) + |> assert_range({5, 6}) end test "persists/checks in eth_height without margins substracted, and never goes negative" do - state = - create_state(0, request_max_size: 10) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 6, root_chain_height: 10}) - |> assert_range({1, 10}) - |> Core.add_new_events([event(6), event(7), event(8), event(9)]) - - for i <- 1..9, do: state |> Core.get_events(i) |> assert_events(check_in_and_db: i) + create_state(0, request_max_size: 10) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 6, root_chain_height: 10}) + |> assert_range({1, 6}) end test "tolerates being asked to sync on height already synced" do create_state(5) - |> Core.get_events_range_for_download(%SyncGuide{sync_height: 1, root_chain_height: 10}) + |> Core.calc_events_range_set_height(%SyncGuide{sync_height: 1, root_chain_height: 10}) |> assert_range(:dont_fetch_events) - |> Core.add_new_events([]) - |> Core.get_events(1) - |> assert_events(events: [], check_in_and_db: 5) end defp create_state(height, opts \\ []) do @@ -200,24 +172,8 @@ defmodule OMG.EthereumEventListener.CoreTest do state end - defp event(height), do: %{eth_height: height} - - defp assert_range({:get_events, range, state}, expect) do + defp assert_range({range, state}, expect) do assert range == expect state end - - defp assert_range({:dont_fetch_events, state}, expect) do - assert :dont_fetch_events == expect - state - end - - defp assert_events(response, opts) do - expected_check_in_and_db = Keyword.get(opts, :check_in_and_db) - expected_events = Keyword.get(opts, :events) - assert {:ok, events, [{:put, @db_key, check_in_and_db}], check_in_and_db, new_state} = response - if expected_events, do: assert(expected_events == events) - if expected_check_in_and_db, do: assert(expected_check_in_and_db == check_in_and_db) - new_state - end end diff --git a/apps/omg/test/omg/fees/fee_filter_test.exs b/apps/omg/test/omg/fees/fee_filter_test.exs index b73324aca6..716a3da600 100644 --- a/apps/omg/test/omg/fees/fee_filter_test.exs +++ b/apps/omg/test/omg/fees/fee_filter_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/fees_test.exs b/apps/omg/test/omg/fees_test.exs index 33450c11c1..877fef2298 100644 --- a/apps/omg/test/omg/fees_test.exs +++ b/apps/omg/test/omg/fees_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/integration/root_chain_coordinator_test.exs b/apps/omg/test/omg/integration/root_chain_coordinator_test.exs index fa87c6cb97..c8cdfe99b0 100644 --- a/apps/omg/test/omg/integration/root_chain_coordinator_test.exs +++ b/apps/omg/test/omg/integration/root_chain_coordinator_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/merge_transaction_validator_test.exs b/apps/omg/test/omg/merge_transaction_validator_test.exs index cd59be49d2..150b4bfc09 100644 --- a/apps/omg/test/omg/merge_transaction_validator_test.exs +++ b/apps/omg/test/omg/merge_transaction_validator_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/merkle_test.exs b/apps/omg/test/omg/merkle_test.exs index 932c804a7a..7eca1a675a 100644 --- a/apps/omg/test/omg/merkle_test.exs +++ b/apps/omg/test/omg/merkle_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/output_test.exs b/apps/omg/test/omg/output_test.exs index 38d1cba3c0..071877cc18 100644 --- a/apps/omg/test/omg/output_test.exs +++ b/apps/omg/test/omg/output_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/raw_data_test.exs b/apps/omg/test/omg/raw_data_test.exs index d5c48cc6b6..0418c9d873 100644 --- a/apps/omg/test/omg/raw_data_test.exs +++ b/apps/omg/test/omg/raw_data_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/release_tasks/set_ethereum_events_check_interval_test.exs b/apps/omg/test/omg/release_tasks/set_ethereum_events_check_interval_test.exs index ec0318b299..fc756d1bed 100644 --- a/apps/omg/test/omg/release_tasks/set_ethereum_events_check_interval_test.exs +++ b/apps/omg/test/omg/release_tasks/set_ethereum_events_check_interval_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/root_chain_coordinator/core_test.exs b/apps/omg/test/omg/root_chain_coordinator/core_test.exs index f064ccef18..6ed086a00c 100644 --- a/apps/omg/test/omg/root_chain_coordinator/core_test.exs +++ b/apps/omg/test/omg/root_chain_coordinator/core_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/signature_test.exs b/apps/omg/test/omg/signature_test.exs index 681c3238fc..331d1ba3d1 100644 --- a/apps/omg/test/omg/signature_test.exs +++ b/apps/omg/test/omg/signature_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,11 +15,12 @@ defmodule OMG.SignatureTest do use ExUnit.Case, async: true doctest OMG.Signature + alias OMG.Crypto alias OMG.Signature describe "recover_public/3" do test "returns an error from an invalid hash" do - {:error, "Recovery id invalid 0-3"} = + {:error, :invalid_recovery_id} = Signature.recover_public( <<2::256>>, 55, @@ -34,7 +35,7 @@ defmodule OMG.SignatureTest do case: :lower ) - hash = :keccakf1600.sha3_256(data) + hash = Crypto.hash(data) v = 27 r = 18_515_461_264_373_351_373_200_002_665_853_028_612_451_056_578_545_711_640_558_177_340_181_847_433_846 s = 46_948_507_304_638_947_509_940_763_649_030_358_759_909_902_576_025_900_602_547_168_820_602_576_006_531 @@ -56,7 +57,7 @@ defmodule OMG.SignatureTest do case: :lower ) - hash = :keccakf1600.sha3_256(data) + hash = Crypto.hash(data) {:ok, public_key} = Signature.recover_public(hash, v, r, s, 1) assert public_key == diff --git a/apps/omg/test/omg/state/core_test.exs b/apps/omg/test/omg/state/core_test.exs index 68bc83077a..4f4f75aa56 100644 --- a/apps/omg/test/omg/state/core_test.exs +++ b/apps/omg/test/omg/state/core_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -1035,6 +1035,7 @@ defmodule OMG.State.CoreTest do # this test takes ~26 seconds on my machine @tag slow: true + @tag timeout: 60_000 * 3 test "long running full block test", %{alice: alice, state_empty: state, fees: fees} do Logger.warn("slow test is running, use --exclude slow to skip") diff --git a/apps/omg/test/omg/state/measurement_calculation_test.exs b/apps/omg/test/omg/state/measurement_calculation_test.exs index f7282851f2..a6ff055e50 100644 --- a/apps/omg/test/omg/state/measurement_calculation_test.exs +++ b/apps/omg/test/omg/state/measurement_calculation_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/state/persistence_test.exs b/apps/omg/test/omg/state/persistence_test.exs index f08b54cf70..0cfb61ebd0 100644 --- a/apps/omg/test/omg/state/persistence_test.exs +++ b/apps/omg/test/omg/state/persistence_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/state/transaction/fee_test.exs b/apps/omg/test/omg/state/transaction/fee_test.exs index 41754b1cfc..d2887b4bfa 100644 --- a/apps/omg/test/omg/state/transaction/fee_test.exs +++ b/apps/omg/test/omg/state/transaction/fee_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/state/transaction/recovered_test.exs b/apps/omg/test/omg/state/transaction/recovered_test.exs index 748e9da030..222cfcfca2 100644 --- a/apps/omg/test/omg/state/transaction/recovered_test.exs +++ b/apps/omg/test/omg/state/transaction/recovered_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/state/transaction/witness_test.exs b/apps/omg/test/omg/state/transaction/witness_test.exs index 085f1cfe02..c500f4806e 100644 --- a/apps/omg/test/omg/state/transaction/witness_test.exs +++ b/apps/omg/test/omg/state/transaction/witness_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/state/transaction_test.exs b/apps/omg/test/omg/state/transaction_test.exs index 492ad037d6..7e902426a4 100644 --- a/apps/omg/test/omg/state/transaction_test.exs +++ b/apps/omg/test/omg/state/transaction_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/state/utxo_set_test.exs b/apps/omg/test/omg/state/utxo_set_test.exs index 95e6e569ff..ec886d3bda 100644 --- a/apps/omg/test/omg/state/utxo_set_test.exs +++ b/apps/omg/test/omg/state/utxo_set_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/state_test.exs b/apps/omg/test/omg/state_test.exs index 9821083bd0..26bcf8358d 100644 --- a/apps/omg/test/omg/state_test.exs +++ b/apps/omg/test/omg/state_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/typed_data_hash_test.exs b/apps/omg/test/omg/typed_data_hash_test.exs index 1e6b0269fa..3f93bb2a93 100644 --- a/apps/omg/test/omg/typed_data_hash_test.exs +++ b/apps/omg/test/omg/typed_data_hash_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/utxo/position_test.exs b/apps/omg/test/omg/utxo/position_test.exs index 55b6c5d331..37f85486a9 100644 --- a/apps/omg/test/omg/utxo/position_test.exs +++ b/apps/omg/test/omg/utxo/position_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/utxo_test.exs b/apps/omg/test/omg/utxo_test.exs index 5f016d7d56..5367a8f924 100644 --- a/apps/omg/test/omg/utxo_test.exs +++ b/apps/omg/test/omg/utxo_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/omg/wire_format_types_test.exs b/apps/omg/test/omg/wire_format_types_test.exs index e5927a6fd0..a9731d6734 100644 --- a/apps/omg/test/omg/wire_format_types_test.exs +++ b/apps/omg/test/omg/wire_format_types_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/support/dev_crypto.ex b/apps/omg/test/support/dev_crypto.ex index 66e29517a8..cbb5ee6039 100644 --- a/apps/omg/test/support/dev_crypto.ex +++ b/apps/omg/test/support/dev_crypto.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -80,7 +80,7 @@ defmodule OMG.DevCrypto do defp der_to_raw(<<4::integer-size(8), data::binary>>), do: data defp get_public_key(private_key) do - case :libsecp256k1.ec_pubkey_create(private_key, :uncompressed) do + case ExSecp256k1.create_public_key(private_key) do {:ok, public_key} -> {:ok, public_key} {:error, reason} -> {:error, to_string(reason)} end diff --git a/apps/omg/test/support/integration/deposit_helper.ex b/apps/omg/test/support/integration/deposit_helper.ex index 26d31f34f4..98716449f6 100644 --- a/apps/omg/test/support/integration/deposit_helper.ex +++ b/apps/omg/test/support/integration/deposit_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/support/signature_helper.ex b/apps/omg/test/support/signature_helper.ex index 27dbb39185..300b88ed73 100644 --- a/apps/omg/test/support/signature_helper.ex +++ b/apps/omg/test/support/signature_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,8 +30,7 @@ defmodule OMG.SignatureHelper do @spec sign_hash(keccak_hash(), private_key, integer() | nil) :: {hash_v, hash_r, hash_s} def sign_hash(hash, private_key, chain_id \\ nil) do - {:ok, <>, recovery_id} = - :libsecp256k1.ecdsa_sign_compact(hash, private_key, :default, <<>>) + {:ok, {<>, recovery_id}} = ExSecp256k1.sign_compact(hash, private_key) # Fork Ψ EIP-155 recovery_id = diff --git a/apps/omg/test/support/test_helper.ex b/apps/omg/test/support/test_helper.ex index cbf45c54e6..4a64cda933 100644 --- a/apps/omg/test/support/test_helper.ex +++ b/apps/omg/test/support/test_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg/test/test_helper.exs b/apps/omg/test/test_helper.exs index 37b79fa875..d88e8df9cb 100644 --- a/apps/omg/test/test_helper.exs +++ b/apps/omg/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_bus/lib/omg_bus.ex b/apps/omg_bus/lib/omg_bus.ex index b1d09dea37..48627e23f5 100644 --- a/apps/omg_bus/lib/omg_bus.ex +++ b/apps/omg_bus/lib/omg_bus.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_bus/lib/omg_bus/application.ex b/apps/omg_bus/lib/omg_bus/application.ex index e46c379032..04bac9736f 100644 --- a/apps/omg_bus/lib/omg_bus/application.ex +++ b/apps/omg_bus/lib/omg_bus/application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_bus/lib/omg_bus/event.ex b/apps/omg_bus/lib/omg_bus/event.ex index 8e0b7dae7d..75b95b6782 100644 --- a/apps/omg_bus/lib/omg_bus/event.ex +++ b/apps/omg_bus/lib/omg_bus/event.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_bus/lib/omg_bus/pubsub.ex b/apps/omg_bus/lib/omg_bus/pubsub.ex index 6860df2237..8b1f460e77 100644 --- a/apps/omg_bus/lib/omg_bus/pubsub.ex +++ b/apps/omg_bus/lib/omg_bus/pubsub.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_bus/lib/omg_bus/supervisor.ex b/apps/omg_bus/lib/omg_bus/supervisor.ex index a44ad82aec..7252434389 100644 --- a/apps/omg_bus/lib/omg_bus/supervisor.ex +++ b/apps/omg_bus/lib/omg_bus/supervisor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_bus/mix.exs b/apps/omg_bus/mix.exs index 43bd9736a4..f191036a9f 100644 --- a/apps/omg_bus/mix.exs +++ b/apps/omg_bus/mix.exs @@ -4,7 +4,7 @@ defmodule OMG.Bus.MixProject do def project() do [ app: :omg_bus, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -25,6 +25,14 @@ defmodule OMG.Bus.MixProject do ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + # Specifies which paths to compile per environment. defp elixirc_paths(:prod), do: ["lib"] defp elixirc_paths(:dev), do: ["lib"] diff --git a/apps/omg_bus/test/omg_bus/event_test.exs b/apps/omg_bus/test/omg_bus/event_test.exs index f5dc761b59..35c3334f42 100644 --- a/apps/omg_bus/test/omg_bus/event_test.exs +++ b/apps/omg_bus/test/omg_bus/event_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_bus/test/test_helper.exs b/apps/omg_bus/test/test_helper.exs index 8dc0b51a43..d9f5d17f46 100644 --- a/apps/omg_bus/test/test_helper.exs +++ b/apps/omg_bus/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_conformance/mix.exs b/apps/omg_conformance/mix.exs index ab8a04bf87..60cf536b0b 100644 --- a/apps/omg_conformance/mix.exs +++ b/apps/omg_conformance/mix.exs @@ -4,7 +4,7 @@ defmodule OMG.Conformance.MixProject do def project() do [ app: :omg_conformance, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -23,6 +23,14 @@ defmodule OMG.Conformance.MixProject do ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + defp elixirc_paths(:prod), do: ["lib"] defp elixirc_paths(:dev), do: ["lib"] defp elixirc_paths(:test), do: ["lib", "test/support"] diff --git a/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs b/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs index fee51e32cf..208224840f 100644 --- a/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs +++ b/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs b/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs index 74992dd778..c13a54a398 100644 --- a/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs +++ b/apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_conformance/test/omg_conformance/conformance/signature_property_test.exs b/apps/omg_conformance/test/omg_conformance/conformance/signature_property_test.exs index 8a39673f45..17ee62aacb 100644 --- a/apps/omg_conformance/test/omg_conformance/conformance/signature_property_test.exs +++ b/apps/omg_conformance/test/omg_conformance/conformance/signature_property_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_conformance/test/omg_conformance/conformance/signature_test.exs b/apps/omg_conformance/test/omg_conformance/conformance/signature_test.exs index 2bd87fb9d0..a715cf8410 100644 --- a/apps/omg_conformance/test/omg_conformance/conformance/signature_test.exs +++ b/apps/omg_conformance/test/omg_conformance/conformance/signature_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_conformance/test/support/conformance/merkle_proof_context.ex b/apps/omg_conformance/test/support/conformance/merkle_proof_context.ex index dc2d106f5e..945fab4cc8 100644 --- a/apps/omg_conformance/test/support/conformance/merkle_proof_context.ex +++ b/apps/omg_conformance/test/support/conformance/merkle_proof_context.ex @@ -1,4 +1,4 @@ -# Copyright 2020 OmiseGO Pte Ltd +# Copyright 2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -201,7 +201,7 @@ defmodule Support.Conformance.MerkleProofContext do # `pragmatic_binary/0` generator is here to speed up the generator a bit and also to allow for more repetition in the # explored domain # TODO: rethink this again, and compare with discussions here: - # https://github.com/omisego/elixir-omg/pull/1251 + # https://github.com/omgnetwork/elixir-omg/pull/1251 # Can the binaries be generated more efficiently and explore the cases interesting to us better? @n_prescribed_binaries 20 @prescribed_binaries for i <- 0..@n_prescribed_binaries, do: :binary.encode_unsigned(i) diff --git a/apps/omg_conformance/test/support/conformance/merkle_proofs.ex b/apps/omg_conformance/test/support/conformance/merkle_proofs.ex index 15a86b4d30..ea740d806e 100644 --- a/apps/omg_conformance/test/support/conformance/merkle_proofs.ex +++ b/apps/omg_conformance/test/support/conformance/merkle_proofs.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_conformance/test/support/conformance/property.ex b/apps/omg_conformance/test/support/conformance/property.ex index eef4197bbb..d70800a62a 100644 --- a/apps/omg_conformance/test/support/conformance/property.ex +++ b/apps/omg_conformance/test/support/conformance/property.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -108,7 +108,7 @@ defmodule Support.Conformance.PropertyGenerators do # taken from ex_plasma, where they have been taken from: # Contract settings # These are being hard-coded from the same values on the contracts. - # See: https://github.com/omisego/plasma-contracts/blob/master/plasma_framework/contracts/src/utils/PosLib.sol#L16-L23 + # See: https://github.com/omgnetwork/plasma-contracts/blob/master/plasma_framework/contracts/src/utils/PosLib.sol#L16-L23 # TODO: when this moves to `ex_plasma`, fix this properly @block_offset 1_000_000_000 @transaction_offset 10_000 diff --git a/apps/omg_conformance/test/support/conformance/signatures_hashes.ex b/apps/omg_conformance/test/support/conformance/signatures_hashes.ex index 0317df1432..5259994336 100644 --- a/apps/omg_conformance/test/support/conformance/signatures_hashes.ex +++ b/apps/omg_conformance/test/support/conformance/signatures_hashes.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex b/apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex index 548a9ee999..e0a2bc54bf 100644 --- a/apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex +++ b/apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_conformance/test/test_helper.exs b/apps/omg_conformance/test/test_helper.exs index 9445a55526..6d969fb0b9 100644 --- a/apps/omg_conformance/test/test_helper.exs +++ b/apps/omg_conformance/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/db.ex b/apps/omg_db/lib/db.ex index 28ecdeed16..f2023d6496 100644 --- a/apps/omg_db/lib/db.ex +++ b/apps/omg_db/lib/db.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/application.ex b/apps/omg_db/lib/omg_db/application.ex index ab513e2069..ec92a0f47e 100644 --- a/apps/omg_db/lib/omg_db/application.ex +++ b/apps/omg_db/lib/omg_db/application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/measure.ex b/apps/omg_db/lib/omg_db/measure.ex index af7e9fe732..df8923d8df 100644 --- a/apps/omg_db/lib/omg_db/measure.ex +++ b/apps/omg_db/lib/omg_db/measure.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/models/payment_exit_info.ex b/apps/omg_db/lib/omg_db/models/payment_exit_info.ex index 913b869bfb..0a11a90562 100644 --- a/apps/omg_db/lib/omg_db/models/payment_exit_info.ex +++ b/apps/omg_db/lib/omg_db/models/payment_exit_info.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/release_tasks/init_key_value_db.ex b/apps/omg_db/lib/omg_db/release_tasks/init_key_value_db.ex index 0bbb70f30f..dbf32a91b6 100644 --- a/apps/omg_db/lib/omg_db/release_tasks/init_key_value_db.ex +++ b/apps/omg_db/lib/omg_db/release_tasks/init_key_value_db.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/release_tasks/init_keys_with_values.ex b/apps/omg_db/lib/omg_db/release_tasks/init_keys_with_values.ex index 58da797c89..ad3120db01 100644 --- a/apps/omg_db/lib/omg_db/release_tasks/init_keys_with_values.ex +++ b/apps/omg_db/lib/omg_db/release_tasks/init_keys_with_values.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/release_tasks/set_key_value_db.ex b/apps/omg_db/lib/omg_db/release_tasks/set_key_value_db.ex index 2bca84dd8a..7b0e461aec 100644 --- a/apps/omg_db/lib/omg_db/release_tasks/set_key_value_db.ex +++ b/apps/omg_db/lib/omg_db/release_tasks/set_key_value_db.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/rocks_db.ex b/apps/omg_db/lib/omg_db/rocks_db.ex index 76b923159d..bc292f7596 100644 --- a/apps/omg_db/lib/omg_db/rocks_db.ex +++ b/apps/omg_db/lib/omg_db/rocks_db.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/rocksdb/core.ex b/apps/omg_db/lib/omg_db/rocksdb/core.ex index 3a9bd6be94..cd8dcf0ef5 100644 --- a/apps/omg_db/lib/omg_db/rocksdb/core.ex +++ b/apps/omg_db/lib/omg_db/rocksdb/core.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/lib/omg_db/rocksdb/server.ex b/apps/omg_db/lib/omg_db/rocksdb/server.ex index 9f002fb7ad..866ab8b67a 100644 --- a/apps/omg_db/lib/omg_db/rocksdb/server.ex +++ b/apps/omg_db/lib/omg_db/rocksdb/server.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/mix.exs b/apps/omg_db/mix.exs index 714f22c84b..660ae7b4ac 100644 --- a/apps/omg_db/mix.exs +++ b/apps/omg_db/mix.exs @@ -4,7 +4,7 @@ defmodule OMG.DB.MixProject do def project() do [ app: :omg_db, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -25,6 +25,14 @@ defmodule OMG.DB.MixProject do ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + # Specifies which paths to compile per environment. defp elixirc_paths(:prod), do: ["lib"] defp elixirc_paths(:dev), do: ["lib"] @@ -32,7 +40,7 @@ defmodule OMG.DB.MixProject do defp deps() do [ - {:rocksdb, "~> 1.3", system_env: [{"ERLANG_ROCKSDB_OPTS", "-DWITH_SYSTEM_ROCKSDB=ON"}]}, + {:rocksdb, "~> 1.6", system_env: [{"ERLANG_ROCKSDB_OPTS", "-DWITH_SYSTEM_ROCKSDB=ON"}]}, {:omg_status, in_umbrella: true}, # NOTE: we only need in :dev and :test here, but we need in :prod too in performance # then there's some unexpected behavior of mix that won't allow to mix these, see diff --git a/apps/omg_db/test/fixtures.exs b/apps/omg_db/test/fixtures.exs index e1ca98992e..463044c2a6 100644 --- a/apps/omg_db/test/fixtures.exs +++ b/apps/omg_db/test/fixtures.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/test/omg_db/application_test.exs b/apps/omg_db/test/omg_db/application_test.exs index fc0151c5b6..f5d63129c8 100644 --- a/apps/omg_db/test/omg_db/application_test.exs +++ b/apps/omg_db/test/omg_db/application_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/test/omg_db/db_test.exs b/apps/omg_db/test/omg_db/db_test.exs index c9423587f7..2574f14a0d 100644 --- a/apps/omg_db/test/omg_db/db_test.exs +++ b/apps/omg_db/test/omg_db/db_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/test/omg_db/models/payment_exit_info_test.exs b/apps/omg_db/test/omg_db/models/payment_exit_info_test.exs index d61d7a35a6..fe934ed0ed 100644 --- a/apps/omg_db/test/omg_db/models/payment_exit_info_test.exs +++ b/apps/omg_db/test/omg_db/models/payment_exit_info_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/test/omg_db/release_tasks/init_key_value_db_test.exs b/apps/omg_db/test/omg_db/release_tasks/init_key_value_db_test.exs index 66089c42af..600e7d097e 100644 --- a/apps/omg_db/test/omg_db/release_tasks/init_key_value_db_test.exs +++ b/apps/omg_db/test/omg_db/release_tasks/init_key_value_db_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ # limitations under the License. defmodule OMG.DB.ReleaseTasks.InitKeyValueDBTest do - use ExUnit.Case, async: true + use ExUnit.Case, async: false alias OMG.DB.ReleaseTasks.InitKeyValueDB alias OMG.DB.ReleaseTasks.SetKeyValueDB @@ -51,7 +51,7 @@ defmodule OMG.DB.ReleaseTasks.InitKeyValueDBTest do :ok = System.put_env("DB_PATH", dir) _ = SetKeyValueDB.load([], release: :watcher) - _ = InitKeyValueDB.run() + :ok = InitKeyValueDB.run() {:error, _} = InitKeyValueDB.run() :ok = System.delete_env("DB_PATH") diff --git a/apps/omg_db/test/omg_db/release_tasks/init_keys_with_values_test.exs b/apps/omg_db/test/omg_db/release_tasks/init_keys_with_values_test.exs index a7c9b6b5ac..92fc2c1b47 100644 --- a/apps/omg_db/test/omg_db/release_tasks/init_keys_with_values_test.exs +++ b/apps/omg_db/test/omg_db/release_tasks/init_keys_with_values_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/test/omg_db/release_tasks/set_key_value_db_test.exs b/apps/omg_db/test/omg_db/release_tasks/set_key_value_db_test.exs index 1c628ccfea..508de2877f 100644 --- a/apps/omg_db/test/omg_db/release_tasks/set_key_value_db_test.exs +++ b/apps/omg_db/test/omg_db/release_tasks/set_key_value_db_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/test/omg_db/rocks_db_test.exs b/apps/omg_db/test/omg_db/rocks_db_test.exs index 04e69edcd1..153abc2eb3 100644 --- a/apps/omg_db/test/omg_db/rocks_db_test.exs +++ b/apps/omg_db/test/omg_db/rocks_db_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/test/support/rocks_db_case.ex b/apps/omg_db/test/support/rocks_db_case.ex index e9c80b9a39..d15021ba49 100644 --- a/apps/omg_db/test/support/rocks_db_case.ex +++ b/apps/omg_db/test/support/rocks_db_case.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_db/test/test_helper.exs b/apps/omg_db/test/test_helper.exs index 1cb01a9407..6a005f025c 100644 --- a/apps/omg_db/test/test_helper.exs +++ b/apps/omg_db/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/eth.ex b/apps/omg_eth/lib/eth.ex index d754fb0110..e861e33cde 100644 --- a/apps/omg_eth/lib/eth.ex +++ b/apps/omg_eth/lib/eth.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/application.ex b/apps/omg_eth/lib/omg_eth/application.ex index 849979adb6..cce5aefd1b 100644 --- a/apps/omg_eth/lib/omg_eth/application.ex +++ b/apps/omg_eth/lib/omg_eth/application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/blockchain/bit_helper.ex b/apps/omg_eth/lib/omg_eth/blockchain/bit_helper.ex index 6f11a38243..6b63ba20f1 100644 --- a/apps/omg_eth/lib/omg_eth/blockchain/bit_helper.ex +++ b/apps/omg_eth/lib/omg_eth/blockchain/bit_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,8 @@ defmodule OMG.Eth.Blockchain.BitHelper do use Bitwise - @type keccak_hash :: binary() + alias ExPlasma.Crypto + @type keccak_hash :: <<_::256>> @doc """ Returns the keccak sha256 of a given input. @@ -39,7 +40,7 @@ defmodule OMG.Eth.Blockchain.BitHelper do """ @spec kec(binary()) :: keccak_hash def kec(data) do - :keccakf1600.sha3_256(data) + Crypto.keccak_hash(data) end @doc """ diff --git a/apps/omg_eth/lib/omg_eth/blockchain/private_key.ex b/apps/omg_eth/lib/omg_eth/blockchain/private_key.ex index ccaef7971b..cede7df594 100644 --- a/apps/omg_eth/lib/omg_eth/blockchain/private_key.ex +++ b/apps/omg_eth/lib/omg_eth/blockchain/private_key.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/blockchain/transaction.ex b/apps/omg_eth/lib/omg_eth/blockchain/transaction.ex index 5e40648839..61a865987d 100644 --- a/apps/omg_eth/lib/omg_eth/blockchain/transaction.ex +++ b/apps/omg_eth/lib/omg_eth/blockchain/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/blockchain/transaction/hash.ex b/apps/omg_eth/lib/omg_eth/blockchain/transaction/hash.ex index 8c312f6705..2833a2d56f 100644 --- a/apps/omg_eth/lib/omg_eth/blockchain/transaction/hash.ex +++ b/apps/omg_eth/lib/omg_eth/blockchain/transaction/hash.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -88,8 +88,7 @@ defmodule OMG.Eth.Blockchain.Transaction.Hash do @spec sign_hash(BitHelper.keccak_hash(), private_key, integer() | nil) :: {hash_v, hash_r, hash_s} def sign_hash(hash, private_key, chain_id \\ nil) do - {:ok, <>, recovery_id} = - :libsecp256k1.ecdsa_sign_compact(hash, private_key, :default, <<>>) + {:ok, {<>, recovery_id}} = ExSecp256k1.sign_compact(hash, private_key) # Fork Ψ EIP-155 recovery_id = diff --git a/apps/omg_eth/lib/omg_eth/blockchain/transaction/signature.ex b/apps/omg_eth/lib/omg_eth/blockchain/transaction/signature.ex index 4cb3feb01b..88d7818ea9 100644 --- a/apps/omg_eth/lib/omg_eth/blockchain/transaction/signature.ex +++ b/apps/omg_eth/lib/omg_eth/blockchain/transaction/signature.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/client.ex b/apps/omg_eth/lib/omg_eth/client.ex index 4ed571da60..84ddb3b313 100644 --- a/apps/omg_eth/lib/omg_eth/client.ex +++ b/apps/omg_eth/lib/omg_eth/client.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,13 +29,15 @@ defmodule OMG.Eth.Client do end end - @spec node_ready() :: :ok | {:error, :geth_still_syncing | :geth_not_listening} - @spec node_ready(module()) :: :ok | {:error, :geth_still_syncing | :geth_not_listening} + @spec node_ready() :: :ok | {:error, :geth_still_syncing} + @spec node_ready(module()) :: :ok | {:error, :geth_still_syncing} def node_ready(client \\ Ethereumex.HttpClient) do case client.eth_syncing() do - {:ok, false} -> :ok - {:ok, _} -> {:error, :geth_still_syncing} - {:error, :econnrefused} -> {:error, :geth_not_listening} + {:ok, false} -> + :ok + + {:ok, _} -> + {:error, :geth_still_syncing} end end end diff --git a/apps/omg_eth/lib/omg_eth/configuration.ex b/apps/omg_eth/lib/omg_eth/configuration.ex index 84c30d5a95..bac3993e78 100644 --- a/apps/omg_eth/lib/omg_eth/configuration.ex +++ b/apps/omg_eth/lib/omg_eth/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/encoding.ex b/apps/omg_eth/lib/omg_eth/encoding.ex index 71b34d1e1a..98df0db62c 100644 --- a/apps/omg_eth/lib/omg_eth/encoding.ex +++ b/apps/omg_eth/lib/omg_eth/encoding.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/encoding/contract_constructor.ex b/apps/omg_eth/lib/omg_eth/encoding/contract_constructor.ex index 805985eb0d..9feb31a538 100644 --- a/apps/omg_eth/lib/omg_eth/encoding/contract_constructor.ex +++ b/apps/omg_eth/lib/omg_eth/encoding/contract_constructor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/ethereum_height.ex b/apps/omg_eth/lib/omg_eth/ethereum_height.ex index 3180eaf9db..a7655b7ac8 100644 --- a/apps/omg_eth/lib/omg_eth/ethereum_height.ex +++ b/apps/omg_eth/lib/omg_eth/ethereum_height.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/ethereum_height_monitor.ex b/apps/omg_eth/lib/omg_eth/ethereum_height_monitor.ex index f612111868..b94d49be25 100644 --- a/apps/omg_eth/lib/omg_eth/ethereum_height_monitor.ex +++ b/apps/omg_eth/lib/omg_eth/ethereum_height_monitor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/ethereum_height_monitor/alarm_handler.ex b/apps/omg_eth/lib/omg_eth/ethereum_height_monitor/alarm_handler.ex index d756536e50..5ae74b0f7c 100644 --- a/apps/omg_eth/lib/omg_eth/ethereum_height_monitor/alarm_handler.ex +++ b/apps/omg_eth/lib/omg_eth/ethereum_height_monitor/alarm_handler.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/metric/ethereumex.ex b/apps/omg_eth/lib/omg_eth/metric/ethereumex.ex index 07fb745242..934faaffc6 100644 --- a/apps/omg_eth/lib/omg_eth/metric/ethereumex.ex +++ b/apps/omg_eth/lib/omg_eth/metric/ethereumex.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex b/apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex index 4ef2b5b1d8..8c5f39ec2c 100644 --- a/apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex +++ b/apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/release_tasks/set_contract/eip55.ex b/apps/omg_eth/lib/omg_eth/release_tasks/set_contract/eip55.ex index aa83ebbba6..b2f9ff9d96 100644 --- a/apps/omg_eth/lib/omg_eth/release_tasks/set_contract/eip55.ex +++ b/apps/omg_eth/lib/omg_eth/release_tasks/set_contract/eip55.ex @@ -1,3 +1,17 @@ +# Copyright 2019-2020 OMG Network Pte Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + defmodule OMG.Eth.ReleaseTasks.SetContract.EIP55 do @moduledoc """ Implements EIP 55 @@ -9,7 +23,8 @@ defmodule OMG.Eth.ReleaseTasks.SetContract.EIP55 do hash = address - |> :keccakf1600.sha3_256() + |> ExKeccak.hash_256() + |> elem(1) |> Base.encode16(case: :lower) |> String.graphemes() diff --git a/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_block_time.ex b/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_block_time.ex index 709f0968d2..59d81a91db 100644 --- a/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_block_time.ex +++ b/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_block_time.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_client.ex b/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_client.ex index 15d41bad2b..cb1cf0b909 100644 --- a/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_client.ex +++ b/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_client.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_events_check_interval.ex b/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_events_check_interval.ex index 98048081fd..e208d93b4e 100644 --- a/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_events_check_interval.ex +++ b/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_events_check_interval.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold.ex b/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold.ex index 1c539a1368..bf4dc25269 100644 --- a/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold.ex +++ b/apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/root_chain.ex b/apps/omg_eth/lib/omg_eth/root_chain.ex index af3297b59b..4ad7c9d274 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/root_chain/abi.ex b/apps/omg_eth/lib/omg_eth/root_chain/abi.ex index b1c71b9638..ddff406675 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/abi.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/abi.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ defmodule OMG.Eth.RootChain.Abi do @moduledoc """ Functions that provide ethereum log decoding """ + alias ExPlasma.Crypto alias OMG.Eth.Encoding alias OMG.Eth.RootChain.AbiEventSelector alias OMG.Eth.RootChain.AbiFunctionSelector @@ -22,7 +23,7 @@ defmodule OMG.Eth.RootChain.Abi do def decode_function(enriched_data, signature) do "0x" <> data = enriched_data - <> = :keccakf1600.hash(:sha3_256, signature) + <> = Crypto.keccak_hash(signature) method_id |> Encoding.to_hex() |> Kernel.<>(data) |> Encoding.from_hex() |> decode_function() end diff --git a/apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex b/apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex index 85c250a18b..1ee64c521b 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/root_chain/abi_function_selector.ex b/apps/omg_eth/lib/omg_eth/root_chain/abi_function_selector.ex index 1957d108eb..725aec00d2 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/abi_function_selector.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/abi_function_selector.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/root_chain/event.ex b/apps/omg_eth/lib/omg_eth/root_chain/event.ex index b9dda01d46..1c4cc0285d 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/event.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/event.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/root_chain/fields.ex b/apps/omg_eth/lib/omg_eth/root_chain/fields.ex index 0e65f3a50c..d51b27f0a2 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/fields.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/fields.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/root_chain/rpc.ex b/apps/omg_eth/lib/omg_eth/root_chain/rpc.ex index faa83397a4..4c621f21d0 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/rpc.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/rpc.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ defmodule OMG.Eth.RootChain.Rpc do Does RPC calls for enriching event functions or bare events polling to plasma contracts. """ require Logger + alias ExPlasma.Crypto alias OMG.Eth.Encoding def call_contract(client \\ Ethereumex.HttpClient, contract, signature, args) do @@ -59,7 +60,7 @@ defmodule OMG.Eth.RootChain.Rpc do defp event_topic_for_signature(signature) do signature - |> ExthCrypto.Hash.hash(ExthCrypto.Hash.kec()) + |> Crypto.keccak_hash() |> Encoding.to_hex() end diff --git a/apps/omg_eth/lib/omg_eth/root_chain/submit_block.ex b/apps/omg_eth/lib/omg_eth/root_chain/submit_block.ex index ed74b3ec6b..7e3d08f6e7 100644 --- a/apps/omg_eth/lib/omg_eth/root_chain/submit_block.ex +++ b/apps/omg_eth/lib/omg_eth/root_chain/submit_block.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/supervisor.ex b/apps/omg_eth/lib/omg_eth/supervisor.ex index d0facc6e19..44e0556a30 100644 --- a/apps/omg_eth/lib/omg_eth/supervisor.ex +++ b/apps/omg_eth/lib/omg_eth/supervisor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/lib/omg_eth/transaction.ex b/apps/omg_eth/lib/omg_eth/transaction.ex index d0f93f7a67..079446d1e0 100644 --- a/apps/omg_eth/lib/omg_eth/transaction.ex +++ b/apps/omg_eth/lib/omg_eth/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/mix.exs b/apps/omg_eth/mix.exs index dcd9e3c246..3f6a03c998 100644 --- a/apps/omg_eth/mix.exs +++ b/apps/omg_eth/mix.exs @@ -6,7 +6,7 @@ defmodule OMG.Eth.MixProject do def project() do [ app: :omg_eth, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -23,10 +23,18 @@ defmodule OMG.Eth.MixProject do [ mod: {OMG.Eth.Application, []}, start_phases: [{:attach_telemetry, []}], - extra_applications: [:sasl, :logger] + extra_applications: [:sasl, :logger, :ex_plasma, :ex_rlp] ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + # Specifies which paths to compile per environment. # :dev compiles `test/support` to gain access to various `Support.*` helpers defp elixirc_paths(:prod), do: ["lib"] @@ -35,8 +43,9 @@ defmodule OMG.Eth.MixProject do defp deps() do [ - {:ex_abi, "~> 0.4"}, + {:ex_abi, "~> 0.5.1"}, {:ethereumex, "~> 0.6.0"}, + {:ex_secp256k1, "~> 0.1.2"}, # Umbrella {:omg_bus, in_umbrella: true}, {:omg_status, in_umbrella: true}, diff --git a/apps/omg_eth/test/fixtures.exs b/apps/omg_eth/test/fixtures.exs index 3a52862a5d..87b98d2438 100644 --- a/apps/omg_eth/test/fixtures.exs +++ b/apps/omg_eth/test/fixtures.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/fixtures/vcr_cassettes/get_ethereum_height.json b/apps/omg_eth/test/fixtures/vcr_cassettes/get_ethereum_height.json deleted file mode 100644 index 597c71f444..0000000000 --- a/apps/omg_eth/test/fixtures/vcr_cassettes/get_ethereum_height.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "request": { - "body": "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x2\"}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sat, 05 Oct 2019 16:26:14 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x2\",false]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{\"difficulty\":\"0x2\",\"extraData\":\"0xd88301081b846765746888676f312e31312e39856c696e757800000000000000b1fd42ee30a08cd49fde78d565a5e6386c80482d8d2e4e78060df054fe3868712225649263b00325f4fa40eabb2f13872d390a93a5ef82d3b38cf1c798d326b101\",\"gasLimit\":\"0x600fa3\",\"gasUsed\":\"0x0\",\"hash\":\"0x4cd50879b0197f5be029ef685bd1484ffb661bd210ab939bff3a022f4f755a49\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0x0000000000000000000000000000000000000000\",\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"nonce\":\"0x0000000000000000\",\"number\":\"0x2\",\"parentHash\":\"0xf6cb21c24110960c9f54efd0ffe26ca557aab24e0597bd907860eec9af8a818b\",\"receiptsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"size\":\"0x25e\",\"stateRoot\":\"0x66269b3209ffb9f7ca0d94b035641d50e992b7e9c88aa4ef38fbc21e415b9220\",\"timestamp\":\"0x5d98c426\",\"totalDifficulty\":\"0x5\",\"transactions\":[],\"transactionsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"uncles\":[]}}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sat, 05 Oct 2019 16:26:14 GMT", - "Content-Length": "1596" - }, - "status_code": 200, - "type": "ok" - } - } -] diff --git a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_deposits.json b/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_deposits.json deleted file mode 100644 index 0613ca439c..0000000000 --- a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_deposits.json +++ /dev/null @@ -1,418 +0,0 @@ -[ - { - "request": { - "body": "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"eth_sendTransaction\",\"params\":[{\"data\":\"0x98b1e06a00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000052f85001c0eceb94825847f220e5aa9e63bb09bf14ded84e390c54a694000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"from\":\"0x825847f220e5aa9e63bb09bf14ded84e390c54a6\",\"gas\":\"0x2BF20\",\"gasPrice\":\"0x3B9ACA00\",\"to\":\"0x0b74b2eba8dac6434593f4b7b21706557c1cfd73\",\"value\":\"0x1\"}]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:11 GMT", - "Content-Length": "103" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":2,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":2,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:11 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":3,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":3,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:11 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":4,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":4,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":5,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":5,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":6,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":6,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":7,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":8,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":8,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":9,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":9,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":10,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":10,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":11,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":11,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":12,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":12,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:12 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":13,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":13,\"result\":{\"blockHash\":\"0x6a8721843410948d037d1a75786d9a9e0052930fb2fdda65e60ba008c6dce35a\",\"blockNumber\":\"0x21\",\"contractAddress\":null,\"cumulativeGasUsed\":\"0x1a4ed\",\"from\":\"0x825847f220e5aa9e63bb09bf14ded84e390c54a6\",\"gasUsed\":\"0x1a4ed\",\"logs\":[{\"address\":\"0x0b74b2eba8dac6434593f4b7b21706557c1cfd73\",\"topics\":[\"0x18569122d84f30025bb8dffb33563f1bdbfb9637f21552b11b8305686e9cb307\",\"0x000000000000000000000000825847f220e5aa9e63bb09bf14ded84e390c54a6\",\"0x0000000000000000000000000000000000000000000000000000000000000001\",\"0x0000000000000000000000000000000000000000000000000000000000000000\"],\"data\":\"0x0000000000000000000000000000000000000000000000000000000000000001\",\"blockNumber\":\"0x21\",\"transactionHash\":\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\",\"transactionIndex\":\"0x0\",\"blockHash\":\"0x6a8721843410948d037d1a75786d9a9e0052930fb2fdda65e60ba008c6dce35a\",\"logIndex\":\"0x0\",\"removed\":false}],\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000040000000000000000000000000000020000000000000000020800000000000000000000000080000000000000000000000000000000010000000000000000000000000000000000000000000000000008000000000000000000000000000000000040000000000000000000000000000100000000000000000000000000010000000000000000000060000000000000000000000000000000004000080000000000000000000000000000\",\"status\":\"0x1\",\"to\":\"0x0b74b2eba8dac6434593f4b7b21706557c1cfd73\",\"transactionHash\":\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\",\"transactionIndex\":\"0x0\"}}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:13 GMT", - "Content-Length": "1646" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":14,\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":14,\"result\":\"0x21\"}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:13 GMT", - "Content-Length": "42" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":15,\"jsonrpc\":\"2.0\",\"method\":\"eth_getLogs\",\"params\":[{\"address\":\"0x0b74b2eba8dac6434593f4b7b21706557c1cfd73\",\"fromBlock\":\"0x1\",\"toBlock\":\"0x21\",\"topics\":[\"0x18569122d84f30025bb8dffb33563f1bdbfb9637f21552b11b8305686e9cb307\"]}]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":15,\"result\":[{\"address\":\"0x0b74b2eba8dac6434593f4b7b21706557c1cfd73\",\"topics\":[\"0x18569122d84f30025bb8dffb33563f1bdbfb9637f21552b11b8305686e9cb307\",\"0x000000000000000000000000825847f220e5aa9e63bb09bf14ded84e390c54a6\",\"0x0000000000000000000000000000000000000000000000000000000000000001\",\"0x0000000000000000000000000000000000000000000000000000000000000000\"],\"data\":\"0x0000000000000000000000000000000000000000000000000000000000000001\",\"blockNumber\":\"0x21\",\"transactionHash\":\"0x1226b7cd05b207c8ad76fcb38d87b1ae479598745a7ade47cf6f60c4e26efe04\",\"transactionIndex\":\"0x0\",\"blockHash\":\"0x6a8721843410948d037d1a75786d9a9e0052930fb2fdda65e60ba008c6dce35a\",\"logIndex\":\"0x0\",\"removed\":false}]}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:13 GMT", - "Content-Length": "704" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":16,\"jsonrpc\":\"2.0\",\"method\":\"eth_getLogs\",\"params\":[{\"address\":\"0x233a952fd2fb68e493e1f672e639050f0b612619\",\"fromBlock\":\"0x1\",\"toBlock\":\"0x21\",\"topics\":[\"0x18569122d84f30025bb8dffb33563f1bdbfb9637f21552b11b8305686e9cb307\"]}]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":16,\"result\":[]}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:42:13 GMT", - "Content-Length": "38" - }, - "status_code": 200, - "type": "ok" - } - } -] \ No newline at end of file diff --git a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_next_child_block.json b/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_next_child_block.json deleted file mode 100644 index 4c998d59c3..0000000000 --- a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_next_child_block.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "request": { - "body": "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"data\":\"0x4ca8714f\",\"to\":\"0xc673e4ffcb8464faff908a6804fe0e635af0ea2f\"},\"latest\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x00000000000000000000000000000000000000000000000000000000000003e8\"}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 00:55:12 GMT", - "Content-Length": "103" - }, - "status_code": 200, - "type": "ok" - } - } -] \ No newline at end of file diff --git a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_root_deployment_height.json b/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_root_deployment_height.json deleted file mode 100644 index 7f5ecaff23..0000000000 --- a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/get_root_deployment_height.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "request": { - "body": "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0x1c19c7cf8061d9c4c87a716e9e4fde8048d11561eaf4099730ab9a1689b1b41c\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{\"blockHash\":\"0x38790bdc836dd215535f713d8cadc8b4cd877d473d284e53993b54cf5d936e3c\",\"blockNumber\":\"0x7\",\"contractAddress\":\"0x5a232b49e9ec6577b51acdb053cd0a2dca884d94\",\"cumulativeGasUsed\":\"0x421f89\",\"from\":\"0x6dca6662f07b764e5692b36a420e7ddfcefbef33\",\"gasUsed\":\"0x421f89\",\"logs\":[{\"address\":\"0x8c07ab37d9f67662f11493b5b8dede956a609897\",\"topics\":[\"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0\",\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"0x0000000000000000000000005a232b49e9ec6577b51acdb053cd0a2dca884d94\"],\"data\":\"0x\",\"blockNumber\":\"0x7\",\"transactionHash\":\"0x1c19c7cf8061d9c4c87a716e9e4fde8048d11561eaf4099730ab9a1689b1b41c\",\"transactionIndex\":\"0x0\",\"blockHash\":\"0x38790bdc836dd215535f713d8cadc8b4cd877d473d284e53993b54cf5d936e3c\",\"logIndex\":\"0x0\",\"removed\":false}],\"logsBloom\":\"0x00000000000000004000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000020000000000000000000400000000020000000000000000000000000000000000000020000000000000000000000000000\",\"status\":\"0x1\",\"to\":null,\"transactionHash\":\"0x1c19c7cf8061d9c4c87a716e9e4fde8048d11561eaf4099730ab9a1689b1b41c\",\"transactionIndex\":\"0x0\"}}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sat, 05 Oct 2019 20:27:03 GMT", - "Content-Length": "1512" - }, - "status_code": 200, - "type": "ok" - } - } -] \ No newline at end of file diff --git a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/has_token_false.json b/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/has_token_false.json deleted file mode 100644 index f07a9133c4..0000000000 --- a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/has_token_false.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "request": { - "body": "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"data\":\"0x9bb0f5990000000000000000000000000000000000000000000000000000000000000001\",\"to\":\"0xd4d0c17100297fb77c3b4523ed54275a732b6d05\"},\"latest\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x0000000000000000000000000000000000000000000000000000000000000000\"}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sat, 05 Oct 2019 21:35:06 GMT", - "Content-Length": "103" - }, - "status_code": 200, - "type": "ok" - } - } -] \ No newline at end of file diff --git a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/submit_block.json b/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/submit_block.json deleted file mode 100644 index f729680879..0000000000 --- a/apps/omg_eth/test/fixtures/vcr_cassettes/root_chain/submit_block.json +++ /dev/null @@ -1,418 +0,0 @@ -[ - { - "request": { - "body": "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"eth_sendTransaction\",\"params\":[{\"data\":\"0xbaa4769400000000000000000000000000000000000000000000000000000000000000ea\",\"from\":\"0x1b3dda52f7dfe3f0afa6f6bceb4a7c50373a817f\",\"gas\":\"0x186A0\",\"gasPrice\":\"0x4A817C800\",\"nonce\":\"0x1\",\"to\":\"0x5a98b691a025af70d6ed32d1ab0ca107892a77b5\",\"value\":\"0x0\"}]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:19 GMT", - "Content-Length": "103" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":2,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":2,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:19 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":3,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":3,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:19 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":4,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":4,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:19 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":5,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":5,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:19 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":6,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":6,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":7,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":7,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":8,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":8,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":9,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":9,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "39" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":10,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":10,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":11,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":11,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":12,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":12,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":13,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":13,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":14,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":14,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":15,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":15,\"result\":null}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:20 GMT", - "Content-Length": "40" - }, - "status_code": 200, - "type": "ok" - } - }, - { - "request": { - "body": "{\"id\":16,\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionReceipt\",\"params\":[\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\"]}", - "headers": { - "Content-Type": "application/json" - }, - "method": "post", - "options": { - "recv_timeout": "infinity", - "pool": "default" - }, - "request_body": "", - "url": "http://localhost:8545" - }, - "response": { - "binary": false, - "body": "{\"jsonrpc\":\"2.0\",\"id\":16,\"result\":{\"blockHash\":\"0x59c880d50455f19b160f94eda085e080701cf4ff5679d39b4c63c3aa75a90b89\",\"blockNumber\":\"0x21\",\"contractAddress\":null,\"cumulativeGasUsed\":\"0x122d5\",\"from\":\"0x1b3dda52f7dfe3f0afa6f6bceb4a7c50373a817f\",\"gasUsed\":\"0x122d5\",\"logs\":[{\"address\":\"0x5a98b691a025af70d6ed32d1ab0ca107892a77b5\",\"topics\":[\"0x5a978f4723b249ccf79cd7a658a8601ce1ff8b89fc770251a6be35216351ce32\"],\"data\":\"0x00000000000000000000000000000000000000000000000000000000000003e8\",\"blockNumber\":\"0x21\",\"transactionHash\":\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\",\"transactionIndex\":\"0x0\",\"blockHash\":\"0x59c880d50455f19b160f94eda085e080701cf4ff5679d39b4c63c3aa75a90b89\",\"logIndex\":\"0x0\",\"removed\":false}],\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000001000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000100001000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"status\":\"0x1\",\"to\":\"0x5a98b691a025af70d6ed32d1ab0ca107892a77b5\",\"transactionHash\":\"0xffedd621509690d98260c3a2cc6676f0b888073d5e3e7fe82351a7367119bc4f\",\"transactionIndex\":\"0x0\"}}\n", - "headers": { - "Content-Type": "application/json", - "Date": "Sun, 06 Oct 2019 07:32:21 GMT", - "Content-Length": "1439" - }, - "status_code": 200, - "type": "ok" - } - } -] \ No newline at end of file diff --git a/apps/omg_eth/test/omg_eth/application_test.exs b/apps/omg_eth/test/omg_eth/application_test.exs index 15e606672f..fff6d2d88e 100644 --- a/apps/omg_eth/test/omg_eth/application_test.exs +++ b/apps/omg_eth/test/omg_eth/application_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/blockchain/bit_helper_test.exs b/apps/omg_eth/test/omg_eth/blockchain/bit_helper_test.exs index cb5b60b755..b0e5747950 100644 --- a/apps/omg_eth/test/omg_eth/blockchain/bit_helper_test.exs +++ b/apps/omg_eth/test/omg_eth/blockchain/bit_helper_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/blockchain/transaction/hash_test.exs b/apps/omg_eth/test/omg_eth/blockchain/transaction/hash_test.exs index eb1e1d4e9b..fd9ce40983 100644 --- a/apps/omg_eth/test/omg_eth/blockchain/transaction/hash_test.exs +++ b/apps/omg_eth/test/omg_eth/blockchain/transaction/hash_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/blockchain/transaction/signature_test.exs b/apps/omg_eth/test/omg_eth/blockchain/transaction/signature_test.exs index 9da8f4db16..98b55b79d7 100644 --- a/apps/omg_eth/test/omg_eth/blockchain/transaction/signature_test.exs +++ b/apps/omg_eth/test/omg_eth/blockchain/transaction/signature_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/blockchain/transaction_test.exs b/apps/omg_eth/test/omg_eth/blockchain/transaction_test.exs index 775fe9c573..7670c6259f 100644 --- a/apps/omg_eth/test/omg_eth/blockchain/transaction_test.exs +++ b/apps/omg_eth/test/omg_eth/blockchain/transaction_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/client_test.exs b/apps/omg_eth/test/omg_eth/client_test.exs index 9499d1ba96..43a16b78b3 100644 --- a/apps/omg_eth/test/omg_eth/client_test.exs +++ b/apps/omg_eth/test/omg_eth/client_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -46,14 +46,4 @@ defmodule OMG.Eth.ClientTest do assert Client.node_ready(test_name) == :ok end - - test "node_ready/0 returns client unavailable ", %{test: test_name} do - defmodule test_name do - def eth_syncing() do - {:error, :econnrefused} - end - end - - assert Client.node_ready(test_name) == {:error, :geth_not_listening} - end end diff --git a/apps/omg_eth/test/omg_eth/encoding/contract_constructor_test.exs b/apps/omg_eth/test/omg_eth/encoding/contract_constructor_test.exs index 6311f599ad..7c0feee39f 100644 --- a/apps/omg_eth/test/omg_eth/encoding/contract_constructor_test.exs +++ b/apps/omg_eth/test/omg_eth/encoding/contract_constructor_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/encoding_test.exs b/apps/omg_eth/test/omg_eth/encoding_test.exs index 4339a2cad4..5d690ad50c 100644 --- a/apps/omg_eth/test/omg_eth/encoding_test.exs +++ b/apps/omg_eth/test/omg_eth/encoding_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/eth_test.exs b/apps/omg_eth/test/omg_eth/eth_test.exs index f1fbc1da2a..205945d218 100644 --- a/apps/omg_eth/test/omg_eth/eth_test.exs +++ b/apps/omg_eth/test/omg_eth/eth_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/ethereum_height_monitor_test.exs b/apps/omg_eth/test/omg_eth/ethereum_height_monitor_test.exs index 293b9ec776..92b3699bcc 100644 --- a/apps/omg_eth/test/omg_eth/ethereum_height_monitor_test.exs +++ b/apps/omg_eth/test/omg_eth/ethereum_height_monitor_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs b/apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs index ae24cde0ba..fac6fadc84 100644 --- a/apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs +++ b/apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_block_time_test.exs b/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_block_time_test.exs index 1dc7fd1977..d57573b365 100644 --- a/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_block_time_test.exs +++ b/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_block_time_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_client_test.exs b/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_client_test.exs index 61ae67ae92..fa1d4ba361 100644 --- a/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_client_test.exs +++ b/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_client_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_events_check_interval_test.exs b/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_events_check_interval_test.exs index ca463335b3..f63a72dbab 100644 --- a/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_events_check_interval_test.exs +++ b/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_events_check_interval_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold_test.exs b/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold_test.exs index 0a2807e9c7..037d0a72ce 100644 --- a/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold_test.exs +++ b/apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/root_chain/event_test.exs b/apps/omg_eth/test/omg_eth/root_chain/event_test.exs index 6e0b91d467..2f5f9afe6b 100644 --- a/apps/omg_eth/test/omg_eth/root_chain/event_test.exs +++ b/apps/omg_eth/test/omg_eth/root_chain/event_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/omg_eth/root_chain_test.exs b/apps/omg_eth/test/omg_eth/root_chain_test.exs index 6d8910d772..f0c3dc87e1 100644 --- a/apps/omg_eth/test/omg_eth/root_chain_test.exs +++ b/apps/omg_eth/test/omg_eth/root_chain_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,17 +15,19 @@ defmodule OMG.Eth.RootChainTest do use ExUnit.Case, async: false + alias ExPlasma.Builder + alias ExPlasma.Crypto + alias ExPlasma.Transaction.Type.PaymentV1 alias OMG.Eth.Configuration alias OMG.Eth.Encoding alias OMG.Eth.RootChain alias OMG.Eth.RootChain.Abi alias Support.DevHelper alias Support.RootChainHelper - @eth "0x0000000000000000000000000000000000000000" @moduletag :common - setup do + setup_all do {:ok, exit_fn} = Support.DevNode.start() on_exit(exit_fn) @@ -63,8 +65,8 @@ defmodule OMG.Eth.RootChainTest do defp deposit_then_start_exit(owner, amount, currency) do owner = Encoding.from_hex(owner, :mixed) - {:ok, deposit} = ExPlasma.Transaction.Deposit.new(owner: owner, currency: currency, amount: amount) - rlp = ExPlasma.Transaction.encode(deposit) + currency = Encoding.from_hex(currency) + rlp = deposit_transaction(amount, owner, currency) {:ok, deposit_tx} = rlp @@ -75,8 +77,8 @@ defmodule OMG.Eth.RootChainTest do deposit_blknum = RootChainHelper.deposit_blknum_from_receipt(deposit_tx) deposit_txindex = OMG.Eth.Encoding.int_from_hex(deposit_txlog["transactionIndex"]) - utxo_pos = ExPlasma.Utxo.pos(%{blknum: deposit_blknum, txindex: deposit_txindex, oindex: 0}) - proof = ExPlasma.Encoding.merkle_proof([rlp], 0) + utxo_pos = ExPlasma.Output.Position.pos(%{blknum: deposit_blknum, txindex: deposit_txindex, oindex: 0}) + proof = ExPlasma.Merkle.proof([rlp], 0) {:ok, start_exit_tx} = utxo_pos @@ -88,8 +90,8 @@ defmodule OMG.Eth.RootChainTest do defp exit_id_from_receipt(%{"logs" => logs}) do topic = - "ExitStarted(address,uint168)" - |> ExthCrypto.Hash.hash(ExthCrypto.Hash.kec()) + "ExitStarted(address,uint160)" + |> Crypto.keccak_hash() |> Encoding.to_hex() [%{exit_id: exit_id}] = @@ -109,4 +111,15 @@ defmodule OMG.Eth.RootChainTest do {:ok, %{"status" => "0x1"}} = Support.DevHelper.transact_sync!(add_exit_queue) end + + defp deposit_transaction(amount_in_wei, address, currency) do + address + |> deposit(currency, amount_in_wei) + |> ExPlasma.encode!(signed: false) + end + + defp deposit(owner, token, amount) do + output = PaymentV1.new_output(owner, token, amount) + Builder.new(ExPlasma.payment_v1(), outputs: [output]) + end end diff --git a/apps/omg_eth/test/support/defaults.ex b/apps/omg_eth/test/support/defaults.ex index e31a162599..c05911b4bd 100644 --- a/apps/omg_eth/test/support/defaults.ex +++ b/apps/omg_eth/test/support/defaults.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/support/dev_geth.ex b/apps/omg_eth/test/support/dev_geth.ex index 5270ecfcbf..d00dcb6379 100644 --- a/apps/omg_eth/test/support/dev_geth.ex +++ b/apps/omg_eth/test/support/dev_geth.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/support/dev_helper.ex b/apps/omg_eth/test/support/dev_helper.ex index 2c6f172987..0e41cd6d0d 100644 --- a/apps/omg_eth/test/support/dev_helper.ex +++ b/apps/omg_eth/test/support/dev_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/support/dev_node.ex b/apps/omg_eth/test/support/dev_node.ex index 1f66e84f74..257645dcd9 100644 --- a/apps/omg_eth/test/support/dev_node.ex +++ b/apps/omg_eth/test/support/dev_node.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/support/root_chain_helper.ex b/apps/omg_eth/test/support/root_chain_helper.ex index d7c3d8417c..7a768330be 100644 --- a/apps/omg_eth/test/support/root_chain_helper.ex +++ b/apps/omg_eth/test/support/root_chain_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ defmodule Support.RootChainHelper do """ import OMG.Eth.Encoding, only: [to_hex: 1, from_hex: 2] + alias ExPlasma.Crypto alias OMG.Eth.Blockchain.BitHelper alias OMG.Eth.Configuration alias OMG.Eth.RootChain.Abi @@ -284,7 +285,7 @@ defmodule Support.RootChainHelper do def deposit_blknum_from_receipt(%{"logs" => logs}) do topic = "DepositCreated(address,uint256,address,uint256)" - |> ExthCrypto.Hash.hash(ExthCrypto.Hash.kec()) + |> Crypto.keccak_hash() |> to_hex() [%{blknum: deposit_blknum}] = diff --git a/apps/omg_eth/test/support/snapshot_contracts.ex b/apps/omg_eth/test/support/snapshot_contracts.ex index da22de1f4e..1d191bec10 100644 --- a/apps/omg_eth/test/support/snapshot_contracts.ex +++ b/apps/omg_eth/test/support/snapshot_contracts.ex @@ -1,4 +1,4 @@ -# Copyright 2020 OmiseGO Pte Ltd +# Copyright 2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/support/token.ex b/apps/omg_eth/test/support/token.ex index b1481f997f..edbf087cda 100644 --- a/apps/omg_eth/test/support/token.ex +++ b/apps/omg_eth/test/support/token.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/support/transaction_helper.ex b/apps/omg_eth/test/support/transaction_helper.ex index 6930edb03e..8da0365b6e 100644 --- a/apps/omg_eth/test/support/transaction_helper.ex +++ b/apps/omg_eth/test/support/transaction_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/support/wait_for.ex b/apps/omg_eth/test/support/wait_for.ex index 253e2924ce..7cd525d6eb 100644 --- a/apps/omg_eth/test/support/wait_for.ex +++ b/apps/omg_eth/test/support/wait_for.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_eth/test/test_helper.exs b/apps/omg_eth/test/test_helper.exs index ec4d389ec3..f904731dfc 100644 --- a/apps/omg_eth/test/test_helper.exs +++ b/apps/omg_eth/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/alert/alarm.ex b/apps/omg_status/lib/omg_status/alert/alarm.ex index dbf34a5db8..779b3e6395 100644 --- a/apps/omg_status/lib/omg_status/alert/alarm.ex +++ b/apps/omg_status/lib/omg_status/alert/alarm.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/alert/alarm_handler.ex b/apps/omg_status/lib/omg_status/alert/alarm_handler.ex index bfe34b9018..5c6d4922d8 100644 --- a/apps/omg_status/lib/omg_status/alert/alarm_handler.ex +++ b/apps/omg_status/lib/omg_status/alert/alarm_handler.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/alert/alarm_printer.ex b/apps/omg_status/lib/omg_status/alert/alarm_printer.ex index 76b2f1ad46..7b58b5bb86 100644 --- a/apps/omg_status/lib/omg_status/alert/alarm_printer.ex +++ b/apps/omg_status/lib/omg_status/alert/alarm_printer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/application.ex b/apps/omg_status/lib/omg_status/application.ex index 5064af012e..f4ebef3c7f 100644 --- a/apps/omg_status/lib/omg_status/application.ex +++ b/apps/omg_status/lib/omg_status/application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/configuration.ex b/apps/omg_status/lib/omg_status/configuration.ex index cfb204c27c..3ffd405b44 100644 --- a/apps/omg_status/lib/omg_status/configuration.ex +++ b/apps/omg_status/lib/omg_status/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/datadog_event/alarm_consumer.ex b/apps/omg_status/lib/omg_status/datadog_event/alarm_consumer.ex index ef8d3de13a..f93471a638 100644 --- a/apps/omg_status/lib/omg_status/datadog_event/alarm_consumer.ex +++ b/apps/omg_status/lib/omg_status/datadog_event/alarm_consumer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ defmodule OMG.Status.DatadogEvent.AlarmConsumer do Mandatory params are in Keyword form: - :publisher is Module that implements a function `event/3` (title, message, option). It's purpose is to forward alarms to a collector (for example, Datadog) - - :alarm_handler (http://erlang.org/doc/man/alarm_handler.html) is a gen_event process that allows us to install our alarm handler ontu. Our installed handler will than receive + - :alarm_handler (http://erlang.org/doc/man/alarm_handler.html) is a gen_event process that allows us to install our alarm handler ontu. Our installed handler will than receive system alarms (set and cleared) and cast us the alarms. - :dd_alarm_handler is the module that we install as alarm_handler and will get notified of set and cleared alarms and forward them to THIS AlarmConsumer process. - :release is the mode this current process is runing under (for example, currently we support watcher, child chain or watcher info) diff --git a/apps/omg_status/lib/omg_status/datadog_event/alarm_handler.ex b/apps/omg_status/lib/omg_status/datadog_event/alarm_handler.ex index beb117979e..5945af4495 100644 --- a/apps/omg_status/lib/omg_status/datadog_event/alarm_handler.ex +++ b/apps/omg_status/lib/omg_status/datadog_event/alarm_handler.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/metric/datadog.ex b/apps/omg_status/lib/omg_status/metric/datadog.ex index a7a00b60c5..a8149d7fdc 100644 --- a/apps/omg_status/lib/omg_status/metric/datadog.ex +++ b/apps/omg_status/lib/omg_status/metric/datadog.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/metric/event.ex b/apps/omg_status/lib/omg_status/metric/event.ex index 1a83b32272..ba83c932ac 100644 --- a/apps/omg_status/lib/omg_status/metric/event.ex +++ b/apps/omg_status/lib/omg_status/metric/event.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ defmodule OMG.Status.Metric.Event do :ife_exit_finalizer, :in_flight_exit, :in_flight_exit_processor, - :in_flight_exit_deleted_processor, :piggyback, :piggyback_challenges_processor, :piggyback_processor, @@ -36,116 +35,61 @@ defmodule OMG.Status.Metric.Event do ] @doc """ - Child Chain API's received transaction submission. + :transaction_submission - Child Chain API's received transaction submission. + :transaction_submission_success - Child Chain API's successful processing of transaction submission. + :transaction_submission_failed - Child Chain API's failed processing of transaction submission. + :transaction_submission_failed - Childchain OMG.State mempool transactions + :pending_transactions - Childchain OMG.State mempool transactions + :block_transactions - Childchain OMG.State transactions in formed block + :block_submission_attempt - Childchain Block submission attempted + :block_submission_success Childchain Block successfully submitted + :block_submission_gas Child Chain Block queue gas usage metric + :block_queue_blknum_submitting - Child Chain BlockQueue's blknum of the block being submitted + :block_queue_blknum_submitted - Child Chain BlockQueue's blknum of the block submitted + :block_queue_num_blocks_stalled - Child Chain BlockQueue's number of blocks currently being submitted and stalled + :authority_balance - Child Chain authority address balance + :balance - OMG.State balance per currency + :unique_users - OMG.State number of unique_users in the system + :block_getter_message_queue_len - OMG.Watcher.BlockGetter message queue length + :watcher_exit_processor_message_queue_len - OMG.Watcher.ExitProcessor message queue length + :eventer_message_queue_len - OMG.Watcher.Eventer message queue length + :db_message_queue_len - OMG.DB server implementation (OMG.DB.LevelDB.Server, or OMG.DB.RocksDB.Server,) message queue length + :pending_block_queue_length - OMG.WatcherInfo.DB.PendingBlock queue length + :write - OMG.DB KV layer has three types of actions: write, read, multiread + :read - OMG.DB KV layer has three types of actions: write, read, multiread + :multiread - OMG.DB KV layer has three types of actions: write, read, multiread + @services - We're interested in the events queue length that particular OMG.EthereumEventListener service process """ def name(:transaction_submission), do: "transaction_submission" - - @doc """ - Child Chain API's successful processing of transaction submission. - """ def name(:transaction_submission_success), do: "transaction_submission_success" - - @doc """ - Child Chain API's failed processing of transaction submission. - """ def name(:transaction_submission_failed), do: "transaction_submission_failed" - - @doc """ - Childchain OMG.State mempool transactions - """ def name(:pending_transactions), do: "pending_transactions" - - @doc """ - Childchain OMG.State transactions in formed block - """ def name(:block_transactions), do: "block_transactions" - - @doc """ - Childchain Block submission attempted - """ def name(:block_submission_attempt), do: "block_submission_attempt" - - @doc """ - Childchain Block successfully submitted - """ def name(:block_submission_success), do: "block_submission_success" - - @doc """ - Child Chain Block queue gas usage metric - """ def name(:block_submission_gas), do: "block_submission_gas" - - @doc """ - Child Chain BlockQueue's blknum of the block being submitted - """ def name(:block_queue_blknum_submitting), do: "block_queue_blknum_submitting" - - @doc """ - Child Chain BlockQueue's blknum of the block submitted - """ def name(:block_queue_blknum_submitted), do: "block_queue_blknum_submitted" - - @doc """ - Child Chain BlockQueue's number of blocks currently being submitted and stalled - """ def name(:block_queue_num_blocks_stalled), do: "block_queue_num_blocks_stalled" - - @doc """ - Child Chain authority address balance - """ def name(:authority_balance), do: "authority_balance" - - @doc """ - OMG.State balance per currency - """ def name(:balance), do: "balance" - - @doc """ - OMG.State number of unique_users in the system - """ def name(:unique_users), do: "unique_users" - - @doc """ - OMG.Watcher.BlockGetter message queue length - """ def name(:block_getter_message_queue_len), do: "block_getter_message_queue_len" - - @doc """ - OMG.Watcher.ExitProcessor message queue length - """ def name(:watcher_exit_processor_message_queue_len), do: "watcher_exit_processor_message_queue_len" - - @doc """ - OMG.Watcher.Eventer message queue length - """ def name(:eventer_message_queue_len), do: "eventer_message_queue_len" - - @doc """ - OMG.DB server implementation (OMG.DB.LevelDB.Server, or OMG.DB.RocksDB.Server,) message queue length - """ def name(:db_message_queue_len), do: "db_message_queue_len" - - @doc """ - OMG.WatcherInfo.DB.PendingBlock queue length - """ def name(:pending_block_queue_length), do: "pending_block_queue_length" - - @doc """ - OMG.DB KV layer has three types of actions: write, read, multiread - """ def name(:write), do: "db_write" def name(:read), do: "db_read" def name(:multiread), do: "db_multiread" @doc """ - We're interested in the events queue length that particular OMG.EthereumEventListener service process + :events - We're interested in the events queue length that particular OMG.EthereumEventListener service process is handling. - """ - def name(service, :events) when service in @services, do: events_name(service) - @doc """ - We're interested in the message queue length of particular OMG.EthereumEventListener service process + message_queue_len - We're interested in the message queue length of particular OMG.EthereumEventListener service process """ + def name(service, :events) when service in @services, do: events_name(service) def name(service, :message_queue_len) when service in @services, do: message_queue_len_name(service) defp events_name(:depositor), do: "depositor_ethereum_events" @@ -156,7 +100,6 @@ defmodule OMG.Status.Metric.Event do defp events_name(:exit_finalizer), do: "exit_finalizer_ethereum_events" defp events_name(:exit_challenger), do: "exit_challenger_ethereum_events" defp events_name(:in_flight_exit_processor), do: "in_flight_exit_processor_ethereum_events" - defp events_name(:in_flight_exit_deleted_processor), do: "in_flight_exit_deleted_processor_ethereum_events" defp events_name(:piggyback_processor), do: "piggyback_processor_ethereum_events" defp events_name(:competitor_processor), do: "competitor_processor_ethereum_events" defp events_name(:challenges_responds_processor), do: "challenges_responds_processor_ethereum_events" @@ -172,10 +115,6 @@ defmodule OMG.Status.Metric.Event do defp message_queue_len_name(:exit_finalizer), do: "exit_finalizer_message_queue_len" defp message_queue_len_name(:exit_challenger), do: "exit_challenger_message_queue_len" defp message_queue_len_name(:in_flight_exit_processor), do: "in_flight_exit_processor_message_queue_len" - - defp message_queue_len_name(:in_flight_exit_deleted_processor), - do: "in_flight_exit_deleted_processor_message_queue_len" - defp message_queue_len_name(:piggyback_processor), do: "piggyback_processor_message_queue_len" defp message_queue_len_name(:competitor_processor), do: "competitor_processor_message_queue_len" defp message_queue_len_name(:challenges_responds_processor), do: "challenges_responds_processor_message_queue_len" diff --git a/apps/omg_status/lib/omg_status/metric/statix.ex b/apps/omg_status/lib/omg_status/metric/statix.ex index 75d25e9190..e1022b51f0 100644 --- a/apps/omg_status/lib/omg_status/metric/statix.ex +++ b/apps/omg_status/lib/omg_status/metric/statix.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/metric/telemetry.ex b/apps/omg_status/lib/omg_status/metric/telemetry.ex index 514af0ac45..c68adfb946 100644 --- a/apps/omg_status/lib/omg_status/metric/telemetry.ex +++ b/apps/omg_status/lib/omg_status/metric/telemetry.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,11 +35,12 @@ defmodule OMG.Status.Metric.Telemetry do TelemetryMetricsStatsd, metrics: metrics(), global_tags: [ + service: service, version: version ], host: dd_host, port: dd_port, - prefix: "omg.#{service}", + prefix: "elixir", formatter: :datadog } ] @@ -52,29 +53,29 @@ defmodule OMG.Status.Metric.Telemetry do # Phoenix Metrics summary( "phoenix.endpoint.stop.duration", - tags: [:version], + tags: [:service, :version], unit: {:native, :millisecond} ), summary( "phoenix.router_dispatch.stop.duration", - tags: [:version, :route], + tags: [:service, :version, :route], unit: {:native, :millisecond} ), summary( "phoenix.router_dispatch.exception.duration", - tags: [:version, :kind], + tags: [:service, :version, :kind], unit: {:native, :millisecond} ), summary( "phoenix.error_rendered.duration", - tags: [:version, :kind], + tags: [:service, :version, :kind], unit: {:native, :millisecond} ), # Custom web metrics counter( "web.fallback.error", - tags: [:version, :route, :error_code] + tags: [:service, :version, :route, :error_code] ) ] end diff --git a/apps/omg_status/lib/omg_status/metric/tracer.ex b/apps/omg_status/lib/omg_status/metric/tracer.ex index 25aebd2519..04b065cb8b 100644 --- a/apps/omg_status/lib/omg_status/metric/tracer.ex +++ b/apps/omg_status/lib/omg_status/metric/tracer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/metric/vmstats_sink.ex b/apps/omg_status/lib/omg_status/metric/vmstats_sink.ex index 8acc0eddfd..44d6ba952e 100644 --- a/apps/omg_status/lib/omg_status/metric/vmstats_sink.ex +++ b/apps/omg_status/lib/omg_status/metric/vmstats_sink.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/monitor/memory_monitor.ex b/apps/omg_status/lib/omg_status/monitor/memory_monitor.ex index f4cff18538..4d7b9991af 100644 --- a/apps/omg_status/lib/omg_status/monitor/memory_monitor.ex +++ b/apps/omg_status/lib/omg_status/monitor/memory_monitor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/monitor/statsd_monitor.ex b/apps/omg_status/lib/omg_status/monitor/statsd_monitor.ex index c6c47d968b..b4976687c1 100644 --- a/apps/omg_status/lib/omg_status/monitor/statsd_monitor.ex +++ b/apps/omg_status/lib/omg_status/monitor/statsd_monitor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/release_tasks/set_application.ex b/apps/omg_status/lib/omg_status/release_tasks/set_application.ex index 71114c0042..c7a5f1814b 100644 --- a/apps/omg_status/lib/omg_status/release_tasks/set_application.ex +++ b/apps/omg_status/lib/omg_status/release_tasks/set_application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/release_tasks/set_logger.ex b/apps/omg_status/lib/omg_status/release_tasks/set_logger.ex index 76edb00fa6..1c3cefc068 100644 --- a/apps/omg_status/lib/omg_status/release_tasks/set_logger.ex +++ b/apps/omg_status/lib/omg_status/release_tasks/set_logger.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/release_tasks/set_sentry.ex b/apps/omg_status/lib/omg_status/release_tasks/set_sentry.ex index 433c83ebf9..6421821899 100644 --- a/apps/omg_status/lib/omg_status/release_tasks/set_sentry.ex +++ b/apps/omg_status/lib/omg_status/release_tasks/set_sentry.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/release_tasks/set_tracer.ex b/apps/omg_status/lib/omg_status/release_tasks/set_tracer.ex index d80168ee5c..f09e08774e 100644 --- a/apps/omg_status/lib/omg_status/release_tasks/set_tracer.ex +++ b/apps/omg_status/lib/omg_status/release_tasks/set_tracer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/lib/omg_status/sentry_filter.ex b/apps/omg_status/lib/omg_status/sentry_filter.ex index b9fbda3422..eafa322823 100644 --- a/apps/omg_status/lib/omg_status/sentry_filter.ex +++ b/apps/omg_status/lib/omg_status/sentry_filter.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,15 +20,14 @@ defmodule OMG.Status.SentryFilter do # when the development environment restarts it lacks network access # something to do with Cloud DNS - def exclude_exception?(%MatchError{term: {:error, :nxdomain}}, _) do - true - end + def exclude_exception?(%MatchError{term: {:error, :nxdomain}}, _), do: true - def exclude_exception?(%Plug.Parsers.RequestTooLargeError{}, _) do - true - end + # Ignoring 406 status code invalid headers exception + def exclude_exception?(%Phoenix.NotAcceptableError{plug_status: 406}, _), do: true - def exclude_exception?(_, _) do - false - end + def exclude_exception?(%Plug.Parsers.RequestTooLargeError{}, _), do: true + + def exclude_exception?(%CaseClauseError{term: {:error, :econnrefused}}, _), do: true + + def exclude_exception?(_, _), do: false end diff --git a/apps/omg_status/lib/status.ex b/apps/omg_status/lib/status.ex index 961d9879b4..9a9b46574e 100644 --- a/apps/omg_status/lib/status.ex +++ b/apps/omg_status/lib/status.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/mix.exs b/apps/omg_status/mix.exs index 69841afaa4..21bbc6a767 100644 --- a/apps/omg_status/mix.exs +++ b/apps/omg_status/mix.exs @@ -4,7 +4,7 @@ defmodule OMG.Status.Mixfile do def project() do [ app: :omg_status, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -31,13 +31,21 @@ defmodule OMG.Status.Mixfile do ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + defp deps(), do: [ {:telemetry, "~> 0.4.1"}, {:telemetry_metrics, "~> 0.4"}, {:telemetry_metrics_statsd, "~> 0.3.0"}, {:sentry, "~> 8.0"}, - {:statix, git: "https://github.com/omisego/statix.git", branch: "otp-21.3.8.4-support-global-tag-patch"}, + {:statix, git: "https://github.com/omgnetwork/statix", branch: "otp-21.3.8.4-support-global-tag-patch"}, {:spandex_datadog, "~> 1.0"}, {:decorator, "~> 1.2"}, {:vmstats, "~> 2.3", runtime: false}, diff --git a/apps/omg_status/test/omg_status/alert/alarm_printer_test.exs b/apps/omg_status/test/omg_status/alert/alarm_printer_test.exs index f1c7c99459..189527f284 100644 --- a/apps/omg_status/test/omg_status/alert/alarm_printer_test.exs +++ b/apps/omg_status/test/omg_status/alert/alarm_printer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/omg_status/datadog_event/alarm_consumer_test.exs b/apps/omg_status/test/omg_status/datadog_event/alarm_consumer_test.exs index 764b66da05..35f2b2d0ad 100644 --- a/apps/omg_status/test/omg_status/datadog_event/alarm_consumer_test.exs +++ b/apps/omg_status/test/omg_status/datadog_event/alarm_consumer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/omg_status/integration/alarms_test.exs b/apps/omg_status/test/omg_status/integration/alarms_test.exs index f4a1d99362..54633ba13e 100644 --- a/apps/omg_status/test/omg_status/integration/alarms_test.exs +++ b/apps/omg_status/test/omg_status/integration/alarms_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/omg_status/metric/datadog_test.exs b/apps/omg_status/test/omg_status/metric/datadog_test.exs index 638a783f3f..469a65f176 100644 --- a/apps/omg_status/test/omg_status/metric/datadog_test.exs +++ b/apps/omg_status/test/omg_status/metric/datadog_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/omg_status/monitor/memory_monitor_test.exs b/apps/omg_status/test/omg_status/monitor/memory_monitor_test.exs index e6c1938a60..3cbd5841e7 100644 --- a/apps/omg_status/test/omg_status/monitor/memory_monitor_test.exs +++ b/apps/omg_status/test/omg_status/monitor/memory_monitor_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/omg_status/monitor/statsd_monitor_test.exs b/apps/omg_status/test/omg_status/monitor/statsd_monitor_test.exs index d7767a3055..af9fb0afda 100644 --- a/apps/omg_status/test/omg_status/monitor/statsd_monitor_test.exs +++ b/apps/omg_status/test/omg_status/monitor/statsd_monitor_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/omg_status/release_tasks/set_logger_test.exs b/apps/omg_status/test/omg_status/release_tasks/set_logger_test.exs index 94faed0de1..8e3f57ec5f 100644 --- a/apps/omg_status/test/omg_status/release_tasks/set_logger_test.exs +++ b/apps/omg_status/test/omg_status/release_tasks/set_logger_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/omg_status/release_tasks/set_sentry_test.exs b/apps/omg_status/test/omg_status/release_tasks/set_sentry_test.exs index 2fd7a4f1c7..107c584735 100644 --- a/apps/omg_status/test/omg_status/release_tasks/set_sentry_test.exs +++ b/apps/omg_status/test/omg_status/release_tasks/set_sentry_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/omg_status/release_tasks/set_tracer_test.exs b/apps/omg_status/test/omg_status/release_tasks/set_tracer_test.exs index 0ece8dc25f..6895b36e4c 100644 --- a/apps/omg_status/test/omg_status/release_tasks/set_tracer_test.exs +++ b/apps/omg_status/test/omg_status/release_tasks/set_tracer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_status/test/sentry_filter_test.exs b/apps/omg_status/test/sentry_filter_test.exs new file mode 100644 index 0000000000..e7679a4a32 --- /dev/null +++ b/apps/omg_status/test/sentry_filter_test.exs @@ -0,0 +1,34 @@ +# Copyright 2019-2020 OMG Network Pte Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +defmodule OMG.Status.SentryFilterTest do + use ExUnit.Case, async: true + + test "excludes exception properly" do + # ignore excluded exception + assert_raise( + Phoenix.NotAcceptableError, + fn -> + raise Phoenix.NotAcceptableError, + "Could not render \"406.json\" for OMG.WatcherRPC.Web.Views.Error, please define a matching clause for render/2 or define a template at \"lib/omg_watcher_rpc_web/templates/views/error/*\". No templates were compiled for this module." + end + ) + + assert Sentry.capture_exception( + %Phoenix.NotAcceptableError{plug_status: 406}, + event_source: :plug, + result: :sync + ) == :excluded + end +end diff --git a/apps/omg_status/test/test_helper.exs b/apps/omg_status/test/test_helper.exs index 8d13291f9c..e0bec854d2 100644 --- a/apps/omg_status/test/test_helper.exs +++ b/apps/omg_status/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/lib/omg_utils/app_version.ex b/apps/omg_utils/lib/omg_utils/app_version.ex new file mode 100644 index 0000000000..b42dbdad96 --- /dev/null +++ b/apps/omg_utils/lib/omg_utils/app_version.ex @@ -0,0 +1,28 @@ +# Copyright 2019-2020 OMG Network Pte Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +defmodule OMG.Utils.AppVersion do + @moduledoc false + + @sha String.replace(elem(System.cmd("git", ["rev-parse", "--short=7", "HEAD"]), 0), "\n", "") + + @doc """ + Derive the running service's version for adding to a response. + """ + @spec version(Application.app()) :: String.t() + def version(app) do + {:ok, vsn} = :application.get_key(app, :vsn) + List.to_string(vsn) <> "+" <> @sha + end +end diff --git a/apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex b/apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex index 27c490d02d..a7d0a178e6 100644 --- a/apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex +++ b/apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/lib/omg_utils/http_rpc/error.ex b/apps/omg_utils/lib/omg_utils/http_rpc/error.ex index 3daada1446..7c2cb6cd4c 100644 --- a/apps/omg_utils/lib/omg_utils/http_rpc/error.ex +++ b/apps/omg_utils/lib/omg_utils/http_rpc/error.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/lib/omg_utils/http_rpc/response.ex b/apps/omg_utils/lib/omg_utils/http_rpc/response.ex index 58b878aab4..1d696630f0 100644 --- a/apps/omg_utils/lib/omg_utils/http_rpc/response.ex +++ b/apps/omg_utils/lib/omg_utils/http_rpc/response.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,8 +18,6 @@ defmodule OMG.Utils.HttpRPC.Response do """ alias OMG.Utils.HttpRPC.Encoding - @sha String.replace(elem(System.cmd("git", ["rev-parse", "--short=7", "HEAD"]), 0), "\n", "") - @type response_t :: %{version: binary(), success: boolean(), data: map()} def serialize_page(data, data_paging) do @@ -74,15 +72,6 @@ defmodule OMG.Utils.HttpRPC.Response do def sanitize({key, value}), do: Map.put_new(%{}, key, value) def sanitize(value), do: value - @doc """ - Derive the running service's version for adding to a response. - """ - @spec version(Application.app()) :: String.t() - def version(app) do - {:ok, vsn} = :application.get_key(app, :vsn) - List.to_string(vsn) <> "+" <> @sha - end - defp do_filter(map_or_struct) do if :code.is_loaded(Ecto) do Enum.filter(map_or_struct, fn diff --git a/apps/omg_utils/lib/omg_utils/http_rpc/validators/base.ex b/apps/omg_utils/lib/omg_utils/http_rpc/validators/base.ex index e78799942f..13f0d3212b 100644 --- a/apps/omg_utils/lib/omg_utils/http_rpc/validators/base.ex +++ b/apps/omg_utils/lib/omg_utils/http_rpc/validators/base.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/lib/omg_utils/logger_ext.ex b/apps/omg_utils/lib/omg_utils/logger_ext.ex index a89683b777..d9a73709cc 100644 --- a/apps/omg_utils/lib/omg_utils/logger_ext.ex +++ b/apps/omg_utils/lib/omg_utils/logger_ext.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/lib/omg_utils/paginator.ex b/apps/omg_utils/lib/omg_utils/paginator.ex index e2c88150f1..256424d9e7 100644 --- a/apps/omg_utils/lib/omg_utils/paginator.ex +++ b/apps/omg_utils/lib/omg_utils/paginator.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/lib/omg_utils/remote_ip.ex b/apps/omg_utils/lib/omg_utils/remote_ip.ex index a2426d0afd..59b921cc11 100644 --- a/apps/omg_utils/lib/omg_utils/remote_ip.ex +++ b/apps/omg_utils/lib/omg_utils/remote_ip.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/lib/utils.ex b/apps/omg_utils/lib/utils.ex index 1e80701ea9..56255f0cd9 100644 --- a/apps/omg_utils/lib/utils.ex +++ b/apps/omg_utils/lib/utils.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/mix.exs b/apps/omg_utils/mix.exs index eeb26ccae5..b2bb8f40ad 100644 --- a/apps/omg_utils/mix.exs +++ b/apps/omg_utils/mix.exs @@ -4,7 +4,7 @@ defmodule Utils.MixProject do def project() do [ app: :omg_utils, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -18,7 +18,15 @@ defmodule Utils.MixProject do end def application() do - [] + [extra_applications: [:plug]] + end + + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") end # Specifies which paths to compile per environment. diff --git a/apps/omg_utils/test/omg_utils/app_version_tet.exs b/apps/omg_utils/test/omg_utils/app_version_tet.exs new file mode 100644 index 0000000000..def64004c0 --- /dev/null +++ b/apps/omg_utils/test/omg_utils/app_version_tet.exs @@ -0,0 +1,27 @@ +# Copyright 2019-2020 OMG Network Pte Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +defmodule OMG.Utils.AppVersionTest do + use ExUnit.Case, async: true + + alias OMG.Utils.AppVersion + + describe "version/1" do + test "returns a compliant semver when given an application" do + # Using :elixir as the app because it is certain to be running during the test + version = AppVersion.version(:elixir) + assert {:ok, _} = Version.parse(version) + end + end +end diff --git a/apps/omg_utils/test/omg_utils/http_rpc/encoding_test.exs b/apps/omg_utils/test/omg_utils/http_rpc/encoding_test.exs index c67b78d278..e37b1ccd13 100644 --- a/apps/omg_utils/test/omg_utils/http_rpc/encoding_test.exs +++ b/apps/omg_utils/test/omg_utils/http_rpc/encoding_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/test/omg_utils/http_rpc/response_test.exs b/apps/omg_utils/test/omg_utils/http_rpc/response_test.exs index a9fb0cf7dd..c26c5749d7 100644 --- a/apps/omg_utils/test/omg_utils/http_rpc/response_test.exs +++ b/apps/omg_utils/test/omg_utils/http_rpc/response_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -159,14 +159,6 @@ defmodule OMG.Utils.HttpRPC.ResponseTest do assert response |> Map.get(:skip_hex_encode) |> is_nil() end - describe "version/1" do - test "returns a compliant semver when given an application" do - # Using :elixir as the app because it is certain to be running during the test - version = Response.version(:elixir) - assert {:ok, _} = Version.parse(version) - end - end - defp unload_ecto() do :code.purge(Ecto) :code.delete(Ecto) diff --git a/apps/omg_utils/test/omg_utils/http_rpc/validators/base_test.exs b/apps/omg_utils/test/omg_utils/http_rpc/validators/base_test.exs index 6799f8f7ee..266dc6cf85 100644 --- a/apps/omg_utils/test/omg_utils/http_rpc/validators/base_test.exs +++ b/apps/omg_utils/test/omg_utils/http_rpc/validators/base_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/test/omg_utils/remote_ip_test.exs b/apps/omg_utils/test/omg_utils/remote_ip_test.exs index 227f3155c7..620a5fd956 100644 --- a/apps/omg_utils/test/omg_utils/remote_ip_test.exs +++ b/apps/omg_utils/test/omg_utils/remote_ip_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/test/test_helper.exs b/apps/omg_utils/test/test_helper.exs index f095c98d5c..a0180595e9 100644 --- a/apps/omg_utils/test/test_helper.exs +++ b/apps/omg_utils/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher.ex b/apps/omg_watcher/lib/omg_watcher.ex index 3d0636cbf6..243852011c 100644 --- a/apps/omg_watcher/lib/omg_watcher.ex +++ b/apps/omg_watcher/lib/omg_watcher.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/account.ex b/apps/omg_watcher/lib/omg_watcher/api/account.ex index 73eca67b8c..83db84bbf8 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/account.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/account.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/alarm.ex b/apps/omg_watcher/lib/omg_watcher/api/alarm.ex index 9ddd818201..b030b32cd9 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/alarm.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/alarm.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/configuration.ex b/apps/omg_watcher/lib/omg_watcher/api/configuration.ex index 6afdb84be4..cf8df5e55f 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/configuration.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/in_flight_exit.ex b/apps/omg_watcher/lib/omg_watcher/api/in_flight_exit.ex index 0dfa53c429..e702cbba12 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/in_flight_exit.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/in_flight_exit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/status.ex b/apps/omg_watcher/lib/omg_watcher/api/status.ex index ff770fe1d2..bc49cc5792 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/status.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/status.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/status_cache.ex b/apps/omg_watcher/lib/omg_watcher/api/status_cache.ex index 27ea308c39..d2fbbfe876 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/status_cache.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/status_cache.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/status_cache/external.ex b/apps/omg_watcher/lib/omg_watcher/api/status_cache/external.ex index 10ba6db142..3469a550f8 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/status_cache/external.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/status_cache/external.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/status_cache/storage.ex b/apps/omg_watcher/lib/omg_watcher/api/status_cache/storage.ex index e1e1602c17..7d3d6a2208 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/status_cache/storage.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/status_cache/storage.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/transaction.ex b/apps/omg_watcher/lib/omg_watcher/api/transaction.ex index 627ab6df8f..f13f0fa5b0 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/transaction.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/api/utxo.ex b/apps/omg_watcher/lib/omg_watcher/api/utxo.ex index 970af52fea..8e5be25162 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/utxo.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/utxo.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/application.ex b/apps/omg_watcher/lib/omg_watcher/application.ex index 78694d27a6..0ba480627c 100644 --- a/apps/omg_watcher/lib/omg_watcher/application.ex +++ b/apps/omg_watcher/lib/omg_watcher/application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/block_getter.ex b/apps/omg_watcher/lib/omg_watcher/block_getter.ex index b74b5ef842..d95d95bff5 100644 --- a/apps/omg_watcher/lib/omg_watcher/block_getter.ex +++ b/apps/omg_watcher/lib/omg_watcher/block_getter.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -129,7 +129,12 @@ defmodule OMG.Watcher.BlockGetter do # :apply_block pipeline of steps @doc """ - Stateful validation and execution of transactions on `OMG.State`. Reacts in case that returns any failed transactions. + Read top down: + - (execute_transactions) Stateful validation and execution of transactions on `OMG.State`. Reacts in case that returns any failed transactions. + - (run_block_download_task) Schedules more blocks to download in case some work downloading is finished and we want to progress. + - (close_and_apply_block) Marks a block as applied and updates `OMG.DB` values. Also commits the updates to `OMG.DB` that `OMG.State` handed off + containing the data coming from the newly applied block. + - (check_validity) Updates its view of validity of the chain. """ def handle_continue({:apply_block_step, :execute_transactions, block_application}, state) do tx_exec_results = for(tx <- block_application.transactions, do: OMG.State.exec(tx, :ignore_fees)) @@ -150,18 +155,11 @@ defmodule OMG.Watcher.BlockGetter do end end - @doc """ - Schedules more blocks to download in case some work downloading is finished and we want to progress. - """ def handle_continue({:apply_block_step, :run_block_download_task, block_application}, state) do {:noreply, run_block_download_task(state), {:continue, {:apply_block_step, :close_and_apply_block, block_application}}} end - @doc """ - Marks a block as applied and updates `OMG.DB` values. Also commits the updates to `OMG.DB` that `OMG.State` handed off - containing the data coming from the newly applied block. - """ def handle_continue({:apply_block_step, :close_and_apply_block, block_application}, state) do {:ok, db_updates_from_state} = OMG.State.close_block() @@ -183,9 +181,6 @@ defmodule OMG.Watcher.BlockGetter do {:noreply, state, {:continue, {:apply_block_step, :check_validity}}} end - @doc """ - Updates its view of validity of the chain. - """ def handle_continue({:apply_block_step, :check_validity}, state) do exit_processor_results = ExitProcessor.check_validity() state = Core.consider_exits(state, exit_processor_results) diff --git a/apps/omg_watcher/lib/omg_watcher/block_getter/block_application.ex b/apps/omg_watcher/lib/omg_watcher/block_getter/block_application.ex index 01d4970556..f0637de440 100644 --- a/apps/omg_watcher/lib/omg_watcher/block_getter/block_application.ex +++ b/apps/omg_watcher/lib/omg_watcher/block_getter/block_application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/block_getter/core.ex b/apps/omg_watcher/lib/omg_watcher/block_getter/core.ex index a3ad2dcec2..4cc7af6ed8 100644 --- a/apps/omg_watcher/lib/omg_watcher/block_getter/core.ex +++ b/apps/omg_watcher/lib/omg_watcher/block_getter/core.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -265,7 +265,7 @@ defmodule OMG.Watcher.BlockGetter.Core do potential_block_withholding_numbers = potential_block_withholdings |> Enum.filter(fn {_, %PotentialWithholding{downloading: downloading}} -> !downloading end) - |> Enum.map(fn {key, __} -> key end) + |> Enum.map(fn {key, _} -> key end) potential_next_block_numbers = first_block_number @@ -329,14 +329,6 @@ defmodule OMG.Watcher.BlockGetter.Core do block_timestamp, _time ) do - _ = - Logger.debug(fn -> - short_hash = returned_hash |> OMG.Eth.Encoding.to_hex() |> Binary.drop(-48) - - "Validating block \##{inspect(requested_number)} #{inspect(short_hash)}... " <> - "with #{inspect(length(transactions))} txs" - end) - with true <- returned_hash == requested_hash || {:error, :bad_returned_hash}, true <- number == requested_number || {:error, :bad_returned_number}, {:ok, recovered_txs} <- recover_all_txs(transactions), diff --git a/apps/omg_watcher/lib/omg_watcher/block_getter/measure.ex b/apps/omg_watcher/lib/omg_watcher/block_getter/measure.ex index fd0f41a0c8..3228e39066 100644 --- a/apps/omg_watcher/lib/omg_watcher/block_getter/measure.ex +++ b/apps/omg_watcher/lib/omg_watcher/block_getter/measure.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/block_getter/status.ex b/apps/omg_watcher/lib/omg_watcher/block_getter/status.ex index ec544310fd..076fd88b6e 100644 --- a/apps/omg_watcher/lib/omg_watcher/block_getter/status.ex +++ b/apps/omg_watcher/lib/omg_watcher/block_getter/status.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/block_getter/supervisor.ex b/apps/omg_watcher/lib/omg_watcher/block_getter/supervisor.ex index f500b32ed8..eaba677871 100644 --- a/apps/omg_watcher/lib/omg_watcher/block_getter/supervisor.ex +++ b/apps/omg_watcher/lib/omg_watcher/block_getter/supervisor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/block_validator.ex b/apps/omg_watcher/lib/omg_watcher/block_validator.ex index 0c9fd43661..f3aec890ee 100644 --- a/apps/omg_watcher/lib/omg_watcher/block_validator.ex +++ b/apps/omg_watcher/lib/omg_watcher/block_validator.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/child_manager.ex b/apps/omg_watcher/lib/omg_watcher/child_manager.ex index 7769a01de1..c6d7bff914 100644 --- a/apps/omg_watcher/lib/omg_watcher/child_manager.ex +++ b/apps/omg_watcher/lib/omg_watcher/child_manager.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/configuration.ex b/apps/omg_watcher/lib/omg_watcher/configuration.ex index 9c264bf683..71568ae5c2 100644 --- a/apps/omg_watcher/lib/omg_watcher/configuration.ex +++ b/apps/omg_watcher/lib/omg_watcher/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/coordinator_setup.ex b/apps/omg_watcher/lib/omg_watcher/coordinator_setup.ex index 170a0ac10f..19c140cd14 100644 --- a/apps/omg_watcher/lib/omg_watcher/coordinator_setup.ex +++ b/apps/omg_watcher/lib/omg_watcher/coordinator_setup.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/datadog_event/contract_event_consumer.ex b/apps/omg_watcher/lib/omg_watcher/datadog_event/contract_event_consumer.ex index 4fbf57bce0..afedc3ef4c 100644 --- a/apps/omg_watcher/lib/omg_watcher/datadog_event/contract_event_consumer.ex +++ b/apps/omg_watcher/lib/omg_watcher/datadog_event/contract_event_consumer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/datadog_event/encode.ex b/apps/omg_watcher/lib/omg_watcher/datadog_event/encode.ex index ccd13c1e35..40d40082fe 100644 --- a/apps/omg_watcher/lib/omg_watcher/datadog_event/encode.ex +++ b/apps/omg_watcher/lib/omg_watcher/datadog_event/encode.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex b/apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex index 6bfd425d9d..452d7d5720 100644 --- a/apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex +++ b/apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -83,6 +83,13 @@ defmodule OMG.Watcher.EthereumEventAggregator do forward_call(server, :in_flight_exit_withdrawn, from_block, to_block, @timeout) end + defstruct delete_events_threshold_ethereum_block_height: 1000, + ets_bucket: nil, + event_signatures: [], + events: [], + contracts: [], + rpc: nil + def start_link(opts) do GenServer.start_link(__MODULE__, opts, name: Keyword.get(opts, :name, __MODULE__)) end @@ -108,9 +115,9 @@ defmodule OMG.Watcher.EthereumEventAggregator do rpc = Keyword.get(opts, :rpc, Rpc) {:ok, - %{ - # 200 blocks of events will be kept in memory - delete_events_threshold_height_blknum: 200, + %__MODULE__{ + # 1000 blocks of events will be kept in memory + delete_events_threshold_ethereum_block_height: 1000, ets_bucket: ets_bucket, event_signatures: events_signatures, events: events, @@ -191,7 +198,7 @@ defmodule OMG.Watcher.EthereumEventAggregator do end defp forward_call(_, _, from_block, to_block, _) when from_block > to_block do - _ = Logger.error("From block #{from_block} was bigger then to_block #{to_block}") + _ = Logger.error("From block #{from_block} was bigger than to_block #{to_block}") {:error, :check_range} end @@ -266,8 +273,10 @@ defmodule OMG.Watcher.EthereumEventAggregator do # block_number <= new_height - delete_events_threshold -> true end) match_spec = [ {{:"$1", :"$2", :"$3"}, - [{:"=<", :"$1", {:-, {:const, new_height_blknum}, {:const, state.delete_events_threshold_height_blknum}}}], - [true]} + [ + {:"=<", :"$1", + {:-, {:const, new_height_blknum}, {:const, state.delete_events_threshold_ethereum_block_height}}} + ], [true]} ] :ets.select_delete(state.ets_bucket, match_spec) diff --git a/apps/omg_watcher/lib/omg_watcher/event.ex b/apps/omg_watcher/lib/omg_watcher/event.ex index 3486d41406..9423151df0 100644 --- a/apps/omg_watcher/lib/omg_watcher/event.ex +++ b/apps/omg_watcher/lib/omg_watcher/event.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor.ex index f6ae72149c..65b35bf56d 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -59,8 +59,14 @@ defmodule OMG.Watcher.ExitProcessor do Accepts events and processes them in the state - new exits are tracked. Returns `db_updates` to be sent to `OMG.DB` by the caller + + - takes a list of standard exit start events from the contract + - fetches the currently observed exit status in the contract (to decide if exits are "inactive on recognition", which + helps cover the case when the Watcher is syncing up) + - updates the `ExitProcessor`'s state + - returns `db_updates` """ - # empty list clause to not block the server for no-ops + def new_exits([]), do: {:ok, []} def new_exits(exits) do @@ -71,6 +77,12 @@ defmodule OMG.Watcher.ExitProcessor do Accepts events and processes them in the state - new in flight exits are tracked. Returns `db_updates` to be sent to `OMG.DB` by the caller + + - takes a list of IFE exit start events from the contract + - fetches the currently observed exit status in the contract (to decide if exits are "inactive on recognition", which + helps cover the case when the Watcher is syncing up) + - updates the `ExitProcessor`'s state + - returns `db_updates` """ # empty list clause to not block the server for no-ops def new_in_flight_exits([]), do: {:ok, []} @@ -83,8 +95,10 @@ defmodule OMG.Watcher.ExitProcessor do Accepts events and processes them in the state - new in flight exits are tracked. Returns `db_updates` to be sent to `OMG.DB` by the caller + - spends input utxos + - deletes in-flight exits from state """ - # empty list clause to not block the server for no-ops + def delete_in_flight_exits([]), do: {:ok, []} def delete_in_flight_exits(in_flight_exit_deleted_events) do @@ -95,8 +109,14 @@ defmodule OMG.Watcher.ExitProcessor do Accepts events and processes them in the state - finalized exits are untracked _if valid_ otherwise raises alert Returns `db_updates` to be sent to `OMG.DB` by the caller + - takes a list of standard exit finalization events from the contract + - discovers the `OMG.State`'s native key for the finalizing exits (`utxo_pos`) (`Core.exit_key_by_exit_id/2`) + - marks as spent these UTXOs in `OMG.State` expecting it to tell which of those were valid finalizations (UTXOs exist) + - reflects this result in the `ExitProcessor`'s state + - returns `db_updates`, concatenated with those related to the call to `OMG.State` + """ - # empty list clause to not block the server for no-ops + def finalize_exits([]), do: {:ok, []} def finalize_exits(finalizations) do @@ -107,8 +127,11 @@ defmodule OMG.Watcher.ExitProcessor do Accepts events and processes them in the state - new piggybacks are tracked, if invalid raises an alert Returns `db_updates` to be sent to `OMG.DB` by the caller + - takes a list of IFE piggybacking events from the contract + - updates the `ExitProcessor`'s state + - returns `db_updates` """ - # empty list clause to not block the server for no-ops + def piggyback_exits([]), do: {:ok, []} def piggyback_exits(piggybacks) do @@ -119,8 +142,11 @@ defmodule OMG.Watcher.ExitProcessor do Accepts events and processes them in the state - challenged exits are untracked Returns `db_updates` to be sent to `OMG.DB` by the caller + - takes a list of standard exit challenge events from the contract + - updates the `ExitProcessor`'s state + - returns `db_updates` """ - # empty list clause to not block the server for no-ops + def challenge_exits([]), do: {:ok, []} def challenge_exits(challenges) do @@ -135,8 +161,11 @@ defmodule OMG.Watcher.ExitProcessor do Competitors are stored for future use (i.e. to challenge an in flight exit). Returns `db_updates` to be sent to `OMG.DB` by the caller + - takes a list of IFE exit canonicity challenge events from the contract + - updates the `ExitProcessor`'s state + - returns `db_updates` """ - # empty list clause to not block the server for no-ops + def new_ife_challenges([]), do: {:ok, []} def new_ife_challenges(challenges) do @@ -149,8 +178,11 @@ defmodule OMG.Watcher.ExitProcessor do Marks the IFE as canonical and perists information about the inclusion age as responded with in the contract. Returns `db_updates` to be sent to `OMG.DB` by the caller + - takes a list of IFE exit canonicity challenge response events from the contract + - updates the `ExitProcessor`'s state + - returns `db_updates` """ - # empty list clause to not block the server for no-ops + def respond_to_in_flight_exits_challenges([]), do: {:ok, []} def respond_to_in_flight_exits_challenges(responds) do @@ -161,8 +193,11 @@ defmodule OMG.Watcher.ExitProcessor do Accepts events and processes them in state. Returns `db_updates` to be sent to `OMG.DB` by the caller + - takes a list of IFE piggyback challenge events from the contract + - updates the `ExitProcessor`'s state + - returns `db_updates` """ - # empty list clause to not block the server for no-ops + def challenge_piggybacks([]), do: {:ok, []} def challenge_piggybacks(challenges) do @@ -173,8 +208,16 @@ defmodule OMG.Watcher.ExitProcessor do Accepts events and processes them in state - finalized outputs are applied to the state. Returns `db_updates` to be sent to `OMG.DB` by the caller + - takes a list of IFE exit finalization events from the contract + - pulls current information on IFE transaction inclusion + - discovers the `OMG.State`'s native key for the finalizing exits (`utxo_pos`) + (`Core.prepare_utxo_exits_for_in_flight_exit_finalizations/2`) + - marks as spent these UTXOs in `OMG.State` expecting it to tell which of those were valid finalizations (UTXOs exist) + - reflects this result in the `ExitProcessor`'s state + - returns `db_updates`, concatenated with those related to the call to `OMG.State` + """ - # empty list clause to not block the server for no-ops + def finalize_in_flight_exits([]), do: {:ok, []} def finalize_in_flight_exits(finalizations) do @@ -187,6 +230,11 @@ defmodule OMG.Watcher.ExitProcessor do This function may also update some internal caches to make subsequent calls not redo the work, but under unchanged conditions, it should have unchanged behavior from POV of an outside caller. + + - pulls current information on IFE transaction inclusion + - gets a list of interesting UTXOs to check for existence in `OMG.State` + - combines this information to discover the state of all the exits to report (mainly byzantine events) + """ def check_validity() do GenServer.call(__MODULE__, :check_validity, @timeout) @@ -207,6 +255,10 @@ defmodule OMG.Watcher.ExitProcessor do @doc """ Returns all information required to produce a transaction to the root chain contract to present a competitor for a non-canonical in-flight exit + + - pulls current information on IFE transaction inclusion + - gets a list of interesting UTXOs to check for existence in `OMG.State` + - combines this information to compose the challenge data """ @spec get_competitor_for_ife(binary()) :: {:ok, ExitProcessor.Canonicity.competitor_data_t()} @@ -219,6 +271,10 @@ defmodule OMG.Watcher.ExitProcessor do @doc """ Returns all information required to produce a transaction to the root chain contract to present a proof of canonicity for a challenged in-flight exit + + - pulls current information on IFE transaction inclusion + - gets a list of interesting UTXOs to check for existence in `OMG.State` + - combines this information to compose the challenge data """ @spec prove_canonical_for_ife(binary()) :: {:ok, ExitProcessor.Canonicity.prove_canonical_data_t()} | {:error, :no_viable_canonical_proof_found} @@ -228,6 +284,8 @@ defmodule OMG.Watcher.ExitProcessor do @doc """ Returns all information required to challenge an invalid input piggyback + - gets a list of interesting UTXOs to check for existence in `OMG.State` + - combines this information to compose the challenge data """ @spec get_input_challenge_data(Transaction.Signed.tx_bytes(), Transaction.input_index_t()) :: {:ok, ExitProcessor.Piggyback.input_challenge_data()} @@ -238,6 +296,10 @@ defmodule OMG.Watcher.ExitProcessor do @doc """ Returns all information required to challenge an invalid output piggyback + - pulls current information on IFE transaction inclusion + - gets a list of interesting UTXOs to check for existence in `OMG.State` + - combines this information to compose the challenge data + """ @spec get_output_challenge_data(Transaction.Signed.tx_bytes(), Transaction.input_index_t()) :: {:ok, ExitProcessor.Piggyback.output_challenge_data()} @@ -248,6 +310,9 @@ defmodule OMG.Watcher.ExitProcessor do @doc """ Returns challenge for an invalid standard exit + - leverages `OMG.State` to quickly learn if the exiting UTXO exists or was spent + - pulls some additional data from `OMG.DB`, if needed + - combines this information to compose the challenge data """ @spec create_challenge(Utxo.Position.t()) :: {:ok, StandardExit.Challenge.t()} | {:error, :utxo_not_spent | :exit_not_found} @@ -309,15 +374,6 @@ defmodule OMG.Watcher.ExitProcessor do {:ok, processor} end - @doc """ - See `new_exits/1`. Flow: - - - takes a list of standard exit start events from the contract - - fetches the currently observed exit status in the contract (to decide if exits are "inactive on recognition", which - helps cover the case when the Watcher is syncing up) - - updates the `ExitProcessor`'s state - - returns `db_updates` - """ def handle_call({:new_exits, exits}, _from, state) do _ = if not Enum.empty?(exits), do: Logger.info("Recognized #{Enum.count(exits)} exits: #{inspect(exits)}") @@ -339,21 +395,12 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, db_updates}, new_state} end - @doc """ - See `new_in_flight_exits/1`. Flow: - - - takes a list of IFE exit start events from the contract - - fetches the currently observed exit status in the contract (to decide if exits are "inactive on recognition", which - helps cover the case when the Watcher is syncing up) - - updates the `ExitProcessor`'s state - - returns `db_updates` - """ def handle_call({:new_in_flight_exits, exits}, _from, state) do _ = if not Enum.empty?(exits), do: Logger.info("Recognized #{Enum.count(exits)} in-flight exits: #{inspect(exits)}") contract_ife_ids = Enum.map(exits, fn %{in_flight_tx: txbytes} -> - ExPlasma.InFlightExit.txbytes_to_id(txbytes) + ExPlasma.InFlightExit.tx_bytes_to_id(txbytes) end) # Prepare events data for internal bus @@ -371,11 +418,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, db_updates}, new_state} end - @doc """ - See `delete_in_flight_exits/1`. Flow: - - spends input utxos - - deletes in-flight exits from state - """ def handle_call({:delete_in_flight_exits, deletions}, _from, state) do _ = if not Enum.empty?(deletions), @@ -387,15 +429,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, db_updates ++ db_updates_from_state}, new_state} end - @doc """ - See `finalize_exits/1`. Flow: - - - takes a list of standard exit finalization events from the contract - - discovers the `OMG.State`'s native key for the finalizing exits (`utxo_pos`) (`Core.exit_key_by_exit_id/2`) - - marks as spent these UTXOs in `OMG.State` expecting it to tell which of those were valid finalizations (UTXOs exist) - - reflects this result in the `ExitProcessor`'s state - - returns `db_updates`, concatenated with those related to the call to `OMG.State` - """ def handle_call({:finalize_exits, exits}, _from, state) do _ = if not Enum.empty?(exits), do: Logger.info("Recognized #{Enum.count(exits)} finalizations: #{inspect(exits)}") @@ -407,13 +440,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, db_updates ++ db_updates_from_state}, new_state} end - @doc """ - See `piggyback_exits/1`. Flow: - - - takes a list of IFE piggybacking events from the contract - - updates the `ExitProcessor`'s state - - returns `db_updates` - """ def handle_call({:piggyback_exits, exits}, _from, state) do _ = if not Enum.empty?(exits), do: Logger.info("Recognized #{Enum.count(exits)} piggybacks: #{inspect(exits)}") {new_state, db_updates} = Core.new_piggybacks(state, exits) @@ -426,26 +452,12 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, db_updates}, new_state} end - @doc """ - See `challenge_exits/1`. Flow: - - - takes a list of standard exit challenge events from the contract - - updates the `ExitProcessor`'s state - - returns `db_updates` - """ def handle_call({:challenge_exits, exits}, _from, state) do _ = if not Enum.empty?(exits), do: Logger.info("Recognized #{Enum.count(exits)} challenges: #{inspect(exits)}") {new_state, db_updates} = Core.challenge_exits(state, exits) {:reply, {:ok, db_updates}, new_state} end - @doc """ - See `new_ife_challenges/1`. Flow: - - - takes a list of IFE exit canonicity challenge events from the contract - - updates the `ExitProcessor`'s state - - returns `db_updates` - """ def handle_call({:new_ife_challenges, challenges}, _from, state) do _ = if not Enum.empty?(challenges), @@ -455,14 +467,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, db_updates}, new_state} end - @doc """ - See `challenge_piggybacks/1`. Flow: - - - takes a list of IFE piggyback challenge events from the contract - - updates the `ExitProcessor`'s state - - returns `db_updates` - """ - def handle_call({:challenge_piggybacks, challenges}, _from, state) do _ = if not Enum.empty?(challenges), @@ -472,13 +476,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, db_updates}, new_state} end - @doc """ - See `respond_to_in_flight_exits_challenges/1`. Flow: - - - takes a list of IFE exit canonicity challenge response events from the contract - - updates the `ExitProcessor`'s state - - returns `db_updates` - """ def handle_call({:respond_to_in_flight_exits_challenges, responds}, _from, state) do _ = if not Enum.empty?(responds), @@ -488,18 +485,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, db_updates}, new_state} end - @doc """ - See `finalize_in_flight_exits/1`. Flow: - - - takes a list of IFE exit finalization events from the contract - - pulls current information on IFE transaction inclusion - - discovers the `OMG.State`'s native key for the finalizing exits (`utxo_pos`) - (`Core.prepare_utxo_exits_for_in_flight_exit_finalizations/2`) - - marks as spent these UTXOs in `OMG.State` expecting it to tell which of those were valid finalizations (UTXOs exist) - - reflects this result in the `ExitProcessor`'s state - - returns `db_updates`, concatenated with those related to the call to `OMG.State` - """ - def handle_call({:finalize_in_flight_exits, finalizations}, _from, state) do _ = Logger.info("Recognized #{Enum.count(finalizations)} ife finalizations: #{inspect(finalizations)}") @@ -510,7 +495,7 @@ defmodule OMG.Watcher.ExitProcessor do Core.prepare_utxo_exits_for_in_flight_exit_finalizations(state2, finalizations) # NOTE: it's not straightforward to track from utxo position returned when exiting utxo in State to ife id - # See issue #671 https://github.com/omisego/elixir-omg/issues/671 + # See issue #671 https://github.com/omgnetwork/elixir-omg/issues/671 {invalidities, state_db_updates} = Enum.reduce(exiting_positions, {%{}, []}, &collect_invalidities_and_state_db_updates/2) @@ -524,13 +509,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, {:ok, state_db_updates ++ db_updates}, state3} end - @doc """ - See `check_validity/0`. Flow: - - - pulls current information on IFE transaction inclusion - - gets a list of interesting UTXOs to check for existence in `OMG.State` - - combines this information to discover the state of all the exits to report (mainly byzantine events) - """ def handle_call(:check_validity, _from, state) do new_state = update_with_ife_txs_from_blocks(state) @@ -542,20 +520,10 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, response, new_state} end - @doc """ - See `get_active_in_flight_exits/0`. - """ def handle_call(:get_active_in_flight_exits, _from, state) do {:reply, {:ok, Core.get_active_in_flight_exits(state)}, state} end - @doc """ - See `get_competitor_for_ife/1`. Flow: - - - pulls current information on IFE transaction inclusion - - gets a list of interesting UTXOs to check for existence in `OMG.State` - - combines this information to compose the challenge data - """ def handle_call({:get_competitor_for_ife, txbytes}, _from, state) do # TODO: run_status_gets and getting all non-existent UTXO positions imaginable can be optimized out heavily # only the UTXO positions being inputs to `txbytes` must be looked at, but it becomes problematic as @@ -570,25 +538,12 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, competitor_result, new_state} end - @doc """ - See `prove_canonical_for_ife/1`. Flow: - - - pulls current information on IFE transaction inclusion - - gets a list of interesting UTXOs to check for existence in `OMG.State` - - combines this information to compose the challenge data - """ def handle_call({:prove_canonical_for_ife, txbytes}, _from, state) do new_state = update_with_ife_txs_from_blocks(state) canonicity_result = Core.prove_canonical_for_ife(new_state, txbytes) {:reply, canonicity_result, new_state} end - @doc """ - See `get_input_challenge_data/2`. Flow: - - - gets a list of interesting UTXOs to check for existence in `OMG.State` - - combines this information to compose the challenge data - """ def handle_call({:get_input_challenge_data, txbytes, input_index}, _from, state) do response = %ExitProcessor.Request{} @@ -598,13 +553,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, response, state} end - @doc """ - See `get_output_challenge_data/2`. Flow: - - - pulls current information on IFE transaction inclusion - - gets a list of interesting UTXOs to check for existence in `OMG.State` - - combines this information to compose the challenge data - """ def handle_call({:get_output_challenge_data, txbytes, output_index}, _from, state) do new_state = update_with_ife_txs_from_blocks(state) @@ -616,13 +564,6 @@ defmodule OMG.Watcher.ExitProcessor do {:reply, response, new_state} end - @doc """ - See `create_challenge/1`. Flow: - - - leverages `OMG.State` to quickly learn if the exiting UTXO exists or was spent - - pulls some additional data from `OMG.DB`, if needed - - combines this information to compose the challenge data - """ def handle_call({:create_challenge, exiting_utxo_pos}, _from, state) do request = %ExitProcessor.Request{se_exiting_pos: exiting_utxo_pos} exiting_utxo_exists = State.utxo_exists?(exiting_utxo_pos) diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/canonicity.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/canonicity.ex index 455f4781b3..22f9abd13e 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/canonicity.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/canonicity.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex index d81a5c29ac..9c0a86bedb 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/core.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/core.ex index d8c0240148..863de92fbb 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/core.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/core.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/double_spend.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/double_spend.ex index 931db968fa..d013384304 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/double_spend.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/double_spend.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex index d6120e863d..01ffb410f2 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/finalizations.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/finalizations.ex index 0c5378dffe..736d4e6aa8 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/finalizations.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/finalizations.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex index 5ec26609a7..e17b054fd7 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ defmodule OMG.Watcher.ExitProcessor.InFlightExitInfo do @type combined_index_t() :: {:input, 0..unquote(@max_inputs - 1)} | {:output, 0..unquote(@max_outputs - 1)} # TODO: divide into inputs and outputs: prevent contract's implementation from leaking into watcher - # https://github.com/omisego/elixir-omg/pull/361#discussion_r247926222 + # https://github.com/omgnetwork/elixir-omg/pull/361#discussion_r247926222 @enforce_keys [ :tx, @@ -504,7 +504,7 @@ defmodule OMG.Watcher.ExitProcessor.InFlightExitInfo do {:ok, Utxo.position(_, _, _) = decoded} -> decoded # The position was huge so it denoted a non-included transaction. # Use a special value denoting "age" of a non-included transaction - {:error, {:blknum, :exceeds_maximum}} -> :no_position + {:error, :encoded_utxo_position_too_low} -> :no_position end end diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/known_tx.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/known_tx.ex index 5265ea0564..56f72fb8c4 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/known_tx.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/known_tx.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/measure.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/measure.ex index 63389b8e81..1473c9e256 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/measure.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/measure.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/piggyback.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/piggyback.ex index ed16c2ece1..9625bd761a 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/piggyback.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/piggyback.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/request.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/request.ex index 9c9c07f603..ac21f3c4fc 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/request.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/request.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/standard_exit.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/standard_exit.ex index a31176c388..5b72753682 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/standard_exit.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/standard_exit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex index ac8de253b5..4628d7c626 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/exit_processor/tx_appendix.ex b/apps/omg_watcher/lib/omg_watcher/exit_processor/tx_appendix.ex index a67f945436..a88223993c 100644 --- a/apps/omg_watcher/lib/omg_watcher/exit_processor/tx_appendix.ex +++ b/apps/omg_watcher/lib/omg_watcher/exit_processor/tx_appendix.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_utils/lib/omg_utils/http_rpc/adapter.ex b/apps/omg_watcher/lib/omg_watcher/http_rpc/adapter.ex similarity index 92% rename from apps/omg_utils/lib/omg_utils/http_rpc/adapter.ex rename to apps/omg_watcher/lib/omg_watcher/http_rpc/adapter.ex index 321f57dc3d..e1dab45f63 100644 --- a/apps/omg_utils/lib/omg_utils/http_rpc/adapter.ex +++ b/apps/omg_watcher/lib/omg_watcher/http_rpc/adapter.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,11 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -defmodule OMG.Utils.HttpRPC.Adapter do +defmodule OMG.Watcher.HttpRPC.Adapter do @moduledoc """ Provides functions to communicate with Child Chain API """ + alias OMG.Utils.AppVersion + require Logger @doc """ @@ -24,7 +26,7 @@ defmodule OMG.Utils.HttpRPC.Adapter do """ def rpc_post(body, path, url) do addr = "#{url}/#{path}" - headers = [{"content-type", "application/json"}] + headers = [{"content-type", "application/json"}, {"X-Watcher-Version", AppVersion.version(:omg_watcher)}] with {:ok, body} <- Jason.encode(body), {:ok, %HTTPoison.Response{} = response} <- HTTPoison.post(addr, body, headers) do diff --git a/apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex b/apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex index dad4a238eb..251df1e586 100644 --- a/apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex +++ b/apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ defmodule OMG.Watcher.HttpRPC.Client do Provides functions to communicate with Child Chain API """ - alias OMG.Utils.HttpRPC.Adapter alias OMG.Utils.HttpRPC.Encoding + alias OMG.Watcher.HttpRPC.Adapter require Logger diff --git a/apps/omg_watcher/lib/omg_watcher/monitor.ex b/apps/omg_watcher/lib/omg_watcher/monitor.ex index 3ae76e6ea9..ab637380ed 100644 --- a/apps/omg_watcher/lib/omg_watcher/monitor.ex +++ b/apps/omg_watcher/lib/omg_watcher/monitor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -81,7 +81,7 @@ defmodule OMG.Watcher.Monitor do # so we do not attempt to restart the exit from the supervisor, if the alarm clears, we restart it then. # We declare the sytem unhealthy def handle_info({:EXIT, _from, reason}, state) do - _ = Logger.error("Watcher supervisor crashed. Raising alarm. Reason #{inspect(reason)}") + _ = Logger.warn("Watcher supervisor crashed. Raising alarm. Reason #{inspect(reason)}") state.alarm_module.set(state.alarm_module.main_supervisor_halted(__MODULE__)) {:noreply, state} diff --git a/apps/omg_watcher/lib/omg_watcher/release_tasks/set_application.ex b/apps/omg_watcher/lib/omg_watcher/release_tasks/set_application.ex index 087639ec3b..8cf43919a4 100644 --- a/apps/omg_watcher/lib/omg_watcher/release_tasks/set_application.ex +++ b/apps/omg_watcher/lib/omg_watcher/release_tasks/set_application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/release_tasks/set_child_chain.ex b/apps/omg_watcher/lib/omg_watcher/release_tasks/set_child_chain.ex index 8970b1c13f..169b0557b3 100644 --- a/apps/omg_watcher/lib/omg_watcher/release_tasks/set_child_chain.ex +++ b/apps/omg_watcher/lib/omg_watcher/release_tasks/set_child_chain.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/release_tasks/set_exit_processor_sla_margin.ex b/apps/omg_watcher/lib/omg_watcher/release_tasks/set_exit_processor_sla_margin.ex index a0c32ca97d..9a9cd9dbc2 100644 --- a/apps/omg_watcher/lib/omg_watcher/release_tasks/set_exit_processor_sla_margin.ex +++ b/apps/omg_watcher/lib/omg_watcher/release_tasks/set_exit_processor_sla_margin.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/release_tasks/set_tracer.ex b/apps/omg_watcher/lib/omg_watcher/release_tasks/set_tracer.ex index 0cc00dc560..b146e89647 100644 --- a/apps/omg_watcher/lib/omg_watcher/release_tasks/set_tracer.ex +++ b/apps/omg_watcher/lib/omg_watcher/release_tasks/set_tracer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/supervisor.ex b/apps/omg_watcher/lib/omg_watcher/supervisor.ex index fdb6ce2116..d3be37689d 100644 --- a/apps/omg_watcher/lib/omg_watcher/supervisor.ex +++ b/apps/omg_watcher/lib/omg_watcher/supervisor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/tracer.ex b/apps/omg_watcher/lib/omg_watcher/tracer.ex index 63aaed59a2..9335eb5299 100644 --- a/apps/omg_watcher/lib/omg_watcher/tracer.ex +++ b/apps/omg_watcher/lib/omg_watcher/tracer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/lib/omg_watcher/utxo_exit/core.ex b/apps/omg_watcher/lib/omg_watcher/utxo_exit/core.ex index e4f0847c2d..a80e7eb1a4 100644 --- a/apps/omg_watcher/lib/omg_watcher/utxo_exit/core.ex +++ b/apps/omg_watcher/lib/omg_watcher/utxo_exit/core.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/mix.exs b/apps/omg_watcher/mix.exs index 55fd2160cb..78397dce25 100644 --- a/apps/omg_watcher/mix.exs +++ b/apps/omg_watcher/mix.exs @@ -4,7 +4,7 @@ defmodule OMG.Watcher.MixProject do def project() do [ app: :omg_watcher, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -22,10 +22,18 @@ defmodule OMG.Watcher.MixProject do [ mod: {OMG.Watcher.Application, []}, start_phases: [{:attach_telemetry, []}], - extra_applications: [:logger, :runtime_tools, :telemetry] + extra_applications: [:logger, :runtime_tools, :telemetry, :phoenix, :poison] ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + # Specifies which paths to compile per environment. defp elixirc_paths(:prod), do: ["lib"] defp elixirc_paths(:dev), do: ["lib"] @@ -37,7 +45,6 @@ defmodule OMG.Watcher.MixProject do # there's no apparent reason why libsecp256k1, spandex need to be included as dependencies # to this umbrella application apart from mix ecto.gen.migration not working, so here they are, copied from # the parent (main) mix.exs - {:libsecp256k1, git: "https://github.com/omisego/libsecp256k1.git", branch: "elixir-only", override: true}, {:spandex, "~> 3.0.2"}, # UMBRELLA diff --git a/apps/omg_watcher/test/fixtures.exs b/apps/omg_watcher/test/fixtures.exs index 947ecdd4c9..3f51dec091 100644 --- a/apps/omg_watcher/test/fixtures.exs +++ b/apps/omg_watcher/test/fixtures.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/api/account_test.exs b/apps/omg_watcher/test/omg_watcher/api/account_test.exs index cfb381e61c..640a070871 100644 --- a/apps/omg_watcher/test/omg_watcher/api/account_test.exs +++ b/apps/omg_watcher/test/omg_watcher/api/account_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/api/alarm_test.exs b/apps/omg_watcher/test/omg_watcher/api/alarm_test.exs index 61b68904dc..adf0952c4f 100644 --- a/apps/omg_watcher/test/omg_watcher/api/alarm_test.exs +++ b/apps/omg_watcher/test/omg_watcher/api/alarm_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/api/status_cache_test.exs b/apps/omg_watcher/test/omg_watcher/api/status_cache_test.exs index 280b51b8ff..84c38a3016 100644 --- a/apps/omg_watcher/test/omg_watcher/api/status_cache_test.exs +++ b/apps/omg_watcher/test/omg_watcher/api/status_cache_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/block_getter/core_test.exs b/apps/omg_watcher/test/omg_watcher/block_getter/core_test.exs index 15dabfff7d..1de7ebfdf5 100644 --- a/apps/omg_watcher/test/omg_watcher/block_getter/core_test.exs +++ b/apps/omg_watcher/test/omg_watcher/block_getter/core_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/block_validator_test.exs b/apps/omg_watcher/test/omg_watcher/block_validator_test.exs index c8d0e0f446..f231601774 100644 --- a/apps/omg_watcher/test/omg_watcher/block_validator_test.exs +++ b/apps/omg_watcher/test/omg_watcher/block_validator_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/child_manager_test.exs b/apps/omg_watcher/test/omg_watcher/child_manager_test.exs index 4e0a640d9c..02e35517e6 100644 --- a/apps/omg_watcher/test/omg_watcher/child_manager_test.exs +++ b/apps/omg_watcher/test/omg_watcher/child_manager_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/datadog_event/contract_event_consumer_test.exs b/apps/omg_watcher/test/omg_watcher/datadog_event/contract_event_consumer_test.exs index 4949b6bdc1..316ace6828 100644 --- a/apps/omg_watcher/test/omg_watcher/datadog_event/contract_event_consumer_test.exs +++ b/apps/omg_watcher/test/omg_watcher/datadog_event/contract_event_consumer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/datadog_event/encode_test.exs b/apps/omg_watcher/test/omg_watcher/datadog_event/encode_test.exs index 18611d58d4..4685677911 100644 --- a/apps/omg_watcher/test/omg_watcher/datadog_event/encode_test.exs +++ b/apps/omg_watcher/test/omg_watcher/datadog_event/encode_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs b/apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs index 2cb3627ea3..d7402faeca 100644 --- a/apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs +++ b/apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -118,11 +118,12 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do describe "delete_old_logs/2" do # we start the test with a completely empty ETS table, meaning to events were retrieved yet # so the first call from a ETH event listener would actually retrieve values from Infura - test "(watcher) that :delete_events_threshold_height_blknum is respected and that events get deleted from ETS", %{ - event_fetcher_name: event_fetcher_name, - table: table, - test: test_name - } do + test "(watcher) that :delete_events_threshold_ethereum_block_height is respected and that events get deleted from ETS", + %{ + event_fetcher_name: event_fetcher_name, + table: table, + test: test_name + } do defmodule test_name do alias OMG.Watcher.EthereumEventAggregatorTest @@ -140,7 +141,11 @@ defmodule OMG.Watcher.EthereumEventAggregatorTest do from_block = 1 to_block = 3 :sys.replace_state(event_fetcher_name, fn state -> Map.put(state, :rpc, test_name) end) - :sys.replace_state(event_fetcher_name, fn state -> Map.put(state, :delete_events_threshold_height_blknum, 1) end) + + :sys.replace_state(event_fetcher_name, fn state -> + Map.put(state, :delete_events_threshold_ethereum_block_height, 1) + end) + events = event_fetcher_name |> :sys.get_state() |> Map.get(:events) # create data that we need diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/canonicity_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/canonicity_test.exs index 117ac5d05b..a2e1c07dee 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/canonicity_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/canonicity_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -502,7 +502,7 @@ defmodule OMG.Watcher.ExitProcessor.CanonicityTest do standard_exiting_pos = Utxo.position(2_000, 0, 1) processor = processor |> start_se_from(standard_exit_tx, standard_exiting_pos) |> start_ife_from(ife_tx) - assert %{utxos_to_check: [Utxo.position(1, 0, 0), standard_exiting_pos]} = + assert %{utxos_to_check: [Utxo.position(1, 0, 0), _standard_exiting_pos]} = %ExitProcessor.Request{blknum_now: @late_blknum} |> Core.determine_utxo_existence_to_get(processor) end diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/core/state_interaction_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/core/state_interaction_test.exs index aaafd75688..a722fa59fd 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/core/state_interaction_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/core/state_interaction_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/core_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/core_test.exs index 2fd9fda0d5..25458785bc 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/core_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/core_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/exit_info_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/exit_info_test.exs index b4b95ab405..ca04f9f163 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/exit_info_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/exit_info_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/finalizations_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/finalizations_test.exs index 28beb9de98..8daf44eb89 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/finalizations_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/finalizations_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/in_flight_exit_info_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/in_flight_exit_info_test.exs index f1111674cd..61f2f207a6 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/in_flight_exit_info_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/in_flight_exit_info_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs index 28c787b750..1db5296008 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/piggyback_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/piggyback_test.exs index 1d9432ef59..5e24c5cdce 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/piggyback_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/piggyback_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs index cc8430b097..6b4dd7b730 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs index 14e60e407d..1ea4b72ec6 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/http_rpc/adapter_test.exs b/apps/omg_watcher/test/omg_watcher/http_rpc/adapter_test.exs new file mode 100644 index 0000000000..445af7b47a --- /dev/null +++ b/apps/omg_watcher/test/omg_watcher/http_rpc/adapter_test.exs @@ -0,0 +1,37 @@ +# Copyright 2019-2020 OMG Network Pte Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +defmodule OMG.Watcher.HttpRPC.AdapterTest do + use ExUnit.Case, async: true + + import FakeServer + + alias OMG.Utils.AppVersion + alias OMG.Watcher.HttpRPC.Adapter + + describe "rpc_post/3" do + test_with_server "includes X-Watcher-Version header" do + route("/path", FakeServer.Response.ok()) + _ = Adapter.rpc_post(%{}, "path", FakeServer.address()) + + expected_watcher_version = AppVersion.version(:omg_watcher_info) + + assert request_received( + "/path", + method: "POST", + headers: %{"content-type" => "application/json", "x-watcher-version" => expected_watcher_version} + ) + end + end +end diff --git a/apps/omg_watcher/test/omg_watcher/integration/block_getter_1_test.exs b/apps/omg_watcher/test/omg_watcher/integration/block_getter_1_test.exs index dda7b8bb1f..df97531592 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/block_getter_1_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/block_getter_1_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/block_getter_2_test.exs b/apps/omg_watcher/test/omg_watcher/integration/block_getter_2_test.exs index 11315e4f9e..c8f44b4b5d 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/block_getter_2_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/block_getter_2_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/block_getter_3_test.exs b/apps/omg_watcher/test/omg_watcher/integration/block_getter_3_test.exs index 14c9265ad8..dd8daed82b 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/block_getter_3_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/block_getter_3_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/block_getter_4_test.exs b/apps/omg_watcher/test/omg_watcher/integration/block_getter_4_test.exs index cc6793b32c..58e0f29ebe 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/block_getter_4_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/block_getter_4_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs b/apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs index d8d1f5de89..cdc63d7a85 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test.exs b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test.exs index cd5d3ce7bb..8610abb86d 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_1_test.exs b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_1_test.exs index 2ec863e244..a094fb0042 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_1_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_1_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_2_test.exs b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_2_test.exs index 5b08d322e4..25a93ec193 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_2_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_2_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_3_test.exs b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_3_test.exs index d5f0a3624e..0757e9d006 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_3_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_3_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_4_test.exs b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_4_test.exs index 750021b2e1..460df9fdff 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_4_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_4_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ defmodule OMG.Watcher.Integration.InFlightExit4Test do # bumping the timeout to three minutes for the tests here, as they do a lot of transactions to Ethereum to test @moduletag timeout: 180_000 - # NOTE: if https://github.com/omisego/elixir-omg/issues/994 is taken care of, this behavior will change, see comments + # NOTE: if https://github.com/omgnetwork/elixir-omg/issues/994 is taken care of, this behavior will change, see comments # therein. @tag fixtures: [:in_beam_watcher, :alice, :bob, :token, :alice_deposits] test "finalization of output from non-included IFE tx - all is good", diff --git a/apps/omg_watcher/test/omg_watcher/integration/invalid_exit_1_test.exs b/apps/omg_watcher/test/omg_watcher/integration/invalid_exit_1_test.exs index e07b63a594..ef0d994dc2 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/invalid_exit_1_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/invalid_exit_1_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -40,10 +40,10 @@ defmodule OMG.Watcher.Integration.InvalidExit1Test do Process.sleep(11_000) %{"blknum" => first_tx_blknum} = - OMG.TestHelper.create_encoded([{deposit_blknum, 0, 0, alice}], @eth, [{alice, 9}]) |> WatcherHelper.submit() + [{deposit_blknum, 0, 0, alice}] |> OMG.TestHelper.create_encoded(@eth, [{alice, 9}]) |> WatcherHelper.submit() %{"blknum" => second_tx_blknum} = - OMG.TestHelper.create_encoded([{first_tx_blknum, 0, 0, alice}], @eth, [{alice, 8}]) |> WatcherHelper.submit() + [{first_tx_blknum, 0, 0, alice}] |> OMG.TestHelper.create_encoded(@eth, [{alice, 8}]) |> WatcherHelper.submit() Process.sleep(11_000) IntegrationTest.wait_for_block_fetch(second_tx_blknum, @timeout) @@ -52,7 +52,8 @@ defmodule OMG.Watcher.Integration.InvalidExit1Test do WatcherHelper.get_exit_data(first_tx_blknum, 0, 0) {:ok, %{"status" => "0x1", "blockNumber" => eth_height}} = - RootChainHelper.start_exit(tx_utxo_pos, txbytes, proof, alice.addr) + tx_utxo_pos + |> RootChainHelper.start_exit(txbytes, proof, alice.addr) |> DevHelper.transact_sync!() IntegrationTest.wait_for_byzantine_events([%Event.InvalidExit{}.name], @timeout) diff --git a/apps/omg_watcher/test/omg_watcher/integration/invalid_exit_2_test.exs b/apps/omg_watcher/test/omg_watcher/integration/invalid_exit_2_test.exs index ae08e86577..842a377cd2 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/invalid_exit_2_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/invalid_exit_2_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/monitor_test.exs b/apps/omg_watcher/test/omg_watcher/integration/monitor_test.exs index 9173e013a2..0aeea8c2c1 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/monitor_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/monitor_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/integration/test_server_test.exs b/apps/omg_watcher/test/omg_watcher/integration/test_server_test.exs index 6dc9e108e3..01493b129e 100644 --- a/apps/omg_watcher/test/omg_watcher/integration/test_server_test.exs +++ b/apps/omg_watcher/test/omg_watcher/integration/test_server_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/release_tasks/set_child_chain_test.exs b/apps/omg_watcher/test/omg_watcher/release_tasks/set_child_chain_test.exs index dc1c005636..316e2a1917 100644 --- a/apps/omg_watcher/test/omg_watcher/release_tasks/set_child_chain_test.exs +++ b/apps/omg_watcher/test/omg_watcher/release_tasks/set_child_chain_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/release_tasks/set_exit_processor_sla_margin_test.exs b/apps/omg_watcher/test/omg_watcher/release_tasks/set_exit_processor_sla_margin_test.exs index 5c98e76c4d..b1d05d72f5 100644 --- a/apps/omg_watcher/test/omg_watcher/release_tasks/set_exit_processor_sla_margin_test.exs +++ b/apps/omg_watcher/test/omg_watcher/release_tasks/set_exit_processor_sla_margin_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/release_tasks/set_tracer_test.exs b/apps/omg_watcher/test/omg_watcher/release_tasks/set_tracer_test.exs index 1b6b81f245..bb358aa7c2 100644 --- a/apps/omg_watcher/test/omg_watcher/release_tasks/set_tracer_test.exs +++ b/apps/omg_watcher/test/omg_watcher/release_tasks/set_tracer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/supervisor_test.exs b/apps/omg_watcher/test/omg_watcher/supervisor_test.exs index 8b4f07a29d..49139d9783 100644 --- a/apps/omg_watcher/test/omg_watcher/supervisor_test.exs +++ b/apps/omg_watcher/test/omg_watcher/supervisor_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/omg_watcher/utxo_exit/core_test.exs b/apps/omg_watcher/test/omg_watcher/utxo_exit/core_test.exs index b70f374a9c..6e7d092932 100644 --- a/apps/omg_watcher/test/omg_watcher/utxo_exit/core_test.exs +++ b/apps/omg_watcher/test/omg_watcher/utxo_exit/core_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/support/exit_processor/case.ex b/apps/omg_watcher/test/support/exit_processor/case.ex index f6605eac08..cc937dccb4 100644 --- a/apps/omg_watcher/test/support/exit_processor/case.ex +++ b/apps/omg_watcher/test/support/exit_processor/case.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/support/exit_processor/test_helper.ex b/apps/omg_watcher/test/support/exit_processor/test_helper.ex index 9adcf0a71f..2e215afca7 100644 --- a/apps/omg_watcher/test/support/exit_processor/test_helper.ex +++ b/apps/omg_watcher/test/support/exit_processor/test_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/support/integration/bad_child_chain_server.ex b/apps/omg_watcher/test/support/integration/bad_child_chain_server.ex index 9924204f39..bc2761eb18 100644 --- a/apps/omg_watcher/test/support/integration/bad_child_chain_server.ex +++ b/apps/omg_watcher/test/support/integration/bad_child_chain_server.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,9 +19,9 @@ defmodule OMG.Watcher.Integration.BadChildChainServer do """ alias OMG.Block - alias OMG.Utils.HttpRPC.Adapter alias OMG.Utils.HttpRPC.Encoding alias OMG.Utils.HttpRPC.Response + alias OMG.Watcher.HttpRPC.Adapter alias OMG.Watcher.Integration.TestServer @doc """ diff --git a/apps/omg_watcher/test/support/integration/fixtures.exs b/apps/omg_watcher/test/support/integration/fixtures.exs index efa5abcc31..b482b3a8d1 100644 --- a/apps/omg_watcher/test/support/integration/fixtures.exs +++ b/apps/omg_watcher/test/support/integration/fixtures.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/support/integration/test_helper.ex b/apps/omg_watcher/test/support/integration/test_helper.ex index f313c7ef8e..b58a19dc24 100644 --- a/apps/omg_watcher/test/support/integration/test_helper.ex +++ b/apps/omg_watcher/test/support/integration/test_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/support/integration/test_server.ex b/apps/omg_watcher/test/support/integration/test_server.ex index 825a4eecba..8c026c5c25 100644 --- a/apps/omg_watcher/test/support/integration/test_server.ex +++ b/apps/omg_watcher/test/support/integration/test_server.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher/test/support/watcher_helper.ex b/apps/omg_watcher/test/support/watcher_helper.ex index 4f242d8659..31b64e0456 100644 --- a/apps/omg_watcher/test/support/watcher_helper.ex +++ b/apps/omg_watcher/test/support/watcher_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ defmodule Support.WatcherHelper do ] for header <- required_headers do - assert header in Keyword.keys(response.resp_headers) + assert header in Enum.map(response.resp_headers, &elem(&1, 0)) end # CORS check diff --git a/apps/omg_watcher/test/test_helper.exs b/apps/omg_watcher/test/test_helper.exs index 1563bb0c58..1031ffe98f 100644 --- a/apps/omg_watcher/test/test_helper.exs +++ b/apps/omg_watcher/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/api/account.ex b/apps/omg_watcher_info/lib/omg_watcher_info/api/account.ex index e9d6b628a8..ad81c842f1 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/api/account.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/api/account.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/api/block.ex b/apps/omg_watcher_info/lib/omg_watcher_info/api/block.ex index 7534b690fb..e582487afd 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/api/block.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/api/block.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/api/deposit.ex b/apps/omg_watcher_info/lib/omg_watcher_info/api/deposit.ex index d4f6b82247..3293010c5d 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/api/deposit.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/api/deposit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/api/stats.ex b/apps/omg_watcher_info/lib/omg_watcher_info/api/stats.ex index 9b97ab0b59..4e7827766d 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/api/stats.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/api/stats.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/api/transaction.ex b/apps/omg_watcher_info/lib/omg_watcher_info/api/transaction.ex index f0592c37c6..075c445a90 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/api/transaction.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/api/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/application.ex b/apps/omg_watcher_info/lib/omg_watcher_info/application.ex index 07b5842379..3e203ae793 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/application.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/block_application_consumer.ex b/apps/omg_watcher_info/lib/omg_watcher_info/block_application_consumer.ex index 851bf1f292..b48ad41dc8 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/block_application_consumer.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/block_application_consumer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/configuration.ex b/apps/omg_watcher_info/lib/omg_watcher_info/configuration.ex index b31bea44d8..eca71707f2 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/configuration.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/block.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/block.ex index c780e0caff..0af7a1bd4e 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/block.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/block.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex index 9a7a832a93..0c8a99e167 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event_txoutput.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event_txoutput.ex index 776599402b..fe538cf71b 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event_txoutput.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/eth_event_txoutput.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/pending_block.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/pending_block.ex index f3f97bacfe..0745bed150 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/pending_block.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/pending_block.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/repo.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/repo.ex index 8fe4b4708a..5c74b88288 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/repo.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/repo.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/transaction.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/transaction.ex index e410570d00..6bf6de7c4c 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/transaction.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/txoutput.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/txoutput.ex index 51af12b76e..3e8ba999ef 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/txoutput.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/txoutput.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/types/atom_type.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/types/atom_type.ex index 03210e55b4..82e41dae16 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/types/atom_type.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/types/atom_type.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/types/block/chunk.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/types/block/chunk.ex index d971e44533..04278695b6 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/types/block/chunk.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/types/block/chunk.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/db/types/integer_type.ex b/apps/omg_watcher_info/lib/omg_watcher_info/db/types/integer_type.ex index b5230e1ae6..7030e4d844 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/db/types/integer_type.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/db/types/integer_type.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/deposit_consumer.ex b/apps/omg_watcher_info/lib/omg_watcher_info/deposit_consumer.ex index 9961b0b0ee..7e64760840 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/deposit_consumer.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/deposit_consumer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/exit_consumer.ex b/apps/omg_watcher_info/lib/omg_watcher_info/exit_consumer.ex index 7a0f39ee5e..8bf195a5a5 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/exit_consumer.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/exit_consumer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/http_rpc/adapter.ex b/apps/omg_watcher_info/lib/omg_watcher_info/http_rpc/adapter.ex index 34a4592760..49bd9ba55a 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/http_rpc/adapter.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/http_rpc/adapter.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ defmodule OMG.WatcherInfo.HttpRPC.Adapter do Provides functions to communicate with Child Chain API """ + alias OMG.Utils.AppVersion + require Logger @doc """ @@ -24,7 +26,7 @@ defmodule OMG.WatcherInfo.HttpRPC.Adapter do """ def rpc_post(body, path, url) do addr = "#{url}/#{path}" - headers = [{"content-type", "application/json"}] + headers = [{"content-type", "application/json"}, {"X-Watcher-Version", AppVersion.version(:omg_watcher_info)}] with {:ok, body} <- Jason.encode(body), {:ok, %HTTPoison.Response{} = response} <- HTTPoison.post(addr, body, headers) do diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/http_rpc/client.ex b/apps/omg_watcher_info/lib/omg_watcher_info/http_rpc/client.ex index d7477ec012..0fe4ca2eef 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/http_rpc/client.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/http_rpc/client.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/measure.ex b/apps/omg_watcher_info/lib/omg_watcher_info/measure.ex index ee6cac3594..1e894ed8b5 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/measure.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/measure.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/order_fee_fetcher.ex b/apps/omg_watcher_info/lib/omg_watcher_info/order_fee_fetcher.ex index 4e028d9d80..96361e6c91 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/order_fee_fetcher.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/order_fee_fetcher.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_processor.ex b/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_processor.ex index b52b979ef7..eaefcf9329 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_processor.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_processor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_processor/storage.ex b/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_processor/storage.ex index 9ac899485c..d549640643 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_processor/storage.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_processor/storage.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_queue_length_checker.ex b/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_queue_length_checker.ex index c3df24dec1..d5edfa0b33 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_queue_length_checker.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_queue_length_checker.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_queue_length_checker/storage.ex b/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_queue_length_checker/storage.ex index 8d3b347a59..2041248322 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_queue_length_checker/storage.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/pending_block_queue_length_checker/storage.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/ethereum_tasks.ex b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/ethereum_tasks.ex index b44f12f3dd..f047a3b1b8 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/ethereum_tasks.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/ethereum_tasks.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/ethereum_tasks/add_eth_height_to_eth_events.ex b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/ethereum_tasks/add_eth_height_to_eth_events.ex index dde41abb13..08adcb57b1 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/ethereum_tasks/add_eth_height_to_eth_events.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/ethereum_tasks/add_eth_height_to_eth_events.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherInfo.ReleaseTasks.EthereumTasks.AddEthereumHeightToEthEvents do @moduledoc """ - Prior to https://github.com/omisego/elixir-omg/pull/1509, `eth_height` was not persisted in the Watcher Info DB + Prior to https://github.com/omgnetwork/elixir-omg/pull/1509, `eth_height` was not persisted in the Watcher Info DB for `eth_events`. This module will add `eth_height` to all persisted `eth_events` where this value is non-existent. """ use Ecto.Migration diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/init_postgresql_db.ex b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/init_postgresql_db.ex index d8e23ac16e..c2c319cddc 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/init_postgresql_db.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/init_postgresql_db.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/set_child_chain.ex b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/set_child_chain.ex index a294fefe04..9cd04942a2 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/set_child_chain.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/set_child_chain.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/set_tracer.ex b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/set_tracer.ex index 350b462f66..d40924cdcd 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/set_tracer.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/release_tasks/set_tracer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/supervisor.ex b/apps/omg_watcher_info/lib/omg_watcher_info/supervisor.ex index 6941b748df..ede17f4fb5 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/supervisor.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/supervisor.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ defmodule OMG.WatcherInfo.Supervisor do def init(:ok) do # why sandbox is in this code - # https://github.com/omisego/elixir-omg/pull/562 + # https://github.com/omgnetwork/elixir-omg/pull/562 top_children = [ %{ diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/tracer.ex b/apps/omg_watcher_info/lib/omg_watcher_info/tracer.ex index f2487a7e40..0c0814ac7c 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/tracer.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/tracer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/transaction.ex b/apps/omg_watcher_info/lib/omg_watcher_info/transaction.ex index 436833217e..785a3137dd 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/transaction.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/omg_watcher_info/utxo_selection.ex b/apps/omg_watcher_info/lib/omg_watcher_info/utxo_selection.ex index c1caef8739..8b24dbccdc 100644 --- a/apps/omg_watcher_info/lib/omg_watcher_info/utxo_selection.ex +++ b/apps/omg_watcher_info/lib/omg_watcher_info/utxo_selection.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/lib/watcher_info.ex b/apps/omg_watcher_info/lib/watcher_info.ex index 866be29424..cdb7eea997 100644 --- a/apps/omg_watcher_info/lib/watcher_info.ex +++ b/apps/omg_watcher_info/lib/watcher_info.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/mix.exs b/apps/omg_watcher_info/mix.exs index a0c36c1e21..16c69f8560 100644 --- a/apps/omg_watcher_info/mix.exs +++ b/apps/omg_watcher_info/mix.exs @@ -4,7 +4,7 @@ defmodule OMG.WatcherInfo.MixProject do def project() do [ app: :omg_watcher_info, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -26,6 +26,14 @@ defmodule OMG.WatcherInfo.MixProject do ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + # Specifies which paths to compile per environment. defp elixirc_paths(:prod), do: ["lib"] defp elixirc_paths(:dev), do: ["lib"] @@ -40,7 +48,7 @@ defmodule OMG.WatcherInfo.MixProject do # there's no apparent reason why libsecp256k1, spandex need to be included as dependencies # to this umbrella application apart from mix ecto.gen.migration not working, so here they are, copied from # the parent (main) mix.exs - {:libsecp256k1, git: "https://github.com/omisego/libsecp256k1.git", branch: "elixir-only", override: true}, + {:spandex, "~> 3.0.2"}, {:jason, "~> 1.0"}, diff --git a/apps/omg_watcher_info/test/fixtures.exs b/apps/omg_watcher_info/test/fixtures.exs index 1fafc868c3..2e172e546a 100644 --- a/apps/omg_watcher_info/test/fixtures.exs +++ b/apps/omg_watcher_info/test/fixtures.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -71,20 +71,14 @@ defmodule OMG.WatcherInfo.Fixtures do deffixture phoenix_ecto_sandbox(web_endpoint) do :ok = web_endpoint - {:ok, pid} = - Supervisor.start_link( - [%{id: DB.Repo, start: {DB.Repo, :start_link, []}, type: :supervisor}], - strategy: :one_for_one, - name: WatcherInfo.Supervisor - ) + Supervisor.start_link( + [%{id: DB.Repo, start: {DB.Repo, :start_link, []}, type: :supervisor}], + strategy: :one_for_one, + name: WatcherInfo.Supervisor + ) :ok = SQL.Sandbox.checkout(DB.Repo) SQL.Sandbox.mode(DB.Repo, {:shared, self()}) - # setup and body test are performed in one process, `on_exit` is performed in another - on_exit(fn -> - wait_for_process(pid) - :ok - end) end deffixture initial_blocks(alice, bob, blocks_inserter, initial_deposits) do @@ -181,18 +175,17 @@ defmodule OMG.WatcherInfo.Fixtures do result rescue e in MatchError -> - %MatchError{ - term: - {:error, - {:shutdown, - {:failed_to_start_child, {:ranch_listener_sup, OMG.WatcherRPC.Web.Endpoint.HTTP}, - {:shutdown, - {:failed_to_start_child, :ranch_acceptors_sup, - {:listen_error, OMG.WatcherRPC.Web.Endpoint.HTTP, :eaddrinuse}}}}}} - } = e - - :ok = Process.sleep(5) - ensure_web_started(module, function, args, counter - 1) + case e do + %MatchError{ + term: + {:error, {:shutdown, {:failed_to_start_child, {:ranch_listener_sup, OMG.WatcherRPC.Web.Endpoint.HTTP}, _}}} + } -> + :ok = Process.sleep(5) + ensure_web_started(module, function, args, counter - 1) + + %MatchError{term: {:error, {:already_started, pid}}} -> + {:ok, pid} + end end defp wait_for_process(pid, timeout \\ :infinity) when is_pid(pid) do diff --git a/apps/omg_watcher_info/test/omg_watcher_info/api/block_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/api/block_test.exs index 5fe55fc896..272ddc39d2 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/api/block_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/api/block_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/api/deposit_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/api/deposit_test.exs index 905f7d1a1f..237e08a517 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/api/deposit_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/api/deposit_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherInfo.API.DepositTest do use ExUnitFixtures - use ExUnit.Case, async: true + use ExUnit.Case, async: false use OMG.WatcherInfo.Fixtures import OMG.WatcherInfo.Factory diff --git a/apps/omg_watcher_info/test/omg_watcher_info/api/stats_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/api/stats_test.exs index d948da9b35..e08e6acef2 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/api/stats_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/api/stats_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/api/transaction_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/api/transaction_test.exs index ace07051c6..40dc0c39b6 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/api/transaction_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/api/transaction_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/block_application_consumer_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/block_application_consumer_test.exs index 21823067d3..78da1b0d4a 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/block_application_consumer_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/block_application_consumer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/db/block/chunk_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/db/block/chunk_test.exs index d8b4be79d2..4fd5d63e12 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/db/block/chunk_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/db/block/chunk_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/db/block_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/db/block_test.exs index 0efbdc4593..3fb66a4d1c 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/db/block_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/db/block_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/db/eth_event_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/db/eth_event_test.exs index 4a4e39b22d..001e2352b4 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/db/eth_event_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/db/eth_event_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherInfo.DB.EthEventTest do use ExUnitFixtures - use ExUnit.Case, async: true + use ExUnit.Case, async: false use OMG.Fixtures alias OMG.Crypto diff --git a/apps/omg_watcher_info/test/omg_watcher_info/db/pending_block_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/db/pending_block_test.exs index 0dbe840b7a..5493cc962c 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/db/pending_block_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/db/pending_block_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherInfo.DB.PendingBlockTest do use ExUnitFixtures - use ExUnit.Case, async: true + use ExUnit.Case, async: false use OMG.Fixtures import OMG.WatcherInfo.Factory diff --git a/apps/omg_watcher_info/test/omg_watcher_info/db/transaction_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/db/transaction_test.exs index 574540f76f..24c36e9dd2 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/db/transaction_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/db/transaction_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/db/txoutput_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/db/txoutput_test.exs index c40e8e747c..a3898c1128 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/db/txoutput_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/db/txoutput_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/exit_consumer_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/exit_consumer_test.exs index 58cf22efe1..b9a447831d 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/exit_consumer_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/exit_consumer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/http_rpc/adapter_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/http_rpc/adapter_test.exs index 0ca7ca5377..b812075713 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/http_rpc/adapter_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/http_rpc/adapter_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,6 +15,9 @@ defmodule OMG.WatcherInfo.HttpRPC.AdapterTest do use ExUnit.Case, async: true + import FakeServer + + alias OMG.Utils.AppVersion alias OMG.WatcherInfo.HttpRPC.Adapter describe "get_unparsed_response_body/1" do @@ -66,4 +69,19 @@ defmodule OMG.WatcherInfo.HttpRPC.AdapterTest do assert response == {:malformed_response, %{"malformed" => "body"}} end end + + describe "rpc_post/3" do + test_with_server "includes X-Watcher-Version header" do + route("/path", FakeServer.Response.ok()) + _ = Adapter.rpc_post(%{}, "path", FakeServer.address()) + + expected_watcher_version = AppVersion.version(:omg_watcher_info) + + assert request_received( + "/path", + method: "POST", + headers: %{"content-type" => "application/json", "x-watcher-version" => expected_watcher_version} + ) + end + end end diff --git a/apps/omg_watcher_info/test/omg_watcher_info/order_fee_fetcher_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/order_fee_fetcher_test.exs index b2eb24c3f1..cdea953cb0 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/order_fee_fetcher_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/order_fee_fetcher_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/pending_block_processor/storage_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/pending_block_processor/storage_test.exs index 8fd189700f..32a0bafb50 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/pending_block_processor/storage_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/pending_block_processor/storage_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherInfo.PendingBlockProcessor.StorageTest do use ExUnitFixtures - use ExUnit.Case, async: true + use ExUnit.Case, async: false import OMG.WatcherInfo.Factory import Ecto.Query, only: [from: 2] diff --git a/apps/omg_watcher_info/test/omg_watcher_info/pending_block_processor_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/pending_block_processor_test.exs index 6c93793488..f102b6a562 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/pending_block_processor_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/pending_block_processor_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherInfo.PendingBlockProcessorTest do use ExUnitFixtures - use ExUnit.Case, async: true + use ExUnit.Case, async: false import Ecto.Query, only: [from: 2] import OMG.WatcherInfo.Factory diff --git a/apps/omg_watcher_info/test/omg_watcher_info/pending_block_queue_length_checker/storage_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/pending_block_queue_length_checker/storage_test.exs index 5050b2f99d..69e5124e54 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/pending_block_queue_length_checker/storage_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/pending_block_queue_length_checker/storage_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherInfo.PendingBlockQueueLengthChecker.StorageTest do use ExUnitFixtures - use ExUnit.Case, async: true + use ExUnit.Case, async: false import OMG.WatcherInfo.Factory diff --git a/apps/omg_watcher_info/test/omg_watcher_info/pending_block_queue_length_checker_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/pending_block_queue_length_checker_test.exs index 4c3881e9f3..6ee69b5ff4 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/pending_block_queue_length_checker_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/pending_block_queue_length_checker_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherInfo.PendingBlockQueueLengthCheckerTest do use ExUnitFixtures - use ExUnit.Case, async: true + use ExUnit.Case, async: false import OMG.WatcherInfo.Factory diff --git a/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/ethereum_tasks/add_eth_height_to_eth_events_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/ethereum_tasks/add_eth_height_to_eth_events_test.exs index 2b767c9b32..0f65a1df03 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/ethereum_tasks/add_eth_height_to_eth_events_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/ethereum_tasks/add_eth_height_to_eth_events_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/set_child_chain_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/set_child_chain_test.exs index 7851a70e3b..11c0b5d50d 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/set_child_chain_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/set_child_chain_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/set_tracer_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/set_tracer_test.exs index f7089a67e2..da5b792ef0 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/set_tracer_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/release_tasks/set_tracer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/transaction_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/transaction_test.exs index 23df15d850..de578f9019 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/transaction_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/transaction_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/omg_watcher_info/utxo_selection_test.exs b/apps/omg_watcher_info/test/omg_watcher_info/utxo_selection_test.exs index 300ba7560e..a79a1df9fb 100644 --- a/apps/omg_watcher_info/test/omg_watcher_info/utxo_selection_test.exs +++ b/apps/omg_watcher_info/test/omg_watcher_info/utxo_selection_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -234,8 +234,8 @@ defmodule OMG.WatcherInfo.UtxoSelectionTest do } assert %{ - @eth => [input_1, merge_1], - @other_token => [input_2, merge_2] + @eth => [^merge_1, ^input_1], + @other_token => [^merge_2, ^input_2] } = UtxoSelection.add_utxos_for_stealth_merge([merge_1, merge_2], inputs) end end diff --git a/apps/omg_watcher_info/test/support/factories/block_factory.ex b/apps/omg_watcher_info/test/support/factories/block_factory.ex index a51f5ae0c5..7d99d8ee34 100644 --- a/apps/omg_watcher_info/test/support/factories/block_factory.ex +++ b/apps/omg_watcher_info/test/support/factories/block_factory.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/support/factories/data_helper.ex b/apps/omg_watcher_info/test/support/factories/data_helper.ex index edd1b8bdb3..fe23d25ff7 100644 --- a/apps/omg_watcher_info/test/support/factories/data_helper.ex +++ b/apps/omg_watcher_info/test/support/factories/data_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/support/factories/eth_event_factory.ex b/apps/omg_watcher_info/test/support/factories/eth_event_factory.ex index 1253b9e0e6..a365241965 100644 --- a/apps/omg_watcher_info/test/support/factories/eth_event_factory.ex +++ b/apps/omg_watcher_info/test/support/factories/eth_event_factory.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/support/factories/pending_block_factory.ex b/apps/omg_watcher_info/test/support/factories/pending_block_factory.ex index f3b0091ec0..56d9b6e65e 100644 --- a/apps/omg_watcher_info/test/support/factories/pending_block_factory.ex +++ b/apps/omg_watcher_info/test/support/factories/pending_block_factory.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/support/factories/transaction_factory.ex b/apps/omg_watcher_info/test/support/factories/transaction_factory.ex index 019462f30c..618b9f987b 100644 --- a/apps/omg_watcher_info/test/support/factories/transaction_factory.ex +++ b/apps/omg_watcher_info/test/support/factories/transaction_factory.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/support/factories/txoutput_factory.ex b/apps/omg_watcher_info/test/support/factories/txoutput_factory.ex index aee7b196f9..a37caa9593 100644 --- a/apps/omg_watcher_info/test/support/factories/txoutput_factory.ex +++ b/apps/omg_watcher_info/test/support/factories/txoutput_factory.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/support/factory.ex b/apps/omg_watcher_info/test/support/factory.ex index 935a7b28c9..6bc2edaffa 100644 --- a/apps/omg_watcher_info/test/support/factory.ex +++ b/apps/omg_watcher_info/test/support/factory.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/support/test_server.ex b/apps/omg_watcher_info/test/support/test_server.ex index 45d2cd99b5..7e350e4098 100644 --- a/apps/omg_watcher_info/test/support/test_server.ex +++ b/apps/omg_watcher_info/test/support/test_server.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_info/test/test_helper.exs b/apps/omg_watcher_info/test/test_helper.exs index 1f38d7cb86..a2d064c24d 100644 --- a/apps/omg_watcher_info/test/test_helper.exs +++ b/apps/omg_watcher_info/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/application.ex b/apps/omg_watcher_rpc/lib/application.ex index fd502a0f8b..641d772e2d 100644 --- a/apps/omg_watcher_rpc/lib/application.ex +++ b/apps/omg_watcher_rpc/lib/application.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/configuration.ex b/apps/omg_watcher_rpc/lib/configuration.ex index fe2232a30d..c528f3cbe1 100644 --- a/apps/omg_watcher_rpc/lib/configuration.ex +++ b/apps/omg_watcher_rpc/lib/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ defmodule OMG.WatcherRPC.Configuration do @spec version() :: String.t() def version() do - OMG.Utils.HttpRPC.Response.version(@app) + OMG.Utils.AppVersion.version(@app) end @spec service_name() :: atom() diff --git a/apps/omg_watcher_rpc/lib/release_tasks/set_api_mode.ex b/apps/omg_watcher_rpc/lib/release_tasks/set_api_mode.ex index 2ee4606a87..94d45062f2 100644 --- a/apps/omg_watcher_rpc/lib/release_tasks/set_api_mode.ex +++ b/apps/omg_watcher_rpc/lib/release_tasks/set_api_mode.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/release_tasks/set_endpoint.ex b/apps/omg_watcher_rpc/lib/release_tasks/set_endpoint.ex index bca355ea98..8d469fbe29 100644 --- a/apps/omg_watcher_rpc/lib/release_tasks/set_endpoint.ex +++ b/apps/omg_watcher_rpc/lib/release_tasks/set_endpoint.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/release_tasks/set_tracer.ex b/apps/omg_watcher_rpc/lib/release_tasks/set_tracer.ex index 3c2c05f000..e5bdcad742 100644 --- a/apps/omg_watcher_rpc/lib/release_tasks/set_tracer.ex +++ b/apps/omg_watcher_rpc/lib/release_tasks/set_tracer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2019 OmiseGO Pte Ltd +# Copyright 2019-2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/tracer.ex b/apps/omg_watcher_rpc/lib/tracer.ex index a0b5972e23..97381c83a4 100644 --- a/apps/omg_watcher_rpc/lib/tracer.ex +++ b/apps/omg_watcher_rpc/lib/tracer.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web.ex b/apps/omg_watcher_rpc/lib/web.ex index 2c0848a1e0..8e26529d03 100644 --- a/apps/omg_watcher_rpc/lib/web.ex +++ b/apps/omg_watcher_rpc/lib/web.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/account.ex b/apps/omg_watcher_rpc/lib/web/controllers/account.ex index e8ed29030e..3e4cee1b63 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/account.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/account.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/alarm.ex b/apps/omg_watcher_rpc/lib/web/controllers/alarm.ex index 05b767460d..6ec13b32aa 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/alarm.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/alarm.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/block.ex b/apps/omg_watcher_rpc/lib/web/controllers/block.ex index 2a860f3594..d58f8b032a 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/block.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/block.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/challenge.ex b/apps/omg_watcher_rpc/lib/web/controllers/challenge.ex index 7322741ba0..bdafb622e5 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/challenge.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/challenge.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/configuration.ex b/apps/omg_watcher_rpc/lib/web/controllers/configuration.ex index 17d65ddd7e..6d09cba1dc 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/configuration.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/deposit.ex b/apps/omg_watcher_rpc/lib/web/controllers/deposit.ex index 16cc1881e7..7a3868a5b1 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/deposit.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/deposit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/fallback.ex b/apps/omg_watcher_rpc/lib/web/controllers/fallback.ex index 028d1cb12a..0bfbb261ea 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/fallback.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/fallback.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/fee.ex b/apps/omg_watcher_rpc/lib/web/controllers/fee.ex index 162c4e2ccd..f63e503bc1 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/fee.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/fee.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/in_flight_exit.ex b/apps/omg_watcher_rpc/lib/web/controllers/in_flight_exit.ex index 0771bb76f1..5999ffef50 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/in_flight_exit.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/in_flight_exit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/stats.ex b/apps/omg_watcher_rpc/lib/web/controllers/stats.ex index 17ba2632db..3a962cae5e 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/stats.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/stats.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/status.ex b/apps/omg_watcher_rpc/lib/web/controllers/status.ex index e524081159..def7348540 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/status.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/status.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/transaction.ex b/apps/omg_watcher_rpc/lib/web/controllers/transaction.ex index 742f6a4b89..1905e26bac 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/transaction.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/controllers/utxo.ex b/apps/omg_watcher_rpc/lib/web/controllers/utxo.ex index b9d9101c4c..859e4c6c70 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/utxo.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/utxo.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/endpoint.ex b/apps/omg_watcher_rpc/lib/web/endpoint.ex index 5d521aa85c..9a35beedc5 100644 --- a/apps/omg_watcher_rpc/lib/web/endpoint.ex +++ b/apps/omg_watcher_rpc/lib/web/endpoint.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/plugs/health.ex b/apps/omg_watcher_rpc/lib/web/plugs/health.ex index daedca0055..8a45c4e07f 100644 --- a/apps/omg_watcher_rpc/lib/web/plugs/health.ex +++ b/apps/omg_watcher_rpc/lib/web/plugs/health.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/plugs/method_param_filter.ex b/apps/omg_watcher_rpc/lib/web/plugs/method_param_filter.ex index 1d326b65dd..dd00d8aedb 100644 --- a/apps/omg_watcher_rpc/lib/web/plugs/method_param_filter.ex +++ b/apps/omg_watcher_rpc/lib/web/plugs/method_param_filter.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/plugs/supported_watcher_modes.ex b/apps/omg_watcher_rpc/lib/web/plugs/supported_watcher_modes.ex index 4365e5f5b9..e0d5095c75 100644 --- a/apps/omg_watcher_rpc/lib/web/plugs/supported_watcher_modes.ex +++ b/apps/omg_watcher_rpc/lib/web/plugs/supported_watcher_modes.ex @@ -1,4 +1,4 @@ -# Copyright 2019 OmiseGO Pte Ltd +# Copyright 2019 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/response.ex b/apps/omg_watcher_rpc/lib/web/response.ex index 56f2e41cf5..a6ad1fe9f6 100644 --- a/apps/omg_watcher_rpc/lib/web/response.ex +++ b/apps/omg_watcher_rpc/lib/web/response.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/router.ex b/apps/omg_watcher_rpc/lib/web/router.ex index 604371ef2e..a99e7f96da 100644 --- a/apps/omg_watcher_rpc/lib/web/router.ex +++ b/apps/omg_watcher_rpc/lib/web/router.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/serializers/base.ex b/apps/omg_watcher_rpc/lib/web/serializers/base.ex index dff1cf6008..0aebeaa8b5 100644 --- a/apps/omg_watcher_rpc/lib/web/serializers/base.ex +++ b/apps/omg_watcher_rpc/lib/web/serializers/base.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/sockets/socket.ex b/apps/omg_watcher_rpc/lib/web/sockets/socket.ex index 66757aa458..2fe4c67ea5 100644 --- a/apps/omg_watcher_rpc/lib/web/sockets/socket.ex +++ b/apps/omg_watcher_rpc/lib/web/sockets/socket.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/validators/account_constraints.ex b/apps/omg_watcher_rpc/lib/web/validators/account_constraints.ex index 991d16d58a..89d35d8c62 100644 --- a/apps/omg_watcher_rpc/lib/web/validators/account_constraints.ex +++ b/apps/omg_watcher_rpc/lib/web/validators/account_constraints.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/validators/block_constraints.ex b/apps/omg_watcher_rpc/lib/web/validators/block_constraints.ex index 2943aae4d7..9659ffb408 100644 --- a/apps/omg_watcher_rpc/lib/web/validators/block_constraints.ex +++ b/apps/omg_watcher_rpc/lib/web/validators/block_constraints.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/validators/deposit_constraints.ex b/apps/omg_watcher_rpc/lib/web/validators/deposit_constraints.ex index f35658c46b..53bd8d6445 100644 --- a/apps/omg_watcher_rpc/lib/web/validators/deposit_constraints.ex +++ b/apps/omg_watcher_rpc/lib/web/validators/deposit_constraints.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/validators/helpers.ex b/apps/omg_watcher_rpc/lib/web/validators/helpers.ex index 9e8bea4a3d..9c74f78b23 100644 --- a/apps/omg_watcher_rpc/lib/web/validators/helpers.ex +++ b/apps/omg_watcher_rpc/lib/web/validators/helpers.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/validators/merge_constraints.ex b/apps/omg_watcher_rpc/lib/web/validators/merge_constraints.ex index 3a18d96673..95e619e7a8 100644 --- a/apps/omg_watcher_rpc/lib/web/validators/merge_constraints.ex +++ b/apps/omg_watcher_rpc/lib/web/validators/merge_constraints.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/validators/order.ex b/apps/omg_watcher_rpc/lib/web/validators/order.ex index c8083a4d27..2bf622ec9b 100644 --- a/apps/omg_watcher_rpc/lib/web/validators/order.ex +++ b/apps/omg_watcher_rpc/lib/web/validators/order.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/validators/transaction_constraints.ex b/apps/omg_watcher_rpc/lib/web/validators/transaction_constraints.ex index 72fa8c67a8..6285942422 100644 --- a/apps/omg_watcher_rpc/lib/web/validators/transaction_constraints.ex +++ b/apps/omg_watcher_rpc/lib/web/validators/transaction_constraints.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/validators/typed_data_signed.ex b/apps/omg_watcher_rpc/lib/web/validators/typed_data_signed.ex index 11ba3a485b..1c3dcfab2f 100644 --- a/apps/omg_watcher_rpc/lib/web/validators/typed_data_signed.ex +++ b/apps/omg_watcher_rpc/lib/web/validators/typed_data_signed.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/account.ex b/apps/omg_watcher_rpc/lib/web/views/account.ex index 76d992e462..1b5109d5ae 100644 --- a/apps/omg_watcher_rpc/lib/web/views/account.ex +++ b/apps/omg_watcher_rpc/lib/web/views/account.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/alarm.ex b/apps/omg_watcher_rpc/lib/web/views/alarm.ex index 9c569785ed..f93c881543 100644 --- a/apps/omg_watcher_rpc/lib/web/views/alarm.ex +++ b/apps/omg_watcher_rpc/lib/web/views/alarm.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/block.ex b/apps/omg_watcher_rpc/lib/web/views/block.ex index 8bb88dcf83..37e5989e6c 100644 --- a/apps/omg_watcher_rpc/lib/web/views/block.ex +++ b/apps/omg_watcher_rpc/lib/web/views/block.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/challenge.ex b/apps/omg_watcher_rpc/lib/web/views/challenge.ex index acdcdcb97f..56b637b134 100644 --- a/apps/omg_watcher_rpc/lib/web/views/challenge.ex +++ b/apps/omg_watcher_rpc/lib/web/views/challenge.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/configuration.ex b/apps/omg_watcher_rpc/lib/web/views/configuration.ex index 3d2da4d719..4b2f987d04 100644 --- a/apps/omg_watcher_rpc/lib/web/views/configuration.ex +++ b/apps/omg_watcher_rpc/lib/web/views/configuration.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/deposit.ex b/apps/omg_watcher_rpc/lib/web/views/deposit.ex index 1c605c2ea6..75c62899a1 100644 --- a/apps/omg_watcher_rpc/lib/web/views/deposit.ex +++ b/apps/omg_watcher_rpc/lib/web/views/deposit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/error.ex b/apps/omg_watcher_rpc/lib/web/views/error.ex index 571897d7b7..a5fb641e34 100644 --- a/apps/omg_watcher_rpc/lib/web/views/error.ex +++ b/apps/omg_watcher_rpc/lib/web/views/error.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/fee.ex b/apps/omg_watcher_rpc/lib/web/views/fee.ex index 48c24920ff..91cee4bb64 100644 --- a/apps/omg_watcher_rpc/lib/web/views/fee.ex +++ b/apps/omg_watcher_rpc/lib/web/views/fee.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/in_flight_exit.ex b/apps/omg_watcher_rpc/lib/web/views/in_flight_exit.ex index 261a1b6237..9704e52c0f 100644 --- a/apps/omg_watcher_rpc/lib/web/views/in_flight_exit.ex +++ b/apps/omg_watcher_rpc/lib/web/views/in_flight_exit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/stats.ex b/apps/omg_watcher_rpc/lib/web/views/stats.ex index eda8dd53c0..aeb1b0db38 100644 --- a/apps/omg_watcher_rpc/lib/web/views/stats.ex +++ b/apps/omg_watcher_rpc/lib/web/views/stats.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/status.ex b/apps/omg_watcher_rpc/lib/web/views/status.ex index e69fb64870..0f724faad3 100644 --- a/apps/omg_watcher_rpc/lib/web/views/status.ex +++ b/apps/omg_watcher_rpc/lib/web/views/status.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/transaction.ex b/apps/omg_watcher_rpc/lib/web/views/transaction.ex index 32b7f94728..4c4bc2277a 100644 --- a/apps/omg_watcher_rpc/lib/web/views/transaction.ex +++ b/apps/omg_watcher_rpc/lib/web/views/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/lib/web/views/utxo.ex b/apps/omg_watcher_rpc/lib/web/views/utxo.ex index 6f4701e962..433000d1fe 100644 --- a/apps/omg_watcher_rpc/lib/web/views/utxo.ex +++ b/apps/omg_watcher_rpc/lib/web/views/utxo.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/mix.exs b/apps/omg_watcher_rpc/mix.exs index bfa3693155..e4080f0ce3 100644 --- a/apps/omg_watcher_rpc/mix.exs +++ b/apps/omg_watcher_rpc/mix.exs @@ -2,9 +2,16 @@ defmodule OMG.WatcherRPC.Mixfile do use Mix.Project def project() do + version = + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + [ app: :omg_watcher_rpc, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", config_path: "../../config/config.exs", deps_path: "../../deps", @@ -25,6 +32,14 @@ defmodule OMG.WatcherRPC.Mixfile do ] end + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") + end + # Specifies which paths to compile per environment. defp elixirc_paths(:prod), do: ["lib"] defp elixirc_paths(:dev), do: ["lib"] diff --git a/apps/omg_watcher_rpc/priv/swagger/info_api_specs.yaml b/apps/omg_watcher_rpc/priv/swagger/info_api_specs.yaml index 851d12929b..e951233f1c 100644 --- a/apps/omg_watcher_rpc/priv/swagger/info_api_specs.yaml +++ b/apps/omg_watcher_rpc/priv/swagger/info_api_specs.yaml @@ -4,13 +4,13 @@ info: title: Watcher Info API description: | API specification of the Watcher's Informational Service - Error codes are available in [html](https://github.com/omisego/elixir-omg/blob/master/docs/api_specs/errors.md#error-codes-description) format. + Error codes are available in [html](https://github.com/omgnetwork/elixir-omg/blob/master/docs/api_specs/errors.md#error-codes-description) format. contact: - name: OmiseGO - email: omisego@omisego.co + name: OMG Network + email: engineering@omg.network license: name: 'Apache 2.0: https://www.apache.org/licenses/LICENSE-2.0' - url: 'https://omisego.network/' + url: 'https://omg.network/' servers: - url: 'https://watcher-info.ropsten.v1.omg.network/' - url: 'http://localhost:7534/' diff --git a/apps/omg_watcher_rpc/priv/swagger/info_api_specs/swagger.yaml b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/swagger.yaml index 3f954387fd..a4221109e2 100644 --- a/apps/omg_watcher_rpc/priv/swagger/info_api_specs/swagger.yaml +++ b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/swagger.yaml @@ -5,13 +5,13 @@ info: description: > API specification of the Watcher's Informational Service - Error codes are available in [html](https://github.com/omisego/elixir-omg/blob/master/docs/api_specs/errors.md#error-codes-description) format. + Error codes are available in [html](https://github.com/omgnetwork/elixir-omg/blob/master/docs/api_specs/errors.md#error-codes-description) format. contact: - name: OmiseGO - email: omisego@omisego.co + name: OMG Network + email: engineering@omg.network license: name: 'Apache 2.0: https://www.apache.org/licenses/LICENSE-2.0' - url: 'https://omisego.network/' + url: 'https://omg.network/' servers: - url: https://watcher-info.ropsten.v1.omg.network/ diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml index 1fc23921bd..6838f1a447 100644 --- a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml @@ -4,13 +4,13 @@ info: title: Watcher security-critical API description: | API specification of the Watcher's security-critical Service - Error codes are available in [html](https://github.com/omisego/elixir-omg/blob/master/docs/api_specs/errors.md#error-codes-description) format. + Error codes are available in [html](https://github.com/omgnetwork/elixir-omg/blob/master/docs/api_specs/errors.md#error-codes-description) format. contact: - name: OmiseGO - email: omisego@omisego.co + name: OMG Network + email: engineering@omg.network license: name: 'Apache 2.0: https://www.apache.org/licenses/LICENSE-2.0' - url: 'https://omisego.network/' + url: 'https://omg.network/' servers: - url: 'https://watcher.ropsten.v1.omg.network/' - url: 'http://localhost:7434/' @@ -19,7 +19,7 @@ tags: description: Status of the child chain. externalDocs: description: Byzantine events description - url: 'https://github.com/omisego/elixir-omg/blob/master/docs/api_specs/status_events_specs.md#byzantine-events' + url: 'https://github.com/omgnetwork/elixir-omg/blob/master/docs/api_specs/status_events_specs.md#byzantine-events' - name: Account description: Account related API. - name: Block diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml index d16507831a..b3301dfd79 100644 --- a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml @@ -5,13 +5,13 @@ info: description: > API specification of the Watcher's security-critical Service - Error codes are available in [html](https://github.com/omisego/elixir-omg/blob/master/docs/api_specs/errors.md#error-codes-description) format. + Error codes are available in [html](https://github.com/omgnetwork/elixir-omg/blob/master/docs/api_specs/errors.md#error-codes-description) format. contact: - name: OmiseGO - email: omisego@omisego.co + name: OMG Network + email: engineering@omg.network license: name: 'Apache 2.0: https://www.apache.org/licenses/LICENSE-2.0' - url: 'https://omisego.network/' + url: 'https://omg.network/' servers: - url: https://watcher.ropsten.v1.omg.network/ @@ -22,7 +22,7 @@ tags: description: Status of the child chain. externalDocs: description: "Byzantine events description" - url: "https://github.com/omisego/elixir-omg/blob/master/docs/api_specs/status_events_specs.md#byzantine-events" + url: "https://github.com/omgnetwork/elixir-omg/blob/master/docs/api_specs/status_events_specs.md#byzantine-events" - name: Account description: Account related API. - name: Block diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/release_tasks/set_endpoint_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/release_tasks/set_endpoint_test.exs index 91001679e5..ed45008489 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/release_tasks/set_endpoint_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/release_tasks/set_endpoint_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/release_tasks/set_tracer_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/release_tasks/set_tracer_test.exs index 184ddec91b..4a1d294e10 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/release_tasks/set_tracer_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/release_tasks/set_tracer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/tracer_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/tracer_test.exs index f93dc74508..ff32aa1dad 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/tracer_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/tracer_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/conn_case.ex b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/conn_case.ex index 32163dacc9..9374e1a1e3 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/conn_case.ex +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/conn_case.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/account_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/account_test.exs index 15b906caef..12a204971b 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/account_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/account_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/alarm_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/alarm_test.exs index 37a75bdb22..03b8c48710 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/alarm_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/alarm_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -73,7 +73,7 @@ defmodule OMG.WatcherRPC.Web.Controller.AlarmTest do ] for header <- required_headers do - assert header in Keyword.keys(response.resp_headers) + assert header in Enum.map(response.resp_headers, &elem(&1, 0)) end # CORS check diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/block_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/block_test.exs index 1a1099c335..ffa1a4aebd 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/block_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/block_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/challenge_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/challenge_test.exs index 239ff0e41c..cceed054ad 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/challenge_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/challenge_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/deposit_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/deposit_test.exs index 8d60799eee..8671e98a4c 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/deposit_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/deposit_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ defmodule OMG.WatcherRPC.Web.Controller.DepositTest do use ExUnitFixtures - use ExUnit.Case, async: true + use ExUnit.Case, async: false use OMG.WatcherInfo.Fixtures import OMG.WatcherInfo.Factory diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/enforce_content_plug_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/enforce_content_plug_test.exs index 19582a4242..6f0feefab9 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/enforce_content_plug_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/enforce_content_plug_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/fallback_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/fallback_test.exs index 6d9b0bfdd7..8092fe9758 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/fallback_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/fallback_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/fee_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/fee_test.exs index 53f8a129d2..dbbdff5ea4 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/fee_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/fee_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/in_flight_exit_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/in_flight_exit_test.exs index 619b96be55..9fb3ca7b70 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/in_flight_exit_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/in_flight_exit_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/stats_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/stats_test.exs index 11257f3955..e64c34111d 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/stats_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/stats_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/status_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/status_test.exs index e04284db53..1952be23ae 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/status_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/status_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/transaction_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/transaction_test.exs index 78e078aae9..326bd5faff 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/transaction_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/transaction_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/utxo_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/utxo_test.exs index 573000fba6..62413c385a 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/utxo_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/controllers/utxo_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/data_case.ex b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/data_case.ex index 50c90f9f57..af2aa7b982 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/data_case.ex +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/data_case.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/plugs/method_param_filter_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/plugs/method_param_filter_test.exs index 530b1f492d..012044f3b2 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/plugs/method_param_filter_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/plugs/method_param_filter_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/plugs/supported_watcher_modes_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/plugs/supported_watcher_modes_test.exs index c7c0067b19..5cd1a80c9c 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/plugs/supported_watcher_modes_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/plugs/supported_watcher_modes_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/response_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/response_test.exs index c1580b9a8f..876d902ac5 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/response_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/response_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/router_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/router_test.exs index 6d79e3802f..51362c7e64 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/router_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/router_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/account_contraints_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/account_contraints_test.exs index 68db12ad13..db2814f327 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/account_contraints_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/account_contraints_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/block_constraints_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/block_constraints_test.exs index c82158ff2e..b7d77a85ea 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/block_constraints_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/block_constraints_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/merge_constraints_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/merge_constraints_test.exs index 6eecc0a4eb..3156a204d7 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/merge_constraints_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/merge_constraints_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/transaction_constraints_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/transaction_constraints_test.exs index d625ce7ea6..3c6e65e5dd 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/transaction_constraints_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/transaction_constraints_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/typed_data_signed_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/typed_data_signed_test.exs index 6946ebdf02..39df7bff95 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/typed_data_signed_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/validators/typed_data_signed_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/view_case.ex b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/view_case.ex index 482831026d..e50947b2b0 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/view_case.ex +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/view_case.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/views/transaction_test.exs b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/views/transaction_test.exs index 89c026ad6d..8894a4fb94 100644 --- a/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/views/transaction_test.exs +++ b/apps/omg_watcher_rpc/test/omg_watcher_rpc/web/views/transaction_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/omg_watcher_rpc/test/test_helper.exs b/apps/omg_watcher_rpc/test/test_helper.exs index 93645aae60..8f7ffa5f19 100644 --- a/apps/omg_watcher_rpc/test/test_helper.exs +++ b/apps/omg_watcher_rpc/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/xomg_tasks/lib/mix/tasks/watcher.ex b/apps/xomg_tasks/lib/mix/tasks/watcher.ex index 81896d2238..2a5d65cdb0 100644 --- a/apps/xomg_tasks/lib/mix/tasks/watcher.ex +++ b/apps/xomg_tasks/lib/mix/tasks/watcher.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/xomg_tasks/lib/mix/tasks/watcher_info.ex b/apps/xomg_tasks/lib/mix/tasks/watcher_info.ex index 8421b00d30..4ad7ce6deb 100644 --- a/apps/xomg_tasks/lib/mix/tasks/watcher_info.ex +++ b/apps/xomg_tasks/lib/mix/tasks/watcher_info.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/xomg_tasks/lib/utils.ex b/apps/xomg_tasks/lib/utils.ex index 85ef428d39..cbc7899a85 100644 --- a/apps/xomg_tasks/lib/utils.ex +++ b/apps/xomg_tasks/lib/utils.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/apps/xomg_tasks/mix.exs b/apps/xomg_tasks/mix.exs index b1ed6dd1b5..e87a7c237e 100644 --- a/apps/xomg_tasks/mix.exs +++ b/apps/xomg_tasks/mix.exs @@ -9,7 +9,7 @@ defmodule OMG.XomgTasks.MixProject do def project() do [ app: :xomg_tasks, - version: "#{String.trim(File.read!("../../VERSION"))}", + version: version(), build_path: "../../_build", deps_path: "../../deps", lockfile: "../../mix.lock", @@ -21,6 +21,14 @@ defmodule OMG.XomgTasks.MixProject do end def application() do - [] + [extra_applications: [:iex, :logger]] + end + + defp version() do + "git" + |> System.cmd(["describe", "--tags", "--abbrev=0"]) + |> elem(0) + |> String.replace("v", "") + |> String.replace("\n", "") end end diff --git a/apps/xomg_tasks/test/test_helper.exs b/apps/xomg_tasks/test/test_helper.exs index 33d0ff9d5d..8154b614a5 100644 --- a/apps/xomg_tasks/test/test_helper.exs +++ b/apps/xomg_tasks/test/test_helper.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/bin/rocksdb b/bin/rocksdb new file mode 100755 index 0000000000..b85893a18d --- /dev/null +++ b/bin/rocksdb @@ -0,0 +1,58 @@ +#!/usr/bin/env sh + +fancy_echo() { + local fmt="$1"; shift + + # shellcheck disable=SC2059 + printf "\\n$fmt\\n" "$@" +} + +install_linux_rocksdb(){ + echo "Installing Rocksdb v6.14.5" + mkdir tmp_rocksdb \ + && cd tmp_rocksdb \ + && git clone https://github.com/facebook/rocksdb.git \ + && cd rocksdb \ + && git checkout v6.14.5 \ + && make shared_lib \ + && sudo mkdir -p /usr/local/rocksdb/lib \ + && sudo mkdir -p /usr/local/rocksdb/include \ + && sudo cp -P librocksdb.so* /usr/local/rocksdb/lib \ + && sudo cp -P /usr/local/rocksdb/lib/librocksdb.so* /usr/lib/ \ + && sudo cp -rP include /usr/local/rocksdb/ \ + && sudo cp -rP include/* /usr/include/ \ + && cd ../../ \ + && rm -rf tmp_rocksdb +} + +install_rocksdb_source(){ + git clone https://github.com/facebook/rocksdb.git + cd rocksdb/ + git checkout tags/v6.14.5 + make clean + make static_lib + make shared_lib + make install INSTALL_PATH=/usr/local/Cellar/rocksdb/6.14.5 +} + + +install_deps() { + local sys=`uname -s` + echo $sys + case $sys in + Linux*) + install_linux_rocksdb + ;; + Darwin*) + install_rocksdb_source + ;; + *) + fancy_echo "Unknown system" + exit 1 + ;; + esac +} +# Exit if any subcommand fails +set -e + +install_deps \ No newline at end of file diff --git a/bin/setup b/bin/setup index aabcdd9643..99faab3cfd 100755 --- a/bin/setup +++ b/bin/setup @@ -54,24 +54,6 @@ install_linux_geth(){ && rm -r gethDownload } -install_linux_rocksdb(){ - echo "Installing Rocksdb v6.2.2" - mkdir tmp_rocksdb \ - && cd tmp_rocksdb \ - && git clone https://github.com/facebook/rocksdb.git \ - && cd rocksdb \ - && git checkout v6.2.2 \ - && make shared_lib \ - && sudo mkdir -p /usr/local/rocksdb/lib \ - && sudo mkdir -p /usr/local/rocksdb/include \ - && sudo cp -P librocksdb.so* /usr/local/rocksdb/lib \ - && sudo cp -P /usr/local/rocksdb/lib/librocksdb.so* /usr/lib/ \ - && sudo cp -rP include /usr/local/rocksdb/ \ - && sudo cp -rP include/* /usr/include/ \ - && cd ../../ \ - && rm -rf tmp_rocksdb -} - install_darwin_deps(){ fancy_echo "Installing dependencies via brew" brew bundle --file=- < emit additionally an `:unchallenged_exit` event which promts mass exit 4. Spend UTXOs in `OMG.State` on exit finalization * if the spent UTXO is present at the moment, forget the exit from validation - this is a valid finalization - * if the spent UTXO is missing, keep on emitting `:unchallenged_exit` (until [issue #1318 is solved](github.com/omisego/elixir-omg/issues/1318)) - this is an invalid finalization. + * if the spent UTXO is missing, keep on emitting `:unchallenged_exit` (until [issue #1318 is solved](https://github.com/omgnetwork/elixir-omg/issues/1318)) - this is an invalid finalization. 5. `ExitProcessor` recognizes exits that are (as seen at the tip of the root chain) already gone, when pulled from old logs. This prevents spurious event raising during syncing. -This is the current behavior ("inactive on recognition"), to be substituted by a more verbose one in [#1318](github.com/omisego/elixir-omg/issues/1318) +This is the current behavior ("inactive on recognition"), to be substituted by a more verbose one in [#1318](https://github.com/omgnetwork/elixir-omg/issues/1318) 6. Checking the validation of exits is user's responsibility. This is done by calling `/status.get` endpoint. @@ -132,5 +132,5 @@ An alternative is to always check the current status of every exit, before takin All the above rules will apply analogically to in-flight exits. See [MoreVP](./morevp.md) for specs and introduction to in-flight exits. Invalid attempts to do an in-flight related action prompt challenges. -Absence of challenges within the `sla_margin`, as well as invalid finalization, should result in client prompting to mass exit (to be implemented in [issue #1275](github.com/omisego/elixir-omg/issues/1275)). +Absence of challenges within the `sla_margin`, as well as invalid finalization, should result in client prompting to mass exit (to be implemented in [issue #1275](https://github.com/omgnetwork/elixir-omg/issues/1275)). `OMG.State` is modified on IFE finalization. diff --git a/docs/fee_design.md b/docs/fee_design.md index 62eed746ab..3b52f81607 100644 --- a/docs/fee_design.md +++ b/docs/fee_design.md @@ -133,9 +133,9 @@ As a result, a high level steps of adding fee exit feature would be: ## Reference -* Tetsuji blockchain fee design: https://github.com/omisego/elixir-omg/blob/master/docs/tesuji_blockchain_design.md#fees +* Tetsuji blockchain fee design: https://github.com/omgnetwork/elixir-omg/blob/master/docs/tesuji_blockchain_design.md#fees * Scope of Five Guys -* Fee exit high level discussion: https://github.com/omisego/plasma-contracts/issues/165 +* Fee exit high level discussion: https://github.com/omgnetwork/plasma-contracts/issues/165 ## FAQ @@ -155,7 +155,7 @@ Q3: Since smart contracts do not check the fee logic, how do we handle in-flight > In the future, we are planning to include the IFE transaction into the block if not already there. We might only include the transactions that follows the fee rules to a block. If an IFE occurs that does not follow the fee rules, it can still be a valid in-flight exit and be processed. -> See: https://github.com/omisego/elixir-omg/issues/994 +> See: https://github.com/omgnetwork/elixir-omg/issues/994 Q4: Should we collect fees when spending the fee transaction's output to a *payment* transaction? diff --git a/docs/install.md b/docs/install.md index 1475e74e79..81e7439978 100644 --- a/docs/install.md +++ b/docs/install.md @@ -34,7 +34,7 @@ mix do local.hex --force, local.rebar --force ## Clone repo ``` -git clone https://github.com/omisego/elixir-omg +git clone https://github.com/omgnetwork/elixir-omg ``` ## Build @@ -54,5 +54,5 @@ mix test To run integration tests (requires **not** having `geth` running in the background): ``` make init_test -mix test --trace --only integration +mix test --only integration ``` diff --git a/docs/morevp.md b/docs/morevp.md index a522826333..48e0d3587b 100644 --- a/docs/morevp.md +++ b/docs/morevp.md @@ -1,7 +1,7 @@ # More Viable Plasma This document is based on the original [More Viable Plasma post](https://ethresear.ch/t/more-viable-plasma/2160/49) on ethresearch. -This document has been moved from the document created in [the research repo](https://github.com/omisego/research/pull/44). +This document has been moved from the document created in [the research repo](https://github.com/omgnetwork/research/pull/44). See there for the original work and discussion done on this design. ## Introduction diff --git a/docs/perf_test_result_dumps.md b/docs/perf_test_result_dumps.md index 6fc2117d32..a86790c2f0 100644 --- a/docs/perf_test_result_dumps.md +++ b/docs/perf_test_result_dumps.md @@ -119,7 +119,7 @@ and ## `53dc46f80eca374c64983aacd37bd6851ec794f4`, 2019-06-28 -(perf drop introduced as documented in [#731](https://github.com/omisego/elixir-omg/issues/731)) +(perf drop introduced as documented in [#731](https://github.com/omgnetwork/elixir-omg/issues/731)) Command as above diff --git a/docs/source_consumption_log.md b/docs/source_consumption_log.md index b51a47ad79..4ca443a9cb 100644 --- a/docs/source_consumption_log.md +++ b/docs/source_consumption_log.md @@ -29,7 +29,7 @@ ecto 3.1.5 -> Apache 2.0 erlang-rocksdb 1.2.0 -> Apache 2.0 erlexec 1.7.5 -> BSD ethereumex 0.5.4 -> MIT -ex_rlp 0.5.2 -> MIT +ex_rlp 0.5.3 -> MIT ex_unit_fixtures -> MIT exexec 0.1.0 -> Apache 2.0 exth_crypto 0.1.4 -> MIT diff --git a/docs/stack_architecture.md b/docs/stack_architecture.md index f8c8adeb82..b3f63befd1 100644 --- a/docs/stack_architecture.md +++ b/docs/stack_architecture.md @@ -1,4 +1,4 @@ -# OmiseGO Client Architecture +# OMG Network Client Architecture This describes the client services stack that communicates with the child chain and root chain to secure the entire Plasma construction and ease application development. An application provider will run these client services on their own or use hosted versions. @@ -37,10 +37,10 @@ The watcher first and foremost plays a critical security role in the system. The #### Specifications -- [Current API](https://developer.omisego.co/elixir-omg/docs-ui/?url=0.2/security_critical_api_specs.yaml) +- [Current API](https://docs.omg.network/elixir-omg/docs-ui/?url=master%2Foperator_api_specs.yaml&urls.primaryName=master%2Finfo_api_specs) - Events - - [Byzantine Events](https://github.com/omisego/elixir-omg/blob/master/docs/api_specs/status_events_specs.md#byzantine-events) + - [Byzantine Events](https://github.com/omgnetwork/elixir-omg/blob/master/docs/api_specs/status_events_specs.md#byzantine-events) ### Informational API Service @@ -56,7 +56,7 @@ Non-critical convenience API proxy and provide data about the chain. #### Specifications -- [Current API](https://developer.omisego.co/elixir-omg/docs-ui/?url=0.2/info_api_specs.yaml) +- [Current API](https://docs.omg.network/elixir-omg/docs-ui/?url=master%2Foperator_api_specs.yaml&urls.primaryName=master%2Finfo_api_specs) ### Integration libraries @@ -76,14 +76,14 @@ Native wrappers to the Watcher and Informational API Service for supported langu #### Current implementations -- [omg-js-lib](https://github.com/omisego/omg-js) +- [omg-js-lib](https://github.com/omgnetwork/omg-js) ### Application Layer #### Purpose -Third party applications that use the OmiseGO Network for value transfer and exchange. +Third party applications that use the OMG Network for value transfer and exchange. #### Design principles diff --git a/docs/standard_vs_in_flight_exits_interaction.md b/docs/standard_vs_in_flight_exits_interaction.md index 79a49c12ae..6e4449e293 100644 --- a/docs/standard_vs_in_flight_exits_interaction.md +++ b/docs/standard_vs_in_flight_exits_interaction.md @@ -15,9 +15,9 @@ To be able to flag all finalized outputs, we would need a global schema for all 1. For normal transaction outputs: `OutputId = hash(txBytes, outputIndex)` 2. For deposit transaction outputs: `OutputId = hash(txBytes, outputIndex, utxoPos)` -We add `utxoPos` as a salt for deposit transaction output because deposit transaction can potentially have same `txBytes` as another deposit transactions (see: [this issue](https://github.com/omisego/plasma-contracts/issues/80)), a naive `hash(txBytes, outputIndex)` would collide when `txBytes` are not unique. +We add `utxoPos` as a salt for deposit transaction output because deposit transaction can potentially have same `txBytes` as another deposit transactions (see: [this issue](https://github.com/omgnetwork/plasma-contracts/issues/80)), a naive `hash(txBytes, outputIndex)` would collide when `txBytes` are not unique. -Also, there was discussion to abstract the output identifier to be more flexible, see [this note](https://github.com/omisego/plasma-contracts/issues/387). But as the first version of Plasma Framework, we decided to go forward with using `OutputId` as a global schema to flag all outputs. +Also, there was discussion to abstract the output identifier to be more flexible, see [this note](https://github.com/omgnetwork/plasma-contracts/issues/387). But as the first version of Plasma Framework, we decided to go forward with using `OutputId` as a global schema to flag all outputs. #### Standard Exit scenario @@ -27,18 +27,18 @@ A standard exit would only impact an output. Thus, in the case of SE, only one o An in-flight exit would impact all inputs and outputs of the in-flight exit transaction. If the IFE is canonical, it would exit the unchallenged piggybacked outputs. On the other hand, if the IFE is non-canonical, the unchallenged piggybacked inputs would be exited. -If any of the in-flight exit input is flagged during `processExit`, that exit would be considered as non-canonical (for more detail on the reasons, see: [this issue](https://github.com/omisego/plasma-contracts/issues/470)). Otherwise, the canonicity would be decided by the canonicity challenge game of the in-flight exit. +If any of the in-flight exit input is flagged during `processExit`, that exit would be considered as non-canonical (for more detail on the reasons, see: [this issue](https://github.com/omgnetwork/plasma-contracts/issues/470)). Otherwise, the canonicity would be decided by the canonicity challenge game of the in-flight exit. If the in-flight exit is considered non-canonical during processing, we flag only the exiting inputs as spent. In other words, if the input is piggybacked, unchallenged and not flagged as spent yet, it would be exited and then be flagged as spent to the `PlasmaFramework`. On the other hand, if the in-flight exit is considered canonical, _all_ inputs plus the exiting outputs would be flagged. So if the output is piggybacked, unchallenged, and not flagged as spent yet, it would be exited and then be flagged as spent. Also all inputs would be flagged as well. -We flag all the inputs when canonical because the current interaction game would have some edge cases during data unavailability, operator can try to double spend via IFE. For more detail, see this issue: [here](https://github.com/omisego/plasma-contracts/issues/102). In short, current IFE interactive game design can potentially decide the canonicity differently during data unavailability to the real canonicity when there is full data availability. We mitigate this by using Kelvin's solution of flagging all inputs (see: [this comment](https://github.com/omisego/plasma-contracts/issues/102#issuecomment-495809967)). So even a mismatch canonicity happens, it cannot be double spent. +We flag all the inputs when canonical because the current interaction game would have some edge cases during data unavailability, operator can try to double spend via IFE. For more detail, see this issue: [here](https://github.com/omgnetwork/plasma-contracts/issues/102). In short, current IFE interactive game design can potentially decide the canonicity differently during data unavailability to the real canonicity when there is full data availability. We mitigate this by using Kelvin's solution of flagging all inputs (see: [this comment](https://github.com/omgnetwork/plasma-contracts/issues/102#issuecomment-495809967)). So even a mismatch canonicity happens, it cannot be double spent. #### Previous design on SE <> IFE interaction -Previously we had a set of rules and action on the SE <> IFE interaction. It takes some time to evolve to the current one. See the original doc on `0.2` branch used for `RootChain.sol`: https://github.com/omisego/elixir-omg/blob/v0.2/docs/standard_vs_in_flight_exits_interaction.md. +Previously we had a set of rules and action on the SE <> IFE interaction. It takes some time to evolve to the current one. See the original doc on `0.2` branch used for `RootChain.sol`: https://github.com/omgnetwork/elixir-omg/blob/v0.2.0/docs/standard_vs_in_flight_exits_interaction.md. We end up change the mechanism heavily for two reasons: 1. Simplicity on the rule @@ -48,7 +48,7 @@ Quite a lot of our current `id` schema comes from the previous doc, such as `exi Note that in previous design, `startInFlightExit` would auto challenge an existing standard exit. We removed such feature from the contract. As a result, watcher should add monitoring on such event when a standard exit can be challenged by an in-flight exit tx. -Also, see the discussion of changing the SE <> IFE interaction mechanism: https://github.com/omisego/plasma-contracts/issues/110 +Also, see the discussion of changing the SE <> IFE interaction mechanism: https://github.com/omgnetwork/plasma-contracts/issues/110 #### Current Implementation Of Payment Exit Game -For more details on our current implementation of Payment Exit Game: https://github.com/omisego/plasma-contracts/blob/master/plasma_framework/docs/design/payment-game-implementation-v1.md +For more details on our current implementation of Payment Exit Game: https://github.com/omgnetwork/plasma-contracts/blob/master/plasma_framework/docs/design/payment-game-implementation-v1.md diff --git a/docs/tesuji_blockchain_design.md b/docs/tesuji_blockchain_design.md index c5072c9dbb..72c2586122 100644 --- a/docs/tesuji_blockchain_design.md +++ b/docs/tesuji_blockchain_design.md @@ -1,6 +1,6 @@ # Tesuji Plasma Blockchain Design -This document describes in detail the blockchain (consensus) design used by the first iteration of OmiseGO Plasma-based implementation. +This document describes in detail the blockchain (consensus) design used by the first iteration of OMG Plasma-based implementation. The design is heavily based on [Minimal Viable Plasma design](https://ethresear.ch/t/minimal-viable-plasma/426), but incorporates several modifications. The reader is assumed to have prior knowledge of Ethereum and familiarity with general ideas behind [Plasma](http://plasma.io). @@ -211,7 +211,7 @@ If the child chain operator submits an invalid block or withholds a submitted bl ### Transactions -Transactions, their semantics and encoding are described in detail in the [Transactions section of the contracts integration document](https://github.com/omisego/plasma-contracts/blob/master/plasma_framework/docs/integration-docs/integration-doc.md#transactions), +Transactions, their semantics and encoding are described in detail in the [Transactions section of the contracts integration document](https://github.com/omgnetwork/plasma-contracts/blob/master/plasma_framework/docs/integration-docs/integration-doc.md#transactions), **NOTE** To create a valid transaction, a user needs to have access to inputs pointers (UTXO positions or OutputIDs or other) of all the UTXOs that they intend to spend. The Child Chain server doesn't provide this data, it is the responsibility of the Watcher (or Watcher Info) service intended to be ran by the users. diff --git a/docs/unified_api.md b/docs/unified_api.md index 036bab4b50..ee39de5d20 100644 --- a/docs/unified_api.md +++ b/docs/unified_api.md @@ -19,7 +19,7 @@ The eWallet already has a well defined API, using HTTP-RPC (rather than REST). - [eWallet Admin API](https://ewallet.staging.omisego.io/api/admin/docs.ui) - [eWallet Client API](https://ewallet.staging.omisego.io/api/client/docs.ui) -We can follow the same model and ensure consistency across all OmiseGO services. +We can follow the same model and ensure consistency across all OMG Network services. #### eWallet API characteristics The API is a collection of HTTP-RPC style method calls in the format @@ -84,7 +84,7 @@ RESPONSE 500 } } ``` -## OmiseGO Plasma API +## OMG Network Plasma API There are three services involved ### 1. ChildChain diff --git a/dummy b/dummy new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mix.exs b/mix.exs index 434259e601..fed576b03e 100644 --- a/mix.exs +++ b/mix.exs @@ -23,7 +23,7 @@ defmodule OMG.Umbrella.MixProject do test_paths: test_paths(), aliases: aliases(), # Docs - source_url: "https://github.com/omisego/elixir-omg", + source_url: "https://github.com/omgnetwork/elixir-omg", version: current_version(), releases: [ watcher: [ @@ -115,10 +115,9 @@ defmodule OMG.Umbrella.MixProject do {:licensir, "~> 0.2.0", only: :dev, runtime: false}, { :ex_unit_fixtures, - git: "https://github.com/omisego/ex_unit_fixtures.git", branch: "feature/require_files_not_load", only: [:test] + git: "https://github.com/omgnetwork/ex_unit_fixtures", branch: "feature/require_files_not_load", only: [:test] }, {:ex_doc, "~> 0.20.2", only: :dev, runtime: false}, - {:libsecp256k1, git: "https://github.com/omisego/libsecp256k1.git", branch: "elixir-only", override: true}, {:spandex, "~> 3.0.2"} ] end @@ -167,8 +166,10 @@ defmodule OMG.Umbrella.MixProject do defp docker(), do: if(System.get_env("DOCKER"), do: "_docker", else: "") defp current_version() do - sha = String.replace(elem(System.cmd("git", ["rev-parse", "--short=7", "HEAD"]), 0), "\n", "") - "#{String.trim(File.read!("VERSION"))}" <> "+" <> sha + "git" + |> System.cmd(["describe", "--tags"]) + |> elem(0) + |> String.replace("\n", "") end defp steps() do diff --git a/mix.lock b/mix.lock index 5ec3446207..bc0d149eda 100644 --- a/mix.lock +++ b/mix.lock @@ -1,34 +1,34 @@ %{ - "binary": {:hex, :binary, "0.0.5", "20d816f7274ea34f1b673b4cff2fdb9ebec9391a7a68c349070d515c66b1b2cf", [:mix], [], "hexpm", "ee1e9ebcab703a4e24db554957fbb540642fe9327eb9e295cb3f07dd7c11ddb2"}, "briefly": {:hex, :briefly, "0.3.0", "16e6b76d2070ebc9cbd025fa85cf5dbaf52368c4bd896fb482b5a6b95a540c2f", [:mix], [], "hexpm", "c6ebf8fc3dcd4950dd10c03e953fb4f553a8bcf0ff4c8c40d71542434cd7e046"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, "certifi": {:hex, :certifi, "2.5.2", "b7cfeae9d2ed395695dd8201c57a2d019c0c43ecaf8b8bcb9320b40d6662f340", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "3b3b5f36493004ac3455966991eaf6e768ce9884693d9968055aeeeb1e575040"}, - "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm", "4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"}, + "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, "cors_plug": {:hex, :cors_plug, "2.0.2", "2b46083af45e4bc79632bd951550509395935d3e7973275b2b743bd63cc942ce", [:mix], [{:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "f0d0e13f71c51fd4ef8b2c7e051388e4dfb267522a83a22392c856de7e46465f"}, "cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"}, "cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"}, "credo": {:hex, :credo, "1.5.1", "4fe303cc828412b9d21eed4eab60914c401e71f117f40243266aafb66f30d036", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "0b219ca4dcc89e4e7bc6ae7e6539c313e738e192e10b85275fa1e82b5203ecd7"}, - "db_connection": {:hex, :db_connection, "2.3.0", "d56ef906956a37959bcb385704fc04035f4f43c0f560dd23e00740daf8028c49", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm", "dcc082b8f723de9a630451b49fdbd7a59b065c4b38176fb147aaf773574d4520"}, + "db_connection": {:hex, :db_connection, "2.3.1", "4c9f3ed1ef37471cbdd2762d6655be11e38193904d9c5c1c9389f1b891a3088e", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm", "abaab61780dde30301d840417890bd9f74131041afd02174cf4e10635b3a63f5"}, "decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"}, "decorator": {:hex, :decorator, "1.3.2", "63b8ac9e23b28053390abdda33bb9e1f3dd9e8f9a981f47a06fc2f2fe2e2f772", [:mix], [], "hexpm", "b80bd089e3c8579e6d9ea84eed307b1597a0d94af25331e424a209477ad1a7fc"}, "dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"}, - "earmark": {:hex, :earmark, "1.4.10", "bddce5e8ea37712a5bfb01541be8ba57d3b171d3fa4f80a0be9bcf1db417bcaf", [:mix], [{:earmark_parser, ">= 1.4.10", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "12dbfa80810478e521d3ffb941ad9fbfcbbd7debe94e1341b4c4a1b2411c1c27"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.10", "6603d7a603b9c18d3d20db69921527f82ef09990885ed7525003c7fe7dc86c56", [:mix], [], "hexpm", "8e2d5370b732385db2c9b22215c3f59c84ac7dda7ed7e544d7c459496ae519c0"}, + "earmark": {:hex, :earmark, "1.4.12", "165bf9ce715fbe60df8e0c65eab213d15544dacaef438cdcd6ba430591e50f9b", [:mix], [{:earmark_parser, ">= 1.4.12", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "3bd688eb9e846322de1371d6baecb11bc075708a551c4d5d2c5a9827466d255c"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"}, "ecto": {:hex, :ecto, "3.5.5", "48219a991bb86daba6e38a1e64f8cea540cded58950ff38fbc8163e062281a07", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "98dd0e5e1de7f45beca6130d13116eae675db59adfa055fb79612406acf6f6f1"}, "ecto_sql": {:hex, :ecto_sql, "3.5.3", "1964df0305538364b97cc4661a2bd2b6c89d803e66e5655e4e55ff1571943efd", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.5.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2f53592432ce17d3978feb8f43e8dc0705e288b0890caf06d449785f018061c"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "erlexec": {:hex, :erlexec, "1.17.6", "467b5f883d32438644f155800c57d09b7cfa4ac4f4c485035915a5fa63d815de", [:rebar3], [], "hexpm", "7b8f0e37079c0c97ddf909ba43153afbb44b390f96893b1f94fe69e03939e13b"}, "ethereumex": {:hex, :ethereumex, "0.6.4", "58e998acb13b45a2b76b954b1d503f2f5f0e8118c0a14769c59264ef3ee4c301", [:mix], [{:httpoison, "~> 1.6", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1", [hex: :poolboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "abc0bed1ba691645700f55bc843be7d08a23284e20ad889cabe6279e13debb32"}, - "ex_abi": {:hex, :ex_abi, "0.4.0", "ff7e7f5b56c228b117e1f54e80c668a8f0424c275f233a50373548b70d99bd5c", [:mix], [{:exth_crypto, "~> 0.1.6", [hex: :exth_crypto, repo: "hexpm", optional: false]}], "hexpm", "2d33499de38c54531103e58530d0453863fb6149106327f691001873b0556e68"}, + "ex_abi": {:hex, :ex_abi, "0.5.1", "e12373d4511de65c8c7e40011fa40ac05bda687de819eb0f41fc36d4e96e7b04", [:mix], [{:ex_keccak, "~> 0.1.2", [hex: :ex_keccak, repo: "hexpm", optional: false]}], "hexpm", "a2d8b8030cb6af03e69dba7395b1929422d7cb15b8275d89844c2495acf9da1f"}, "ex_doc": {:hex, :ex_doc, "0.20.2", "1bd0dfb0304bade58beb77f20f21ee3558cc3c753743ae0ddbb0fd7ba2912331", [:mix], [{:earmark, "~> 1.3", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "8e24fc8ff9a50b9f557ff020d6c91a03cded7e59ac3e0eec8a27e771430c7d27"}, + "ex_keccak": {:hex, :ex_keccak, "0.1.2", "4548914dc250a919712f03b4574fd2d048cd6d1245481b559abe9e7b9adafbd3", [:mix], [{:rustler, "~> 0.21.1", [hex: :rustler, repo: "hexpm", optional: false]}], "hexpm", "da2a11b1f95727193865f9184b6af9e1665e82b84f3c531ab4b7323532dafebd"}, "ex_machina": {:hex, :ex_machina, "2.4.0", "09a34c5d371bfb5f78399029194a8ff67aff340ebe8ba19040181af35315eabb", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "a20bc9ddc721b33ea913b93666c5d0bdca5cbad7a67540784ae277228832d72c"}, - "ex_plasma": {:git, "https://github.com/omgnetwork/ex_plasma.git", "bd42028341d9232e11a084dbc5adac08c8bf5672", [ref: "bd42028341d9232e11a084dbc5adac08c8bf5672"]}, + "ex_plasma": {:git, "https://github.com/omgnetwork/ex_plasma.git", "867fee97dd930b47d22b5b32c4ef1751424c4206", [ref: "867fee97dd930b47d22b5b32c4ef1751424c4206"]}, "ex_rlp": {:hex, :ex_rlp, "0.5.3", "9055bddade545ee3e734aaad62c4b4d08211834da3beb43ae269b75785909e5e", [:mix], [], "hexpm", "a755a5f8f9f66079f3ecbe021536b949077fac0df963d9e59a20321bab28722d"}, - "ex_unit_fixtures": {:git, "https://github.com/omisego/ex_unit_fixtures.git", "4a099c621dc70e0d65cb9619b38192e31ec5f504", [branch: "feature/require_files_not_load"]}, + "ex_secp256k1": {:hex, :ex_secp256k1, "0.1.2", "affe4e0fa1adc085ab47d7ab3cc44d594249d24bd0a37a9002f6648d112c2081", [:mix], [{:rustler, "~> 0.21.1 ", [hex: :rustler, repo: "hexpm", optional: false]}], "hexpm", "8ae0131380ada331b15924b563f89e7f56b4e74cc10978f3ea0836589e87730a"}, + "ex_unit_fixtures": {:git, "https://github.com/omgnetwork/ex_unit_fixtures", "4a099c621dc70e0d65cb9619b38192e31ec5f504", [branch: "feature/require_files_not_load"]}, "excoveralls": {:hex, :excoveralls, "0.12.3", "2142be7cb978a3ae78385487edda6d1aff0e482ffc6123877bb7270a8ffbcfe0", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "568a3e616c264283f5dea5b020783ae40eef3f7ee2163f7a67cbd7b35bcadada"}, "exexec": {:hex, :exexec, "0.2.0", "a6ffc48cba3ac9420891b847e4dc7120692fb8c08c9e82220ebddc0bb8d96103", [:mix], [{:erlexec, "~> 1.10", [hex: :erlexec, repo: "hexpm", optional: false]}], "hexpm", "312cd1c9befba9e078e57f3541e4f4257eabda6eb9c348154fe899d6ac633299"}, - "exth_crypto": {:hex, :exth_crypto, "0.1.6", "8e636a9bcb75d8e32451be96e547a495121ed2178d078db294edb0f81f7cf2e8", [:mix], [{:binary, "~> 0.0.4", [hex: :binary, repo: "hexpm", optional: false]}, {:keccakf1600, "~> 2.0.0", [hex: :keccakf1600_orig, repo: "hexpm", optional: false]}, {:libsecp256k1, "~> 0.1.9", [hex: :libsecp256k1, repo: "hexpm", optional: false]}], "hexpm", "45d6faf4b889f8fc526deba059e0c7947423784ab1e7fa85be8db4c46cf4416b"}, "fake_server": {:hex, :fake_server, "2.1.0", "aefed08a587e2498fdb39ac9de6f9eabbe7bd83da9801d08d3574d61b7eb03d5", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm", "3200d57a523b27d2c8ebfc1a80b76697b3c8a06bf9d678d82114f5f98d350c75"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "hackney": {:hex, :hackney, "1.16.0", "5096ac8e823e3a441477b2d187e30dd3fff1a82991a806b2003845ce72ce2d84", [:rebar3], [{:certifi, "2.5.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.1", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.0", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.6", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "3bf0bebbd5d3092a3543b783bf065165fa5d3ad4b899b836810e513064134e18"}, @@ -36,16 +36,15 @@ "idna": {:hex, :idna, "6.0.1", "1d038fb2e7668ce41fbf681d2c45902e52b3cb9e9c77b55334353b222c2ee50c", [:rebar3], [{:unicode_util_compat, "0.5.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a02c8a1c4fd601215bb0b0324c8a6986749f807ce35f25449ec9e69758708122"}, "ink": {:hex, :ink, "1.2.0", "8dc46993a5cae17e392be5a2b5a0cb79b12c72ad7b31ca43f5fc586a20d5c429", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "26570ca0a5698e93567e5c522463c0ad8e271bcf0a61a54d7303f4621a873472"}, "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, - "keccakf1600": {:hex, :keccakf1600_orig, "2.0.0", "0a7217ddb3ee8220d449bbf7575ec39d4e967099f220a91e3dfca4dbaef91963", [:rebar3], [], "hexpm", "bdbbb02d67bea35605f95d4e3de48203347374e414da7945c4f2f7fd13ffe632"}, "libgraph": {:hex, :libgraph, "0.13.3", "20732b7bafb933dcf7351c479e03076ebd14a85fd3202c67a1c197f4f7c2466b", [:mix], [], "hexpm", "78f2576eef615440b46f10060b1de1c86640441422832052686df53dc3c148c6"}, - "libsecp256k1": {:git, "https://github.com/omisego/libsecp256k1.git", "83d4c91b7b5ad79fdd3c020be8c57ff6e2212780", [branch: "elixir-only"]}, + "libsecp256k1": {:git, "https://github.com/omgnetwork/libsecp256k1", "83d4c91b7b5ad79fdd3c020be8c57ff6e2212780", [branch: "elixir-only"]}, "libsecp256k1_source": {:git, "https://github.com/bitcoin-core/secp256k1.git", "d33352151699bd7598b868369dace092f7855740", [ref: "d33352151699bd7598b868369dace092f7855740"]}, "licensir": {:hex, :licensir, "0.2.7", "ad902c337560ccd70de843e5b208c1db08ba2f879ee01c9389023b779131f30a", [:mix], [], "hexpm", "16f9fdaa49cfca5b28267f41748f3c6dad31ebca3a7c682b1703cb2076d3a168"}, "makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"}, "makeup_elixir": {:hex, :makeup_elixir, "0.15.0", "98312c9f0d3730fde4049985a1105da5155bfe5c11e47bdc7406d88e01e4219b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "75ffa34ab1056b7e24844c90bfc62aaf6f3a37a15faa76b07bc5eba27e4a8b4a"}, "merkle_tree": {:hex, :merkle_tree, "2.0.0", "84a9cbfd3d8fab545d69c320460ff713ddea2f64ec4c14edfcc4f8eba899d5ab", [:mix], [], "hexpm", "351a764e385ce75bd782a972fc9597d99bed4d692631903e4a08936d4939c895"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, - "mime": {:hex, :mime, "1.4.0", "5066f14944b470286146047d2f73518cf5cca82f8e4815cf35d196b58cf07c47", [:mix], [], "hexpm", "75fa42c4228ea9a23f70f123c74ba7cece6a03b1fd474fe13f6a7a85c6ea4ff6"}, + "mime": {:hex, :mime, "1.5.0", "203ef35ef3389aae6d361918bf3f952fa17a09e8e43b5aa592b93eba05d0fb8d", [:mix], [], "hexpm", "55a94c0f552249fc1a3dd9cd2d3ab9de9d3c89b559c2bd01121f824834f24746"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, "mix_audit": {:hex, :mix_audit, "0.1.4", "35c424173a574436a80ad7f63cf014a7d9ce727de8cd4e7b4138d90b11aec043", [:make, :mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.4.0", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "7a43fee661bcadbad31aa04a86d33a890421c174723814b8a3a7f0e7076936a1"}, "msgpax": {:hex, :msgpax, "2.2.4", "7b3790ef684089076b63c0f08c2f4b079c6311daeb006b69e4ed2bf67518291e", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "b351b6d992d79624a8430a99d21a41b36b1b90edf84326a294e9f4a2de11f089"}, @@ -63,17 +62,19 @@ "propcheck": {:hex, :propcheck, "1.3.0", "0eda73220796262c8cb38d1bf4f7ca6eb428b414f495184132f317958bb9ad68", [:mix], [{:libgraph, "~> 0.13", [hex: :libgraph, repo: "hexpm", optional: false]}, {:proper, "~> 1.3", [hex: :proper, repo: "hexpm", optional: false]}], "hexpm", "3ef93a24dc5729bdf2c418045e1a4008a79446872fd5eb0f63dc58691ae47601"}, "proper": {:hex, :proper, "1.3.0", "c1acd51c51da17a2fe91d7a6fc6a0c25a6a9849d8dc77093533109d1218d8457", [:make, :mix, :rebar3], [], "hexpm", "4aa192fccddd03fdbe50fef620be9d4d2f92635b54f55fb83aec185994403cbc"}, "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"}, - "rocksdb": {:hex, :rocksdb, "1.5.1", "016861fbfb1f76ec2c48f745fca1f6e140fc0f27adc8c389c4cabce4a79b5f2f", [:rebar3], [], "hexpm", "63db7dfd65082d61df92810f61bd934080c77bc57eb711b36bb56a8926bdf3b0"}, + "rocksdb": {:hex, :rocksdb, "1.6.0", "e3f7286987c901da3286e38a676254cd575821db00214b4745b94bb4be82a1f3", [:rebar3], [], "hexpm", "4dfa34f05b678207578488d14776705ac13a29425eb1a0cefca4a8bc16e8b53f"}, + "rustler": {:hex, :rustler, "0.21.1", "5299980be32da997c54382e945bacaa015ed97a60745e1e639beaf6a7b278c65", [:mix], [{:toml, "~> 0.5.2", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "6ee1651e10645b2b2f3bb70502bf180341aa058709177e9bc28c105934094bc6"}, "sentry": {:hex, :sentry, "8.0.4", "6886ea584fa0dfc144dd3d8c4723570a4c0c6387a639077de34fce96b11995e2", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, "~> 2.3", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "781e4e0a8d4524c015f0f8d82e6bc30e6bf33df622da58d8c89d30c3cb943e67"}, "spandex": {:hex, :spandex, "3.0.3", "91aa318f3de696bb4d931adf65f7ebdbe5df25cccce1fe8fd376a44c46bcf69b", [:mix], [{:decorator, "~> 1.2", [hex: :decorator, repo: "hexpm", optional: true]}, {:optimal, "~> 0.3.3", [hex: :optimal, repo: "hexpm", optional: false]}, {:plug, ">= 1.0.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "e3e6c319d0ab478ddc9a39102a727a410c962b4d51c0932c72279b86d3b17044"}, "spandex_datadog": {:hex, :spandex_datadog, "1.0.0", "20db83c10600210a36a1ac95ed8cef3efb400ae948f48252437c2cc21dfd3969", [:mix], [{:msgpax, "~> 2.2.1", [hex: :msgpax, repo: "hexpm", optional: false]}, {:spandex, "~> 3.0", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm", "d1a499ed3e8580b88ca8ba10208004849b3bd6cfa045b90e4b69055b78474045"}, "spandex_ecto": {:hex, :spandex_ecto, "0.6.2", "845e0e0a115e84c218015e8a13cca7adb38e8b0a1b45010a51451a8c9961c551", [:mix], [{:spandex, "~> 2.2 or ~> 3.0", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm", "ddeb5c279ca850a38eee6decc8f91b3f4929c76f141b3329293793be54d0c1c7"}, - "spandex_phoenix": {:hex, :spandex_phoenix, "1.0.4", "e42471659c67c02d19fd76fdcce2e044f8f85f050671361324643624aa2ba971", [:mix], [{:plug, "~> 1.3", [hex: :plug, repo: "hexpm", optional: false]}, {:spandex, "~> 2.2 or ~> 3.0", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm", "d3969e21f93be314b772777924a9b067767b8b9a0464c55a04270c64793aa495"}, + "spandex_phoenix": {:hex, :spandex_phoenix, "1.0.5", "6bb632d3b8157bbbdac97e03aca6dc3b2afd115b6d015fc8206b009685cd3b27", [:mix], [{:plug, "~> 1.3", [hex: :plug, repo: "hexpm", optional: false]}, {:spandex, "~> 2.2 or ~> 3.0", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm", "f7bcd063fed9eb140373603f8a7340b71e219e3f62824c2c7571036f47e2ac3c"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, - "statix": {:git, "https://github.com/omisego/statix.git", "50745f14fd1d44297818a48336f041c228a0920f", [branch: "otp-21.3.8.4-support-global-tag-patch"]}, + "statix": {:git, "https://github.com/omgnetwork/statix", "50745f14fd1d44297818a48336f041c228a0920f", [branch: "otp-21.3.8.4-support-global-tag-patch"]}, "telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"}, "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.0", "da9d49ee7e6bb1c259d36ce6539cd45ae14d81247a2b0c90edf55e2b50507f7b", [:mix], [{:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5cfe67ad464b243835512aa44321cee91faed6ea868d7fb761d7016e02915c3d"}, "telemetry_metrics_statsd": {:hex, :telemetry_metrics_statsd, "0.3.0", "ce81e3681e8e02fbd72cbc0394225eab5b2bb27e9a1f322d8b09fb7b65876c22", [:mix], [{:telemetry_metrics, "~> 0.3", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "effcfb97405a64cb78b4cc3cc0ef1d3c7066d487115e164b6483bedd6d92abd0"}, + "toml": {:hex, :toml, "0.5.2", "e471388a8726d1ce51a6b32f864b8228a1eb8edc907a0edf2bb50eab9321b526", [:mix], [], "hexpm", "f1e3dabef71fb510d015fad18c0e05e7c57281001141504c6b69d94e99750a07"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.5.0", "8516502659002cec19e244ebd90d312183064be95025a319a6c7e89f4bccd65b", [:rebar3], [], "hexpm", "d48d002e15f5cc105a696cf2f1bbb3fc72b4b770a184d8420c8db20da2674b38"}, "vmstats": {:hex, :vmstats, "2.4.0", "57763d3edc861da2de02b2f0df3adc37e5a140117147937e83908cac40a10c9b", [:rebar3], [], "hexpm", "266f464e64b459f614ed64e25bda270f8a77951868bbaf0e2209274efc3d9b6d"}, "yamerl": {:hex, :yamerl, "0.8.0", "8214cfe16bbabe5d1d6c14a14aea11c784b9a21903dd6a7c74f8ce180adae5c7", [:rebar3], [], "hexpm", "010634477bf9c208a0767dcca89116c2442cf0b5e87f9c870f85cd1c3e0c2aab"}, diff --git a/nginx.conf b/nginx.conf index 9775fb7319..e4756e89fa 100644 --- a/nginx.conf +++ b/nginx.conf @@ -2,7 +2,7 @@ events {} http { server { listen 80; - + access_log off; location / { proxy_pass http://172.27.0.101:8545; } @@ -10,7 +10,7 @@ http { server { listen 81; - + access_log off; location / { proxy_pass http://172.27.0.101:8546; proxy_http_version 1.1; diff --git a/priv/perf/Dockerfile b/priv/perf/Dockerfile index b3b5faebf3..cea40c01a6 100644 --- a/priv/perf/Dockerfile +++ b/priv/perf/Dockerfile @@ -1,6 +1,11 @@ -FROM elixir:1.10.4-alpine - -RUN apk add git curl bash maven jq \ +FROM elixir:1.11.2-alpine + +RUN apk add --no-cache rust \ + cargo \ + git \ + curl \ + bash \ + maven jq \ autoconf \ automake \ gmp \ diff --git a/priv/perf/Makefile b/priv/perf/Makefile index 09de887e80..942735503e 100644 --- a/priv/perf/Makefile +++ b/priv/perf/Makefile @@ -25,7 +25,7 @@ init: mix deps.get test: # runs test against child chain and geth provided in test docker containers - LOAD_TEST_FAUCET_PRIVATE_KEY=0xd885a307e35738f773d8c9c63c7a3f3977819274638d04aaf934a1e1158513ce mix test --trace + LOAD_TEST_FAUCET_PRIVATE_KEY=0xd885a307e35738f773d8c9c63c7a3f3977819274638d04aaf934a1e1158513ce mix test format-code-check-warnings: LOAD_TEST_FAUCET_PRIVATE_KEY=0xd885a307e35738f773d8c9c63c7a3f3977819274638d04aaf934a1e1158513ce MIX_ENV=test mix do compile --warnings-as-errors --ignore-module-conflict --force, test --exclude test diff --git a/priv/perf/apps/load_test/lib/child_chain/abi.ex b/priv/perf/apps/load_test/lib/child_chain/abi.ex index fb53d0a59d..eb97c3f977 100644 --- a/priv/perf/apps/load_test/lib/child_chain/abi.ex +++ b/priv/perf/apps/load_test/lib/child_chain/abi.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ defmodule LoadTest.ChildChain.Abi do def decode_function(enriched_data, signature) do "0x" <> data = enriched_data - <> = :keccakf1600.hash(:sha3_256, signature) + <> = elem(ExKeccak.hash_256(signature), 1) method_id |> Encoding.to_hex() |> Kernel.<>(data) |> Encoding.to_binary() |> decode_function() end diff --git a/priv/perf/apps/load_test/lib/child_chain/abi/abi_event_selector.ex b/priv/perf/apps/load_test/lib/child_chain/abi/abi_event_selector.ex index 6ec8b5ed79..9fca6d87b5 100644 --- a/priv/perf/apps/load_test/lib/child_chain/abi/abi_event_selector.ex +++ b/priv/perf/apps/load_test/lib/child_chain/abi/abi_event_selector.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/child_chain/abi/abi_function_selector.ex b/priv/perf/apps/load_test/lib/child_chain/abi/abi_function_selector.ex index e3d6f7c362..47e96779c1 100644 --- a/priv/perf/apps/load_test/lib/child_chain/abi/abi_function_selector.ex +++ b/priv/perf/apps/load_test/lib/child_chain/abi/abi_function_selector.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/child_chain/abi/fields.ex b/priv/perf/apps/load_test/lib/child_chain/abi/fields.ex index 73e73ce115..5636846613 100644 --- a/priv/perf/apps/load_test/lib/child_chain/abi/fields.ex +++ b/priv/perf/apps/load_test/lib/child_chain/abi/fields.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/child_chain/deposit.ex b/priv/perf/apps/load_test/lib/child_chain/deposit.ex index dc9b339b3f..3f6f82aa23 100644 --- a/priv/perf/apps/load_test/lib/child_chain/deposit.ex +++ b/priv/perf/apps/load_test/lib/child_chain/deposit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/child_chain/exit.ex b/priv/perf/apps/load_test/lib/child_chain/exit.ex index a85c29392d..9f311ecece 100644 --- a/priv/perf/apps/load_test/lib/child_chain/exit.ex +++ b/priv/perf/apps/load_test/lib/child_chain/exit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/child_chain/transaction.ex b/priv/perf/apps/load_test/lib/child_chain/transaction.ex index 92b6a206c5..b70e871734 100644 --- a/priv/perf/apps/load_test/lib/child_chain/transaction.ex +++ b/priv/perf/apps/load_test/lib/child_chain/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -162,7 +162,7 @@ defmodule LoadTest.ChildChain.Transaction do defp parse_inputs(inputs_rlp) do with true <- Enum.count(inputs_rlp) <= 4 || {:error, :too_many_inputs}, - # NOTE: workaround for https://github.com/omisego/ex_plasma/issues/19. + # NOTE: workaround for https://github.com/omgnetwork/ex_plasma/issues/19. # remove, when this is blocked on `ex_plasma` end true <- Enum.all?(inputs_rlp, &(&1 != <<0::256>>)) || {:error, :malformed_inputs}, do: {:ok, Enum.map(inputs_rlp, &parse_input!/1)} diff --git a/priv/perf/apps/load_test/lib/child_chain/utxos.ex b/priv/perf/apps/load_test/lib/child_chain/utxos.ex index a1da831d7d..b834c39002 100644 --- a/priv/perf/apps/load_test/lib/child_chain/utxos.ex +++ b/priv/perf/apps/load_test/lib/child_chain/utxos.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/child_chain/watcher_sync.ex b/priv/perf/apps/load_test/lib/child_chain/watcher_sync.ex index d0978456f7..cf1e66299a 100644 --- a/priv/perf/apps/load_test/lib/child_chain/watcher_sync.ex +++ b/priv/perf/apps/load_test/lib/child_chain/watcher_sync.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ defmodule LoadTest.ChildChain.WatcherSync do # NOTE: allowing some more time for the dust to settle on the synced Watcher # otherwise some of the freshest UTXOs to exit will appear as missing on the Watcher - # related issue to remove this `sleep` and fix properly is https://github.com/omisego/elixir-omg/issues/1031 + # related issue to remove this `sleep` and fix properly is https://github.com/omgnetwork/elixir-omg/issues/1031 Process.sleep(2000) _ = Logger.info("Watcher synchronized") end diff --git a/priv/perf/apps/load_test/lib/connection/child_chain.ex b/priv/perf/apps/load_test/lib/connection/child_chain.ex index 47d01bf163..7447c9a7a5 100644 --- a/priv/perf/apps/load_test/lib/connection/child_chain.ex +++ b/priv/perf/apps/load_test/lib/connection/child_chain.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/connection/connection_defaults.ex b/priv/perf/apps/load_test/lib/connection/connection_defaults.ex index 1076e7c247..a5c5859f94 100644 --- a/priv/perf/apps/load_test/lib/connection/connection_defaults.ex +++ b/priv/perf/apps/load_test/lib/connection/connection_defaults.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/connection/watcher_info.ex b/priv/perf/apps/load_test/lib/connection/watcher_info.ex index 6379ce7c79..0649ea4c2a 100644 --- a/priv/perf/apps/load_test/lib/connection/watcher_info.ex +++ b/priv/perf/apps/load_test/lib/connection/watcher_info.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/connection/watcher_security.ex b/priv/perf/apps/load_test/lib/connection/watcher_security.ex index b02583821b..4b0e147fe7 100644 --- a/priv/perf/apps/load_test/lib/connection/watcher_security.ex +++ b/priv/perf/apps/load_test/lib/connection/watcher_security.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/ethereum/account.ex b/priv/perf/apps/load_test/lib/ethereum/account.ex index 65deac3ff4..2d93517873 100644 --- a/priv/perf/apps/load_test/lib/ethereum/account.ex +++ b/priv/perf/apps/load_test/lib/ethereum/account.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ defmodule LoadTest.Ethereum.Account do end defp compute_public_key(private_key) do - {:ok, _} = :libsecp256k1.ec_pubkey_create(private_key, :uncompressed) + ExSecp256k1.create_public_key(private_key) end defp compute_address(<>) do diff --git a/priv/perf/apps/load_test/lib/ethereum/bit_helper.ex b/priv/perf/apps/load_test/lib/ethereum/bit_helper.ex index b1204a21eb..52b3f4af92 100644 --- a/priv/perf/apps/load_test/lib/ethereum/bit_helper.ex +++ b/priv/perf/apps/load_test/lib/ethereum/bit_helper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ defmodule LoadTest.Ethereum.BitHelper do """ @spec kec(binary()) :: keccak_hash def kec(data) do - :keccakf1600.sha3_256(data) + elem(ExKeccak.hash_256(data), 1) end @doc """ diff --git a/priv/perf/apps/load_test/lib/ethereum/crypto.ex b/priv/perf/apps/load_test/lib/ethereum/crypto.ex index f1482d2890..7c416f1849 100644 --- a/priv/perf/apps/load_test/lib/ethereum/crypto.ex +++ b/priv/perf/apps/load_test/lib/ethereum/crypto.ex @@ -11,7 +11,7 @@ defmodule LoadTest.Ethereum.Crypto do see https://hexdocs.pm/exth_crypto/ExthCrypto.Hash.html#kec/0 """ @spec hash(binary) :: hash_t() - def hash(message), do: ExthCrypto.Hash.hash(message, ExthCrypto.Hash.kec()) + def hash(message), do: elem(ExKeccak.hash_256(message), 1) @doc """ Generates private key. Internally uses OpenSSL RAND_bytes. May throw if there is not enough entropy. diff --git a/priv/perf/apps/load_test/lib/ethereum/ethereum.ex b/priv/perf/apps/load_test/lib/ethereum/ethereum.ex index 309a83fd97..0add0a36e7 100644 --- a/priv/perf/apps/load_test/lib/ethereum/ethereum.ex +++ b/priv/perf/apps/load_test/lib/ethereum/ethereum.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/ethereum/hash.ex b/priv/perf/apps/load_test/lib/ethereum/hash.ex index b04b811aaf..cedc41eff0 100644 --- a/priv/perf/apps/load_test/lib/ethereum/hash.ex +++ b/priv/perf/apps/load_test/lib/ethereum/hash.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -90,8 +90,7 @@ defmodule LoadTest.Ethereum.Hash do @spec sign_hash(BitHelper.keccak_hash(), private_key, integer() | nil) :: {hash_v, hash_r, hash_s} def sign_hash(hash, private_key, chain_id \\ nil) do - {:ok, <>, recovery_id} = - :libsecp256k1.ecdsa_sign_compact(hash, private_key, :default, <<>>) + {:ok, {<>, recovery_id}} = ExSecp256k1.sign_compact(hash, private_key) # Fork Ψ EIP-155 recovery_id = diff --git a/priv/perf/apps/load_test/lib/ethereum/nonce_tracker.ex b/priv/perf/apps/load_test/lib/ethereum/nonce_tracker.ex index 91bf0dd5ef..ec3523bcf9 100644 --- a/priv/perf/apps/load_test/lib/ethereum/nonce_tracker.ex +++ b/priv/perf/apps/load_test/lib/ethereum/nonce_tracker.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/ethereum/transaction/signature.ex b/priv/perf/apps/load_test/lib/ethereum/transaction/signature.ex index d9a90c0cdf..0a365df9ae 100644 --- a/priv/perf/apps/load_test/lib/ethereum/transaction/signature.ex +++ b/priv/perf/apps/load_test/lib/ethereum/transaction/signature.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/ethereum/transaction/transaction.ex b/priv/perf/apps/load_test/lib/ethereum/transaction/transaction.ex index d10e9d5652..05a39a42e1 100644 --- a/priv/perf/apps/load_test/lib/ethereum/transaction/transaction.ex +++ b/priv/perf/apps/load_test/lib/ethereum/transaction/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/performance.ex b/priv/perf/apps/load_test/lib/performance.ex index a7fba64de1..1c51bdaa2b 100644 --- a/priv/perf/apps/load_test/lib/performance.ex +++ b/priv/perf/apps/load_test/lib/performance.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/runner/childchain.ex b/priv/perf/apps/load_test/lib/runner/childchain.ex index ae5a3f9e59..92c67f566e 100644 --- a/priv/perf/apps/load_test/lib/runner/childchain.ex +++ b/priv/perf/apps/load_test/lib/runner/childchain.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/runner/deposits.ex b/priv/perf/apps/load_test/lib/runner/deposits.ex index 65b28d879a..b6d87f2061 100644 --- a/priv/perf/apps/load_test/lib/runner/deposits.ex +++ b/priv/perf/apps/load_test/lib/runner/deposits.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/runner/smoke.ex b/priv/perf/apps/load_test/lib/runner/smoke.ex index 6013b4f6e5..08dc8fa38a 100644 --- a/priv/perf/apps/load_test/lib/runner/smoke.ex +++ b/priv/perf/apps/load_test/lib/runner/smoke.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/runner/standard_exits.ex b/priv/perf/apps/load_test/lib/runner/standard_exits.ex index a307a698b0..9428317dab 100644 --- a/priv/perf/apps/load_test/lib/runner/standard_exits.ex +++ b/priv/perf/apps/load_test/lib/runner/standard_exits.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/runner/transactions.ex b/priv/perf/apps/load_test/lib/runner/transactions.ex index 416651c702..3f1d4a699c 100644 --- a/priv/perf/apps/load_test/lib/runner/transactions.ex +++ b/priv/perf/apps/load_test/lib/runner/transactions.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/runner/utxos_load.ex b/priv/perf/apps/load_test/lib/runner/utxos_load.ex index e4d1ac1e46..af3d56beba 100644 --- a/priv/perf/apps/load_test/lib/runner/utxos_load.ex +++ b/priv/perf/apps/load_test/lib/runner/utxos_load.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/runner/watcher_info.ex b/priv/perf/apps/load_test/lib/runner/watcher_info.ex index 7e3916524e..a3609472ca 100644 --- a/priv/perf/apps/load_test/lib/runner/watcher_info.ex +++ b/priv/perf/apps/load_test/lib/runner/watcher_info.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/account_transactions.ex b/priv/perf/apps/load_test/lib/scenario/account_transactions.ex index fd0389d8b3..f33e3760bc 100644 --- a/priv/perf/apps/load_test/lib/scenario/account_transactions.ex +++ b/priv/perf/apps/load_test/lib/scenario/account_transactions.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/create_utxos.ex b/priv/perf/apps/load_test/lib/scenario/create_utxos.ex index 136f73a783..2f4c1472dd 100644 --- a/priv/perf/apps/load_test/lib/scenario/create_utxos.ex +++ b/priv/perf/apps/load_test/lib/scenario/create_utxos.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/deposits.ex b/priv/perf/apps/load_test/lib/scenario/deposits.ex index bb66ffa5cc..544c3a07ae 100644 --- a/priv/perf/apps/load_test/lib/scenario/deposits.ex +++ b/priv/perf/apps/load_test/lib/scenario/deposits.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/fund_account.ex b/priv/perf/apps/load_test/lib/scenario/fund_account.ex index 1606de53cb..1dbeddc647 100644 --- a/priv/perf/apps/load_test/lib/scenario/fund_account.ex +++ b/priv/perf/apps/load_test/lib/scenario/fund_account.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/many_standard_exits.ex b/priv/perf/apps/load_test/lib/scenario/many_standard_exits.ex index 8e6bc28871..034e5d022e 100644 --- a/priv/perf/apps/load_test/lib/scenario/many_standard_exits.ex +++ b/priv/perf/apps/load_test/lib/scenario/many_standard_exits.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/smoke.ex b/priv/perf/apps/load_test/lib/scenario/smoke.ex index b0e84b0aae..fa5fc0007b 100644 --- a/priv/perf/apps/load_test/lib/scenario/smoke.ex +++ b/priv/perf/apps/load_test/lib/scenario/smoke.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/spend_eth_utxo.ex b/priv/perf/apps/load_test/lib/scenario/spend_eth_utxo.ex index 79d5db1b82..5ed39a461e 100644 --- a/priv/perf/apps/load_test/lib/scenario/spend_eth_utxo.ex +++ b/priv/perf/apps/load_test/lib/scenario/spend_eth_utxo.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/start_standard_exit.ex b/priv/perf/apps/load_test/lib/scenario/start_standard_exit.ex index b6ff0da3de..3aee174954 100644 --- a/priv/perf/apps/load_test/lib/scenario/start_standard_exit.ex +++ b/priv/perf/apps/load_test/lib/scenario/start_standard_exit.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/transactions.ex b/priv/perf/apps/load_test/lib/scenario/transactions.ex index ca853fce82..f82170d6f4 100644 --- a/priv/perf/apps/load_test/lib/scenario/transactions.ex +++ b/priv/perf/apps/load_test/lib/scenario/transactions.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/scenario/watcher_status.ex b/priv/perf/apps/load_test/lib/scenario/watcher_status.ex index d58d8f0117..d7c14e61d2 100644 --- a/priv/perf/apps/load_test/lib/scenario/watcher_status.ex +++ b/priv/perf/apps/load_test/lib/scenario/watcher_status.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/service/datadog.ex b/priv/perf/apps/load_test/lib/service/datadog.ex index baa82f76a7..2334fab79b 100644 --- a/priv/perf/apps/load_test/lib/service/datadog.ex +++ b/priv/perf/apps/load_test/lib/service/datadog.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/service/datadog/api.ex b/priv/perf/apps/load_test/lib/service/datadog/api.ex index 7407de5864..7788cf2471 100644 --- a/priv/perf/apps/load_test/lib/service/datadog/api.ex +++ b/priv/perf/apps/load_test/lib/service/datadog/api.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/service/datadog/dummy_statix.ex b/priv/perf/apps/load_test/lib/service/datadog/dummy_statix.ex index 7f67f5d724..e19c752222 100644 --- a/priv/perf/apps/load_test/lib/service/datadog/dummy_statix.ex +++ b/priv/perf/apps/load_test/lib/service/datadog/dummy_statix.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/service/faucet.ex b/priv/perf/apps/load_test/lib/service/faucet.ex index aeb3fa6552..b2b84c0191 100644 --- a/priv/perf/apps/load_test/lib/service/faucet.ex +++ b/priv/perf/apps/load_test/lib/service/faucet.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/service/metrics.ex b/priv/perf/apps/load_test/lib/service/metrics.ex index d007090d71..564551eefb 100644 --- a/priv/perf/apps/load_test/lib/service/metrics.ex +++ b/priv/perf/apps/load_test/lib/service/metrics.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/service/sleeper.ex b/priv/perf/apps/load_test/lib/service/sleeper.ex index 538b76e179..85a2674910 100644 --- a/priv/perf/apps/load_test/lib/service/sleeper.ex +++ b/priv/perf/apps/load_test/lib/service/sleeper.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/service/sync.ex b/priv/perf/apps/load_test/lib/service/sync.ex index a85eef8d0a..f523a7fc06 100644 --- a/priv/perf/apps/load_test/lib/service/sync.ex +++ b/priv/perf/apps/load_test/lib/service/sync.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/test_runner.ex b/priv/perf/apps/load_test/lib/test_runner.ex index bda1282e63..e5e2569f10 100644 --- a/priv/perf/apps/load_test/lib/test_runner.ex +++ b/priv/perf/apps/load_test/lib/test_runner.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/test_runner/config.ex b/priv/perf/apps/load_test/lib/test_runner/config.ex index 252ecf21bd..2fd83362a3 100644 --- a/priv/perf/apps/load_test/lib/test_runner/config.ex +++ b/priv/perf/apps/load_test/lib/test_runner/config.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/test_runner/help.ex b/priv/perf/apps/load_test/lib/test_runner/help.ex index 98ab1dff8c..95c8f28b8b 100644 --- a/priv/perf/apps/load_test/lib/test_runner/help.ex +++ b/priv/perf/apps/load_test/lib/test_runner/help.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/utils/encoding.ex b/priv/perf/apps/load_test/lib/utils/encoding.ex index 51966c1baa..063db94707 100644 --- a/priv/perf/apps/load_test/lib/utils/encoding.ex +++ b/priv/perf/apps/load_test/lib/utils/encoding.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/watcher_info/balance.ex b/priv/perf/apps/load_test/lib/watcher_info/balance.ex index b6323c1221..2d74ab27ba 100644 --- a/priv/perf/apps/load_test/lib/watcher_info/balance.ex +++ b/priv/perf/apps/load_test/lib/watcher_info/balance.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/watcher_info/client.ex b/priv/perf/apps/load_test/lib/watcher_info/client.ex index dbd5bdae8d..8f36ec8122 100644 --- a/priv/perf/apps/load_test/lib/watcher_info/client.ex +++ b/priv/perf/apps/load_test/lib/watcher_info/client.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/lib/watcher_info/transaction.ex b/priv/perf/apps/load_test/lib/watcher_info/transaction.ex index 5ecabe8df3..542457fd27 100644 --- a/priv/perf/apps/load_test/lib/watcher_info/transaction.ex +++ b/priv/perf/apps/load_test/lib/watcher_info/transaction.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -131,14 +131,8 @@ defmodule LoadTest.WatcherInfo.Transaction do end end - defp signature_digest(hash_digest, private_key_binary) do - {:ok, <>, recovery_id} = - :libsecp256k1.ecdsa_sign_compact( - hash_digest, - private_key_binary, - :default, - <<>> - ) + defp signature_digest(hash_digest, private_key) do + {:ok, {<>, recovery_id}} = ExSecp256k1.sign_compact(hash_digest, private_key) # EIP-155 # See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md diff --git a/priv/perf/apps/load_test/lib/watcher_info/utxo.ex b/priv/perf/apps/load_test/lib/watcher_info/utxo.ex index a0f6e153b2..36f7ef8002 100644 --- a/priv/perf/apps/load_test/lib/watcher_info/utxo.ex +++ b/priv/perf/apps/load_test/lib/watcher_info/utxo.ex @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/mix.exs b/priv/perf/apps/load_test/mix.exs index 18acb6d4f0..fde9854bb2 100644 --- a/priv/perf/apps/load_test/mix.exs +++ b/priv/perf/apps/load_test/mix.exs @@ -19,7 +19,7 @@ defmodule LoadTest.MixProject do # Run "mix help compile.app" to learn about applications. def application do [ - extra_applications: [:logger], + extra_applications: [:logger, :ex_secp256k1], mod: {LoadTest.Application, []} ] end @@ -30,17 +30,22 @@ defmodule LoadTest.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ + {:ex_rlp, "~> 0.5.3"}, + {:ex_keccak, "~> 0.1.2"}, + {:ex_abi, "~> 0.5.1"}, {:briefly, "~> 0.3"}, {:chaperon, "~> 0.3.1"}, {:statix, "~> 1.4"}, {:histogrex, "~> 0.0.5"}, {:tesla, "~> 1.3.0"}, - {:httpoison, "~> 1.6.2", override: true}, - {:ex_plasma, git: "https://github.com/omisego/ex_plasma.git", branch: "master-v2", override: true}, + {:httpoison, "~> 1.7", override: true}, + {:hackney, + git: "https://github.com/SergeTupchiy/hackney", ref: "2bf38f92f647de00c4850202f37d4eaab93ed834", override: true}, + {:ex_plasma, + git: "https://github.com/omgnetwork/ex_plasma", ref: "5e94c4fc82dbf26cb457b30911505ec45ec534ea", override: true}, + {:ex_secp256k1, "~> 0.1.2"}, {:telemetry, "~> 0.4.1"}, {:fake_server, "~> 2.1", only: :test}, - # Better adapter for tesla - {:hackney, "~> 1.15.2"}, {:watcher_info_api, in_umbrella: true}, {:watcher_security_critical_api, in_umbrella: true}, {:child_chain_api, in_umbrella: true} diff --git a/priv/perf/apps/load_test/test/load_test/runner/childchain_test.exs b/priv/perf/apps/load_test/test/load_test/runner/childchain_test.exs index 53c3fe9b2e..c18045c94b 100644 --- a/priv/perf/apps/load_test/test/load_test/runner/childchain_test.exs +++ b/priv/perf/apps/load_test/test/load_test/runner/childchain_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/test/load_test/runner/smoke_test.exs b/priv/perf/apps/load_test/test/load_test/runner/smoke_test.exs index 72ccf00f03..a02e7ddfbe 100644 --- a/priv/perf/apps/load_test/test/load_test/runner/smoke_test.exs +++ b/priv/perf/apps/load_test/test/load_test/runner/smoke_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/test/load_test/runner/standard_exit_test.exs b/priv/perf/apps/load_test/test/load_test/runner/standard_exit_test.exs index ee02949d88..dc9fd29993 100644 --- a/priv/perf/apps/load_test/test/load_test/runner/standard_exit_test.exs +++ b/priv/perf/apps/load_test/test/load_test/runner/standard_exit_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/test/load_test/runner/utxos_load_test.exs b/priv/perf/apps/load_test/test/load_test/runner/utxos_load_test.exs index 47f4c48048..3d0d72f5a2 100644 --- a/priv/perf/apps/load_test/test/load_test/runner/utxos_load_test.exs +++ b/priv/perf/apps/load_test/test/load_test/runner/utxos_load_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/test/load_test/runner/watcher_info_test.exs b/priv/perf/apps/load_test/test/load_test/runner/watcher_info_test.exs index 8bf8cfa8f6..2d6b26c60d 100644 --- a/priv/perf/apps/load_test/test/load_test/runner/watcher_info_test.exs +++ b/priv/perf/apps/load_test/test/load_test/runner/watcher_info_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/apps/load_test/test/load_test/service/datadog/api_test.exs b/priv/perf/apps/load_test/test/load_test/service/datadog/api_test.exs index d5128874f8..6cf0704dab 100644 --- a/priv/perf/apps/load_test/test/load_test/service/datadog/api_test.exs +++ b/priv/perf/apps/load_test/test/load_test/service/datadog/api_test.exs @@ -1,4 +1,4 @@ -# Copyright 2019-2020 OmiseGO Pte Ltd +# Copyright 2019-2020 OMG Network Pte Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/priv/perf/mix.lock b/priv/perf/mix.lock index 47a4b1ef28..c7a14e69ef 100644 --- a/priv/perf/mix.lock +++ b/priv/perf/mix.lock @@ -3,7 +3,7 @@ "binary": {:hex, :binary, "0.0.5", "20d816f7274ea34f1b673b4cff2fdb9ebec9391a7a68c349070d515c66b1b2cf", [:mix], [], "hexpm", "ee1e9ebcab703a4e24db554957fbb540642fe9327eb9e295cb3f07dd7c11ddb2"}, "briefly": {:hex, :briefly, "0.3.0", "16e6b76d2070ebc9cbd025fa85cf5dbaf52368c4bd896fb482b5a6b95a540c2f", [:mix], [], "hexpm", "c6ebf8fc3dcd4950dd10c03e953fb4f553a8bcf0ff4c8c40d71542434cd7e046"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"}, - "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"}, + "certifi": {:hex, :certifi, "2.5.2", "b7cfeae9d2ed395695dd8201c57a2d019c0c43ecaf8b8bcb9320b40d6662f340", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "3b3b5f36493004ac3455966991eaf6e768ce9884693d9968055aeeeb1e575040"}, "chaperon": {:hex, :chaperon, "0.3.1", "505a6f4c3ee396d6b33750d24ba46f437b3714700c2c9434199da38ca1af174f", [:mix], [{:basic_auth, "~> 2.2", [hex: :basic_auth, repo: "hexpm", optional: false]}, {:cowboy, "~> 2.6", [hex: :cowboy, repo: "hexpm", optional: false]}, {:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:e_q, "~> 1.0.0", [hex: :e_q, repo: "hexpm", optional: false]}, {:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:ex_aws_s3, "~> 2.0", [hex: :ex_aws_s3, repo: "hexpm", optional: false]}, {:histogrex, "~> 0.0.5", [hex: :histogrex, repo: "hexpm", optional: false]}, {:httpoison, "~> 1.5", [hex: :httpoison, repo: "hexpm", optional: false]}, {:instream, "~> 0.21.0", [hex: :instream, repo: "hexpm", optional: false]}, {:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}, {:uuid, "~> 1.1", [hex: :uuid, repo: "hexpm", optional: false]}, {:websockex, "~> 0.4", [hex: :websockex, repo: "hexpm", optional: false]}], "hexpm", "dbcf477fe177b9ea91a5f838d5df99cbed1ea4e634f5070a718bbea1767a82ce"}, "cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"}, @@ -12,18 +12,19 @@ "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, "e_q": {:hex, :e_q, "1.0.0", "7b4dab148b8f482fac6be0e3b5ecf5b4ca86d6148b33b96ee7ca9f2e2fcf2fb7", [:mix], [], "hexpm", "23dbb293640ba24a38c6b56bfa81a569b8a6654b85e0ccbedf89c740e2b91937"}, "ethereumex": {:hex, :ethereumex, "0.6.4", "58e998acb13b45a2b76b954b1d503f2f5f0e8118c0a14769c59264ef3ee4c301", [:mix], [{:httpoison, "~> 1.6", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.1", [hex: :poolboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "abc0bed1ba691645700f55bc843be7d08a23284e20ad889cabe6279e13debb32"}, - "ex_abi": {:hex, :ex_abi, "0.2.2", "805c19edccb98ecd02a2eee1851d49f625ae036953ae45b3349468333b19870e", [:mix], [{:exth_crypto, "~> 0.1.6", [hex: :exth_crypto, repo: "hexpm", optional: false]}], "hexpm", "649688a53dde9c676f6a760cc0c1e43cb246010a7f83b13b9e5bd75aa04cc409"}, + "ex_abi": {:hex, :ex_abi, "0.5.1", "e12373d4511de65c8c7e40011fa40ac05bda687de819eb0f41fc36d4e96e7b04", [:mix], [{:ex_keccak, "~> 0.1.2", [hex: :ex_keccak, repo: "hexpm", optional: false]}], "hexpm", "a2d8b8030cb6af03e69dba7395b1929422d7cb15b8275d89844c2495acf9da1f"}, "ex_aws": {:hex, :ex_aws, "2.1.6", "41ab8b4caa48035c96d07faa035d2d9de6df480e7e084c054e662ac888dcd4d4", [:mix], [{:configparser_ex, "~> 4.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8", [hex: :jsx, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "a541bd042c1ee26412bb1e749ddf2a1c327e4fb7e382b1cd227e1b00eed3d469"}, "ex_aws_s3": {:hex, :ex_aws_s3, "2.1.0", "4db576e1036e554acdc2f03041ae16651a00307a69a377369fdc0e3d7f2e41e9", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm", "7b6867d326251f3f3c1a6f5e70ef084c6ae75a933d3fc373d1e10fd4ae1e1483"}, - "ex_plasma": {:git, "https://github.com/omisego/ex_plasma.git", "8efb48a2283984e8fcb4ab0398c922f4c8ed014c", [branch: "master-v2"]}, + "ex_keccak": {:hex, :ex_keccak, "0.1.2", "4548914dc250a919712f03b4574fd2d048cd6d1245481b559abe9e7b9adafbd3", [:mix], [{:rustler, "~> 0.21.1", [hex: :rustler, repo: "hexpm", optional: false]}], "hexpm", "da2a11b1f95727193865f9184b6af9e1665e82b84f3c531ab4b7323532dafebd"}, + "ex_plasma": {:git, "https://github.com/omgnetwork/ex_plasma", "5e94c4fc82dbf26cb457b30911505ec45ec534ea", [ref: "5e94c4fc82dbf26cb457b30911505ec45ec534ea"]}, "ex_rlp": {:hex, :ex_rlp, "0.5.3", "9055bddade545ee3e734aaad62c4b4d08211834da3beb43ae269b75785909e5e", [:mix], [], "hexpm", "a755a5f8f9f66079f3ecbe021536b949077fac0df963d9e59a20321bab28722d"}, - "exth_crypto": {:hex, :exth_crypto, "0.1.6", "8e636a9bcb75d8e32451be96e547a495121ed2178d078db294edb0f81f7cf2e8", [:mix], [{:binary, "~> 0.0.4", [hex: :binary, repo: "hexpm", optional: false]}, {:keccakf1600, "~> 2.0.0", [hex: :keccakf1600_orig, repo: "hexpm", optional: false]}, {:libsecp256k1, "~> 0.1.9", [hex: :libsecp256k1, repo: "hexpm", optional: false]}], "hexpm", "45d6faf4b889f8fc526deba059e0c7947423784ab1e7fa85be8db4c46cf4416b"}, + "ex_secp256k1": {:hex, :ex_secp256k1, "0.1.2", "affe4e0fa1adc085ab47d7ab3cc44d594249d24bd0a37a9002f6648d112c2081", [:mix], [{:rustler, "~> 0.21.1 ", [hex: :rustler, repo: "hexpm", optional: false]}], "hexpm", "8ae0131380ada331b15924b563f89e7f56b4e74cc10978f3ea0836589e87730a"}, "fake_server": {:hex, :fake_server, "2.1.0", "aefed08a587e2498fdb39ac9de6f9eabbe7bd83da9801d08d3574d61b7eb03d5", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm", "3200d57a523b27d2c8ebfc1a80b76697b3c8a06bf9d678d82114f5f98d350c75"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, - "hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "e0100f8ef7d1124222c11ad362c857d3df7cb5f4204054f9f0f4a728666591fc"}, + "hackney": {:git, "https://github.com/SergeTupchiy/hackney", "2bf38f92f647de00c4850202f37d4eaab93ed834", [ref: "2bf38f92f647de00c4850202f37d4eaab93ed834"]}, "histogrex": {:hex, :histogrex, "0.0.5", "2e92ce1690bd304e5e5b683c51951f7376dd2cc379f0575d45951a2a82c2edd2", [:mix], [], "hexpm", "5eb03f7d802defa4cce11f130211bdefe2d21817439e0bb37a7ceaf7e6d43340"}, - "httpoison": {:hex, :httpoison, "1.6.2", "ace7c8d3a361cebccbed19c283c349b3d26991eff73a1eaaa8abae2e3c8089b6", [:mix], [{:hackney, "~> 1.15 and >= 1.15.2", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "aa2c74bd271af34239a3948779612f87df2422c2fdcfdbcec28d9c105f0773fe"}, - "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "4bdd305eb64e18b0273864920695cb18d7a2021f31a11b9c5fbcd9a253f936e2"}, + "httpoison": {:hex, :httpoison, "1.7.0", "abba7d086233c2d8574726227b6c2c4f6e53c4deae7fe5f6de531162ce9929a0", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "975cc87c845a103d3d1ea1ccfd68a2700c211a434d8428b10c323dc95dc5b980"}, + "idna": {:hex, :idna, "6.0.1", "1d038fb2e7668ce41fbf681d2c45902e52b3cb9e9c77b55334353b222c2ee50c", [:rebar3], [{:unicode_util_compat, "0.5.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a02c8a1c4fd601215bb0b0324c8a6986749f807ce35f25449ec9e69758708122"}, "influxql": {:hex, :influxql, "0.2.1", "71bfd5c0d81bf870f239baf3357bf5226b44fce16e1b9399ba1368203ca71245", [:mix], [], "hexpm", "75faf04960d6830ca0827869eaac1ba092655041c5e96deb2a588bafb601205c"}, "instream": {:hex, :instream, "0.21.0", "9660449133120cb19851d92173c92164cf3f70deb32c4b7ee2a772b575fa7df8", [:mix], [{:hackney, "~> 1.1", [hex: :hackney, repo: "hexpm", optional: false]}, {:influxql, "~> 0.2.0", [hex: :influxql, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}], "hexpm", "bbc6f1c53679df6deb78806ec24259413219b2c9a7c2dbdd6289f3544f065111"}, "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, @@ -41,11 +42,13 @@ "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"}, - "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.5", "6eaf7ad16cb568bb01753dbbd7a95ff8b91c7979482b95f38443fe2c8852a79b", [:make, :mix, :rebar3], [], "hexpm", "13104d7897e38ed7f044c4de953a6c28597d1c952075eb2e328bc6d6f2bfc496"}, + "rustler": {:hex, :rustler, "0.21.1", "5299980be32da997c54382e945bacaa015ed97a60745e1e639beaf6a7b278c65", [:mix], [{:toml, "~> 0.5.2", [hex: :toml, repo: "hexpm", optional: false]}], "hexpm", "6ee1651e10645b2b2f3bb70502bf180341aa058709177e9bc28c105934094bc6"}, + "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, "statix": {:hex, :statix, "1.4.0", "c822abd1e60e62828e8460e932515d0717aa3c089b44cc3f795d43b94570b3a8", [:mix], [], "hexpm", "507373cc80925a9b6856cb14ba17f6125552434314f6613c907d295a09d1a375"}, "telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"}, "tesla": {:hex, :tesla, "1.3.3", "26ae98627af5c406584aa6755ab5fc96315d70d69a24dd7f8369cfcb75094a45", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: true]}, {:exjsx, ">= 3.0.0", [hex: :exjsx, repo: "hexpm", optional: true]}, {:fuse, "~> 2.4", [hex: :fuse, repo: "hexpm", optional: true]}, {:gun, "~> 1.3", [hex: :gun, repo: "hexpm", optional: true]}, {:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:poison, ">= 1.0.0", [hex: :poison, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "2648f1c276102f9250299e0b7b57f3071c67827349d9173f34c281756a1b124c"}, - "unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm", "1d1848c40487cdb0b30e8ed975e34e025860c02e419cb615d255849f3427439d"}, + "toml": {:hex, :toml, "0.5.2", "e471388a8726d1ce51a6b32f864b8228a1eb8edc907a0edf2bb50eab9321b526", [:mix], [], "hexpm", "f1e3dabef71fb510d015fad18c0e05e7c57281001141504c6b69d94e99750a07"}, + "unicode_util_compat": {:hex, :unicode_util_compat, "0.5.0", "8516502659002cec19e244ebd90d312183064be95025a319a6c7e89f4bccd65b", [:rebar3], [], "hexpm", "d48d002e15f5cc105a696cf2f1bbb3fc72b4b770a184d8420c8db20da2674b38"}, "uuid": {:hex, :uuid, "1.1.8", "e22fc04499de0de3ed1116b770c7737779f226ceefa0badb3592e64d5cfb4eb9", [:mix], [], "hexpm", "c790593b4c3b601f5dc2378baae7efaf5b3d73c4c6456ba85759905be792f2ac"}, "websockex": {:hex, :websockex, "0.4.2", "9a3b7dc25655517ecd3f8ff7109a77fce94956096b942836cdcfbc7c86603ecc", [:mix], [], "hexpm", "803cd76e91544b56f0e655e36790be797fa6436db9224f7c303db9b9df2a3df4"}, }