Full Code of omisego/elixir-omg for AI

master 2c68973d8f29 cached
737 files
2.7 MB
760.2k tokens
3043 symbols
1 requests
Download .txt
Showing preview only (3,035K chars total). Download the full file or copy to clipboard to get everything.
Repository: omisego/elixir-omg
Branch: master
Commit: 2c68973d8f29
Files: 737
Total size: 2.7 MB

Directory structure:
gitextract_2b551nix/

├── .circleci/
│   ├── ci_increase_chart_version.sh
│   ├── ci_publish.sh
│   ├── config.yml
│   ├── status.sh
│   └── test_runner.py
├── .formatter.exs
├── .githooks/
│   └── pre-commit
├── .github/
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── workflows/
│       ├── auto-merge-pr.yml
│       ├── auto-pr-for-branch-syncing.yml
│       └── enforce-changelog-labels.yml
├── .github_changelog_generator
├── .gitignore
├── .gitmodules
├── .releaserc.yaml
├── .tool-versions
├── AUTHORS
├── CHANGELOG.md
├── CODEOWNERS
├── Dockerfile.watcher
├── Dockerfile.watcher_info
├── LICENSE
├── Makefile
├── README.md
├── apps/
│   ├── omg_bus/
│   │   ├── lib/
│   │   │   ├── omg_bus/
│   │   │   │   ├── application.ex
│   │   │   │   ├── event.ex
│   │   │   │   ├── pubsub.ex
│   │   │   │   └── supervisor.ex
│   │   │   └── omg_bus.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── omg_bus/
│   │       │   └── event_test.exs
│   │       └── test_helper.exs
│   ├── omg_conformance/
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── omg_conformance/
│   │       │   └── conformance/
│   │       │       ├── merkle_proof_property_test.exs
│   │       │       ├── merkle_proof_test.exs
│   │       │       ├── signature_property_test.exs
│   │       │       └── signature_test.exs
│   │       ├── support/
│   │       │   └── conformance/
│   │       │       ├── merkle_proof_context.ex
│   │       │       ├── merkle_proofs.ex
│   │       │       ├── property.ex
│   │       │       ├── signatures_hashes.ex
│   │       │       └── signatures_hashes_case.ex
│   │       └── test_helper.exs
│   ├── omg_db/
│   │   ├── lib/
│   │   │   ├── db.ex
│   │   │   └── omg_db/
│   │   │       ├── application.ex
│   │   │       ├── measure.ex
│   │   │       ├── models/
│   │   │       │   └── payment_exit_info.ex
│   │   │       ├── release_tasks/
│   │   │       │   ├── init_key_value_db.ex
│   │   │       │   ├── init_keys_with_values.ex
│   │   │       │   └── set_key_value_db.ex
│   │   │       ├── rocks_db.ex
│   │   │       └── rocksdb/
│   │   │           ├── core.ex
│   │   │           └── server.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── fixtures.exs
│   │       ├── omg_db/
│   │       │   ├── application_test.exs
│   │       │   ├── db_test.exs
│   │       │   ├── models/
│   │       │   │   └── payment_exit_info_test.exs
│   │       │   ├── release_tasks/
│   │       │   │   ├── init_key_value_db_test.exs
│   │       │   │   ├── init_keys_with_values_test.exs
│   │       │   │   └── set_key_value_db_test.exs
│   │       │   └── rocks_db_test.exs
│   │       ├── support/
│   │       │   └── rocks_db_case.ex
│   │       └── test_helper.exs
│   ├── omg_eth/
│   │   ├── lib/
│   │   │   ├── eth.ex
│   │   │   └── omg_eth/
│   │   │       ├── application.ex
│   │   │       ├── blockchain/
│   │   │       │   ├── bit_helper.ex
│   │   │       │   ├── private_key.ex
│   │   │       │   ├── transaction/
│   │   │       │   │   ├── hash.ex
│   │   │       │   │   └── signature.ex
│   │   │       │   └── transaction.ex
│   │   │       ├── client.ex
│   │   │       ├── configuration.ex
│   │   │       ├── encoding/
│   │   │       │   └── contract_constructor.ex
│   │   │       ├── encoding.ex
│   │   │       ├── ethereum_height.ex
│   │   │       ├── ethereum_height_monitor/
│   │   │       │   └── alarm_handler.ex
│   │   │       ├── ethereum_height_monitor.ex
│   │   │       ├── metric/
│   │   │       │   └── ethereumex.ex
│   │   │       ├── release_tasks/
│   │   │       │   ├── set_contract.ex
│   │   │       │   ├── set_ethereum_block_time.ex
│   │   │       │   ├── set_ethereum_client.ex
│   │   │       │   ├── set_ethereum_events_check_interval.ex
│   │   │       │   └── set_ethereum_stalled_sync_threshold.ex
│   │   │       ├── root_chain/
│   │   │       │   ├── abi.ex
│   │   │       │   ├── abi_event_selector.ex
│   │   │       │   ├── abi_function_selector.ex
│   │   │       │   ├── event.ex
│   │   │       │   ├── fields.ex
│   │   │       │   ├── rpc.ex
│   │   │       │   └── submit_block.ex
│   │   │       ├── root_chain.ex
│   │   │       ├── supervisor.ex
│   │   │       └── transaction.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── fixtures.exs
│   │       ├── omg_eth/
│   │       │   ├── application_test.exs
│   │       │   ├── blockchain/
│   │       │   │   ├── bit_helper_test.exs
│   │       │   │   ├── transaction/
│   │       │   │   │   ├── hash_test.exs
│   │       │   │   │   └── signature_test.exs
│   │       │   │   └── transaction_test.exs
│   │       │   ├── client_test.exs
│   │       │   ├── encoding/
│   │       │   │   └── contract_constructor_test.exs
│   │       │   ├── encoding_test.exs
│   │       │   ├── eth_test.exs
│   │       │   ├── ethereum_height_monitor_test.exs
│   │       │   ├── release_tasks/
│   │       │   │   ├── set_contract_test.exs
│   │       │   │   ├── set_ethereum_block_time_test.exs
│   │       │   │   ├── set_ethereum_client_test.exs
│   │       │   │   ├── set_ethereum_events_check_interval_test.exs
│   │       │   │   └── set_ethereum_stalled_sync_threshold_test.exs
│   │       │   ├── root_chain/
│   │       │   │   ├── abi_test.exs
│   │       │   │   └── event_test.exs
│   │       │   └── root_chain_test.exs
│   │       ├── support/
│   │       │   ├── defaults.ex
│   │       │   ├── dev_geth.ex
│   │       │   ├── dev_helper.ex
│   │       │   ├── dev_node.ex
│   │       │   ├── root_chain_helper.ex
│   │       │   ├── snapshot_contracts.ex
│   │       │   ├── token.ex
│   │       │   ├── transaction_helper.ex
│   │       │   └── wait_for.ex
│   │       └── test_helper.exs
│   ├── omg_status/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── lib/
│   │   │   ├── omg_status/
│   │   │   │   ├── alert/
│   │   │   │   │   ├── alarm.ex
│   │   │   │   │   ├── alarm_handler.ex
│   │   │   │   │   └── alarm_printer.ex
│   │   │   │   ├── application.ex
│   │   │   │   ├── configuration.ex
│   │   │   │   ├── datadog_event/
│   │   │   │   │   ├── alarm_consumer.ex
│   │   │   │   │   └── alarm_handler.ex
│   │   │   │   ├── metric/
│   │   │   │   │   ├── datadog.ex
│   │   │   │   │   ├── event.ex
│   │   │   │   │   ├── statix.ex
│   │   │   │   │   ├── telemetry.ex
│   │   │   │   │   ├── tracer.ex
│   │   │   │   │   └── vmstats_sink.ex
│   │   │   │   ├── monitor/
│   │   │   │   │   ├── memory_monitor.ex
│   │   │   │   │   └── statsd_monitor.ex
│   │   │   │   ├── release_tasks/
│   │   │   │   │   ├── set_application.ex
│   │   │   │   │   ├── set_logger.ex
│   │   │   │   │   ├── set_sentry.ex
│   │   │   │   │   └── set_tracer.ex
│   │   │   │   └── sentry_filter.ex
│   │   │   └── status.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── omg_status/
│   │       │   ├── alert/
│   │       │   │   └── alarm_printer_test.exs
│   │       │   ├── datadog_event/
│   │       │   │   └── alarm_consumer_test.exs
│   │       │   ├── integration/
│   │       │   │   └── alarms_test.exs
│   │       │   ├── metric/
│   │       │   │   └── datadog_test.exs
│   │       │   ├── monitor/
│   │       │   │   ├── memory_monitor_test.exs
│   │       │   │   └── statsd_monitor_test.exs
│   │       │   └── release_tasks/
│   │       │       ├── set_logger_test.exs
│   │       │       ├── set_sentry_test.exs
│   │       │       └── set_tracer_test.exs
│   │       ├── sentry_filter_test.exs
│   │       └── test_helper.exs
│   ├── omg_utils/
│   │   ├── lib/
│   │   │   ├── omg_utils/
│   │   │   │   ├── app_version.ex
│   │   │   │   ├── http_rpc/
│   │   │   │   │   ├── encoding.ex
│   │   │   │   │   ├── error.ex
│   │   │   │   │   ├── response.ex
│   │   │   │   │   └── validators/
│   │   │   │   │       └── base.ex
│   │   │   │   ├── paginator.ex
│   │   │   │   └── remote_ip.ex
│   │   │   └── utils.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── omg_utils/
│   │       │   ├── app_version_tet.exs
│   │       │   ├── http_rpc/
│   │       │   │   ├── encoding_test.exs
│   │       │   │   ├── response_test.exs
│   │       │   │   └── validators/
│   │       │   │       └── base_test.exs
│   │       │   └── remote_ip_test.exs
│   │       └── test_helper.exs
│   ├── omg_watcher/
│   │   ├── lib/
│   │   │   ├── omg_watcher/
│   │   │   │   ├── api/
│   │   │   │   │   ├── account.ex
│   │   │   │   │   ├── alarm.ex
│   │   │   │   │   ├── configuration.ex
│   │   │   │   │   ├── in_flight_exit.ex
│   │   │   │   │   ├── status.ex
│   │   │   │   │   ├── status_cache/
│   │   │   │   │   │   ├── external.ex
│   │   │   │   │   │   └── storage.ex
│   │   │   │   │   ├── status_cache.ex
│   │   │   │   │   ├── transaction.ex
│   │   │   │   │   └── utxo.ex
│   │   │   │   ├── application.ex
│   │   │   │   ├── block.ex
│   │   │   │   ├── block_getter/
│   │   │   │   │   ├── block_application.ex
│   │   │   │   │   ├── core.ex
│   │   │   │   │   ├── measure.ex
│   │   │   │   │   ├── status.ex
│   │   │   │   │   └── supervisor.ex
│   │   │   │   ├── block_getter.ex
│   │   │   │   ├── block_validator.ex
│   │   │   │   ├── child_manager.ex
│   │   │   │   ├── configuration.ex
│   │   │   │   ├── coordinator_setup.ex
│   │   │   │   ├── crypto.ex
│   │   │   │   ├── datadog_event/
│   │   │   │   │   ├── contract_event_consumer.ex
│   │   │   │   │   └── encode.ex
│   │   │   │   ├── ethereum_event_aggregator.ex
│   │   │   │   ├── ethereum_event_listener/
│   │   │   │   │   ├── core.ex
│   │   │   │   │   └── measure.ex
│   │   │   │   ├── ethereum_event_listener.ex
│   │   │   │   ├── event.ex
│   │   │   │   ├── exit_processor/
│   │   │   │   │   ├── canonicity.ex
│   │   │   │   │   ├── competitor_info.ex
│   │   │   │   │   ├── core.ex
│   │   │   │   │   ├── double_spend.ex
│   │   │   │   │   ├── exit_info.ex
│   │   │   │   │   ├── finalizations.ex
│   │   │   │   │   ├── in_flight_exit_info.ex
│   │   │   │   │   ├── known_tx.ex
│   │   │   │   │   ├── measure.ex
│   │   │   │   │   ├── piggyback.ex
│   │   │   │   │   ├── request.ex
│   │   │   │   │   ├── standard_exit.ex
│   │   │   │   │   ├── tools.ex
│   │   │   │   │   └── tx_appendix.ex
│   │   │   │   ├── exit_processor.ex
│   │   │   │   ├── fees/
│   │   │   │   │   └── fee_filter.ex
│   │   │   │   ├── fees.ex
│   │   │   │   ├── http_rpc/
│   │   │   │   │   ├── adapter.ex
│   │   │   │   │   └── client.ex
│   │   │   │   ├── merge_transaction_validator.ex
│   │   │   │   ├── merkle.ex
│   │   │   │   ├── monitor.ex
│   │   │   │   ├── output.ex
│   │   │   │   ├── raw_data.ex
│   │   │   │   ├── release_tasks/
│   │   │   │   │   ├── set_application.ex
│   │   │   │   │   ├── set_ethereum_events_check_interval.ex
│   │   │   │   │   ├── set_exit_processor_sla_margin.ex
│   │   │   │   │   └── set_tracer.ex
│   │   │   │   ├── root_chain_coordinator/
│   │   │   │   │   ├── core.ex
│   │   │   │   │   ├── measure.ex
│   │   │   │   │   └── service.ex
│   │   │   │   ├── root_chain_coordinator.ex
│   │   │   │   ├── signature.ex
│   │   │   │   ├── state/
│   │   │   │   │   ├── core.ex
│   │   │   │   │   ├── measure.ex
│   │   │   │   │   ├── measurement_calculation.ex
│   │   │   │   │   ├── transaction/
│   │   │   │   │   │   ├── fee.ex
│   │   │   │   │   │   ├── payment.ex
│   │   │   │   │   │   ├── recovered.ex
│   │   │   │   │   │   ├── signed.ex
│   │   │   │   │   │   ├── validator/
│   │   │   │   │   │   │   ├── fee_claim.ex
│   │   │   │   │   │   │   └── payment.ex
│   │   │   │   │   │   ├── validator.ex
│   │   │   │   │   │   └── witness.ex
│   │   │   │   │   ├── transaction.ex
│   │   │   │   │   └── utxo_set.ex
│   │   │   │   ├── state.ex
│   │   │   │   ├── supervisor.ex
│   │   │   │   ├── sync_supervisor.ex
│   │   │   │   ├── tracer.ex
│   │   │   │   ├── typed_data_hash/
│   │   │   │   │   ├── config.ex
│   │   │   │   │   ├── tools.ex
│   │   │   │   │   └── types.ex
│   │   │   │   ├── typed_data_hash.ex
│   │   │   │   ├── utxo/
│   │   │   │   │   └── position.ex
│   │   │   │   ├── utxo.ex
│   │   │   │   ├── utxo_exit/
│   │   │   │   │   └── core.ex
│   │   │   │   └── wire_format_types.ex
│   │   │   └── omg_watcher.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── fixtures.exs
│   │       ├── omg_watcher/
│   │       │   ├── api/
│   │       │   │   ├── account_test.exs
│   │       │   │   ├── alarm_test.exs
│   │       │   │   └── status_cache_test.exs
│   │       │   ├── block_getter/
│   │       │   │   └── core_test.exs
│   │       │   ├── block_test.exs
│   │       │   ├── block_validator_test.exs
│   │       │   ├── child_manager_test.exs
│   │       │   ├── crypto_test.exs
│   │       │   ├── datadog_event/
│   │       │   │   ├── contract_event_consumer_test.exs
│   │       │   │   └── encode_test.exs
│   │       │   ├── ethereum_event_aggregator_test.exs
│   │       │   ├── ethereum_event_listener/
│   │       │   │   └── core_test.exs
│   │       │   ├── exit_processor/
│   │       │   │   ├── canonicity_test.exs
│   │       │   │   ├── core/
│   │       │   │   │   └── state_interaction_test.exs
│   │       │   │   ├── core_test.exs
│   │       │   │   ├── exit_info_test.exs
│   │       │   │   ├── finalizations_test.exs
│   │       │   │   ├── in_flight_exit_info_test.exs
│   │       │   │   ├── persistence_test.exs
│   │       │   │   ├── piggyback_test.exs
│   │       │   │   ├── standard_exit_test.exs
│   │       │   │   └── tools_test.exs
│   │       │   ├── fees/
│   │       │   │   └── fee_filter_test.exs
│   │       │   ├── fees_test.exs
│   │       │   ├── http_rpc/
│   │       │   │   └── adapter_test.exs
│   │       │   ├── integration/
│   │       │   │   ├── block_getter_1_test.exs
│   │       │   │   ├── block_getter_2_test.exs
│   │       │   │   ├── block_getter_3_test.exs
│   │       │   │   ├── block_getter_4_test.exs
│   │       │   │   ├── block_getter_test.exs
│   │       │   │   ├── in_flight_exit_test.exs
│   │       │   │   ├── in_flight_exit_test_1_test.exs
│   │       │   │   ├── in_flight_exit_test_2_test.exs
│   │       │   │   ├── in_flight_exit_test_3_test.exs
│   │       │   │   ├── in_flight_exit_test_4_test.exs
│   │       │   │   ├── invalid_exit_1_test.exs
│   │       │   │   ├── invalid_exit_2_test.exs
│   │       │   │   ├── monitor_test.exs
│   │       │   │   ├── root_chain_coordinator_test.exs
│   │       │   │   └── test_server_test.exs
│   │       │   ├── merge_transaction_validator_test.exs
│   │       │   ├── merkle_test.exs
│   │       │   ├── output_test.exs
│   │       │   ├── raw_data_test.exs
│   │       │   ├── release_tasks/
│   │       │   │   ├── set_ethereum_events_check_interval_test.exs
│   │       │   │   ├── set_exit_processor_sla_margin_test.exs
│   │       │   │   └── set_tracer_test.exs
│   │       │   ├── root_chain_coordinator/
│   │       │   │   └── core_test.exs
│   │       │   ├── signature_test.exs
│   │       │   ├── state/
│   │       │   │   ├── core_test.exs
│   │       │   │   ├── measurement_calculation_test.exs
│   │       │   │   ├── persistence_test.exs
│   │       │   │   ├── transaction/
│   │       │   │   │   ├── fee_test.exs
│   │       │   │   │   ├── recovered_test.exs
│   │       │   │   │   └── witness_test.exs
│   │       │   │   ├── transaction_test.exs
│   │       │   │   └── utxo_set_test.exs
│   │       │   ├── state_test.exs
│   │       │   ├── supervisor_test.exs
│   │       │   ├── typed_data_hash_test.exs
│   │       │   ├── utxo/
│   │       │   │   └── position_test.exs
│   │       │   ├── utxo_exit/
│   │       │   │   └── core_test.exs
│   │       │   ├── utxo_test.exs
│   │       │   └── wire_format_types_test.exs
│   │       ├── support/
│   │       │   ├── dev_crypto.ex
│   │       │   ├── exit_processor/
│   │       │   │   ├── case.ex
│   │       │   │   └── test_helper.ex
│   │       │   ├── integration/
│   │       │   │   ├── bad_child_chain_server.ex
│   │       │   │   ├── deposit_helper.ex
│   │       │   │   ├── fixtures.exs
│   │       │   │   ├── test_helper.ex
│   │       │   │   └── test_server.ex
│   │       │   ├── signature_helper.ex
│   │       │   ├── test_helper.ex
│   │       │   └── watcher_helper.ex
│   │       └── test_helper.exs
│   ├── omg_watcher_info/
│   │   ├── lib/
│   │   │   ├── omg_watcher_info/
│   │   │   │   ├── api/
│   │   │   │   │   ├── account.ex
│   │   │   │   │   ├── block.ex
│   │   │   │   │   ├── deposit.ex
│   │   │   │   │   ├── stats.ex
│   │   │   │   │   └── transaction.ex
│   │   │   │   ├── application.ex
│   │   │   │   ├── block_applicator.ex
│   │   │   │   ├── db/
│   │   │   │   │   ├── block.ex
│   │   │   │   │   ├── eth_event.ex
│   │   │   │   │   ├── eth_event_txoutput.ex
│   │   │   │   │   ├── repo.ex
│   │   │   │   │   ├── transaction.ex
│   │   │   │   │   ├── txoutput.ex
│   │   │   │   │   └── types/
│   │   │   │   │       ├── atom_type.ex
│   │   │   │   │       ├── block/
│   │   │   │   │       │   └── chunk.ex
│   │   │   │   │       └── integer_type.ex
│   │   │   │   ├── http_rpc/
│   │   │   │   │   ├── adapter.ex
│   │   │   │   │   └── client.ex
│   │   │   │   ├── measure.ex
│   │   │   │   ├── order_fee_fetcher.ex
│   │   │   │   ├── release_tasks/
│   │   │   │   │   ├── init_postgresql_db.ex
│   │   │   │   │   └── set_tracer.ex
│   │   │   │   ├── supervisor.ex
│   │   │   │   ├── tracer.ex
│   │   │   │   ├── transaction.ex
│   │   │   │   └── utxo_selection.ex
│   │   │   └── watcher_info.ex
│   │   ├── mix.exs
│   │   ├── priv/
│   │   │   └── repo/
│   │   │       └── migrations/
│   │   │           ├── 20180813131000_create_block_table.exs
│   │   │           ├── 20180813131706_create_transaction_table.exs
│   │   │           ├── 20180813133000_create_ethevent_table.exs
│   │   │           ├── 20180813143343_create_txoutput_table.exs
│   │   │           ├── 20190314105410_alter_transactions_table_add_metadata_field.exs
│   │   │           ├── 20190315095855_alter_transactions_table_add_partitial_index.exs
│   │   │           ├── 20190408131000_add_missing_indices_to_txoutputs.exs
│   │   │           ├── 20190806111817_alter_txoutputs_ethevents_make_many_to_many_relation.exs
│   │   │           ├── 20190917165912_set_inserted_at_updated_at_to_epoc.exs
│   │   │           ├── 20200129051756_index_block_timestamp.exs
│   │   │           ├── 20200211064454_add_txtype_to_transaction_and_output.exs
│   │   │           ├── 20200214132000_add_and_fix_timestamps.exs
│   │   │           ├── 20200514115919_add_eth_height_to_eth_events.exs
│   │   │           └── 20200529085008_create_pending_block_table.exs
│   │   └── test/
│   │       ├── fixtures.exs
│   │       ├── omg_watcher_info/
│   │       │   ├── api/
│   │       │   │   ├── block_test.exs
│   │       │   │   ├── deposit_test.exs
│   │       │   │   ├── stats_test.exs
│   │       │   │   └── transaction_test.exs
│   │       │   ├── block_applicator_test.exs
│   │       │   ├── db/
│   │       │   │   ├── block/
│   │       │   │   │   └── chunk_test.exs
│   │       │   │   ├── block_test.exs
│   │       │   │   ├── eth_event_test.exs
│   │       │   │   ├── transaction_test.exs
│   │       │   │   └── txoutput_test.exs
│   │       │   ├── http_rpc/
│   │       │   │   └── adapter_test.exs
│   │       │   ├── order_fee_fetcher_test.exs
│   │       │   ├── release_tasks/
│   │       │   │   └── set_tracer_test.exs
│   │       │   ├── transaction_test.exs
│   │       │   └── utxo_selection_test.exs
│   │       ├── support/
│   │       │   ├── factories/
│   │       │   │   ├── block_factory.ex
│   │       │   │   ├── data_helper.ex
│   │       │   │   ├── eth_event_factory.ex
│   │       │   │   ├── transaction_factory.ex
│   │       │   │   └── txoutput_factory.ex
│   │       │   ├── factory.ex
│   │       │   └── test_server.ex
│   │       └── test_helper.exs
│   ├── omg_watcher_rpc/
│   │   ├── lib/
│   │   │   ├── application.ex
│   │   │   ├── configuration.ex
│   │   │   ├── release_tasks/
│   │   │   │   ├── set_api_mode.ex
│   │   │   │   ├── set_endpoint.ex
│   │   │   │   └── set_tracer.ex
│   │   │   ├── tracer.ex
│   │   │   ├── web/
│   │   │   │   ├── controllers/
│   │   │   │   │   ├── account.ex
│   │   │   │   │   ├── alarm.ex
│   │   │   │   │   ├── block.ex
│   │   │   │   │   ├── challenge.ex
│   │   │   │   │   ├── configuration.ex
│   │   │   │   │   ├── deposit.ex
│   │   │   │   │   ├── fallback.ex
│   │   │   │   │   ├── fee.ex
│   │   │   │   │   ├── in_flight_exit.ex
│   │   │   │   │   ├── stats.ex
│   │   │   │   │   ├── status.ex
│   │   │   │   │   ├── transaction.ex
│   │   │   │   │   └── utxo.ex
│   │   │   │   ├── endpoint.ex
│   │   │   │   ├── plugs/
│   │   │   │   │   ├── health.ex
│   │   │   │   │   ├── method_param_filter.ex
│   │   │   │   │   └── supported_watcher_modes.ex
│   │   │   │   ├── response.ex
│   │   │   │   ├── router.ex
│   │   │   │   ├── serializers/
│   │   │   │   │   └── base.ex
│   │   │   │   ├── sockets/
│   │   │   │   │   └── socket.ex
│   │   │   │   ├── validators/
│   │   │   │   │   ├── account_constraints.ex
│   │   │   │   │   ├── block_constraints.ex
│   │   │   │   │   ├── deposit_constraints.ex
│   │   │   │   │   ├── helpers.ex
│   │   │   │   │   ├── merge_constraints.ex
│   │   │   │   │   ├── order.ex
│   │   │   │   │   ├── transaction_constraints.ex
│   │   │   │   │   └── typed_data_signed.ex
│   │   │   │   └── views/
│   │   │   │       ├── account.ex
│   │   │   │       ├── alarm.ex
│   │   │   │       ├── block.ex
│   │   │   │       ├── challenge.ex
│   │   │   │       ├── configuration.ex
│   │   │   │       ├── deposit.ex
│   │   │   │       ├── error.ex
│   │   │   │       ├── fee.ex
│   │   │   │       ├── in_flight_exit.ex
│   │   │   │       ├── stats.ex
│   │   │   │       ├── status.ex
│   │   │   │       ├── transaction.ex
│   │   │   │       └── utxo.ex
│   │   │   └── web.ex
│   │   ├── mix.exs
│   │   ├── priv/
│   │   │   └── swagger/
│   │   │       ├── info_api_specs/
│   │   │       │   ├── account/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── alarm/
│   │   │       │   │   ├── alarms_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── batch_transaction/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── block/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── configuration/
│   │   │       │   │   ├── configuration_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── deposit/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── fees/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── response_schemas.yaml
│   │   │       │   ├── responses.yaml
│   │   │       │   ├── stats/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── swagger.yaml
│   │   │       │   └── transaction/
│   │   │       │       ├── paths.yaml
│   │   │       │       ├── request_bodies.yaml
│   │   │       │       ├── response_schemas.yaml
│   │   │       │       ├── responses.yaml
│   │   │       │       └── schemas.yaml
│   │   │       ├── info_api_specs.yaml
│   │   │       ├── security_critical_api_specs/
│   │   │       │   ├── account/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── alarm/
│   │   │       │   │   ├── alarms_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── batch_transaction/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── block/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── configuration/
│   │   │       │   │   ├── configuration_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── in_flight_exit/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── response_schemas.yaml
│   │   │       │   ├── responses.yaml
│   │   │       │   ├── status/
│   │   │       │   │   ├── byzantine_events_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── swagger.yaml
│   │   │       │   ├── transaction/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   └── utxo/
│   │   │       │       ├── paths.yaml
│   │   │       │       ├── request_bodies.yaml
│   │   │       │       ├── response_schemas.yaml
│   │   │       │       ├── responses.yaml
│   │   │       │       └── schemas.yaml
│   │   │       ├── security_critical_api_specs.yaml
│   │   │       ├── shared/
│   │   │       │   ├── paths.yaml
│   │   │       │   ├── request_bodies.yaml
│   │   │       │   └── schemas.yaml
│   │   │       └── swagger.md
│   │   └── test/
│   │       ├── omg_watcher_rpc/
│   │       │   ├── release_tasks/
│   │       │   │   ├── set_endpoint_test.exs
│   │       │   │   └── set_tracer_test.exs
│   │       │   ├── tracer_test.exs
│   │       │   └── web/
│   │       │       ├── conn_case.ex
│   │       │       ├── controllers/
│   │       │       │   ├── account_test.exs
│   │       │       │   ├── alarm_test.exs
│   │       │       │   ├── block_test.exs
│   │       │       │   ├── challenge_test.exs
│   │       │       │   ├── deposit_test.exs
│   │       │       │   ├── enforce_content_plug_test.exs
│   │       │       │   ├── fallback_test.exs
│   │       │       │   ├── fee_test.exs
│   │       │       │   ├── in_flight_exit_test.exs
│   │       │       │   ├── stats_test.exs
│   │       │       │   ├── status_test.exs
│   │       │       │   ├── transaction_test.exs
│   │       │       │   └── utxo_test.exs
│   │       │       ├── data_case.ex
│   │       │       ├── plugs/
│   │       │       │   ├── method_param_filter_test.exs
│   │       │       │   └── supported_watcher_modes_test.exs
│   │       │       ├── response_test.exs
│   │       │       ├── router_test.exs
│   │       │       ├── validators/
│   │       │       │   ├── account_contraints_test.exs
│   │       │       │   ├── block_constraints_test.exs
│   │       │       │   ├── merge_constraints_test.exs
│   │       │       │   ├── transaction_constraints_test.exs
│   │       │       │   └── typed_data_signed_test.exs
│   │       │       ├── view_case.ex
│   │       │       └── views/
│   │       │           └── transaction_test.exs
│   │       └── test_helper.exs
│   └── xomg_tasks/
│       ├── lib/
│       │   ├── mix/
│       │   │   └── tasks/
│       │   │       ├── watcher.ex
│       │   │       └── watcher_info.ex
│       │   └── utils.ex
│       ├── mix.exs
│       └── test/
│           └── test_helper.exs
├── bin/
│   ├── generate-localchain-env
│   ├── revert
│   ├── rocksdb
│   ├── setup
│   ├── variables
│   └── variables_test_barebone
├── config/
│   ├── .credo.exs
│   ├── config.exs
│   ├── credo/
│   │   ├── license_header.ex
│   │   └── require_parentheses_on_zero_arity_defs.ex
│   ├── dev.exs
│   ├── prod.exs
│   ├── releases.exs
│   └── test.exs
├── contract_addresses_template.env
├── coveralls.json
├── dialyzer.ignore-warnings
├── docker/
│   ├── create_databases.sql
│   ├── geth/
│   │   ├── command
│   │   └── geth-blank-password
│   ├── nginx/
│   │   ├── geth_nginx.conf
│   │   ├── nginx.conf
│   │   └── nginx.reorg.conf
│   └── static_feefeed/
│       └── file.json
├── docker-compose-infura.yml
├── docker-compose-watcher.yml
├── docker-compose.datadog.yml
├── docker-compose.dev.yml
├── docker-compose.feefeed.yml
├── docker-compose.reorg.yml
├── docker-compose.specs.yml
├── docker-compose.yml
├── docs/
│   ├── api_specs/
│   │   ├── errors.md
│   │   ├── index.html.md
│   │   └── status_events_specs.md
│   ├── architecture.md
│   ├── branching.md
│   ├── deployment_configuration.md
│   ├── details.md
│   ├── dex_design.md
│   ├── exit_validation.md
│   ├── fee_design.md
│   ├── in_flight_exit_scenarios.md
│   ├── install.md
│   ├── morevp.md
│   ├── perf_test_result_dumps.md
│   ├── run_local_watcher.md
│   ├── source_consumption_log.md
│   ├── stack_architecture.md
│   ├── standard_vs_in_flight_exits_interaction.md
│   ├── tesuji_blockchain_design.md
│   ├── transaction_validation.md
│   ├── unified_api.md
│   └── watcher_db_design.md
├── dummy
├── fees_setup.env
├── mix.exs
├── priv/
│   ├── dev-artifacts/
│   │   ├── README.md
│   │   ├── fee_specs.dev.json
│   │   └── fee_specs.test.json
│   └── perf/
│       ├── .formatter.exs
│       ├── .gitignore
│       ├── Dockerfile
│       ├── Makefile
│       ├── README.md
│       ├── apps/
│       │   └── load_test/
│       │       ├── .formatter.exs
│       │       ├── .gitignore
│       │       ├── README.md
│       │       ├── lib/
│       │       │   ├── application.ex
│       │       │   ├── child_chain/
│       │       │   │   ├── abi/
│       │       │   │   │   ├── abi_event_selector.ex
│       │       │   │   │   ├── abi_function_selector.ex
│       │       │   │   │   └── fields.ex
│       │       │   │   ├── abi.ex
│       │       │   │   ├── deposit.ex
│       │       │   │   ├── exit.ex
│       │       │   │   ├── transaction.ex
│       │       │   │   ├── utxos.ex
│       │       │   │   └── watcher_sync.ex
│       │       │   ├── connection/
│       │       │   │   ├── child_chain.ex
│       │       │   │   ├── connection_defaults.ex
│       │       │   │   ├── watcher_info.ex
│       │       │   │   └── watcher_security.ex
│       │       │   ├── ethereum/
│       │       │   │   ├── account.ex
│       │       │   │   ├── bit_helper.ex
│       │       │   │   ├── crypto.ex
│       │       │   │   ├── ethereum.ex
│       │       │   │   ├── hash.ex
│       │       │   │   ├── nonce_tracker.ex
│       │       │   │   └── transaction/
│       │       │   │       ├── signature.ex
│       │       │   │       └── transaction.ex
│       │       │   ├── performance.ex
│       │       │   ├── runner/
│       │       │   │   ├── childchain.ex
│       │       │   │   ├── deposits.ex
│       │       │   │   ├── smoke.ex
│       │       │   │   ├── standard_exits.ex
│       │       │   │   ├── transactions.ex
│       │       │   │   ├── utxos_load.ex
│       │       │   │   └── watcher_info.ex
│       │       │   ├── scenario/
│       │       │   │   ├── account_transactions.ex
│       │       │   │   ├── create_utxos.ex
│       │       │   │   ├── deposits.ex
│       │       │   │   ├── fund_account.ex
│       │       │   │   ├── many_standard_exits.ex
│       │       │   │   ├── smoke.ex
│       │       │   │   ├── spend_eth_utxo.ex
│       │       │   │   ├── start_standard_exit.ex
│       │       │   │   ├── transactions.ex
│       │       │   │   └── watcher_status.ex
│       │       │   ├── service/
│       │       │   │   ├── datadog/
│       │       │   │   │   ├── api.ex
│       │       │   │   │   └── dummy_statix.ex
│       │       │   │   ├── datadog.ex
│       │       │   │   ├── faucet.ex
│       │       │   │   ├── metrics.ex
│       │       │   │   ├── sleeper.ex
│       │       │   │   └── sync.ex
│       │       │   ├── test_runner/
│       │       │   │   ├── config.ex
│       │       │   │   └── help.ex
│       │       │   ├── test_runner.ex
│       │       │   ├── utils/
│       │       │   │   └── encoding.ex
│       │       │   └── watcher_info/
│       │       │       ├── balance.ex
│       │       │       ├── client.ex
│       │       │       ├── transaction.ex
│       │       │       └── utxo.ex
│       │       ├── mix.exs
│       │       └── test/
│       │           ├── load_test/
│       │           │   ├── runner/
│       │           │   │   ├── childchain_test.exs
│       │           │   │   ├── smoke_test.exs
│       │           │   │   ├── standard_exit_test.exs
│       │           │   │   ├── utxos_load_test.exs
│       │           │   │   └── watcher_info_test.exs
│       │           │   └── service/
│       │           │       └── datadog/
│       │           │           └── api_test.exs
│       │           └── test_helper.exs
│       ├── config/
│       │   ├── .credo.exs
│       │   ├── config.exs
│       │   ├── dev.exs
│       │   ├── stress.exs
│       │   └── test.exs
│       ├── mix.exs
│       └── scripts/
│           └── generate_api_client.sh
├── rel/
│   └── env.sh.eex
├── rootfs/
│   ├── watcher_entrypoint
│   └── watcher_info_entrypoint
├── snapshot_reorg.env
└── snapshots.env

================================================
FILE CONTENTS
================================================

================================================
FILE: .circleci/ci_increase_chart_version.sh
================================================
#!/bin/sh

"""
This is the script that would send a dispatch event to the helm chart repo to auto increase chart version.
You can set the UPDATE_DEV flag to decide whether to update to dev too.

For master, we increase the chart version and update dev together. The app version should be short git sha with length 7.
For release, we increase the chart version only. The app version should be semver. (eg. 1.0.3-pre.0)

Required env vars:
- CHART_NAME (eg. childchain, watcher, watcher-info)
- APP_VERSION (eg. 3d75118 or 1.0.3-pre.0)
- HELM_CHART_REPO (eg. helm-devlopement)
- UPDATE_DEV (true/false)
- GITHUB_API_TOKEN
"""

set -ex

[ -z "$CHART_NAME" ] && echo "CHART_NAME should be set" && exit 1
[ -z "$APP_VERSION" ] && echo "APP_VERSION should be set" && exit 1
[ -z "$HELM_CHART_REPO" ] && echo "HELM_CHART_REPO should be set" && exit 1
[ -z "$UPDATE_DEV" ] && echo "HELM_CHART_REPO should be set" && exit 1
[ -z "$GITHUB_API_TOKEN" ] && echo "GITHUB_API_TOKEN should be set" && exit 1


echo "increase chart version: chart [${CHART_NAME}], appVersion: [${APP_VERSION}], update_dev: [${UPDATE_DEV}]"

curl --location --request POST "https://api.github.com/repos/omgnetwork/${HELM_CHART_REPO}/dispatches" \
--header "Accept: application/vnd.github.v3+json" \
--header "authorization: token ${GITHUB_API_TOKEN}" \
--header "Content-Type: application/json" \
--data-raw " { \
    \"event_type\": \"increase-chart-version\", \
    \"client_payload\": { \
        \"chart_name\": \"${CHART_NAME}\", \
        \"app_version\": \"${APP_VERSION}\", \
        \"update_dev\": \"${UPDATE_DEV}\" \
    } \
}"


================================================
FILE: .circleci/ci_publish.sh
================================================
#!/bin/sh

set -e

echo_info() {
    printf "\\033[0;34m%s\\033[0;0m\\n" "$1"
}

echo_warn() {
    printf "\\033[0;33m%s\\033[0;0m\\n" "$1"
}


## Sanity check
##

if [ -z "$DOCKER_PASS" ] || [ -z "$DOCKER_USER" ]; then
    echo_warn "Docker credentials is not present, skipping publish."
    exit 0
fi

if [ -z "$IMAGE_NAME" ]; then
    echo_warn "IMAGE_NAME not present, failing."
    exit 1
fi


## Generate tags
##

if [ -n "$CIRCLE_SHA1" ]; then
    _image_tag="$(printf "%s" "$CIRCLE_SHA1" | head -c 7)"
fi

if [ -n "$CIRCLE_TAG" ]; then
    _ver="${CIRCLE_TAG#*v}"

    # Given a v1.0.0-pre.1 tag, this will generate:
    # - 1.0
    # - 1.0.0-pre
    # - 1.0.0-pre.1
    while true; do
        case "$_ver" in
            *.* )
                _image_tag="$_ver $_image_tag"
                _ver="${_ver%.*}"
                ;;
            * )
                break;;
        esac
    done

    # In case the commit is HEAD of latest version branch, also tag stable.
    if [ -n "$CIRCLE_REPOSITORY_URL" ] && [ -n "$CIRCLE_SHA1" ]; then
        _stable_head="$(
            git ls-remote --heads "$CIRCLE_REPOSITORY_URL" "v*" |
            awk '/refs\/heads\/v[0-9]+\.[0-9]+$/ { LH=$1 } END { print LH }'
        )"

        if [ "$CIRCLE_SHA1" = "$_stable_head" ]; then
            _image_tag="$_image_tag stable"
        fi
    fi
else
    case "$CIRCLE_BRANCH" in
        master ) _image_tag="$_image_tag latest";;
        v*     ) _image_tag="$_image_tag ${CIRCLE_BRANCH#*v}-dev";;
        *      ) ;;
    esac
fi


## Publishing
##

if [ -f "$HOME/caches/docker-layers.tar" ]; then
    docker load -i "$HOME/caches/docker-layers.tar"
fi

printf "%s\\n" "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin

for tag in $_image_tag; do
    echo_info "Publishing Docker image as $IMAGE_NAME:$tag"
    docker tag "$IMAGE_NAME" "$IMAGE_NAME:$tag"
    docker push "$IMAGE_NAME:$tag"
done


================================================
FILE: .circleci/config.yml
================================================
version: 2.1

executors:
  metal:
    docker:
      - image: circleci/elixir:1.10.2
      - image: circleci/postgres:9.6
        environment:
          MIX_ENV: test
          POSTGRES_USER: omisego_dev
          POSTGRES_PASSWORD: omisego_dev
          POSTGRES_DB: omisego_test
          CIRLCECI: true
    working_directory: ~/src

  metal_macos:
    macos:
      xcode: "11.0.0"

  builder:
    docker:
      - image: omisegoimages/elixir-omg-builder:stable-20201207
    working_directory: ~/src

  builder_pg:
    docker:
      - image: omisegoimages/elixir-omg-builder:stable-20201207
      - image: circleci/postgres:9.6-alpine
        environment:
          POSTGRES_USER: omisego_dev
          POSTGRES_PASSWORD: omisego_dev
          POSTGRES_DB: omisego_test
    working_directory: ~/src

  builder_pg_geth:
    docker:
      - image: omisegoimages/elixir-omg-tester:stable-20201207
      - image: circleci/postgres:9.6-alpine
        environment:
          POSTGRES_USER: omisego_dev
          POSTGRES_PASSWORD: omisego_dev
          POSTGRES_DB: omisego_test
    working_directory: ~/src

  deployer:
    docker:
      - 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:
      - attach_workspace:
          name: Attach workspace
          at: .

  docker_login:
    description: login to dockerhub for private repo access
    steps:
      - run: printf "%s\\n" "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin

  make_docker_images:
    description: Builds docker images
    steps:
      - run: make docker-watcher
      - run: make docker-watcher_info

  check_docker_status:
    description: Installs elixir and checks if docker is healthy
    steps:
      - run:
          name: Print docker states
          command: |
            docker image ls
            docker-compose ps

  setup_childchain:
    description: "Setups Child chain for watcher tests"
    steps:
      # otherwise docker compose down errors with ERROR: Couldn't find env file
      - run: touch localchain_contract_addresses.env
      - run: docker-compose down
      - run: sudo rm -rf data/
      - run:
          name: Setup data dir
          command: |
            [ -d data ] || mkdir data && chmod 777 data
      - run:
          name: Pull down snapshot
          command: SNAPSHOT=SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_20 make init_test
      - run: |
          echo -e "FEE_SPECS_FILE_PATH=/dev-artifacts/fee_specs.test.json\n$(cat fees_setup.env)" > fees_setup.env
          echo "FEE_SPECS_FILE_PATH=/dev-artifacts/fee_specs.test.json" >> fees_setup.env
          cat fees_setup.env
      - run:
          name: Standup Geth and Child Chain
          command: docker-compose up geth childchain postgres
          background: true
      - run:
          name: Has Childchain started?
          command: |
            attempt_counter=0
            max_attempts=25
            until $(curl --output /dev/null --silent --head --fail http://localhost:9656/alarm.get); do
              if [ ${attempt_counter} -eq ${max_attempts} ];then
                echo "Max attempts reached"
                exit 1
              fi
              printf '.'
              attempt_counter=$(($attempt_counter+1))
              sleep 5
            done

  run_test_in_docker:
    description: "Quick test runs"
    parameters:
      test_command:
        type: string
      test_name:
        type: string
    steps:
      - run:
          name: "Docker run <<parameters.test_name>>"
          command: |
            docker run --rm -it --network=chain_net -e DOCKER=true -e CHILD_CHAIN_URL=http://172.27.0.108:9656/ -e ETHEREUM_RPC_URL=http://172.27.0.108:80 -e DOCKER_GETH=true -e TEST_DATABASE_URL=postgresql://omisego_dev:omisego_dev@172.27.0.107:5432/omisego_test -e SHELL=/bin/sh -v $(pwd):/app --entrypoint /bin/sh omisegoimages/elixir-omg-builder:stable-20201207 -c "cd /app && mix deps.get && <<parameters.test_command>>"

  install_elixir:
    description: Installs elixir and checks if docker is healthy
    steps:
      - 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 plugin-add rust || asdf plugin-update rust
            asdf install
          no_output_timeout: 2400
      - install_rust
      - save_cache:
          key: v2-asdf-install
          paths:
            - ~/.asdf
            - ~/.asdf-vm
      - run: make install-hex-rebar
      - restore_cache:
          key: v2-mix-specs-cache-{{ .Branch }}-{{ checksum "mix.lock" }}

  install_deps:
    description: Install linux dependencies
    steps:
      - run:
          name: Install deps
          command: |
            set -e
            sudo killall dpkg || true &&
            sudo rm /var/lib/dpkg/lock || true &&
            sudo rm /var/cache/apt/archives/lock || true &&
            sudo dpkg --configure -a || true &&
            sudo apt-get update &&
            ./bin/setup
          no_output_timeout: 2400
  install_and_setup_gcloud:
    description: Installs and sets up gcloud to fetch feefeed
    steps:
      - run: |
          export LD_LIBRARY_PATH=/usr/local/lib
          export CLOUDSDK_PYTHON=/usr/bin/python
          wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-323.0.0-linux-x86_64.tar.gz -O gcloud-sdk.tar.gz
            tar zxf gcloud-sdk.tar.gz google-cloud-sdk
            mv google-cloud-sdk ~/.google-cloud-sdk
            ~/.google-cloud-sdk/install.sh --quiet
            echo $GCP_KEY_FILE | gcloud auth activate-service-account $GCP_SERVICE_EMAIL --key-file=-
            gcloud --quiet config set project ${GCP_PROJECT}
            gcloud --quiet config set compute/zone ${GCP_ZONE}
            gcloud --quiet auth configure-docker

jobs:
  barebuild:
    executor: metal
    environment:
      MIX_ENV: test
    steps:
      - checkout
      - run: make install-hex-rebar
      - run: echo 'export PATH=~/.cargo/bin:$PATH' >> $BASH_ENV
      - run:
          command: ./bin/setup
          no_output_timeout: 2400
      - run: make deps-elixir-omg
      - run: ERLANG_ROCKSDB_BUILDOPTS='-j 2' make build-test
      - run: mix test
      - run:
          name: Integration Tests
          command: |
            # 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
          no_output_timeout: 30m
  barebuild_macos:
    executor: metal_macos
    environment:
      MIX_ENV: test
    steps:
      - checkout
      - run: echo 'export PATH=~/.cargo/bin:$PATH' >> $BASH_ENV
      - run: |
          brew install postgres
          initdb /usr/local/var/postgres/data
          pg_ctl -D /usr/local/var/postgres/data -l /tmp/postgresql.log start
          psql template1 \<<EOF
          CREATE USER omisego_dev WITH CREATEDB ENCRYPTED PASSWORD 'omisego_dev';
          CREATE DATABASE omisego_dev OWNER 'omisego_dev';
          EOF
      - run: |
          git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.4
          echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
          echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile
          source ~/.bash_profile
          asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
          asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
          asdf plugin-add rust || asdf plugin-update rust
          asdf install
      - run: make init_test
      - install_rust
      - run:
          command: ./bin/setup
          no_output_timeout: 2400
      - run: make deps-elixir-omg
      - run: ERLANG_ROCKSDB_BUILDOPTS='-j 2' make build-test
      - run: mix test
  build:
    executor: builder
    environment:
      MIX_ENV: test
    steps:
      - checkout
      - restore_cache:
          key: v1-rocksdb-cache-{{ checksum "mix.lock" }}
      - run: make init_test
      - run: make deps-elixir-omg
      - run: ERLANG_ROCKSDB_BUILDOPTS='-j 2' make build-test
      - save_cache:
          key: v2-mix-cache-test-compile-{{ checksum "mix.lock" }}-{{ .Branch }}-{{ .Revision }}
          paths: "_build_docker"
      - save_cache:
          key: v1-rocksdb-cache-{{ checksum "mix.lock" }}
          paths:
            - "deps_docker/"
            - "deps_docker/rocksdb"
            - "_build_docker/test/lib/rocksdb/"
            - "_build_docker/test/dev/rocksdb/"
            - "deps/"
            - "_build/test/lib/rocksdb/"
            - "_build/test/dev/rocksdb/"
      - persist_to_workspace:
          name: Persist workspace
          root: ~/src
          paths:
            - .circleci
            - dialyzer.ignore-warnings
            - .formatter.exs
            - _build_docker
            - .credo.exs
            - apps
            - bin
            - config
            - deps_docker
            - doc
            - mix.exs
            - mix.lock
            - deploy_and_populate.sh
            - launcher.py
            - docker-compose.yml
            - rel/
            - VERSION
            - .git
            - Makefile
            - priv
            - data
            - snapshots.env
            - snapshot_reorg.env
            - nginx.conf
            - contract_addresses_template.env
            - localchain_contract_addresses.env


  audit_deps:
    executor: builder
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - run: mix deps.audit

  lint:
    executor: builder
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - run: make install-hex-rebar
      - run: mix do compile --warnings-as-errors --force, credo --ignore-checks Credo.Check.Readability.SinglePipe, format --check-formatted --dry-run
      - run:
          command: |
            export SHELL=/bin/bash
            set +eo pipefail
            _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 273 ]; then
              echo "Have you been naughty or nice? Find out if Santa knows."
              exit 1
            fi

  sobelow:
    executor: builder_pg
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - run: mix archive.install hex sobelow --force
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r .
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg_bus
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg_db
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg_eth
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg_status
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg_utils
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg_watcher
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg_watcher_info
      - run: mix sobelow --exit --skip --ignore Config.HTTPS -r apps/omg_watcher_rpc --router apps/omg_watcher_rpc/lib/web/router.ex

  watcher_coveralls_and_integration_tests:
    executor: builder_pg_geth
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - restore_cache:
          keys:
            - v2-mix-cache-test-compile-{{ checksum "mix.lock" }}-{{ .Branch }}-{{ .Revision }}
      - run:
          name: Compile
          command: mix compile
      - run:
          name: Integration Tests & Coveralls Part Watcher
          command: |
            # 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
            else
              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-2004:202010-01
    environment:
      MIX_ENV: test
    steps:
      - checkout
      - restore_cache:
          keys:
            - v2-mix-cache-test-compile-watcher_mix_based_childchain-{{ checksum "mix.lock" }}-{{ .Branch }}
      - run: rm -rf _build_docker/test/lib/omg*
      - run:
          name: Setup dirs
          command: |
            [ -d _build_docker ] || mkdir _build_docker && sudo chmod -R 777 _build_docker
      - run:
          name: Setup dirs deps_docker
          command: |
            [ -d deps_docker ] || mkdir deps_docker &&  sudo chmod -R 777 deps_docker
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/invalid_exit_1_test.exs --include mix_based_child_chain"
            test_name: "invalid_exit_1_test.exs"
      - save_cache:
          key: v2-mix-cache-test-compile-watcher_mix_based_childchain-{{ checksum "mix.lock" }}-{{ .Branch }}
          paths:
            - deps_docker
            - _build_docker
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/in_flight_exit_test_3_test.exs --include mix_based_child_chain"
            test_name: "in_flight_exit_test_3_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/in_flight_exit_test_2_test.exs --include mix_based_child_chain"
            test_name: "in_flight_exit_test_2_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/in_flight_exit_test_1_test.exs --include mix_based_child_chain"
            test_name: "in_flight_exit_test_1_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/in_flight_exit_test_4_test.exs --include mix_based_child_chain"
            test_name: "in_flight_exit_test_4_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/in_flight_exit_test.exs --include mix_based_child_chain"
            test_name: "in_flight_exit_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/invalid_exit_2_test.exs --include mix_based_child_chain"
            test_name: "invalid_exit_2_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/block_getter_1_test.exs --include mix_based_child_chain"
            test_name: "block_getter_1_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/block_getter_2_test.exs --include mix_based_child_chain"
            test_name: "block_getter_2_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/block_getter_3_test.exs --include mix_based_child_chain"
            test_name: "block_getter_3_test.exs"
      - setup_childchain
      - run_test_in_docker:
            test_command: "mix test test/omg_watcher/integration/block_getter_4_test.exs --include mix_based_child_chain"
            test_name: "block_getter_4_test.exs"

  watcher_info_coveralls_and_integration_tests:
    executor: builder_pg_geth
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - restore_cache:
          keys:
            - v2-mix-cache-test-compile-{{ checksum "mix.lock" }}-{{ .Branch }}-{{ .Revision }}
      - run:
          name: Compile
          command: mix compile
      - run:
          name: Integration Tests & Coveralls Part Watcher
          command: |
            # 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
            else
              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

  common_coveralls_and_integration_tests:
    executor: builder_pg_geth
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - restore_cache:
          keys:
            - v2-mix-cache-test-compile-{{ checksum "mix.lock" }}-{{ .Branch }}-{{ .Revision }}
      - run:
          name: Compile
          command: mix compile
      - run:
          name: Integration Tests & Coveralls Part Common
          command: |
            # 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
            else
              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

  test:
    executor: builder_pg
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - restore_cache:
          keys:
            - v2-mix-cache-test-compile-{{ checksum "mix.lock" }}-{{ .Branch }}-{{ .Revision }}
      - run:
          name: Compile
          command: mix compile
      - run:
          name: Test
          command: |
            # 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   --exclude common --exclude watcher --exclude watcher_info
            else
              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

  property_tests:
    executor: builder_pg_geth
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - restore_cache:
          keys:
            - v2-mix-cache-test-compile-{{ checksum "mix.lock" }}-{{ .Branch }}-{{ .Revision }}
      - run:
          name: Compile
          command: mix compile
      - run:
          name: Property Test
          command: |
            export SHELL=/bin/bash
            # no coverage calculation, coverage is on the other tests
            mix test --only property

  integration_tests:
    executor: builder_pg_geth
    environment:
      MIX_ENV: test
    steps:
      - setup_elixir-omg_workspace
      - restore_cache:
          keys:
            - v2-mix-cache-test-compile-{{ checksum "mix.lock" }}-{{ .Branch }}-{{ .Revision }}
      - run:
          name: Compile
          command: mix compile
      - install_rust
      - run:
          name: Integration Tests
          command: |
            # 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

  dialyzer:
    executor: builder_pg
    steps:
      - setup_elixir-omg_workspace
      - restore_cache:
          keys:
            - v3-plt-cache-{{ ".tool-versions" }}-{{ checksum "mix.lock" }}
            - v3-plt-cache-{{ ".tool-versions" }}-{{ checksum "mix.exs" }}
            - v3-plt-cache-{{ ".tool-versions" }}
      - run:
          name: Unpack PLT cache
          command: |
            mkdir -p _build_docker/test
            cp plts/dialyxir*.plt _build_docker/test/ || true
            mkdir -p ~/.mix
            cp plts/dialyxir*.plt ~/.mix/ || true
      - run: mix dialyzer --plt
      - run:
          name: Pack PLT cache
          command: |
            mkdir -p plts
            cp _build_docker/test/dialyxir*.plt plts/
            cp ~/.mix/dialyxir*.plt plts/
      - save_cache:
          key: v3-plt-cache-{{ ".tool-versions" }}-{{ checksum "mix.lock" }}
          paths:
            - plts
      - save_cache:
          key: v3-plt-cache-{{ ".tool-versions" }}-{{ checksum "mix.exs" }}
          paths:
            - plts
      - save_cache:
          key: v3-plt-cache-{{ ".tool-versions" }}
          paths:
            - plts
      - run: mix dialyzer --format short

  test_docker_compose_release:
    machine:
      image: ubuntu-2004:202010-01
    environment:
      SNAPSHOT: SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120
      LD_LIBRARY_PATH: /usr/local/lib
      CLOUDSDK_PYTHON: /usr/bin/python
      CHILD_CHAIN_URL: "http://localhost:9656"
      FEE_CLAIMER_ADDRESS: "0x3b9f4c1dd26e0be593373b1d36cee2008cbeb837"
    parallelism: 5
    steps:
      - checkout
      - run:
          name: "Pull Submodules"
          command: |
            git submodule init
            git submodule update --remote
      - run:
          name: Setup data dir
          command: |
            [ -d data ] || mkdir data && chmod 777 data
      - docker_login
      - make_docker_images
      - install_and_setup_gcloud
      - run:
          name: Start daemon services
          command: make cabbage-start-services
      - 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
          command: |
            cd priv/cabbage
            make install
            make generate_api_code
            mix deps.get
      - run:
          name: Run specs
          working_directory: ~/project/priv/cabbage
          environment:
            MIX_ENV: test
          command: |
            mix compile
      - run:
          name: Run specs
          working_directory: ~/project/priv/cabbage
          command: |
            TESTFILES=$(circleci tests glob "apps/itest/test/itest/*_test.exs" | circleci tests split --split-by=timings --show-counts)
            echo ${TESTFILES}
            mix test ${TESTFILES} --trace
      - store_test_results:
          path: ~/project/priv/cabbage/_build/test/lib/itest/

  test_docker_compose_performance:
    description: "These are not actually performance tests, we're checking if the scripts work"
    machine:
      image: ubuntu-2004:202010-01
    environment:
      PERF_IMAGE_NAME: "omisego/perf:latest"
      STATIX_TAG: "env:perf_circleci"
      LD_LIBRARY_PATH: /usr/local/lib
      CLOUDSDK_PYTHON: /usr/bin/python
    steps:
      - checkout
      - run:
          name: Setup data dir
          command: |
            [ -d data ] || mkdir data && chmod 777 data
      - docker_login
      - make_docker_images
      - install_and_setup_gcloud
      - run:
          name: Build perf docker image
          command: make docker-perf IMAGE_NAME=$PERF_IMAGE_NAME
      - install_elixir
      - run:
          name: Start daemon services
          command: |
            cd priv/perf
            make start-services
      - run:
          name: docker services logs
          background: true
          command: |
            cd priv/perf
            make log-services
      - run: sh .circleci/status.sh
      - run:
          name: Run load test
          command: |
            cd priv/perf
            make init
            export $(cat ../../localchain_contract_addresses.env | xargs)
            make test
      - run:
          name: Show help information
          command: docker run -it $PERF_IMAGE_NAME mix run -e "LoadTest.TestRunner.run()" -- help
      - run:
          name: Run perf smoke test (deposits)
          command: |
            docker run -it --env-file ./localchain_contract_addresses.env -e FEE_AMOUNT=1 --env DD_API_KEY --env DD_APP_KEY --env STATIX_TAG --network host $PERF_IMAGE_NAME mix run -e "LoadTest.TestRunner.run()" -- "deposits" 1 200
      - run:
          name: Run perf smoke test (transactions)
          command: |
            docker run -it --env-file ./localchain_contract_addresses.env -e FEE_AMOUNT=1 --env DD_API_KEY --env DD_APP_KEY --env STATIX_TAG --network host $PERF_IMAGE_NAME mix run -e "LoadTest.TestRunner.run()" -- "transactions" 1 200
      - run:
          name: (Perf) Format generated code and check for warnings
          command: |
            cd priv/perf
            # run format ONLY on formatted code so that it cleans up quoted atoms because
            # we cannot exclude folders to --warnings-as-errors
            mix format apps/*_api/lib/*_api/model/*.ex
            export $(cat ../../localchain_contract_addresses.env | xargs)
            make format-code-check-warnings
      - save_cache:
          key: v2-mix-specs-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
          paths:
            - "priv/perf/deps"

      - run:
          name: (Perf) Credo and formatting
          command: |
            cd priv/perf
            mix do credo, format --check-formatted --dry-run

  test_docker_compose_reorg:
    machine:
      image: ubuntu-2004:202010-01
    environment:
      REORG: true
      LD_LIBRARY_PATH: /usr/local/lib
      CLOUDSDK_PYTHON: /usr/bin/python
    steps:
      - checkout
      - run:
          name: "Pull Submodules"
          command: |
            git submodule init
            git submodule update --remote
      - run:
          name: Setup data dir
          command: |
            [ -d data1 ] || mkdir data1 && chmod 777 data1
            [ -d data2 ] || mkdir data2 && chmod 777 data2
            [ -d data ] || mkdir data && chmod 777 data
      - docker_login
      - make_docker_images
      - install_and_setup_gcloud
      - run:
          name: Start daemon services
          command: |
            make init_test_reorg
            cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env
            docker-compose -f docker-compose.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
          command: make cabbage-reorg-watcher-logs
          background: true
      - run:
          name: Print watcher_info logs
          command: make cabbage-reorg-watcher_info-logs
          background: true
      - run:
          name: Print childchain logs
          command: make cabbage-reorg-childchain-logs
          background: true
      - run:
          name: Print geth logs
          command: make cabbage-reorg-geth-logs
          background: true
      - run:
          name: Print reorg logs
          command: make cabbage-reorgs-logs
          background: true
      - run:
          name: Run specs
          command: |
            cd priv/cabbage
            make install
            make generate_api_code
            mix deps.get
            mix test --only deposit --trace
          no_output_timeout: 30m

  test_barebone_release:
    machine:
      image: ubuntu-2004:202010-01
    environment:
      TERM: xterm-256color
      LD_LIBRARY_PATH: /usr/local/lib
      CLOUDSDK_PYTHON: /usr/bin/python
    steps:
      - checkout
      - run:
          name: "Pull Submodules"
          command: |
            git submodule init
            git submodule update --remote
      - run: echo 'export PATH=~/.cargo/bin:$PATH' >> $BASH_ENV
      - install_and_setup_gcloud
      - docker_login
      - run:
          name: Start geth, postgres, feefeed and pull in blockchain snapshot
          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:
          key: v1-dev-release-cache-{{ checksum "mix.lock" }}
      - run:
          name: Compile
          command: |
            set -e
            make deps-elixir-omg
            mix compile
          no_output_timeout: 2400
      - save_cache:
          key: v1-dev-release-cache-{{ checksum "mix.lock" }}
          paths:
            - "deps_docker/"
            - "deps/"
            - "_build/dev/"
            - "_build/dev/"
      - run:
          name: Run Watcher
          command: |
            set -e
            make start-watcher OVERRIDING_START=start_iex OVERRIDING_VARIABLES=./bin/variables_test_barebone
          background: true
          no_output_timeout: 2400
      - run:
          name: Run Watcher Info
          command: |
            set -e
            make start-watcher_info OVERRIDING_START=start_iex OVERRIDING_VARIABLES=./bin/variables_test_barebone
          background: true
          no_output_timeout: 2400
      - run:
          name: Print docker and process states
          command: |
            docker ps
            ps axww | grep watcher
            ps axww | grep watcher_info
            ps axww | grep child_chain
      - run:
          name: Has Watcher started?
          command: |
            attempt_counter=0
            max_attempts=25
            until $(curl --output /dev/null --silent --head --fail http://localhost:7434/alarm.get); do
              if [ ${attempt_counter} -eq ${max_attempts} ];then
                echo "Max attempts reached"
                exit 1
              fi
              printf '.'
              attempt_counter=$(($attempt_counter+1))
              sleep 5
            done
      - run:
          name: Has Watcher Info started?
          command: |
            attempt_counter=0
            max_attempts=25
            until $(curl --output /dev/null --silent --head --fail http://localhost:7534/alarm.get); do
              if [ ${attempt_counter} -eq ${max_attempts} ];then
                echo "Max attempts reached"
                exit 1
              fi
              printf '.'
              attempt_counter=$(($attempt_counter+1))
              sleep 5
            done


  publish_watcher:
    machine:
      image: ubuntu-2004:202010-01
    environment:
      WATCHER_IMAGE_NAME: "omisego/watcher"
    steps:
      - checkout
      - run: make docker-watcher WATCHER_IMAGE_NAME=$WATCHER_IMAGE_NAME
      - run:
          name: "cp release"
          command: |
            mkdir current_release/
            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-2004:202010-01
    environment:
      PERF_IMAGE_NAME: "omisego/perf"
    steps:
      - checkout
      - run: make docker-perf IMAGE_NAME=$PERF_IMAGE_NAME
      - run: IMAGE_NAME=$PERF_IMAGE_NAME sh .circleci/ci_publish.sh

  publish_watcher_info:
    machine:
      image: ubuntu-2004:202010-01
    environment:
      WATCHER_INFO_IMAGE_NAME: "omisego/watcher_info"
    steps:
      - checkout
      - run: make docker-watcher_info WATCHER_INFO_IMAGE_NAME=$WATCHER_INFO_IMAGE_NAME
      - run:
          name: "cp release"
          command: |
            mkdir current_release/
            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

  increase_chart_version_watcher_master:
    docker:
      - image: cimg/base:2020.01
    environment:
      CHART_NAME: watcher
      HELM_CHART_REPO: helm-development
      UPDATE_DEV: true
    steps:
      - checkout
      - run: APP_VERSION="$(echo "$CIRCLE_SHA1" | head -c 7)" sh .circleci/ci_increase_chart_version.sh

  increase_chart_version_watcher_info_master:
    docker:
      - image: cimg/base:2020.01
    environment:
      CHART_NAME: watcher-info
      HELM_CHART_REPO: helm-development
      UPDATE_DEV: true
    steps:
      - checkout
      - run: APP_VERSION="$(echo "$CIRCLE_SHA1" | head -c 7)" sh .circleci/ci_increase_chart_version.sh

  increase_chart_version_watcher_release:
    docker:
      - image: cimg/base:2020.01
    environment:
      CHART_NAME: watcher
      HELM_CHART_REPO: helm-development
      UPDATE_DEV: false
    steps:
      - checkout
      - run: APP_VERSION="${CIRCLE_TAG#*v}" sh .circleci/ci_increase_chart_version.sh

  increase_chart_version_watcher_info_release:
    docker:
      - image: cimg/base:2020.01
    environment:
      CHART_NAME: watcher-info
      HELM_CHART_REPO: helm-development
      UPDATE_DEV: false
    steps:
      - 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
        environment:
          MIX_ENV: test
    steps:
      - run:
          name: Tell coveralls.io build is done
          command: curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$CIRCLE_WORKFLOW_WORKSPACE_ID&payload[status]=done"

  notify_services:
    executor: builder_pg
    steps:
      - run:
          name: Send development deployment markers
          command: |
            curl -X POST -H 'Content-type: application/json' -d '{"title": "Starting Service", "text": "Starting with git SHA '"$CIRCLE_SHA1"'", "alert_type": "info" }' 'https://app.datadoghq.com/api/v1/events?api_key='"$DD_API_KEY"''
            curl -X POST -H 'Content-type: application/json' -H 'Authorization: Bearer '"$SENTRY_TOKEN"'' -d '{"projects": ["elixir-omg"], "ref": "'"$CIRCLE_SHA1"'", "version": "Watcher-ChildChain-'"$CIRCLE_SHA1"'"}' 'https://sentry.io/api/0/organizations/omisego/releases/'
            GH_URL="https://github.com/omisego/elixir-omg/tree/${CIRCLE_BRANCH}"
            CIRCLE_URL="https://circleci.com/gh/omisego/elixir-omg/${CIRCLE_BUILD_NUM}"
            WORKFLOW_URL="https://circleci.com/workflow-run/${CIRCLE_WORKFLOW_ID}"
            MESSAGE="omisego/elixir-omg branch ${CIRCLE_BRANCH} has deployed a new version"
            RICH_MESSAGE="*omisego/elixir-omg* branch *${CIRCLE_BRANCH}* has been deployed"
            curl -X POST -H 'Content-Type: application/json' --data "{ \
              \"attachments\": [ \
                { \
                  \"fallback\": \"${MESSAGE}\", \
                  \"text\": \"Deployment: ${RICH_MESSAGE}\", \
                  \"mrkdwn\": true, \
                  \"color\": \"#2ced49\", \
                  \"fields\": [ \
                    { \
                      \"title\": \"Git SHA\", \
                      \"value\": \"<$GH_URL|$CIRCLE_SHA1>\", \
                      \"short\": true \
                    }, { \
                      \"title\": \"Branch\", \
                      \"value\": \"<$GH_URL|$CIRCLE_BRANCH>\", \
                      \"short\": true \
                    }, { \
                      \"title\": \"Build\", \
                      \"value\": \"<$CIRCLE_URL|$CIRCLE_BUILD_NUM>\", \
                      \"short\": true \
                    } \
                  ] \
                } \
              ] \
            }" ${SLACK_WEBHOOK}

workflows:
  version: 2
  nightly:
    triggers:
      - schedule:
          cron: "30 8 * * 1-5"
          filters:
            branches:
              only:
                - master
    jobs:
      - build
      - integration_tests:
          requires: [build]
      - barebuild_macos
      #- test_barebone_release
  build-test-deploy:
    jobs:
      - build:
          filters: &all_branches_and_tags
            branches:
              only: /.+/
            tags:
              only: /.+/
      # - test_barebone_release:
      #     filters: *all_branches_and_tags
      - notify_services:
          requires:
            - increase_chart_version_watcher_master
            - increase_chart_version_watcher_info_master
          filters:
            branches:
              only:
                - master
      - coveralls_report:
          requires:
            - watcher_coveralls_and_integration_tests
            - watcher_info_coveralls_and_integration_tests
            - common_coveralls_and_integration_tests
            - test
      - watcher_coveralls_and_integration_tests:
          requires: [build]
          filters: *all_branches_and_tags
      - watcher_info_coveralls_and_integration_tests:
          requires: [build]
          filters: *all_branches_and_tags
      - common_coveralls_and_integration_tests:
          requires: [build]
          filters: *all_branches_and_tags
      - test_docker_compose_release:
          filters: *all_branches_and_tags
      # - test_docker_compose_performance:
      #     filters: *all_branches_and_tags
      - test_docker_compose_reorg:
          filters:
            branches:
              only:
                - master
                - master-v2
      - audit_deps:
          requires: [build]
          filters: *all_branches_and_tags
      - lint:
          requires: [build]
          filters: *all_branches_and_tags
      - sobelow:
          requires: [build]
          filters: *all_branches_and_tags
      - dialyzer:
          requires: [build]
          filters: *all_branches_and_tags
      - test:
          requires: [build]
          filters: *all_branches_and_tags
      - property_tests:
          requires: [build]
          filters: &master_and_version_branches_and_all_tags
            branches:
              only:
                - master
                # vMAJOR.MINOR (e.g. v0.1, v0.2, v1.0, v2.1, etc.)
                - /^v[0-9]+\.[0-9]+/
            tags:
              only:
                - /.+/
      - watcher_mix_based_childchain:
          filters: *all_branches_and_tags
      - publish_watcher:
          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,
              audit_deps
            ]
          filters: &master_and_version_branches_and_all_tags
            branches:
              only:
                - master
                # vMAJOR.MINOR (e.g. v0.1, v0.2, v1.0, v2.1, etc.)
                - /^v[0-9]+\.[0-9]+/
            tags:
              only:
                - /.+/
      - publish_watcher_info:
          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,
              audit_deps
            ]
          filters: *master_and_version_branches_and_all_tags

      # - publish_perf:
      #     requires: [test_docker_compose_performance]
      #     filters:
      #       branches:
      #         only:
      #           - master
      #           # vMAJOR.MINOR (e.g. v0.1, v0.2, v1.0, v2.1, etc.)
      #           - /^v[0-9]+\.[0-9]+/
      #       tags:
      #         only:
      #           - /.+/
      # Increase chart version for master, this will end up trigger deployment on dev
      - increase_chart_version_watcher_master:
          requires: [publish_watcher, publish_watcher_info]
          filters:
            branches:
              only:
                - master
      - increase_chart_version_watcher_info_master:
          requires: [publish_watcher, publish_watcher_info]
          filters:
            branches:
              only:
                - master
      # Increase chart version for new release
      - increase_chart_version_watcher_release:
          requires: [publish_watcher, publish_watcher_info]
          filters: &only_release_tag
            branches:
              ignore: /.*/
            tags:
              only:
                # eg. v1.0.3-pre.0, v1.0.3, ...
                - /^v[0-9]+\.[0-9]+\.[0-9]+.*/
      - 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,
            audit_deps
          ]
          context:
          - shared-semantic-release
          filters:
            branches:
              only: /^master$/
            tags:
              ignore: /.*/


================================================
FILE: .circleci/status.sh
================================================
#!/bin/sh

retries=0
status=1

# Retries roughly every 5 seconds up to 2 minutes
while [ $retries -lt 24 ];  do
  alarms=$(make get-alarms)
  status=$?
  echo ${alarms}

  if [ "$status" -eq "0" ]; then
    exit 0
  fi

  retries=$(( ${retries} + 1 ))
  sleep 5
done

exit ${status}


================================================
FILE: .circleci/test_runner.py
================================================
#!/usr/bin/python3
import logging
import os
import sys
import time

import requests


def create_job(test_runner: str) -> str:
    ''' Create a job in the test runner. Returns the job ID
    '''
    payload = {
        "job": {
            "command": "npm",
            "args": ["run", "ci-test-fast"],
            "cwd": "/home/omg/omg-js"
        }
    }
    try:
        request = requests.post(test_runner + '/job', json=payload)
    except ConnectionError:
        logging.critical('Could not connect to the test runner')
        sys.exit(1)  # Return a non-zero exit code so CircleCI fails

    logging.info('Job created: {}'.format(
        request.content.decode('utf-8'))
    )
    return request.content.decode('utf-8')


def check_job_completed(test_runner: str, job_id: str):
    ''' Get the status of the job from the test runner
    '''
    start_time = int(time.time())
    while True:
        if start_time >= (start_time + 360):
            logging.critical('Test runner did not complete within six minutes')
            sys.exit(1)  # Return a non-zero exit code so CircleCI fails
        try:
            request = requests.get(
                '{}/job/{}/status'.format(test_runner, job_id),
                headers={'Cache-Control': 'no-cache'}
            )
        except ConnectionError:
            logging.critical('Could not connect to the test runner')
            sys.exit(1)  # Return a non-zero exit code so CircleCI fails
        if 'Exited' in request.content.decode('utf-8'):
            logging.info('Job completed successfully')
            break


def check_job_result(test_runner: str, job_id: str):
    ''' Check the result of the job. This is the result of the tests that are
    executed against the push. If they all pass 'true' is returned.
    '''
    try:
        request = requests.get(
            test_runner + '/job/{}/success'.format(job_id),
            headers={'Cache-Control': 'no-cache'}
        )
    except ConnectionError:
        logging.critical('Could not connect to the test runner')
        sys.exit(1)
    if 'true' in request.content.decode('utf-8'):
        logging.info('Tests completed successfully')


def get_envs() -> dict:
    ''' Get the environment variables for the workflow
    '''
    envs = {}
    test_runner = os.getenv('TEST_RUNNER_SERVICE')
    if test_runner is None:
        logging.critical('Test runner service ENV missing')
        sys.exit(1)  # Return a non-zero exit code so CircleCI fails

    envs['TEST_RUNNER_SERVICE'] = test_runner
    return envs


def start_workflow():
    ''' Get the party started
    '''
    logging.info('Workflow started')
    envs = get_envs()
    job_id = str(create_job(envs['TEST_RUNNER_SERVICE']))
    check_job_completed(envs['TEST_RUNNER_SERVICE'], job_id)
    check_job_result(envs['TEST_RUNNER_SERVICE'], job_id)


def set_logger():
    ''' Sets the logging module parameters
    '''
    root = logging.getLogger('')
    for handler in root.handlers:
        root.removeHandler(handler)
    format = '%(asctime)s %(levelname)-8s:%(message)s'
    logging.basicConfig(format=format, level='INFO')


if __name__ == '__main__':
    set_logger()
    start_workflow()


================================================
FILE: .formatter.exs
================================================
# Used by "mix format"
[
  inputs: [
    "config/*.exs",
    "rel/config.exs",
    "mix.exs",
    "apps/*/mix.exs",
    "apps/*/{lib,test,config}/**/*.{ex,exs}",
    "priv/*/config/config.exs",
    "priv/*/mix.exs",
  ]
  ++ (Path.wildcard("priv/*/apps/*/mix.exs") -- Enum.flat_map(
    ["priv/*/apps/watcher_info_api/mix.exs", "priv/*/apps/watcher_security_critical_api/mix.exs"],
    &Path.wildcard/1
  ))
  ++ (Path.wildcard("priv/*/apps/*/{lib,test,config}/**/*.{ex,exs}") -- (Path.wildcard("priv/*/apps/watcher_info_api/{lib,test,config}/**/*.{ex,exs}") ++ Path.wildcard("priv/*/apps/watcher_security_critical_api/{lib,test,config}/**/*.{ex,exs}"))),
  line_length: 120
]


================================================
FILE: .githooks/pre-commit
================================================
#!/bin/sh
echo "Is your code formatted?"
exec mix format --check-formatted


================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
:clipboard: Add associated issues, tickets, docs URL here.

## Overview

Describe what your Pull Request is about in a few sentences.

## Changes

Describe your changes and implementation choices. More details make PRs easier to review.

- Change 1
- Change 2
- ...

## Testing

Describe how to test your new feature/bug fix and if possible, a step by step guide on how to demo this.


================================================
FILE: .github/workflows/auto-merge-pr.yml
================================================
name: Auto Merge PR without conflicts

on:
  pull_request:
    branches: [ master-v2 ]

jobs:
  auto-merge-pr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Attach Label to PR
        run: |
          set -o xtrace

          curl -X PATCH "https://api.github.com/repos/omgnetwork/elixir-omg/issues/${{ github.event.pull_request.number }}" \
          -H "Accept: application/vnd.github.v3+json" \
          -H "Authorization: token ${{ secrets.HOUSE_KEEPER_BOT_TOKEN }}" \
          --data "{\"labels\": [\"sync master-v2\"]}"

      - name: Merge PR
        if: github.head_ref == 'master'
        run: |
          set -o xtrace

          function check_merge() {
          curl "https://api.github.com/repos/omgnetwork/elixir-omg/pulls/${{ github.event.pull_request.number }}" \
          -H "Accept: application/vnd.github.v3+json" \
          -H "Authorization: token ${{ secrets.HOUSE_KEEPER_BOT_TOKEN }}" |
          jq -r '.mergeable'
          }  

          until [ "$(check_merge)" = true -o "$(check_merge)" = false ]; do
            echo -n 'waiting...'
            sleep 10
          done

          if [ "$(check_merge)" = true ]; then
             curl -X PUT "https://api.github.com/repos/omgnetwork/elixir-omg/pulls/${{ github.event.pull_request.number }}/merge" \
             -H "Accept: application/vnd.github.v3+json" \
             -H "Authorization: token ${{ secrets.HOUSE_KEEPER_BOT_TOKEN }}" \
             --data "{\"commit_title\": \"auto-merged ${{ github.event.pull_request.number }}\"}"
          else
             echo "PR unmerged"
          fi


================================================
FILE: .github/workflows/auto-pr-for-branch-syncing.yml
================================================
name: Auto PR for syncing master to master-v2

on:
  push:
    branches: [master]

jobs:
  auto-pr-for-branch-syncing:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Create Pull Request
        run: |
          set -o xtrace

          readonly FROM_BRANCH="master"
          readonly TO_BRANCH="master-v2"
          readonly TITLE="sync: auto syncing from ${FROM_BRANCH} to ${TO_BRANCH}"
          readonly BODY="Time to sync \`${TO_BRANCH}\` with updates from \`${FROM_BRANCH}\`!"

          curl -X POST "https://api.github.com/repos/omgnetwork/elixir-omg/pulls" \
          -H "Accept: application/vnd.github.v3+json" \
          -H "Authorization: token ${{ secrets.HOUSE_KEEPER_BOT_TOKEN }}" \
          --data "{\"title\": \"${TITLE}\", \"head\": \"${FROM_BRANCH}\", \"base\": \"${TO_BRANCH}\", \"body\": \"${BODY}\"}"


================================================
FILE: .github/workflows/enforce-changelog-labels.yml
================================================
name: Enforce changelog labels

on:
  pull_request:
    types: [opened, labeled, unlabeled, synchronize, reopened]
    branches: [master]

jobs:
  enforce-changelog-label:
    runs-on: ubuntu-latest
    env:
      # When updating the labels here, also update the `configure-sections` of the `.github_changelog_generator` file
      ONE_OF_LABELS: "api|enhancement|breaking|bug|chore|documentation"
    steps:
      - name: Check the PR for a changelog label
        id: check-changelog-label
        run: |
          set -o xtrace
          # Using the issues API instead of pulls because it can return only the labels
          curl "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/issues/${{ github.event.pull_request.number }}/labels" \
          | grep -o '"name": "[^"]*' \
          | cut -d'"' -f4 \
          | grep -E $ONE_OF_LABELS \
          || (echo "::error::The PR is missing a valid changelog label. Label the PR with one of: ${ONE_OF_LABELS//|/, }." && exit 1)


================================================
FILE: .github_changelog_generator
================================================
# Issue/PR filter
release-branch=master
since-tag=v0.4.8
exclude-tags-regex=.*-pre.*
unreleased=true

issues=false
pull-requests=true
pr-wo-labels=true

# Categories
pr-label=### Untagged pull requests

# When updating the sections here, also update the `ONE_OF_LABELS` env vars in the `.github/workflows/enforce-changelog-labels.yml` file
configure-sections={"api":{"prefix":"### API changes","labels":["api"]}, "breaking":{"prefix":"### Breaking changes","labels":["breaking"]}, "enhancement":{"prefix":"### Enhancements","labels":["enhancement"]}, "bug":{"prefix":"### Bug fixes","labels":["bug"]}, "chore":{"prefix":"### Chores","labels":["chore"]}, "documentation":{"prefix":"### Documentation updates","labels":["documentation"]}}



================================================
FILE: .gitignore
================================================
# The directory Mix will write compiled artifacts to.
/_build/

# The directory Mix will write compiled artifacts to when in docker.
/_build_docker/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# app-specific coverage results go to their respective apps
/apps/*/cover/

# The directory Mix downloads your dependencies sources to when in docker.
/deps_docker/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Dev sqllite db
*ecto_simple.sqlite3*

# Developers config file
your_config_file.exs

# results of perftesting and profiling with default arguments
fprof.trace
perf_result_*

*.statistics

# Common virtualenv directory
env/

# Elixirls data directory
.elixir_ls

# VS Code config file
.vscode/

# Docker
src/
docker-compose.override.yml

# Sobelow
.sobelow

#generated applications and source
priv/apps/childchain_api
priv/apps/watcher_info_api
priv/apps/watcher_security_critical_api

# where Geth gets it's snapshot data
data/
data1/
data2/
# local test setup
localchain_contract_addresses.env


# the famous mac .DS_Store
.DS_Store

# IntelliJ files
.idea/
*.iml

#vs code
.tool_versions


================================================
FILE: .gitmodules
================================================
[submodule "priv/cabbage"]
  path = priv/cabbage
  url = https://github.com/omgnetwork/specs.git
  branch = master



================================================
FILE: .releaserc.yaml
================================================
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


================================================
FILE: .tool-versions
================================================
elixir 1.11.2
erlang 23.1.4
rust 1.46.0


================================================
FILE: AUTHORS
================================================
OMG Network Pte Ltd


================================================
FILE: CHANGELOG.md
================================================
# Changelog

## [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-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)

[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.4-pre.1...v1.0.4)

### API changes

-  /block.validate endpoint [\#1668](https://github.com/omgnetwork/elixir-omg/pull/1668) ([okalouti](https://github.com/okalouti))

### Enhancements

- Block Validation: New Checks [\#1693](https://github.com/omgnetwork/elixir-omg/pull/1693) ([okalouti](https://github.com/okalouti))
- feat: configurable DB pool size, queue target and queue interval [\#1689](https://github.com/omgnetwork/elixir-omg/pull/1689) ([unnawut](https://github.com/unnawut))
- feat: block queue metrics and stalled submission alarm [\#1649](https://github.com/omgnetwork/elixir-omg/pull/1649) ([unnawut](https://github.com/unnawut))

### Bug fixes

- 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))
- 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))

### Chores

- bump version 1.0.4 [\#1722](https://github.com/omgnetwork/elixir-omg/pull/1722) ([jarindr](https://github.com/jarindr))
- auto trigger chart version bump [\#1695](https://github.com/omgnetwork/elixir-omg/pull/1695) ([boolafish](https://github.com/boolafish))
- bump phoenix [\#1680](https://github.com/omgnetwork/elixir-omg/pull/1680) ([InoMurko](https://github.com/InoMurko))
- chore: increase timeouts for childchain healthchecks [\#1671](https://github.com/omgnetwork/elixir-omg/pull/1671) ([ayrat555](https://github.com/ayrat555))
- fix integration tests [\#1654](https://github.com/omgnetwork/elixir-omg/pull/1654) ([ayrat555](https://github.com/ayrat555))
- feat: pin elixir and erlang versions for asdf [\#1648](https://github.com/omgnetwork/elixir-omg/pull/1648) ([unnawut](https://github.com/unnawut))
- chore: change log and version file change for v1.0.3 \(\#1638\) [\#1639](https://github.com/omgnetwork/elixir-omg/pull/1639) ([boolafish](https://github.com/boolafish))
- use cabbage tests from a separate repo [\#1636](https://github.com/omgnetwork/elixir-omg/pull/1636) ([ayrat555](https://github.com/ayrat555))
- set OMG.State GenServer timeout to 10s [\#1517](https://github.com/omgnetwork/elixir-omg/pull/1517) ([achiurizo](https://github.com/achiurizo))

### Documentation updates

- v.1.0.4 change log [\#1719](https://github.com/omgnetwork/elixir-omg/pull/1719) ([jarindr](https://github.com/jarindr))
- docs: extend description of running cabbage tests [\#1658](https://github.com/omgnetwork/elixir-omg/pull/1658) ([pnowosie](https://github.com/pnowosie))

## [v1.0.3](https://github.com/omgnetwork/elixir-omg/tree/v1.0.3) (2020-07-09)

[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.3-pre.2...v1.0.3)

### API changes

- Add Transaction filter by end\_datetime [\#1595](https://github.com/omgnetwork/elixir-omg/pull/1595) ([jarindr](https://github.com/jarindr))

### Enhancements

- Add block processing queue to watcher info [\#1560](https://github.com/omgnetwork/elixir-omg/pull/1560) ([mederic-p](https://github.com/mederic-p))

### Bug fixes

- remove trace decorator from OMG.WatcherInfo.DB.EthEvent.get/1 [\#1640](https://github.com/omgnetwork/elixir-omg/pull/1640) ([ayrat555](https://github.com/ayrat555))
- get call\_data and rename it [\#1635](https://github.com/omgnetwork/elixir-omg/pull/1635) ([InoMurko](https://github.com/InoMurko))
- fix: handle "transaction underpriced" and other unknown server error responses [\#1617](https://github.com/omgnetwork/elixir-omg/pull/1617) ([unnawut](https://github.com/unnawut))

### Chores

- chore: change log and version file change for v1.0.3 [\#1638](https://github.com/omgnetwork/elixir-omg/pull/1638) ([boolafish](https://github.com/boolafish))
- sync v1.0.2 back to master [\#1626](https://github.com/omgnetwork/elixir-omg/pull/1626) ([boolafish](https://github.com/boolafish))
- enable margin [\#1622](https://github.com/omgnetwork/elixir-omg/pull/1622) ([InoMurko](https://github.com/InoMurko))
- Auto PR with Auto merge for syncing master-v2 [\#1604](https://github.com/omgnetwork/elixir-omg/pull/1604) ([souradeep-das](https://github.com/souradeep-das))
- integrate spandex ecto [\#1602](https://github.com/omgnetwork/elixir-omg/pull/1602) ([ayrat555](https://github.com/ayrat555))
- Revert "explain analyze updates \(\#1569\)" [\#1601](https://github.com/omgnetwork/elixir-omg/pull/1601) ([boolafish](https://github.com/boolafish))
- feat: sync v1.0.1 changes back to master [\#1599](https://github.com/omgnetwork/elixir-omg/pull/1599) ([unnawut](https://github.com/unnawut))
- release artifacts [\#1597](https://github.com/omgnetwork/elixir-omg/pull/1597) ([InoMurko](https://github.com/InoMurko))
- 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))

## [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)

### Enhancements

- global block get interval [\#1576](https://github.com/omgnetwork/elixir-omg/pull/1576) ([InoMurko](https://github.com/InoMurko))
- install telemetry handler for authority balance [\#1567](https://github.com/omgnetwork/elixir-omg/pull/1567) ([InoMurko](https://github.com/InoMurko))
- restart strategy [\#1565](https://github.com/omgnetwork/elixir-omg/pull/1565) ([InoMurko](https://github.com/InoMurko))

### Bug fixes

- async stream + timeout [\#1593](https://github.com/omgnetwork/elixir-omg/pull/1593) ([InoMurko](https://github.com/InoMurko))
- fix: error attempting to log txhash in binary [\#1532](https://github.com/omgnetwork/elixir-omg/pull/1532) ([unnawut](https://github.com/unnawut))
- use fixed version of ex\_abi [\#1519](https://github.com/omgnetwork/elixir-omg/pull/1519) ([ayrat555](https://github.com/ayrat555))

### Chores

- chore: bump version in VERSION file [\#1613](https://github.com/omgnetwork/elixir-omg/pull/1613) ([boolafish](https://github.com/boolafish))
- docs: v1.0.2 change logs [\#1611](https://github.com/omgnetwork/elixir-omg/pull/1611) ([boolafish](https://github.com/boolafish))
- chore: merge master back to v1.0.2 [\#1606](https://github.com/omgnetwork/elixir-omg/pull/1606) ([boolafish](https://github.com/boolafish))
- chore: minor fixes [\#1584](https://github.com/omgnetwork/elixir-omg/pull/1584) ([boolafish](https://github.com/boolafish))
- explain analyze updates [\#1569](https://github.com/omgnetwork/elixir-omg/pull/1569) ([InoMurko](https://github.com/InoMurko))
- Sync v1.0.0 [\#1563](https://github.com/omgnetwork/elixir-omg/pull/1563) ([T-Dnzt](https://github.com/T-Dnzt))

### 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.0-pre.2...v1.0.1)

### Chores

- feat: increase ExitProcessor timeouts [\#1592](https://github.com/omgnetwork/elixir-omg/pull/1592) ([InoMurko](https://github.com/InoMurko))

## [v1.0.0](https://github.com/omgnetwork/elixir-omg/tree/v1.0.0) (2020-06-12)

[Full Changelog](https://github.com/omgnetwork/elixir-omg/compare/v1.0.0-pre.1...v1.0.0)

### API changes

- Add deposit.all endpoint and fetch eth\_height retroactively [\#1509](https://github.com/omgnetwork/elixir-omg/pull/1509) ([okalouti](https://github.com/okalouti))
- Add timestamp and scheduled finalisation time to InvalidExit and UnchallengedExit events [\#1495](https://github.com/omgnetwork/elixir-omg/pull/1495) ([okalouti](https://github.com/okalouti))
- Introduce spending\_txhash in invalid exit events [\#1492](https://github.com/omgnetwork/elixir-omg/pull/1492) ([mederic-p](https://github.com/mederic-p))
- \[2\] Add root chain transaction hash to InvalidExit and UnchallengedExit events [\#1485](https://github.com/omgnetwork/elixir-omg/pull/1485) ([okalouti](https://github.com/okalouti))
- Add root chain transaction hash to InvalidExit and UnchallengedExit events [\#1479](https://github.com/omgnetwork/elixir-omg/pull/1479) ([okalouti](https://github.com/okalouti))
- Input validation enhancements for endpoints [\#1469](https://github.com/omgnetwork/elixir-omg/pull/1469) ([okalouti](https://github.com/okalouti))
- account.get\_utxo pagination [\#1436](https://github.com/omgnetwork/elixir-omg/pull/1436) ([jarindr](https://github.com/jarindr))
- Filtering Input Parameters to Childchain/Watcher API depending on HTTP Method [\#1424](https://github.com/omgnetwork/elixir-omg/pull/1424) ([okalouti](https://github.com/okalouti))
- Prevent split/merge creation in /transaction.create [\#1416](https://github.com/omgnetwork/elixir-omg/pull/1416) ([T-Dnzt](https://github.com/T-Dnzt))

### Enhancements

- Inomurko/reorg block getter [\#1554](https://github.com/omgnetwork/elixir-omg/pull/1554) ([InoMurko](https://github.com/InoMurko))
- add: logging for ethereum tasks [\#1550](https://github.com/omgnetwork/elixir-omg/pull/1550) ([okalouti](https://github.com/okalouti))
- feat: env configurable block\_submit\_max\_gas\_price [\#1548](https://github.com/omgnetwork/elixir-omg/pull/1548) ([unnawut](https://github.com/unnawut))
- cache blocks into ets [\#1547](https://github.com/omgnetwork/elixir-omg/pull/1547) ([InoMurko](https://github.com/InoMurko))
- feat: add event type when consumer is spending utxos [\#1538](https://github.com/omgnetwork/elixir-omg/pull/1538) ([pnowosie](https://github.com/pnowosie))
- cache status get [\#1535](https://github.com/omgnetwork/elixir-omg/pull/1535) ([InoMurko](https://github.com/InoMurko))
- refactor: consistent log message for new events [\#1534](https://github.com/omgnetwork/elixir-omg/pull/1534) ([unnawut](https://github.com/unnawut))
- transaction rewrite, increase pg connection timeout [\#1525](https://github.com/omgnetwork/elixir-omg/pull/1525) ([InoMurko](https://github.com/InoMurko))
- Making Child-chain work with fee feed [\#1500](https://github.com/omgnetwork/elixir-omg/pull/1500) ([pnowosie](https://github.com/pnowosie))
- Papa/sec 27 watcher info ife support [\#1496](https://github.com/omgnetwork/elixir-omg/pull/1496) ([pnowosie](https://github.com/pnowosie))
- feat: make invalid piggyback cause unchallenged exit event when it's close to being finalized [\#1493](https://github.com/omgnetwork/elixir-omg/pull/1493) ([pgebal](https://github.com/pgebal))
- who monitors the monitor [\#1488](https://github.com/omgnetwork/elixir-omg/pull/1488) ([InoMurko](https://github.com/InoMurko))
- feat: system memory monitor that considers buffered and cached memory [\#1474](https://github.com/omgnetwork/elixir-omg/pull/1474) ([unnawut](https://github.com/unnawut))
- Break down incoming events to publish separately [\#1472](https://github.com/omgnetwork/elixir-omg/pull/1472) ([souradeep-das](https://github.com/souradeep-das))
- feat: add child chain metrics for transaction submissions, successes and failures [\#1470](https://github.com/omgnetwork/elixir-omg/pull/1470) ([unnawut](https://github.com/unnawut))
- feat: configurable fee specs path from env var [\#1385](https://github.com/omgnetwork/elixir-omg/pull/1385) ([mederic-p](https://github.com/mederic-p))

### Bug fixes

- prevent race condition for status cache [\#1558](https://github.com/omgnetwork/elixir-omg/pull/1558) ([InoMurko](https://github.com/InoMurko))
- fix: add Ink's log\_encoding\_error config [\#1512](https://github.com/omgnetwork/elixir-omg/pull/1512) ([unnawut](https://github.com/unnawut))
- fix: exclude active exiting utxos from calls to /account.get\_exitable\_utxos [\#1505](https://github.com/omgnetwork/elixir-omg/pull/1505) ([pgebal](https://github.com/pgebal))
- feat: update ink to v1.1 to fix Mix module not found [\#1504](https://github.com/omgnetwork/elixir-omg/pull/1504) ([unnawut](https://github.com/unnawut))
- fix: MemoryMonitor breaking on OS that does not provide buffered and cached memory data [\#1486](https://github.com/omgnetwork/elixir-omg/pull/1486) ([unnawut](https://github.com/unnawut))

### Chores

- Changelog for v1.0.0 [\#1556](https://github.com/omgnetwork/elixir-omg/pull/1556) ([T-Dnzt](https://github.com/T-Dnzt))
- updating httpoison [\#1542](https://github.com/omgnetwork/elixir-omg/pull/1542) ([InoMurko](https://github.com/InoMurko))
- use backport ex\_plasma [\#1537](https://github.com/omgnetwork/elixir-omg/pull/1537) ([achiurizo](https://github.com/achiurizo))
- chore: sync v0.4.8 into master [\#1531](https://github.com/omgnetwork/elixir-omg/pull/1531) ([unnawut](https://github.com/unnawut))
- refactor: remove fixture-based start exit test [\#1514](https://github.com/omgnetwork/elixir-omg/pull/1514) ([unnawut](https://github.com/unnawut))
- test: watcher's /status.get cabbage test [\#1508](https://github.com/omgnetwork/elixir-omg/pull/1508) ([unnawut](https://github.com/unnawut))
- refactor: move exit info related functions to smaller responsibility module [\#1503](https://github.com/omgnetwork/elixir-omg/pull/1503) ([boolafish](https://github.com/boolafish))
- fix: lint\_version compatibility with bash [\#1502](https://github.com/omgnetwork/elixir-omg/pull/1502) ([unnawut](https://github.com/unnawut))
- feat: merge latest v0.4 to master [\#1499](https://github.com/omgnetwork/elixir-omg/pull/1499) ([unnawut](https://github.com/unnawut))
- Kevin/load test cleanup [\#1490](https://github.com/omgnetwork/elixir-omg/pull/1490) ([kevsul](https://github.com/kevsul))
- Revert "Add root chain transaction hash to InvalidExit and UnchallengedExit events" [\#1483](https://github.com/omgnetwork/elixir-omg/pull/1483) ([okalouti](https://github.com/okalouti))
- refactor: add prerequisites for makefile targets involving docker-compose [\#1476](https://github.com/omgnetwork/elixir-omg/pull/1476) ([pgebal](https://github.com/pgebal))
- Move db storage out of docker containers [\#1473](https://github.com/omgnetwork/elixir-omg/pull/1473) ([kevsul](https://github.com/kevsul))
- Inomurko/macos nightly build fix [\#1464](https://github.com/omgnetwork/elixir-omg/pull/1464) ([InoMurko](https://github.com/InoMurko))
- fix: circleci to return the original start-services result after logging the failure [\#1463](https://github.com/omgnetwork/elixir-omg/pull/1463) ([unnawut](https://github.com/unnawut))
- Update alpine base image in Dockerfiles to v3.11 [\#1450](https://github.com/omgnetwork/elixir-omg/pull/1450) ([arthurk](https://github.com/arthurk))

### Documentation updates

- Watcher configs [\#1536](https://github.com/omgnetwork/elixir-omg/pull/1536) ([dmitrydao](https://github.com/dmitrydao))
- Update README.md [\#1468](https://github.com/omgnetwork/elixir-omg/pull/1468) ([dmitrydao](https://github.com/dmitrydao))
- Update installation instructions [\#1465](https://github.com/omgnetwork/elixir-omg/pull/1465) ([pnowosie](https://github.com/pnowosie))



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*


================================================
FILE: CODEOWNERS
================================================
mix.lock @InoMurko


================================================
FILE: Dockerfile.watcher
================================================
FROM alpine:3.11

LABEL maintainer="OMG Network Team <omg@omise.co>"
LABEL description="Official image for OMG Network (Watcher) Plasma Network"

ENV LANG=C.UTF-8

## S6
##

ENV S6_VERSION="1.21.4.0"

RUN set -xe \
 && apk add --update --no-cache --virtual .fetch-deps \
        curl \
        ca-certificates \
 && S6_DOWNLOAD_URL="https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-amd64.tar.gz" \
 && S6_DOWNLOAD_SHA256="e903f138dea67e75afc0f61e79eba529212b311dc83accc1e18a449d58a2b10c" \
 && curl -fsL -o s6-overlay.tar.gz "${S6_DOWNLOAD_URL}" \
 && echo "${S6_DOWNLOAD_SHA256}  s6-overlay.tar.gz" |sha256sum -c - \
 && tar -xzC / -f s6-overlay.tar.gz \
 && rm s6-overlay.tar.gz \
 && apk del .fetch-deps

## Application
##

#rocksdb need libstdc++
RUN apk add --update --no-cache --virtual .watcher-runtime \
        bash \
        libressl \
        libressl-dev \
        libstdc++ \
        lksctp-tools

#libsecp256k1
RUN apk add --no-cache gmp-dev

COPY rootfs /

# USER directive is not being used here since privileges are dropped via
# s6-setuigid in /entrypoint. s6-overlay is required to be run as root.
ARG user=watcher
ARG group=watcher
ARG uid=10000
ARG gid=10000

RUN set -xe \
 && addgroup -g ${gid} ${group} \
 && adduser -D -h /app -u ${uid} -G ${group} ${user} \
 && chown "${uid}:${gid}" "/app" \
 && chmod +x /watcher_entrypoint

#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-20201207 /usr/local/rocksdb/ /usr/local/rocksdb/

ARG release_version
ADD _build_docker/prod/watcher-${release_version}.tar.gz /app
RUN chown -R "${uid}:${gid}" /app
WORKDIR /app

# Watcher app is using PORT environment variable to determine which port to run
# the application server.
ENV PORT 7434

EXPOSE $PORT

# These are ports required for clustering. The range is defined in vm.args
# in inet_dist_listen_min and inet_dist_listen_max.
#EXPOSE 4369 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909
# curl for healthchecks
RUN apk add --no-cache curl
ENTRYPOINT ["/init", "/watcher_entrypoint"]

CMD ["foreground"]


================================================
FILE: Dockerfile.watcher_info
================================================
FROM alpine:3.11

LABEL maintainer="OMG Network Team <engineering@omg.network>"
LABEL description="Official image for OMG Network (WatcherInfo) Plasma Network"

ENV LANG=C.UTF-8

## S6
##

ENV S6_VERSION="1.21.4.0"

RUN set -xe \
 && apk add --update --no-cache --virtual .fetch-deps \
        curl \
        ca-certificates \
 && S6_DOWNLOAD_URL="https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-amd64.tar.gz" \
 && S6_DOWNLOAD_SHA256="e903f138dea67e75afc0f61e79eba529212b311dc83accc1e18a449d58a2b10c" \
 && curl -fsL -o s6-overlay.tar.gz "${S6_DOWNLOAD_URL}" \
 && echo "${S6_DOWNLOAD_SHA256}  s6-overlay.tar.gz" |sha256sum -c - \
 && tar -xzC / -f s6-overlay.tar.gz \
 && rm s6-overlay.tar.gz \
 && apk del .fetch-deps

## Application
##

#rocksdb need libstdc++
RUN apk add --update --no-cache --virtual .watcher-runtime \
        bash \
        libressl \
        libressl-dev \
        libstdc++ \
        lksctp-tools

#libsecp256k1
RUN apk add --no-cache gmp-dev

COPY rootfs /

# USER directive is not being used here since privileges are dropped via
# s6-setuigid in /entrypoint. s6-overlay is required to be run as root.
ARG user=watcher
ARG group=watcher
ARG uid=10000
ARG gid=10000

RUN set -xe \
 && addgroup -g ${gid} ${group} \
 && adduser -D -h /app -u ${uid} -G ${group} ${user} \
 && chown "${uid}:${gid}" "/app" \
 && chmod +x /watcher_info_entrypoint

#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-20201207 /usr/local/rocksdb/ /usr/local/rocksdb/

ARG release_version
ADD _build_docker/prod/watcher_info-${release_version}.tar.gz /app
RUN chown -R "${uid}:${gid}" /app
WORKDIR /app

# Watcher app is using PORT environment variable to determine which port to run
# the application server.
ENV PORT 7534

EXPOSE $PORT

# These are ports required for clustering. The range is defined in vm.args
# in inet_dist_listen_min and inet_dist_listen_max.
#EXPOSE 4369 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909
# curl for healthchecks
RUN apk add --no-cache curl
ENTRYPOINT ["/init", "/watcher_info_entrypoint"]

CMD ["foreground"]


================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

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.
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.


================================================
FILE: Makefile
================================================
MAKEFLAGS += --silent
OVERRIDING_START ?= start_iex
OVERRIDING_VARIABLES ?= bin/variables
SNAPSHOT ?= SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_20
BAREBUILD_ENV ?= dev
help:
	@echo "Dont Fear the Makefile"
	@echo ""
	@echo "PRE-LUMPHINI"
	@echo "------------------"
	@echo
	@echo "If you want to connect to an existing network (Pre-Lumphini) with a Watcher \c"
	@echo "and validate transactions. Run:"
	@echo "  - \`make start-pre-lumphini-watcher\` \c"
	@echo ""
	@echo
	@echo "DOCKER CLUSTER USAGE"
	@echo "------------------"
	@echo ""
	@echo "  - \`make docker-start-cluster\`: start everything for you, but if there are no local images \c"
	@echo "for Watcher and Child chain tagged with latest they will get pulled from our repository."
	@echo ""
	@echo "  - \`make docker-start-cluster-with-infura\`: start everything but connect to Infura \c"
	@echo "instead of your own local geth network. Note: you will need to configure the environment \c"
	@echo "variables defined in docker-compose-infura.yml"
	@echo ""
	@echo "DOCKER DEVELOPMENT"
	@echo "------------------"
	@echo ""
	@echo "  - \`make docker-build-start-cluster\`: watcher and watcher_info images \c"
	@echo "from your current code base, then start a cluster with these freshly built images."
	@echo ""
	@echo " - \`make docker-build\`" watcher and watcher_info images from your current code base
	@echo ""
	@echo "  - \`make docker-update-watcher\`, \`make docker-update-watcher_info\`"
	@echo "replaces containers with your code changes\c"
	@echo "for rapid development."
	@echo ""
	@echo "  - \`make docker-nuke\`: wipe docker clean, including containers, images, networks \c"
	@echo "and build cache."
	@echo ""
	@echo "  - \`make docker-remote-watcher\`: remote console (IEx-style) into the watcher application."
	@echo ""
	@echo "  - \`make docker-remote-watcher_info\`: remote console (IEx-style) into the \c"
	@echo "watcher_info application."
	@echo ""
	@echo "BARE METAL DEVELOPMENT"
	@echo "----------------------"
	@echo
	@echo "This presumes you want to run geth and postgres as containers \c"
	@echo "but Watcher and Child Chain bare metal. You will need four terminal windows."
	@echo ""
	@echo "1. In the first one, start geth, postgres:"
	@echo "    make start-services"
	@echo ""
	@echo "3. In the third terminal window, run:"
	@echo "    make start-watcher"
	@echo ""
	@echo "4. In the fourth terminal window, run:"
	@echo "    make start-watcher_info"
	@echo ""
	@echo "5. Wait until they all boot. And run in the fifth terminal window:"
	@echo "    make get-alarms"
	@echo ""
	@echo "    make remote-watcher"
	@echo ""
	@echo "or"
	@echo "    make remote-watcher_info"
	@echo ""
	@echo "MISCELLANEOUS"
	@echo "-------------"
	@echo "  - \`make diagnostics\`: generate comprehensive diagnostics info for troubleshooting"
	@echo "  - \`make list\`: list all available make targets"
	@echo ""

.PHONY: list
list:
	@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'

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-20201207"
IMAGE_BUILD_DIR ?= $(PWD)

ENV_DEV         ?= env MIX_ENV=dev
ENV_TEST        ?= env MIX_ENV=test
ENV_PROD        ?= env MIX_ENV=prod

WATCHER_PORT ?= 7434
WATCHER_INFO_PORT ?= 7534

HEX_URL    ?= https://repo.hex.pm/installs/1.8.0/hex-0.20.5.ez
HEX_SHA    ?= cb7fdddbc4e5051b403cfb5e874ceb5cb0ecbe981a2a1517b97f9f76c67d234692e901ff48ee10dc712f728ae6ed0a51b11b8bd65b5db5582896123de20e7d49
REBAR_URL  ?= https://repo.hex.pm/installs/1.0.0/rebar-2.6.2
REBAR_SHA  ?= ff1c5ddfce1fcfd73fd65b8bfc0ff1c13aefc2e98921d528cbc1f35e86c9caa1c9c4e848b9ce6404d9a81c50cfcf0e45dd0dddb23cd42708664c41fce6618900
REBAR3_URL ?= https://repo.hex.pm/installs/1.0.0/rebar3-3.5.1
REBAR3_SHA ?= 86e998642991d384e9a6d4f216552609496da0e6ec4eb235df5b8b637d078c1a118bc7cdab501d1d54d24e0b6642adf32cc0c43019d948304301ceef227bedfd

#
# Setting-up
#

deps: deps-elixir-omg

deps-elixir-omg:
	HEX_HTTP_TIMEOUT=120 mix deps.get

# Mimicks `mix local.hex --force && mix local.rebar --force` but with version pinning. See:
# - https://github.com/elixir-lang/elixir/blob/master/lib/mix/lib/mix/tasks/local.hex.ex
# - https://github.com/elixir-lang/elixir/blob/master/lib/mix/lib/mix/tasks/local.rebar.ex
install-hex-rebar:
	mix archive.install ${HEX_URL} --force --sha512 ${HEX_SHA}
	mix local.rebar rebar ${REBAR_URL} --force --sha512 ${REBAR_SHA}
	mix local.rebar rebar3 ${REBAR3_URL} --force --sha512 ${REBAR3_SHA}

.PHONY: deps deps-elixir-omg

#
# Cleaning
#

clean: clean-elixir-omg

clean-elixir-omg:
	rm -rf _build/*
	rm -rf deps/*
	rm -rf _build_docker/*
	rm -rf deps_docker/*

clean-contracts:
	rm -rf data/*

.PHONY: clean clean-elixir-omg clean-contracts

#
# Linting
#

format:
	mix format

check-format:
	mix format --check-formatted 2>&1

check-credo:
	$(ENV_TEST) mix credo 2>&1

check-dialyzer:
	$(ENV_TEST) mix dialyzer 2>&1

.PHONY: format check-format check-credo

#
# Building
#

build-watcher-prod: deps-elixir-omg
	$(ENV_PROD) mix do compile, release watcher --overwrite

build-watcher-dev: deps-elixir-omg
	$(ENV_DEV) mix do compile, release watcher --overwrite

build-watcher_info-prod: deps-elixir-omg
	$(ENV_PROD) mix do compile, release watcher_info --overwrite

build-watcher_info-dev: deps-elixir-omg
	$(ENV_DEV) mix do compile, release watcher_info --overwrite

build-test: deps-elixir-omg
	$(ENV_TEST) mix compile

.PHONY: build-prod build-dev build-test

#
# Contracts initialization
#

# Get the SNAPSHOT url from the snapshots file based on the SNAPSHOT env value
# untar the snapshot and fetch values from the files in build dir that came from plasma-deployer
# put these values into an localchain_contract_addresses.env via the script in bin
# localchain_contract_addresses.env is used by docker, exunit tests and end2end tests
init-contracts: clean-contracts
	mkdir data/ || true && \
	chmod 777 data && \
	URL=$$(grep "^$(SNAPSHOT)" snapshots.env | cut -d'=' -f2-) && \
	curl -o data/snapshot.tar.gz $$URL && \
	cd data && \
	tar --strip-components 1 -zxvf snapshot.tar.gz data/geth && \
	tar --exclude=data/* -xvzf snapshot.tar.gz && \
	AUTHORITY_ADDRESS=$$(cat plasma-contracts/build/authority_address) && \
	ETH_VAULT=$$(cat plasma-contracts/build/eth_vault) && \
	ERC20_VAULT=$$(cat plasma-contracts/build/erc20_vault) && \
	PAYMENT_EXIT_GAME=$$(cat plasma-contracts/build/payment_exit_game) && \
	PLASMA_FRAMEWORK_TX_HASH=$$(cat plasma-contracts/build/plasma_framework_tx_hash) && \
	PLASMA_FRAMEWORK=$$(cat plasma-contracts/build/plasma_framework) && \
	PAYMENT_EIP712_LIBMOCK=$$(cat plasma-contracts/build/paymentEip712LibMock) && \
	MERKLE_WRAPPER=$$(cat plasma-contracts/build/merkleWrapper) && \
	ERC20_MINTABLE=$$(cat plasma-contracts/build/erc20Mintable) && \
	sh ../bin/generate-localchain-env AUTHORITY_ADDRESS=$$AUTHORITY_ADDRESS ETH_VAULT=$$ETH_VAULT \
	ERC20_VAULT=$$ERC20_VAULT PAYMENT_EXIT_GAME=$$PAYMENT_EXIT_GAME \
	PLASMA_FRAMEWORK_TX_HASH=$$PLASMA_FRAMEWORK_TX_HASH PLASMA_FRAMEWORK=$$PLASMA_FRAMEWORK \
	PAYMENT_EIP712_LIBMOCK=$$PAYMENT_EIP712_LIBMOCK MERKLE_WRAPPER=$$MERKLE_WRAPPER ERC20_MINTABLE=$$ERC20_MINTABLE

init-contracts-reorg: clean-contracts
	mkdir data1/ || true && \
	mkdir data2/ || true && \
	mkdir data/ || true && \
	URL=$$(grep "SNAPSHOT" snapshot_reorg.env | cut -d'=' -f2-) && \
	curl -o data1/snapshot.tar.gz $$URL && \
	cd data1 && \
	tar --strip-components 1 -zxvf snapshot.tar.gz data/geth && \
	tar --exclude=data/* -xvzf snapshot.tar.gz && \
        mv snapshot.tar.gz ../data2/snapshot.tar.gz && \
	cd ../data2 && \
	tar --strip-components 1 -zxvf snapshot.tar.gz data/geth && \
	tar --exclude=data/* -xvzf snapshot.tar.gz && \
        mv snapshot.tar.gz ../data/snapshot.tar.gz && \
	cd ../data && \
	tar --strip-components 1 -zxvf snapshot.tar.gz data/geth && \
	tar --exclude=data/* -xvzf snapshot.tar.gz && \
	AUTHORITY_ADDRESS=$$(cat plasma-contracts/build/authority_address) && \
	ETH_VAULT=$$(cat plasma-contracts/build/eth_vault) && \
	ERC20_VAULT=$$(cat plasma-contracts/build/erc20_vault) && \
	PAYMENT_EXIT_GAME=$$(cat plasma-contracts/build/payment_exit_game) && \
	PLASMA_FRAMEWORK_TX_HASH=$$(cat plasma-contracts/build/plasma_framework_tx_hash) && \
	PLASMA_FRAMEWORK=$$(cat plasma-contracts/build/plasma_framework) && \
	PAYMENT_EIP712_LIBMOCK=$$(cat plasma-contracts/build/paymentEip712LibMock) && \
	MERKLE_WRAPPER=$$(cat plasma-contracts/build/merkleWrapper) && \
	ERC20_MINTABLE=$$(cat plasma-contracts/build/erc20Mintable) && \
	sh ../bin/generate-localchain-env AUTHORITY_ADDRESS=$$AUTHORITY_ADDRESS ETH_VAULT=$$ETH_VAULT \
	ERC20_VAULT=$$ERC20_VAULT PAYMENT_EXIT_GAME=$$PAYMENT_EXIT_GAME \
	PLASMA_FRAMEWORK_TX_HASH=$$PLASMA_FRAMEWORK_TX_HASH PLASMA_FRAMEWORK=$$PLASMA_FRAMEWORK \
	PAYMENT_EIP712_LIBMOCK=$$PAYMENT_EIP712_LIBMOCK MERKLE_WRAPPER=$$MERKLE_WRAPPER ERC20_MINTABLE=$$ERC20_MINTABLE

.PHONY: init-contracts

#
# Testing
#

init_test: init-contracts

init_test_reorg: init-contracts-reorg

test:
	mix test --include test --exclude common --exclude watcher --exclude watcher_info

test-watcher:
	mix test --include watcher --exclude watcher_info --exclude common --exclude test

test-watcher_info:
	mix test --include watcher_info --exclude watcher --exclude common --exclude test

test-common:
	mix test --include common --exclude watcher --exclude watcher_info --exclude test

#
# Documentation
#
changelog:
	github_changelog_generator --user omgnetwork --project elixir-omg

.PHONY: changelog

###
start-integration-watcher:
	docker-compose -f docker-compose-watcher.yml up
###

#
# Docker
#

docker-watcher-prod:
	docker run --rm -it \
		-v $(PWD):/app \
		-u root \
		--entrypoint /bin/sh \
		$(IMAGE_BUILDER) \
		-c "cd /app && make build-watcher-prod"

docker-watcher_info-prod:
	docker run --rm -it \
		-v $(PWD):/app \
		-u root \
		--entrypoint /bin/sh \
		$(IMAGE_BUILDER) \
		-c "cd /app && make build-watcher_info-prod"

docker-watcher-build:
	docker build -f Dockerfile.watcher \
		--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=$$(git describe --tags) \
		--cache-from $(WATCHER_INFO_IMAGE_NAME) \
		-t $(WATCHER_INFO_IMAGE_NAME) \
		.

docker-watcher: docker-watcher-prod docker-watcher-build
docker-watcher_info: docker-watcher_info-prod docker-watcher_info-build

docker-perf:
	docker build -f ./priv/perf/Dockerfile -t $(IMAGE_NAME) .

docker-build: docker-watcher docker-watcher_info

docker-push: docker
	docker push $(WATCHER_IMAGE_NAME)
	docker push $(WATCHER_INFO_IMAGE_NAME)


### Cabbage logs

cabbage-logs:
	docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.specs.yml logs --follow

cabbage-logs-reorg:
	docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow

### Cabbage reorg docker logs

cabbage-reorg-watcher-logs:
	docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow watcher

cabbage-reorg-watcher_info-logs:
	docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow watcher_info

cabbage-reorg-childchain-logs:
	docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow childchain

cabbage-reorg-geth-logs:
	docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow | grep "geth"

cabbage-reorgs-logs:
	docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow | grep "reorg"

### Cabbage service commands

cabbage-start-services:
	make init_test && \
        cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env && \
	docker-compose -f docker-compose.yml -f docker-compose.specs.yml up -d || \
	(START_RESULT=$?; docker-compose logs; exit $START_RESULT;)

cabbage-start-services-reorg:
	make init_test_reorg && \
	cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env && \
	docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml up -d || \
	(START_RESULT=$?; docker-compose logs; exit $START_RESULT;)

###OTHER
docker-start-cluster:
	SNAPSHOT=SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120 make init_test && \
	docker-compose build --no-cache && docker-compose up

docker-build-start-cluster:
	$(MAKE) docker-build
	SNAPSHOT=SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120 make init_test && \
	docker-compose build --no-cache && docker-compose up

docker-stop-cluster: localchain_contract_addresses.env
	docker-compose down

docker-update-watcher: localchain_contract_addresses.env
	docker stop elixir-omg_watcher_1
	$(MAKE) docker-watcher
	docker-compose up watcher

docker-update-watcher_info: localchain_contract_addresses.env
	docker stop elixir-omg_watcher_info_1
	$(MAKE) docker-watcher_info
	docker-compose up watcher_info

docker-start-cluster-with-infura: localchain_contract_addresses.env
	if [ -f ./docker-compose.override.yml ]; then \
		docker-compose -f docker-compose.yml -f docker-compose-infura.yml -f docker-compose.override.yml up; \
	else \
		echo "Starting infura requires overriding docker-compose-infura.yml values in a docker-compose.override.yml"; \
	fi

docker-start-cluster-with-datadog: localchain_contract_addresses.env
	docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.datadog.yml up watcher watcher_info childchain

docker-stop-cluster-with-datadog: localchain_contract_addresses.env
	docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.datadog.yml down

docker-nuke: localchain_contract_addresses.env
	docker-compose down --remove-orphans --volumes
	docker system prune --all
	$(MAKE) clean
	$(MAKE) init-contracts

docker-remote-watcher:
	docker exec -it watcher /app/bin/watcher remote

docker-remote-watcher_info:
	docker exec -ti watcher_info /app/bin/watcher_info remote

.PHONY: docker-nuke docker-remote-watcher docker-remote-watcher_info

###
### barebone stuff
###
start-services:
	SNAPSHOT=SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120 make init_test && \
	docker-compose -f ./docker-compose.yml -f ./docker-compose.feefeed.yml up feefeed geth nginx postgres

start-watcher:
	. ${OVERRIDING_VARIABLES} && \
	echo "Building Watcher" && \
	make build-watcher-${BAREBUILD_ENV} && \
	echo "Potential cleanup" && \
	rm -f ./_build/${BAREBUILD_ENV}/rel/watcher/var/sys.config || true && \
	echo "Init Watcher DBs" && \
	_build/${BAREBUILD_ENV}/rel/watcher/bin/watcher eval "OMG.DB.ReleaseTasks.InitKeyValueDB.run()" && \
	_build/${BAREBUILD_ENV}/rel/watcher/bin/watcher eval "OMG.DB.ReleaseTasks.InitKeysWithValues.run()" && \
	echo "Run Watcher" && \
	. ${OVERRIDING_VARIABLES} && \
	PORT=${WATCHER_PORT} _build/${BAREBUILD_ENV}/rel/watcher/bin/watcher $(OVERRIDING_START)

start-watcher_info:
	. ${OVERRIDING_VARIABLES} && \
	echo "Building Watcher Info" && \
	make build-watcher_info-${BAREBUILD_ENV} && \
	echo "Potential cleanup" && \
	rm -f ./_build/${BAREBUILD_ENV}/rel/watcher_info/var/sys.config || true && \
	echo "Init Watcher Info DBs" && \
	_build/${BAREBUILD_ENV}/rel/watcher_info/bin/watcher_info eval "OMG.DB.ReleaseTasks.InitKeyValueDB.run()" && \
	_build/${BAREBUILD_ENV}/rel/watcher_info/bin/watcher_info eval "OMG.DB.ReleaseTasks.InitKeysWithValues.run()" && \
	_build/${BAREBUILD_ENV}/rel/watcher_info/bin/watcher_info eval "OMG.WatcherInfo.ReleaseTasks.InitPostgresqlDB.migrate()" && \
	echo "Run Watcher Info" && \
	. ${OVERRIDING_VARIABLES} && \
	PORT=${WATCHER_INFO_PORT} _build/${BAREBUILD_ENV}/rel/watcher_info/bin/watcher_info $(OVERRIDING_START)

update-watcher:
	_build/dev/rel/watcher/bin/watcher stop ; \
	$(ENV_DEV) mix do compile, release watcher --overwrite && \
	. ${OVERRIDING_VARIABLES} && \
	exec PORT=${WATCHER_PORT} _build/dev/rel/watcher/bin/watcher $(OVERRIDING_START) &

update-watcher_info:
	_build/dev/rel/watcher_info/bin/watcher_info stop ; \
	$(ENV_DEV) mix do compile, release watcher_info --overwrite && \
	. ${OVERRIDING_VARIABLES} && \
	exec PORT=${WATCHER_INFO_PORT} _build/dev/rel/watcher_info/bin/watcher_info $(OVERRIDING_START) &

stop-watcher:
	. ${OVERRIDING_VARIABLES} && \
	_build/dev/rel/watcher/bin/watcher stop

stop-watcher_info:
	. ${OVERRIDING_VARIABLES} && \
	_build/dev/rel/watcher_info/bin/watcher_info stop

remote-watcher:
	. ${OVERRIDING_VARIABLES} && \
	_build/dev/rel/watcher/bin/watcher remote

remote-watcher_info:
	. ${OVERRIDING_VARIABLES} && \
	_build/dev/rel/watcher_info/bin/watcher_info remote

get-alarms:
	echo "Child Chain alarms" ; \
	curl -s -X GET http://localhost:9656/alarm.get ; \
	echo "\nWatcher alarms" ; \
	curl -s -X GET http://localhost:${WATCHER_PORT}/alarm.get ; \
	echo "\nWatcherInfo alarms" ; \
	curl -s -X GET http://localhost:${WATCHER_INFO_PORT}/alarm.get

cluster-stop: localchain_contract_addresses.env
	${MAKE} stop-watcher ; ${MAKE} stop-watcher_info ; docker-compose down

### git setup
init:
	git config core.hooksPath .githooks

#old git
#init:
#  find .git/hooks -type l -exec rm {} \;
#  find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \;

###
### SWAGGER openapi
###
security_critical_api_specs:
	swagger-cli bundle -r -t yaml -o apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml

info_api_specs:
	swagger-cli bundle -r -t yaml -o apps/omg_watcher_rpc/priv/swagger/info_api_specs.yaml apps/omg_watcher_rpc/priv/swagger/info_api_specs/swagger.yaml

api_specs: security_critical_api_specs info_api_specs operator_api_specs

###
### Diagnostics report
###

diagnostics: localchain_contract_addresses.env
	echo "---------- START OF DIAGNOSTICS REPORT ----------"
	echo "\n---------- CHILDCHAIN LOGS ----------"
	docker-compose logs childchain
	echo "\n---------- WATCHER LOGS ----------"
	docker-compose logs watcher
	echo "\n---------- WATCHER_INFO LOGS ----------"
	docker-compose logs watcher_info
	echo "\n---------- GIT ----------"
	echo "Git commit: $$(git rev-parse HEAD)"
	git status
	echo "\n---------- DOCKER-COMPOSE CONTAINERS ----------"
	docker-compose ps
	echo "\n---------- DOCKER CONTAINERS ----------"
	docker ps
	echo "\n---------- DOCKER IMAGES ----------"
	docker image ls
	echo "\n ---------- END OF DIAGNOSTICS REPORT ----------"

.PHONY: diagnostics

localchain_contract_addresses.env:
	$(MAKE) init-contracts


================================================
FILE: README.md
================================================
<img src="docs/assets/logo.png" width="100" height="100" align="right" />

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)

**IMPORTANT NOTICE: Heavily WIP, expect anything**

**Table of Contents**

<!--ts-->
   * [Getting Started](#getting-started)
      * [Service start up using Docker Compose](#service-start-up-using-docker-compose)
         * [Troubleshooting Docker](#troubleshooting-docker)
       * [Install on a Linux host](#install-on-a-linux-host)
   * [Installing Plasma contract snapshots](#installing-plasma-contract-snapshots)
   * [Testing &amp; development](#testing--development)
   * [Working with API Spec's](#working-with-api-specs)

<!-- Added by: user, at: 2019-04-03T18:13+02:00 -->

<!--te-->

<!-- Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc) -->
<!-- GH_TOC_TOKEN=75... ./gh-md-toc --insert ../omgnetwork/README.md -->

# Getting Started

A public testnet for the OMG Network is coming soon.
However, if you are brave and want to test being a Plasma chain operator, read on!

## Service start up using Docker Compose
This is the recommended method of starting the blockchain services, with the auxiliary services automatically provisioned through Docker.

Before attempting the start up please ensure that you are not running any services that are listening on the following TCP ports: 9656, 7434, 7534, 5000, 8545, 5432, 5433.
All commands should be run from the root of the repo.

To bring the entire system up you will first need to bring in the compatible Geth snapshot of plasma contracts:

```sh
make init_test
```
It creates a file `./localchain_contract_addresses.env`. It is required to have this file in current directory for running any `docker-compose` command.

```sh
docker-compose up
```

To bring only specific services up (eg: the childchain service, geth, etc...):

```sh
docker-compose up childchain geth ...
```

_(Note: This will also bring up any services childchain depends on.)_

To run a Watcher only, first make sure you sent an ENV variable called with `INFURA_API_KEY` with your api key and then run:

```sh
docker-compose -f docker-compose-watcher.yml up
```

### Troubleshooting Docker
You can view the running containers via `docker ps`

If service start up is unsuccessful, containers can be left hanging which impacts the start of services on the future attempts of `docker-compose up`.
You can stop all running containers via `docker kill $(docker ps -q)`.

If the blockchain services are not already present on the host, docker-compose will attempt to pull the latest build coming from master.
If you want Docker to use the latest commit from `elixir-omg` you can trigger a fresh build by building all three services with `make docker-childchain`, `make docker-watcher` and `make docker-watcher_info`.

# Install on a Linux host
Follow the guide to **[install](docs/install.md)** the Child Chain server, Watcher and Watcher Info.

# Installing Plasma contract snapshots

To pull in the compatible snapshot for Geth:
```bash
make init_test
```

# Testing & development

Docker building of source code and dependencies used to directly use common `mix` folders like `_build` and `deps`. To support workflows that switch between bare metal and Docker containers we've introduced `_build_docker` and `deps_docker` folders:

```sh
sudo rm -rf _build_docker
sudo rm -rf deps_docker

mkdir _build_docker && chmod 777 _build_docker
mkdir deps_docker && chmod 777 deps_docker
```

Pull in the compatible Plasma contracts snapshot:
```bash
make init_test
```

You can setup the docker environment to run testing and development tasks:

```sh
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.datadog.yml run --rm --entrypoint bash elixir-omg
```

Once the shell has loaded, you can continue and run additional tasks.

Get the necessary dependencies for building:
```bash
cd app && mix deps.get
```

Quick test (no integration tests):
```bash
mix test
```

Longer-running integration tests (requires compiling contracts):
```bash
mix test   --only integration
```

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
MIX_ENV=test iex -S mix run --no-start
```

## Running integration cabbage tests

Integration tests are written using the [`cabbage`](https://github.com/cabbage-ex/cabbage) library and they are located in a separated repo - [specs](https://github.com/omgnetwork/specs). This repo is added to `elixir-omg` as a git submodule. So to fetch them run:
```bash
git submodule init
git submodule update --remote
```

Create a directory for geth:
```bash
mkdir data && chmod 777 data
```

Make services:
```bash
make docker-watcher
make docker-watcher_info
```

Start geth and postgres:
```bash
cd priv/cabbage
make start_daemon_services-2
```

If the above command fails with the message similar to:
```
Creating network "omisego_chain_net" with driver "bridge"
ERROR: Pool overlaps with other one on this address space
```

try the following remedy and retry:
```bash
make stop_daemon_services
rm -rf ../../data/*
docker network prune
```


Build the integration tests project and run tests:
```bash
cd priv/cabbage
make install
make generate_api_code
mix deps.get
mix test
```

## Running reorg cabbage tests

Reorg tests test different assumptions against chain reorgs. They also use the same submodule as regular integration cabbage tests.

Fetch submodule:
```bash
git submodule init
git submodule update --remote
```

Create a directory for geth nodes:
```bash
mkdir data1 && chmod 777 data1 && mkdir data2 && chmod 777 data2 && mkdir data && chmod 777 data
```

Make services:
```bash
make docker-watcher
make docker-watcher_info
```

Start geth nodes and postgres:
```bash
cd priv/cabbage
make start_daemon_services_reorg-2
```

Build the integration tests project and run reorg tests:
```bash
cd priv/cabbage
make install
make generate_api_code
mix deps.get
REORG=true mix test --only reorg
```

# Working with API Spec's

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/omgnetwork/elixir-omg/tree/gh-pages) for more details.

# More details about the design and architecture

Details about the repository, code, architecture and design decisions are available **[here](docs/details.md)**.


================================================
FILE: apps/omg_bus/lib/omg_bus/application.ex
================================================
# Copyright 2019-2020 OMG Network 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.Bus.Application do
  @moduledoc false

  use Application

  def start(_type, _args) do
    OMG.Bus.Supervisor.start_link()
  end
end


================================================
FILE: apps/omg_bus/lib/omg_bus/event.ex
================================================
# Copyright 2019-2020 OMG Network 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.Bus.Event do
  @moduledoc """
  Representation of a single event to be published on OMG event bus
  """

  @enforce_keys [:topic, :event, :payload]
  @type topic_t() :: {atom(), binary()} | binary()
  @type t() :: %__MODULE__{topic: binary(), event: atom, payload: any()}

  defstruct [:topic, :event, :payload]

  @spec new(__MODULE__.topic_t(), atom(), any()) :: __MODULE__.t()
  def new({origin, topic}, event, payload) when is_atom(origin) and is_atom(event) do
    %__MODULE__{topic: "#{origin}:#{topic}", event: event, payload: payload}
  end
end


================================================
FILE: apps/omg_bus/lib/omg_bus/pubsub.ex
================================================
# Copyright 2019-2020 OMG Network 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.Bus.PubSub do
  @moduledoc """
  Thin wrapper around the pubsub mechanism allowing us to not repeat ourselves when starting/broadcasting/subscribing

  All of the messages published will have `:internal_bus_event` prepended to the tuple to distinguish them

  ### Topics and messages

  #### `enqueue_block`

  Is being broadcast on a local node whenever `OMG.Watcher.State` completes forming of a new child chain block

  Message: {:internal_event_bus, :enqueue_block, OMG.Watcher.Block.t()}
  """
  alias Phoenix.PubSub

  def child_spec(args \\ []) do
    args
    |> Keyword.put_new(:name, __MODULE__)
    |> Keyword.put_new(:adapter, PubSub.PG2)
    |> PubSub.child_spec()
  end

  defmacro __using__(_) do
    quote do
      alias OMG.Bus.Event
      alias Phoenix.PubSub

      @doc """
      Fixes the name of the PubSub server and the variant of `Phoenix.PubSub` used
      """

      @doc """
      Subscribes the current process to the internal bus topic
      """
      def subscribe(topic, opts \\ [])

      def subscribe({origin, topic}, opts) when is_atom(origin) do
        PubSub.subscribe(OMG.Bus.PubSub, "#{origin}:#{topic}", opts)
      end

      def subscribe(topic, opts) do
        PubSub.subscribe(OMG.Bus.PubSub, topic, opts)
      end

      @doc """
      Broadcast a message with a prefix indicating that it is originating from the internal event bus

      Handle the message in the receiving process by e.g.
      ```
      def handle_info({:internal_bus_event, :some_event, my_payload}, state)
      ```
      """
      def broadcast(%Event{topic: topic, event: event, payload: payload}) when is_atom(event) do
        PubSub.broadcast(OMG.Bus.PubSub, topic, {:internal_event_bus, event, payload})
      end

      @doc """
      Same as `broadcast/1`, but performed on the local node
      """
      def direct_local_broadcast(%Event{topic: topic, event: event, payload: payload})
          when is_atom(event) do
        PubSub.local_broadcast(OMG.Bus.PubSub, topic, {:internal_event_bus, event, payload})
      end
    end
  end
end


================================================
FILE: apps/omg_bus/lib/omg_bus/supervisor.ex
================================================
# Copyright 2019-2020 OMG Network 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.Bus.Supervisor do
  @moduledoc """
   OMG Bus top level supervisor.
  """
  use Supervisor
  require Logger

  def start_link() do
    Supervisor.start_link(__MODULE__, :ok, name: __MODULE__)
  end

  def init(:ok) do
    children = [{OMG.Bus.PubSub, []}]

    opts = [strategy: :one_for_one]

    _ = Logger.info("Starting #{inspect(__MODULE__)}")
    Supervisor.init(children, opts)
  end
end


================================================
FILE: apps/omg_bus/lib/omg_bus.ex
================================================
# Copyright 2019-2020 OMG Network 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.Bus do
  @moduledoc """
  Modules purpose is to serve as a event bus, the implementation is in the `OMG.Bus.PubSub` macro.
  """
  use OMG.Bus.PubSub
end


================================================
FILE: apps/omg_bus/mix.exs
================================================
defmodule OMG.Bus.MixProject do
  use Mix.Project

  def project() do
    [
      app: :omg_bus,
      version: version(),
      build_path: "../../_build",
      config_path: "../../config/config.exs",
      deps_path: "../../deps",
      lockfile: "../../mix.lock",
      elixir: "~> 1.8",
      elixirc_paths: elixirc_paths(Mix.env()),
      start_permanent: Mix.env() == :prod,
      deps: deps(),
      test_coverage: [tool: ExCoveralls]
    ]
  end

  def application() do
    [
      mod: {OMG.Bus.Application, []},
      extra_applications: [:logger],
      included_applications: []
    ]
  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"]
  defp elixirc_paths(:test), do: ["lib", "test/support"]

  defp deps(), do: [{:phoenix_pubsub, "~> 2.0"}]
end


================================================
FILE: apps/omg_bus/test/omg_bus/event_test.exs
================================================
# Copyright 2019-2020 OMG Network 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.Bus.EventTest do
  @moduledoc false

  use ExUnit.Case

  alias OMG.Bus.Event

  test "creates a root chain event" do
    topic = "Deposit"
    event = :deposit
    payload = ["payload"]

    assert %Event{topic: "root_chain:" <> topic, event: event, payload: payload} ==
             Event.new({:root_chain, topic}, event, payload)
  end

  test "creates a child chain event" do
    topic = "blocks"
    event = :deposit
    payload = ["payload"]

    assert %Event{topic: "child_chain:" <> topic, event: event, payload: payload} ==
             Event.new({:child_chain, topic}, event, payload)
  end
end


================================================
FILE: apps/omg_bus/test/test_helper.exs
================================================
# Copyright 2019-2020 OMG Network 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.
ExUnit.start()


================================================
FILE: apps/omg_conformance/mix.exs
================================================
defmodule OMG.Conformance.MixProject do
  use Mix.Project

  def project() do
    [
      app: :omg_conformance,
      version: version(),
      build_path: "../../_build",
      config_path: "../../config/config.exs",
      deps_path: "../../deps",
      lockfile: "../../mix.lock",
      elixir: "~> 1.8",
      elixirc_paths: elixirc_paths(Mix.env()),
      start_permanent: Mix.env() == :prod,
      deps: deps(),
      test_coverage: [tool: ExCoveralls]
    ]
  end

  def application() do
    [
      extra_applications: [:logger]
    ]
  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"]

  defp deps() do
    [
      {:propcheck, "~> 1.1", only: [:test]},
      {:omg_watcher, in_umbrella: true}
    ]
  end
end


================================================
FILE: apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs
================================================
# Copyright 2019-2020 OMG Network 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.Conformance.MerkleProofPropertyTest do
  @moduledoc """
  Checks if some properties about the merkle proving (proof generation and validation) are consistent across
  implementations (currently `elixir-omg` and `plasma-contracts`, Elixir and Solidity)
  """

  alias OMG.Watcher.Merkle
  alias Support.Conformance.MerkleProofContext
  alias Support.SnapshotContracts

  import Support.Conformance.MerkleProofs, only: [solidity_proof_valid: 5]

  use PropCheck
  use ExUnit.Case, async: false

  @moduletag :property
  @moduletag timeout: 450_000

  setup_all do
    {:ok, exit_fn} = Support.DevNode.start()

    contracts = SnapshotContracts.parse_contracts()
    merkle_wrapper_address_hex = contracts["CONTRACT_ADDRESS_MERKLE_WRAPPER"]

    on_exit(exit_fn)

    [contract: OMG.Eth.Encoding.from_hex(merkle_wrapper_address_hex)]
  end

  property "any root hash and proof created by the Elixir implementation validates in the contract, for all leaves",
           [500, :verbose, max_size: 256, constraint_tries: 100_000],
           %{contract: contract} do
    forall leaves <- list(binary()) do
      root_hash = Merkle.hash(leaves)

      leaves
      |> Enum.with_index()
      |> Enum.all?(fn {leaf, txindex} ->
        proof = Merkle.create_tx_proof(leaves, txindex)
        solidity_proof_valid(leaf, txindex, root_hash, proof, contract)
      end)
    end
  end

  property "no proof can prove a mutated leaf",
           [5000, :verbose, max_size: 256, constraint_tries: 100_000],
           %{contract: contract} do
    forall proof <- MerkleProofContext.correct() do
      forall mutated <- MerkleProofContext.mutated_leaf(proof) do
        not solidity_proof_valid(mutated.leaf, mutated.txindex, mutated.root_hash, mutated.proof, contract)
      end
    end
  end

  property "no proof can prove at different index",
           [5000, :verbose, max_size: 256, constraint_tries: 100_000],
           %{contract: contract} do
    forall proof <- MerkleProofContext.correct() do
      forall mutated <- MerkleProofContext.mutated_txindex(proof) do
        not solidity_proof_valid(mutated.leaf, mutated.txindex, mutated.root_hash, mutated.proof, contract)
      end
    end
  end

  property "no mutated proof bytes can prove anything that the original proved",
           [5000, :verbose, max_size: 256, constraint_tries: 100_000],
           %{contract: contract} do
    forall proof <- MerkleProofContext.correct() do
      forall mutated <- MerkleProofContext.mutated_proof(proof) do
        not solidity_proof_valid(mutated.leaf, mutated.txindex, mutated.root_hash, mutated.proof, contract)
      end
    end
  end

  property "no proof can prove a different leaf/txindex if proof bytes mutated",
           [5000, :verbose, max_size: 256, constraint_tries: 100_000],
           %{contract: contract} do
    forall proof <- MerkleProofContext.correct() do
      forall mutated <- MerkleProofContext.mutated_to_prove_sth_else(proof) do
        not solidity_proof_valid(mutated.leaf, mutated.txindex, mutated.root_hash, mutated.proof, contract)
      end
    end
  end
end


================================================
FILE: apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs
================================================
# Copyright 2019-2020 OMG Network 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.Conformance.MerkleProofTest do
  @moduledoc """
  Checks if some particular cases of merkle proofs (proof generation and validation) behave consistently across
  implementations (currently `elixir-omg` and `plasma-contracts`, Elixir and Solidity)
  """

  alias OMG.Eth.Encoding
  alias OMG.Watcher.Crypto
  alias OMG.Watcher.Merkle
  alias Support.SnapshotContracts

  import Support.Conformance.MerkleProofs, only: [solidity_proof_valid: 5]

  use ExUnit.Case, async: false

  @moduletag :integration
  @moduletag :common

  @proof_length 16
  @max_block_size trunc(:math.pow(2, @proof_length))

  setup_all do
    {:ok, exit_fn} = Support.DevNode.start()

    contracts = SnapshotContracts.parse_contracts()
    merkle_wrapper_address_hex = contracts["CONTRACT_ADDRESS_MERKLE_WRAPPER"]

    on_exit(exit_fn)

    [contract: Encoding.from_hex(merkle_wrapper_address_hex)]
  end

  test "a simple, 3-leaf merkle proof validates fine", %{contract: contract} do
    leaves = [<<1>>, <<0>>, <<>>]
    root_hash = Merkle.hash(leaves)

    leaves
    |> Enum.with_index()
    |> Enum.each(fn {leaf, txindex} ->
      proof = Merkle.create_tx_proof(leaves, txindex)
      assert solidity_proof_valid(leaf, txindex, root_hash, proof, contract)
    end)
  end

  @tag timeout: 240_000
  test "a full-tree merkle proof validates fine", %{contract: contract} do
    # why?
    # 1. we'd like to test all proofs on a full tree
    # 2. that's 65K proofs
    # 3. so we're pre-building the merkle tree by using raw `MerkleTree` calls instead of `OMG.Watcher.Merkle`
    #    This is slightly inconsistent, but otherwise the test takes forever
    full_leaves = Enum.map(1..@max_block_size, &:binary.encode_unsigned/1)
    full_root_hash = Merkle.hash(full_leaves)

    full_tree =
      MerkleTree.build(full_leaves,
        hash_function: &Crypto.hash/1,
        height: 16,
        default_data_block: <<0::256>>
      )

    full_leaves
    |> Enum.with_index()
    |> Enum.each(fn {leaf, txindex} ->
      proof = full_tree |> MerkleTree.Proof.prove(txindex) |> Enum.reverse() |> Enum.join()
      assert solidity_proof_valid(leaf, txindex, full_root_hash, proof, contract)
    end)
  end
end


================================================
FILE: apps/omg_conformance/test/omg_conformance/conformance/signature_property_test.exs
================================================
# Copyright 2019-2020 OMG Network 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.Conformance.SignaturePropertyTest do
  @moduledoc """
  Checks if some properties about the signatures (structural, EIP-712 hashes to be precise) hold for the Elixir and
  Solidity implementations.

  NOTE: if this fails with something like

  ```
  Assertion with == failed
  code:  assert solidity_hash!(tx, contract) == elixir_hash(tx)
  left:  <<8, 195, 121, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>>
  ```

  where `Support.Conformance.SignaturesHashes.signature_hash!/2` return an "almost zero" binary, it means the contract
  unexpectedly refused to signhash a generated transaction.
  """

  alias Support.Conformance.PropertyGenerators

  import Support.Conformance.SignaturesHashes,
    only: [verify: 2, verify_distinct: 3, verify_both_error: 2, verify_distinct_or_erroring: 3]

  use PropCheck
  use Support.Conformance.SignaturesHashesCase, async: false

  @moduletag :property
  @moduletag timeout: 450_000

  property "any tx hashes/signhashes the same in all implementations",
           [1000, :verbose, max_size: 100, constraint_tries: 100_000],
           %{contract: contract} do
    forall tx <- PropertyGenerators.payment_tx() do
      # TODO: expand with verifying the non-signature-related hash, Transaction.raw_txhash
      #       This occurs multiple times, wherever transaction/implementation identity/conformance is tested
      verify(tx, contract)
    end
  end

  property "any 2 different txs hash/signhash differently, regardless of implementation",
           [1000, :verbose, max_size: 100, constraint_tries: 100_000],
           %{contract: contract} do
    forall [{tx1, tx2} <- PropertyGenerators.distinct_payment_txs()] do
      verify_distinct(tx1, tx2, contract)
    end
  end

  property "any crude-mutated tx binary either fails to decode to a transaction object or is recognized as different",
           [1000, :verbose, max_size: 100, constraint_tries: 100_000],
           %{contract: contract} do
    forall {tx1_binary, tx2_binary} <- PropertyGenerators.tx_binary_with_mutation() do
      verify_distinct_or_erroring(tx1_binary, tx2_binary, contract)
    end
  end

  # this is by far the most interesting-case-yielding test, hence number of cases is set to x10 the others
  property "any rlp-mutated tx binary either fails to decode to a transaction object or is recognized as different",
           [10_000, :verbose, max_size: 100, constraint_tries: 100_000],
           %{contract: contract} do
    forall {tx1_binary, tx2_binary} <- PropertyGenerators.tx_binary_with_rlp_mutation() do
      verify_distinct_or_erroring(tx1_binary, tx2_binary, contract)
    end
  end

  property "arbitrary binaries never decode",
           [1000, :verbose, max_size: 1000],
           %{contract: contract} do
    forall some_binary <- binary() do
      verify_both_error(some_binary, contract)
    end
  end
end


================================================
FILE: apps/omg_conformance/test/omg_conformance/conformance/signature_test.exs
================================================
# Copyright 2019-2020 OMG Network 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.Conformance.SignatureTest do
  @moduledoc """
  Tests that EIP-712-compliant signatures generated `somehow` (via Elixir code as it happens) are treated the same
  by both Elixir signature code and contract signature code.
  """

  alias OMG.Watcher.State.Transaction

  import Support.Conformance.SignaturesHashes, only: [verify: 2, verify_distinct: 3]

  use Support.Conformance.SignaturesHashesCase, async: false

  @moduletag :integration
  @moduletag :common

  @good_metadata <<1::size(32)-unit(8)>>

  describe "elixir vs solidity conformance test" do
    test "no inputs test", %{contract: contract} do
      tx = Transaction.Payment.new([], [{@alice, @eth, 100}])
      verify(tx, contract)
    end

    test "signature test - small tx", %{contract: contract} do
      tx = Transaction.Payment.new([{1, 0, 0}], [{@alice, @eth, 100}])
      verify(tx, contract)
    end

    test "signature test - full tx", %{contract: contract} do
      tx =
        Transaction.Payment.new(
          [{1, 0, 0}, {1000, 555, 3}, {2000, 333, 1}, {15_015, 0, 0}],
          [{@alice, @eth, 100}, {@alice, @token, 50}, {@bob, @token, 75}, {@bob, @eth, 25}]
        )

      verify(tx, contract)
    end

    test "signature test transaction with metadata", %{contract: contract} do
      tx =
        Transaction.Payment.new(
          [{1, 0, 0}, {1000, 555, 3}, {2000, 333, 1}, {15_015, 0, 0}],
          [{@alice, @eth, 100}, {@alice, @eth, 50}, {@bob, @eth, 75}, {@bob, @eth, 25}],
          @good_metadata
        )

      verify(tx, contract)
    end
  end

  describe "distinct transactions yield distinct sign hashes" do
    test "different inputs - txs hash differently but same in both implementations", %{contract: contract} do
      tx1 = Transaction.Payment.new([{1, 0, 0}], [{@alice, @eth, 100}])
      tx2 = Transaction.Payment.new([{2, 0, 0}], [{@alice, @eth, 100}])
      verify_distinct(tx1, tx2, contract)
    end

    test "different outputs - txs hash differently but same in both implementations", %{contract: contract} do
      tx1 = Transaction.Payment.new([{1, 0, 0}], [{@alice, @eth, 110}])
      tx2 = Transaction.Payment.new([{1, 0, 0}], [{@alice, @eth, 100}])
      verify_distinct(tx1, tx2, contract)
    end

    test "different metadata - txs hash differently but same in both implementations", %{contract: contract} do
      tx1 = Transaction.Payment.new([{1, 0, 0}], [{@alice, @eth, 100}])
      tx2 = Transaction.Payment.new([{1, 0, 0}], [{@alice, @eth, 100}], <<1::256>>)
      verify_distinct(tx1, tx2, contract)
    end
  end
end


================================================
FILE: apps/omg_conformance/test/support/conformance/merkle_proof_context.ex
================================================
# 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.
# 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 Support.Conformance.MerkleProofContext do
  @moduledoc """
  A package of data associated with a single proof to assert about. Contains the proof, what it proves, and the under-
  -lying merkle tree leaves as well
  """
  defstruct [:leaves, :root_hash, :leaf, :txindex, :proof]

  alias OMG.Watcher.Merkle

  use PropCheck

  @doc """
  A correct context - a proof proves something it should
  """
  def correct() do
    let leaves <- such_that(leaves <- list(pragmatic_binary()), when: length(leaves) > 0) do
      leaves_length = length(leaves)
      root_hash = Merkle.hash(leaves)

      let txindex <- integer(0, leaves_length - 1) do
        proof = Merkle.create_tx_proof(leaves, txindex)
        leaf = Enum.at(leaves, txindex)
        %__MODULE__{leaves: leaves, root_hash: root_hash, leaf: leaf, txindex: txindex, proof: proof}
      end
    end
  end

  @doc """
  A mutated context where only the leaf is different from the original, correct proof
  """
  def mutated_leaf(%__MODULE__{} = base) do
    # TODO: add borrowing leaf from proof

    # Some of the generators under `union/1` are only valid on certain conditions. Setting weight to 0 prevents them
    # if the condition is not met
    zero_out_leaf_weight = if base.leaf == <<0::256>>, do: 0, else: 1
    trimmed_leaf_weight = if base.leaf == "", do: 0, else: 1
    get_other_leaf_weight = if base.leaves |> Enum.uniq() |> length() < 2, do: 0, else: 1

    weighted_union([
      {zero_out_leaf_weight, zero_out_leaf(base)},
      {1, random_leaf(base)},
      {trimmed_leaf_weight, trimmed_leaf(base)},
      {1, expanded_leaf(base)},
      {get_other_leaf_weight, get_other_leaf(base)}
    ])
  end

  @doc """
  A mutated context where only the txindex proven is different from the original, correct proof
  """
  def mutated_txindex(%__MODULE__{} = base) do
    # The trick here is that it can be any index (even beyond the scope of leaves list!), but can't point to an
    # identical leaf, in case we have 2 in the leaves list.
    # So this is slightly different from `distinct_leaf_index` in `get_other_leaf/1`
    distinct_leaf_index = such_that(i <- non_neg_integer(), when: Enum.at(base.leaves, i) != base.leaf)

    let other_txindex <- distinct_leaf_index do
      %{base | txindex: other_txindex}
    end
  end

  @doc """
  A mutated context where only the proof bytes are different from the original, correct proof
  """
  def mutated_proof(%__MODULE__{} = base) do
    union([
      bitwise_modify_proof(base),
      chunkwise_modify_proof(base)
    ])
  end

  @doc """
  A mutated context where we're trying to alter both the proof and what we prove, aiming to "reuse" parts of a proof
  that worked (the original, `base`) and produce a proof that works when it shouldn't
  """
  def mutated_to_prove_sth_else(%__MODULE__{} = base) do
    let [
      other_proof <- mutated_proof(base),
      proving_something_else <- union([mutated_leaf(base), mutated_txindex(base)])
    ] do
      # first get a context that's proving something else (other leaf or other index) and after that modify proof
      %{proving_something_else | proof: other_proof.proof}
    end
  end

  #
  # leaf mutations

  defp zero_out_leaf(%__MODULE__{} = base) do
    %{base | leaf: <<0::256>>}
  end

  defp random_leaf(%__MODULE__{} = base) do
    let b <- such_that(b <- pragmatic_binary(), when: b != base.leaf) do
      %{base | leaf: b}
    end
  end

  defp trimmed_leaf(%__MODULE__{} = base) do
    length_leaf = byte_size(base.leaf)

    let to_keep <- integer(0, length_leaf - 1) do
      %{base | leaf: binary_part(base.leaf, 0, to_keep)}
    end
  end

  defp expanded_leaf(%__MODULE__{} = base) do
    let [b <- non_empty_binary(), append? <- boolean()] do
      if append?, do: %{base | leaf: base.leaf <> b}, else: %{base | leaf: b <> base.leaf}
    end
  end

  defp get_other_leaf(%__MODULE__{} = base) do
    length_leaves = length(base.leaves)
    distinct_leaf_index = such_that(i <- integer(0, length_leaves - 1), when: Enum.at(base.leaves, i) != base.leaf)

    let other_index <- distinct_leaf_index do
      %{base | leaf: Enum.at(base.leaves, other_index)}
    end
  end

  #
  # proof mutations

  defp bitwise_modify_proof(%__MODULE__{} = base) do
    # TODO: more cases pending
    union([
      bitwise_append(base)
    ])
  end

  defp chunkwise_modify_proof(%__MODULE__{} = base) do
    insert_leaf_chunk_weight = if base.leaf == "", do: 0, else: 1

    weighted_union([
      {1, insert_zero_chunk(base)},
      {insert_leaf_chunk_weight, insert_leaf_chunk(base)},
      {1, drop_chunk(base)},
      {1, swap_neighbors(base)}
    ])
  end

  defp insert_zero_chunk(%__MODULE__{} = base) do
    # @proof length doesn't work for some reason
    let position <- integer(0, 16) do
      %{base | proof: base.proof |> chunk() |> List.insert_at(position, <<0::256>>) |> unchunk()}
    end
  end

  defp insert_leaf_chunk(%__MODULE__{} = base) do
    # @proof length doesn't work for some reason
    let position <- integer(0, 16) do
      %{base | proof: base.proof |> chunk() |> List.insert_at(position, base.leaf) |> unchunk()}
    end
  end

  defp drop_chunk(%__MODULE__{} = base) do
    # @proof length doesn't work for some reason
    let position <- integer(0, 16 - 1) do
      %{base | proof: base.proof |> chunk() |> List.delete_at(position) |> unchunk()}
    end
  end

  defp swap_neighbors(%__MODULE__{} = base) do
    # @proof length doesn't work for some reason
    let position <- integer(0, 16 - 1 - 1) do
      chunked_proof = chunk(base.proof)
      [neighbor1, neighbor2] = Enum.slice(chunked_proof, position, 2)

      swapped_proof =
        chunked_proof
        |> List.replace_at(position, neighbor2)
        |> List.replace_at(position + 1, neighbor1)
        |> unchunk

      %{base | proof: swapped_proof}
    end
  end

  defp bitwise_append(%__MODULE__{} = base) do
    let to_append <- union([non_empty_binary(), <<0>>, <<0::256>>, <<0::512>>]) do
      %{base | proof: base.proof <> to_append}
    end
  end

  # `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/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)

  defp prescribed_binary(), do: union(@prescribed_binaries)
  defp pragmatic_binary(), do: union([binary(), prescribed_binary()])

  defp non_empty_binary(), do: such_that(b <- pragmatic_binary(), when: b != "")

  #
  # auxiliary helper functions

  defp chunk(proof), do: for(<<chunk::256 <- proof>>, do: <<chunk::256>>)
  defp unchunk(chunked_proof), do: Enum.join(chunked_proof)
end


================================================
FILE: apps/omg_conformance/test/support/conformance/merkle_proofs.ex
================================================
# Copyright 2019-2020 OMG Network 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 Support.Conformance.MerkleProofs do
  @moduledoc """
  Utility functions used when testing Elixir vs Solidity implementation conformance
  """

  import ExUnit.Assertions, only: [assert: 1]

  alias OMG.Eth.Encoding

  @doc """
  Checks if the provided proof data returns true (valid proof) in the contract
  """
  def solidity_proof_valid(leaf, index, root_hash, proof, contract) do
    signature = "checkMembership(bytes,uint256,bytes32,bytes)"
    args = [leaf, index, root_hash, proof]
    return_types = [:bool]

    try do
      {:ok, result} = call_contract(contract, signature, args, return_types)
      result
      # Some incorrect proofs throw, and end up returning something that the ABI decoder borks on, hence rescue
    rescue
      e in CaseClauseError ->
        # this term holds the failure reason, but attempted to be decoded as a bool. It is a huge int
        %{term: failed_decoding_reason} = e
        # now we bring it back to binary form
        binary_reason = :binary.encode_unsigned(failed_decoding_reason)
        # it should contain 4 bytes of the function selector and then zeros
        assert_contract_reverted(binary_reason)
        false
    end
  end

  # see similar function in `Support.Conformance.SignaturesHashes`
  defp assert_contract_reverted(chopped_reason_binary_result) do
    # only geth is supported for the merkle proof conformance tests for now
    :geth = Application.fetch_env!(:omg_eth, :eth_node)

    # revert from `call_contract` it returns something resembling a reason
    # binary (beginning with 4-byte function selector). We need to assume that this is in fact a revert
    assert <<0::size(28)-unit(8)>> = binary_part(chopped_reason_binary_result, 4, 28)
  end

  defp call_contract(contract, signature, args, return_types) do
    data = ABI.encode(signature, args)

    {:ok, return} =
      Ethereumex.HttpClient.eth_call(%{
        from: Encoding.to_hex(contract),
        to: Encoding.to_hex(contract),
        data: Encoding.to_hex(data)
      })

    decode_answer(return, return_types)
  end

  defp decode_answer(enc_return, return_types) do
    single_return =
      enc_return
      |> Encoding.from_hex()
      |> ABI.TypeDecoder.decode(return_types)
      |> hd()

    {:ok, single_return}
  end
end


================================================
FILE: apps/omg_conformance/test/support/conformance/property.ex
================================================
# Copyright 2019-2020 OMG Network 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 Support.Conformance.PropertyGenerators do
  @moduledoc """
  Utility functions (mainly `:propcheck` generators) useful for building property tests for conformance tests
  """

  alias OMG.Watcher.State.Transaction

  use PropCheck

  require Transaction.Payment

  @doc """
  Generates a payment transaction, as valid as possible
  """
  def payment_tx() do
    let [inputs <- valid_inputs_list(), outputs <- valid_outputs_list(), metadata <- hash()] do
      Transaction.Payment.new(inputs, outputs, metadata)
    end
  end

  @doc """
  Generates a pair of _distinct_ payment transactions, as valid as possible.

  Mimicks the `payment_tx/0` generator, but uses mutations to generate the other transaction
  """
  def distinct_payment_txs() do
    proposition_result =
      let [inputs <- valid_inputs_list(), outputs <- valid_outputs_list(), metadata <- hash()] do
        tx1 = Transaction.Payment.new(inputs, outputs, metadata)

        tx2 =
          let [
            inputs2 <- union([inputs, mutated_inputs(inputs), Enum.reverse(inputs)]),
            outputs2 <- union([outputs, mutated_outputs(outputs), Enum.reverse(outputs)]),
            metadata2 <- union([metadata, mutated_hash(metadata), hash()])
          ] do
            Transaction.Payment.new(inputs2, outputs2, metadata2)
          end

        {tx1, tx2}
      end

    such_that(pair <- proposition_result, when: is_pair_of_distinct_terms?(pair))
  end

  @doc """
  Generates a valid payment transaction using `payment_tx/0` then mutates it using a structure-blind binary mutation
  """
  def tx_binary_with_mutation() do
    proposition_result =
      let [tx1 <- payment_tx()] do
        tx1_binary = Transaction.raw_txbytes(tx1)
        {tx1_binary, mutate_binary(tx1_binary)}
      end

    such_that(pair <- proposition_result, when: is_pair_of_distinct_terms?(pair))
  end

  @doc """
  Generates a valid payment transaction using `payment_tx/0` then mutates it using a RLP-aware mutation
  """
  def tx_binary_with_rlp_mutation() do
    proposition_result =
      let [tx1 <- payment_tx()] do
        tx1_binary = Transaction.raw_txbytes(tx1)
        {tx1_binary, rlp_mutate_binary(tx1_binary)}
      end

    such_that(pair <- proposition_result, when: is_pair_of_distinct_terms?(pair))
  end

  defp is_pair_of_distinct_terms?({base_term, new_term}), do: base_term != new_term

  defp non_zero_address(), do: union([exactly(<<1::160>>), binary(20)])
  defp address(), do: union([exactly(<<0::160>>), exactly(<<1::160>>), binary(20)])
  defp hash(), do: union([exactly(<<0::256>>), exactly(<<1::256>>), binary(32)])

  defp injectable_binary() do
    union([
      binary(),
      <<0::8>>,
      <<1::8>>,
      <<0::16>>,
      <<1::16>>,
      <<0::32>>,
      <<1::32>>,
      <<0::128>>,
      <<1::128>>,
      <<0::256>>,
      <<1::256>>
    ])
  end

  # 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/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
  @max_txindex trunc(:math.pow(2, 16) - 1)
  @max_blknum trunc((:math.pow(2, 54) - 1 - @max_txindex) / (@block_offset / @transaction_offset))

  defp valid_blknum(), do: integer(0, @max_blknum)
  defp valid_txndex(), do: integer(0, @max_txindex)
  defp valid_oindex(), do: integer(0, @transaction_offset - 1)

  # TODO: revisit this to generate logic-wise invalid txs like zero inputs/outputs (H6)
  defp valid_input_tuple() do
    proposition_result =
      let [blknum <- valid_blknum(), txindex <- valid_txndex(), oindex <- valid_oindex()] do
        {blknum, txindex, oindex}
      end

    such_that({blknum, txindex, oindex} <- proposition_result, when: blknum + txindex + oindex > 0)
  end

  # TODO: revisit the case of negative amounts, funny things happen
  defp valid_output_tuple() do
    let [owner <- non_zero_address(), currency <- address(), amount <- pos_integer()] do
      {owner, currency, amount}
    end
  end

  defp valid_inputs_list() do
    such_that(l <- list(valid_input_tuple()), when: length(l) <= Transaction.Payment.max_inputs())
  end

  defp valid_outputs_list() do
    such_that(l <- list(valid_output_tuple()), when: length(l) > 0 && length(l) <= Transaction.Payment.max_outputs())
  end

  defp mutated_hash(base_hash) do
    # TODO: provide more cases
    OMG.Watcher.Crypto.hash(base_hash)
  end

  defp mutated_inputs(inputs) do
    # TODO: provide more cases
    if Enum.empty?(inputs), do: valid_inputs_list(), else: tl(inputs)
  end

  defp mutated_outputs(outputs) do
    # TODO: provide more cases
    if length(outputs) == 1, do: valid_outputs_list(), else: tl(outputs)
  end

  defp prepend_binary(base_binary) do
    let(random_binary <- injectable_binary(), do: random_binary <> base_binary)
  end

  defp apend_binary(base_binary) do
    let(random_binary <- injectable_binary(), do: base_binary <> random_binary)
  end

  defp substring_binary(base_binary) do
    base_length = byte_size(base_binary)

    let [from <- integer(0, base_length - 1)] do
      max_substring_length = max(1, base_length - from)

      let [substring_length <- integer(1, max_substring_length)] do
        binary_part(base_binary, from, substring_length)
      end
    end
  end

  defp insert_into_binary(base_binary) do
    base_length = byte_size(base_binary)

    let [from <- integer(0, base_length - 1), random_binary <- injectable_binary()] do
      binary_part(base_binary, 0, from) <> random_binary <> binary_part(base_binary, from, base_length - from)
    end
  end

  defp mutate_binary(base_binary) do
    union([
      prepend_binary(base_binary),
      apend_binary(base_binary),
      substring_binary(base_binary),
      insert_into_binary(base_binary)
    ])
  end

  defp inject_extra_item(base_rlp_items) when is_list(base_rlp_items) do
    rlp_items_length = length(base_rlp_items)

    let [new_item <- rlp_item_generator(), index <- integer(0, rlp_items_length)] do
      List.insert_at(base_rlp_items, index, new_item)
    end
  end

  # base wasn't a list so we make one now!
  defp inject_extra_item(base_rlp_items) do
    union([[rlp_item_generator(), base_rlp_items], [base_rlp_items, rlp_item_generator()]])
  end

  defp try_reversing(rlp_item) when is_list(rlp_item) and length(rlp_item) > 1, do: Enum.reverse(rlp_item)
  defp try_reversing(rlp_item), do: rlp_item

  defp swap_in_rlp([]), do: rlp_item_generator()

  defp swap_in_rlp(rlp_items) when is_list(rlp_items) do
    rlp_items_length = length(rlp_items)

    # first we pick were we _could_ change the list
    let [index <- integer(0, rlp_items_length - 1)] do
      to_swap = Enum.at(rlp_items, index)
      # now we either go deeper to change it or change right here
      let [mutated_rlp <- mutate_sub_rlp(to_swap)] do
        List.replace_at(rlp_items, index, mutated_rlp)
      end
    end
  end

  defp swap_in_rlp(rlp_item) when is_integer(rlp_item) or is_binary(rlp_item), do: rlp_item_generator()

  defp rlp_item_generator(),
    do: union([[], injectable_binary(), non_neg_integer(), list(union([injectable_binary(), non_neg_integer()]))])

  defp mutate_sub_rlp(base_rlp_items) do
    union([
      rlp_item_generator(),
      swap_in_rlp(base_rlp_items),
      try_reversing(base_rlp_items),
      inject_extra_item(base_rlp_items)
    ])
  end

  defp rlp_mutate_binary(base_binary) do
    # TODO: these mutations used could use improving/extending
    base_rlp_items = base_binary |> Transaction.decode!() |> Transaction.Protocol.get_data_for_rlp()

    let([mutated_rlp <- mutate_sub_rlp(base_rlp_items)]) do
      ExRLP.encode(mutated_rlp)
    end
  end
end


================================================
FILE: apps/omg_conformance/test/support/conformance/signatures_hashes.ex
================================================
# Copyright 2019-2020 OMG Network 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 Support.Conformance.SignaturesHashes do
  @moduledoc """
  Utility functions that used when testing Elixir vs Solidity implementation conformance
  """

  import ExUnit.Assertions, only: [assert: 1]

  alias OMG.Eth.Encoding
  alias OMG.Watcher.State.Transaction
  alias OMG.Watcher.TypedDataHash

  @doc """
  Check if both implementations treat distinct transactions as distinct but produce sign hashes consistently
  """
  def verify_distinct(tx1, tx2, contract) do
    # NOTE: those two verifies might be redundant, rethink sometimes. For now keeping to increase chance of picking up
    # discrepancies
    verify(tx1, contract)
    verify(tx2, contract)
    assert solidity_hash!(tx1, contract) != solidity_hash!(tx2, contract)
    assert elixir_hash(tx1) != elixir_hash(tx2)
  end

  @doc """
  Check if both implementations product the same signature hash
  """
  def verify(tx, contract) do
    assert solidity_hash!(tx, contract) == elixir_hash(tx)
  end

  @doc """
  Check if both implementations error for a binary that's known to not be a validly decoding transaction
  """
  def verify_both_error(some_binary, contract) do
    # elixir implementation errors
    assert {:error, _} = Transaction.decode(some_binary)

    # solidity implementation errors
    some_binary
    |> solidity_hash(contract)
    |> assert_contract_reverted()

    true
  end

  @doc """
  Check if both implementations either:
    - treat distinct transactions as distinct but produce sign hashes consistently
    - both error
  _under the condition that `tx2_binary` decodes fine in the "native" implementation in Elixir_
  """
  def verify_distinct_or_erroring(tx1_binary, tx2_binary, contract) do
    # TODO - think of a better approach to handling the different treatment of valid/admissible tx/output types
    #      there shouldn't be that many cases, 2 (`{:ok, _}` and `{:error, _}`) should ideally do
    case Transaction.decode(tx2_binary) do
      # if the mutated transaction decodes fine, we check whether signature hashes match across impls and are distinct
      {:ok, _} ->
        verify_distinct(Transaction.decode!(tx1_binary), Transaction.decode!(tx2_binary), contract)

      # NOTE: unrecognized tx/output type is never picked up in the contract, since there, decoding assumes already a
      #       particular type (i.e. Payment) and only checks if delivered type (`1`, `2`, ...) is correct in later stage
      #       when fetching and verifying the `ISpendingCondition`
      {:error, :unrecognized_transaction_type} ->
        true

      {:error, :unrecognized_output_type} ->
        true

      # NOTE: another temporary special case handling, until a better idea comes. `tx_type` 3 is `Transaction.Fee`
      #       transaction which pops out as `malformed` in `elixir-omg` and is accepted by contracts
      {:error, :malformed_transaction} ->
        case ExRLP.decode(tx2_binary) do
          # first RLP item of the transaction specifies the tx type as `Transaction.Fee` - can't test further
          [<<3>> | _] -> true
          # in all other cases the contract should revert
          _ -> verify_both_error(tx2_binary, contract)
        end

      # in other cases of errors, we check whether both implementations reject the mutated transaction
      {:error, _} ->
        verify_both_error(tx2_binary, contract)
    end
  end

  # NOTE: `solidity_hash!/2` returns `<<8, 195, 121, 160, 0, 0, 0, more zeroes...>>` on revert, see note on
  #       `solidity_hash/2`
  defp solidity_hash!(tx, contract) do
    {:ok, solidity_hash} = solidity_hash(tx, contract)
    solidity_hash
  end

  defp solidity_hash(%{} = tx, contract), do: tx |> Transaction.raw_txbytes() |> solidity_hash(contract)

  # NOTE: `solidity_hash/2` returns something like `{:ok, <<8, 195, 121, 160, 0, 0, 0, more zeroes...>>}`, on contract
  #       revert, when using `:geth` Ethereum node. If an assertion fails with such a result, it indicates the contract
  #       rejected some transaction to signhash unexpectedly.
  defp solidity_hash(encoded_tx, contract) when is_binary(encoded_tx) do
    call_contract(contract, "hashTx(address,bytes)", [contract, encoded_tx], [{:bytes, 32}])
  end

  defp elixir_hash(%{} = tx), do: TypedDataHash.hash_struct(tx)
  defp elixir_hash(encoded_tx), do: encoded_tx |> Transaction.decode!() |> elixir_hash()

  defp assert_contract_reverted(result) do
    {:ok, chopped_reason_binary_result} = result
    assert <<0::size(28)-unit(8)>> = binary_part(chopped_reason_binary_result, 4, 28)
  end

  defp call_contract(contract, signature, args, return_types) do
    data = ABI.encode(signature, args)

    {:ok, return} =
      Ethereumex.HttpClient.eth_call(%{
        from: Encoding.to_hex(contract),
        to: Encoding.to_hex(contract),
        data: Encoding.to_hex(data)
      })

    decode_answer(return, return_types)
  end

  defp decode_answer(enc_return, return_types) do
    single_return =
      enc_return
      |> Encoding.from_hex()
      |> ABI.TypeDecoder.decode(return_types)
      |> hd()

    {:ok, single_return}
  end
end


================================================
FILE: apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex
================================================
# Copyright 2019-2020 OMG Network 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 Support.Conformance.SignaturesHashesCase do
  @moduledoc """
  `ExUnit` test case for the setup required by a test of Elixir and Solidity implementation conformance
  """
  alias Support.SnapshotContracts

  use ExUnit.CaseTemplate

  using do
    quote do
      @alice <<215, 32, 17, 47, 111, 72, 20, 47, 149, 226, 138, 242, 35, 254, 141, 212, 16, 22, 155, 182>>
      @bob <<141, 246, 138, 77, 76, 3, 78, 54, 173, 40, 234, 195, 29, 170, 154, 64, 99, 14, 118, 139>>
      @eth <<0::160>>
      @token <<235, 169, 32, 193, 242, 237, 159, 137, 184, 46, 124, 13, 178, 171, 61, 87, 179, 179, 135, 146>>
      @zero_address <<0::160>>
    end
  end

  setup_all do
    {:ok, exit_fn} = Support.DevNode.start()
    contracts = SnapshotContracts.parse_contracts()
    signtest_addr_hex = contracts["CONTRACT_ADDRESS_PAYMENT_EIP_712_LIB_MOCK"]
    old_config = Application.get_all_env(:omg_eth)
    :ok = Application.put_env(:omg_eth, :contract_addr, %{plasma_framework: signtest_addr_hex})

    on_exit(fn ->
      # reverting to the original values from `omg_eth/config/test.exs`
      :ok = Application.put_all_env(omg_eth: old_config)

      exit_fn.()
    end)

    [contract: OMG.Eth.Encoding.from_hex(signtest_addr_hex)]
  end
end


================================================
FILE: apps/omg_conformance/test/test_helper.exs
================================================
# Copyright 2019-2020 OMG Network 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.
ExUnit.configure(exclude: [integration: true, property: true])
{:ok, _} = Application.ensure_all_started(:propcheck)
ExUnit.start()


================================================
FILE: apps/omg_db/lib/db.ex
================================================
# Copyright 2019-2020 OMG Network 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.DB do
  @moduledoc """
  DB API module provides an interface to all needed functions that need to be implemented by the
  underlying database layer.
  """
  use Spandex.Decorators

  alias OMG.DB.RocksDB
  @type utxo_pos_db_t :: {pos_integer, non_neg_integer, non_neg_integer}

  @callback start_link(term) :: GenServer.on_start()
  @callback child_spec() :: Supervisor.child_spec()
  @callback child_spec(term) :: Supervisor.child_spec()
  @callback init(String.t()) :: :ok
  @callback init() :: :ok
  @callback initiation_multiupdate() :: :ok | {:error, any}

  @callback multi_update(term()) :: :ok | {:error, any}
  @callback blocks(block_to_fetch :: list()) :: {:ok, list(term)}
  @callback utxos() :: {:ok, list({utxo_pos_db_t, term})}
  @callback utxo(utxo_pos_db_t) :: {:ok, term} | :not_found
  @callback competitors_info() :: {:ok, list(term)}
  @callback spent_blknum(utxo_pos_db_t()) :: {:ok, pos_integer} | :not_found
  @callback block_hashes(integer()) :: {:ok, list()}
  @callback child_top_block_number() :: {:ok, non_neg_integer()} | :not_found
  @callback get_single_value(atom()) :: {:ok, term} | :not_found
  @callback batch_get(atom(), list(term)) :: {:ok, list(term)} | :not_found
  @callback get_all_by_type(atom()) :: {:ok, list(term)} | :not_found

  # callbacks useful for injecting a specific server implementation
  @callback initiation_multiupdate(GenServer.server()) :: :ok | {:error, any}
  @callback multi_update(term(), GenServer.server()) :: :ok | {:error, any}
  @callback blocks(block_to_fetch :: list(), GenServer.server()) :: {:ok, list()} | {:error, any}
  @callback utxos(GenServer.server()) :: {:ok, list({utxo_pos_db_t, term})} | {:error, any}
  @callback utxo(utxo_pos_db_t, GenServer.server()) :: {:ok, term} | :not_found
  @callback competitors_info(GenServer.server()) :: {:ok, list(term)} | {:error, any}
  @callback spent_blknum(utxo_pos_db_t(), GenServer.server()) :: {:ok, pos_integer} | :not_found
  @callback block_hashes(integer(), GenServer.server()) :: {:ok, list()}
  @callback child_top_block_number(GenServer.server()) :: {:ok, non_neg_integer()} | :not_found
  @callback get_single_value(atom(), GenServer.server()) :: {:ok, term} | :not_found
  @callback batch_get(atom(), list(term), keyword()) :: {:ok, list(term)} | :not_found
  @callback get_all_by_type(atom(), keyword()) :: {:ok, list(term)} | :not_found
  @optional_callbacks child_spec: 1,
                      initiation_multiupdate: 1,
                      multi_update: 2,
                      blocks: 2,
                      utxos: 1,
                      utxo: 2,
                      spent_blknum: 2,
                      block_hashes: 2,
                      child_top_block_number: 1,
                      get_single_value: 2

  def start_link(args), do: RocksDB.start_link(args)

  def child_spec(), do: RocksDB.child_spec()
  def child_spec(args), do: RocksDB.child_spec(args)

  def init(path) do
    RocksDB.init(path)
  end

  def init() do
    RocksDB.init()
  end

  @doc """
  Puts all zeroes and other init values to a generically initialized `OMG.DB`
  """

  def initiation_multiupdate(), do: RocksDB.initiation_multiupdate()
  def initiation_multiupdate(server), do: RocksDB.initiation_multiupdate(server)

  @decorate span(service: :ethereum_event_listener, type: :backend, name: "multi_update/1")
  def multi_update(db_updates), do: RocksDB.multi_update(db_updates)
  def multi_update(db_updates, server), do: RocksDB.multi_update(db_updates, server)

  def blocks(blocks_to_fetch), do: RocksDB.blocks(blocks_to_fetch)
  def blocks(blocks_to_fetch, server), do: RocksDB.blocks(blocks_to_fetch, server)

  def utxos(), do: RocksDB.utxos()
  def utxos(server), do: RocksDB.utxos(server)

  def utxo(utxo_pos), do: RocksDB.utxo(utxo_pos)
  def utxo(utxo_pos, server), do: RocksDB.utxo(utxo_pos, server)

  def competitors_info(), do: RocksDB.competitors_info()
  def competitors_info(server), do: RocksDB.competitors_info(server)

  def spent_blknum(utxo_pos), do: RocksDB.spent_blknum(utxo_pos)
  def spent_blknum(utxo_pos, server), do: RocksDB.spent_blknum(utxo_pos, server)

  def block_hashes(block_numbers_to_fetch), do: RocksDB.block_hashes(block_numbers_to_fetch)
  def block_hashes(block_numbers_to_fetch, server), do: RocksDB.block_hashes(block_numbers_to_fetch, server)

  def child_top_block_number(), do: RocksDB.child_top_block_number()

  def get_single_value(parameter_name), do: RocksDB.get_single_value(parameter_name)
  def get_single_value(parameter_name, server), do: RocksDB.get_single_value(parameter_name, server)

  @doc """
  This is generic DB function that can batch get the specific data of a
  specific type with the given specific keys of the type.
  """
  def batch_get(type, specific_keys), do: RocksDB.batch_get(type, specific_keys)
  def batch_get(type, specific_keys, opts), do: RocksDB.batch_get(type, specific_keys, opts)

  @doc """
  This is generic DB function that can get all data of a specific type.
  """
  def get_all_by_type(type), do: RocksDB.get_all_by_type(type)
  def get_all_by_type(type, opts), do: RocksDB.get_all_by_type(type, opts)

  @doc """
  A list of all atoms that we use as single-values stored in the database (i.e. markers/flags of all kinds)
  """
  def single_value_parameter_names() do
    [
      # child chain - used at block forming
      :child_top_block_number,
      # watcher
      :last_block_getter_eth_height,
      :last_ife_exit_deleted_eth_height,
      # watcher and child chain
      :last_depositor_eth_height,
      :last_exiter_eth_height,
      :last_piggyback_exit_eth_height,
      :last_in_flight_exit_eth_height,
      :last_exit_processor_eth_height,
      :last_exit_finalizer_eth_height,
      :last_exit_challenger_eth_height,
      :last_in_flight_exit_processor_eth_height,
      :last_ife_exit_deleted_eth_height,
      :last_piggyback_processor_eth_height,
      :last_competitor_processor_eth_height,
      :last_challenges_responds_processor_eth_height,
      :last_piggyback_challenges_processor_eth_height,
      :last_ife_exit_finalizer_eth_height,
      :omg_eth_contracts
    ]
  end
end


================================================
FILE: apps/omg_db/lib/omg_db/application.ex
================================================
# Copyright 2019-2020 OMG Network 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.DB.Application do
  @moduledoc false

  use Application

  def start(_type, _args) do
    children = [OMG.DB.child_spec()]

    opts = [strategy: :one_for_one, name: OMG.DB.Supervisor]

    Supervisor.start_link(children, opts)
  end

  def start_phase(:attach_telemetry, :normal, _phase_args) do
    handlers = [["measure-db", OMG.DB.Measure.supported_events(), &OMG.DB.Measure.handle_event/4, nil]]

    Enum.each(handlers, fn handler ->
      case apply(:telemetry, :attach_many, handler) do
        :ok -> :ok
        {:error, :already_exists} -> :ok
      end
    end)
  end
end


================================================
FILE: apps/omg_db/lib/omg_db/measure.ex
================================================
# Copyright 2019-2020 OMG Network 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.DB.Measure do
  @moduledoc """
   A telemetry handler for DB related metrics.
  """
  alias OMG.Status.Metric.Datadog
  import OMG.Status.Metric.Event, only: [name: 1]

  alias OMG.DB.RocksDB.Server

  @write :write
  @read :read
  @multiread :multiread
  @keys [@write, @read, @multiread]

  @services [Server]

  @supported_events List.foldl(@services, [], fn service, acc ->
                      acc ++
                        [
                          [:process, service],
                          [:update_write, service],
                          [:update_read, service],
                          [:update_multiread, service]
                        ]
                    end)
  def supported_events(), do: @supported_events

  def handle_event([:process, service_name], _, state, _config) when service_name in @services do
    value =
      self()
      |> Process.info(:message_queue_len)
      |> elem(1)

    _ = Datadog.gauge(name(:db_message_queue_len), value, tags: ["service_name:#{service_name}"])

    Enum.each(@keys, fn table_key ->
      case :ets.take(state.name, table_key) do
        [{key, value}] ->
          _ = Datadog.gauge(name(key), value)

        _ ->
          # handling the case where the entry doesn't exist yet
          :skip
      end
    end)
  end

  def handle_event([:update_write, service_name], _, state, _config) when service_name in @services do
    :ets.update_counter(state.name, @write, {2, 1}, {@write, 0})
  end

  def handle_event([:update_read, service_name], _, state, _config) when service_name in @services do
    :ets.update_counter(state.name, @read, {2, 1}, {@read, 0})
  end

  def handle_event([:update_multiread, service_name], _, state, _config) when service_name in @services do
    :ets.update_counter(state.name, @multiread, {2, 1}, {@multiread, 0})
  end
end


================================================
FILE: apps/omg_db/lib/omg_db/models/payment_exit_info.ex
================================================
# Copyright 2019-2020 OMG Network 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.DB.Models.PaymentExitInfo do
  @moduledoc """
  DB model wrapper that is responsible for Payment (V1) Exit Info.
  """

  alias OMG.DB

  @server_name OMG.DB.RocksDB.Server

  @ten_seconds 10_000
  @one_minute 60_000

  def exit_info(utxo_pos, server \\ @server_name) do
    {:ok, data} = DB.batch_get(:exit_info, [utxo_pos], server: server)
    {:ok, hd(data)}
  end

  def exit_infos(utxo_pos_list, server \\ @server_name)
      when is_list(utxo_pos_list) do
    DB.batch_get(:exit_info, utxo_pos_list, server: server, timeout: @ten_seconds)
  end

  def all_exit_infos(server \\ @server_name) do
    DB.get_all_by_type(:exit_info, server: server, timeout: @one_minute)
  end

  def all_in_flight_exits_infos(server \\ @server_name) do
    DB.get_all_by_type(:in_flight_exit_info, server: server, timeout: @one_minute)
  end
end


================================================
FILE: apps/omg_db/lib/omg_db/release_tasks/init_key_value_db.ex
================================================
# 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.
# 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.DB.ReleaseTasks.InitKeyValueDB do
  @moduledoc """
    Creates an empty instance of OMG DB storage and fills it with the required initial data.
  """

  @start_apps [:logger, :crypto, :ssl]
  require Logger

  def run() do
    _ = on_load()
    path = Application.get_env(:omg_db, :path)
    process(path)
  end

  defp process(path) do
    _ = Logger.warn("Creating database at #{inspect(path)}")
    result = init_kv_db(path)
    Enum.each(Enum.reverse(@start_apps), &Application.stop/1)
    result
  end

  defp init_kv_db(path) do
    case OMG.DB.init(path) do
      {:error, term} ->
        _ = Logger.error("Could not initialize the DB in #{path}. Reason #{inspect(term)}")
        {:error, term}

      :ok ->
        _ = Logger.warn("The database at #{inspect(path)} has been created")
    end
  end

  defp on_load() do
    _ = Enum.each(@start_apps, &Application.ensure_all_started/1)
    _ = Application.load(:omg_db)
  end
end


================================================
FILE: apps/omg_db/lib/omg_db/release_tasks/init_keys_with_values.ex
================================================
# 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.
# 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.DB.ReleaseTasks.InitKeysWithValues do
  @moduledoc """
  Sets values for keys stored in RocksDB, if they are not set.
  """
  require Logger

  @keys_to_values [last_ife_exit_deleted_eth_height: 0]

  def run() do
    {:ok, _} = Application.ensure_all_started(:logger)

    path = Application.get_env(:omg_db, :path)
    Application.put_env(:omg_db, :path, path)

    case Application.ensure_all_started(:omg_db) do
      {:ok, _} ->
        Enum.each(@keys_to_values, &set_single_value/1)

      {:error, _} ->
        _ = Logger.info("DB not initialized yet, no action required")
        :ok
    end
  end

  defp set_single_value({key, init_val}) do
    case OMG.DB.RocksDB.get_single_value(key) do
      :not_found ->
        :ok = OMG.DB.RocksDB.multi_update([{:put, key, init_val}])
        _ = Logger.info("#{key} not set. Setting it to #{inspect(init_val)}")
        :ok

      {:ok, _} ->
        :ok
    end
  end
end


================================================
FILE: apps/omg_db/lib/omg_db/release_tasks/set_key_value_db.ex
================================================
# 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.
# 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.DB.ReleaseTasks.SetKeyValueDB do
  @moduledoc false
  @behaviour Config.Provider
  require Logger
  @app :omg_db

  def init(args) do
    args
  end

  def load(config, args) do
    _ = on_load()
    release = Keyword.get(args, :release)

    case get_env("DB_PATH") do
      root_path when is_binary(root_path) ->
        set_db(config, root_path, release)

      _ ->
        root_path = Path.join([System.user_home!(), ".omg/data"])
        set_db(config, root_path, release)
    end
  end

  defp set_db(config, root_path, release) do
    path = Path.join([root_path, "#{release}"])
    _ = Logger.info("CONFIGURATION: App: #{@app} Key: DB_PATH Value: #{inspect(path)}.")
    # if we want to access the updated path in the same VM instance, we need to update it imidiatelly
    Application.put_env(@app, :path, path)
    Config.Reader.merge(config, omg_db: [path: path])
  end

  defp get_env(key), do: System.get_env(key)

  defp on_load() do
    _ = Application.ensure_all_started(:logger)
    _ = Application.load(@app)
  end
end


================================================
FILE: apps/omg_db/lib/omg_db/rocks_db.ex
================================================
# Copyright 2019-2020 OMG Network 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.DB.RocksDB do
  @moduledoc """
  Our-types-aware port/adapter to a database backend.
  Contains functions to access data stored in the database
  """
  alias OMG.DB
  @behaviour OMG.DB

  require Logger

  @server_name OMG.DB.RocksDB.Server

  @default_genserver_timeout 5000
  @one_minute 60_000
  @ten_minutes 10 * @one_minute

  @type utxo_pos_db_t :: {pos_integer, non_neg_integer, non_neg_integer}

  def start_link(args) do
    @server_name.start_link(args)
  end

  def child_spec() do
    db_path = Application.fetch_env!(:omg_db, :path)
    args = [db_path: db_path, name: OMG.DB.RocksDB.Server]

    %{
      id: OMG.DB.RocksDB.Server,
      start: {OMG.DB.RocksDB.Server, :start_link, [args]},
      type: :worker
    }
  end

  def child_spec([db_path: _db_path, name: server_name] = args) do
    %{
      id: server_name,
      start: {OMG.DB.RocksDB.Server, :start_link, [args]},
      type: :worker
    }
  end

  def multi_update(db_updates, server_name \\ @server_name) do
    GenServer.call(server_name, {:multi_update, db_updates})
  end

  @spec blocks(block_to_fetch :: list(), atom) :: {:ok, list()} | {:error, any}
  def blocks(blocks_to_fetch, server_name \\ @server_name)

  def blocks([], _server_name), do: {:ok, []}

  def blocks(blocks_to_fetch, server_name) do
    GenServer.call(server_name, {:blocks, blocks_to_fetch})
  end

  def utxos(server_name \\ @server_name) do
    _ = Logger.info("Reading UTXO set, this might take a while. Allowing #{inspect(@ten_minutes)} ms")
    GenServer.call(server_name, :utxos, @ten_minutes)
  end

  def utxo(utxo_pos, server_name \\ @server_name) do
    GenServer.call(server_name, {:utxo, utxo_pos})
  end

  def competitors_info(server_name \\ @server_name) do
    _ = Logger.info("Reading competitors' info, this might take a while. Allowing #{inspect(@one_minute)} ms")
    GenServer.call(server_name, :competitors_info, @one_minute)
  end

  def spent_blknum(utxo_pos, server_name \\ @server_name) do
    GenServer.call(server_name, {:spent_blknum, utxo_pos})
  end

  def block_hashes(block_numbers_to_fetch, server_name \\ @server_name) do
    GenServer.call(server_name, {:block_hashes, block_numbers_to_fetch})
  end

  def child_top_block_number(server_name \\ @server_name) do
    GenServer.call(server_name, :child_top_block_number)
  end

  # Note: *_eth_height values below denote actual Ethereum height service has processed.
  # It might differ from "latest" Ethereum block.

  def get_single_value(parameter_name, server_name \\ @server_name) do
    GenServer.call(server_name, {:get_single_value, parameter_name})
  end

  @doc """
  Batch get data of a type with the given specific keys.

  optional args includes:
  1. timeout (in ms). Defaults to 5000 which is the same default value of Genserver.
  2. server (type in Genserver.server()). Defaults to OMG.DB.RocksDB.Server.
  """
  def batch_get(type, specific_keys, opts \\ []) do
    timeout = opts[:timeout] || @default_genserver_timeout
    server = opts[:server] || @server_name

    _ =
      Logger.info(
        "Batch get data for type #{inspect(type)} with the following keys #{inspect(specific_keys)}." <>
          " Allowing #{inspect(timeout)} ms"
      )

    GenServer.call(server, {:get, type, specific_keys}, timeout)
  end

  @doc """
  Get ALL data of a type.

  optional args includes:
  1. timeout (in ms). Defaults to 5000 which is the same default value of Genserver.
  2. server (type in Genserver.server()). Defaults to OMG.DB.RocksDB.Server.
  """
  def get_all_by_type(type, opts \\ []) do
    timeout = opts[:timeout] || @default_genserver_timeout
    server = opts[:server] || @server_name

    _ =
      Logger.info(
        "Reading all data for type #{inspect(type)}, this might take a while. Allowing #{inspect(timeout)} ms"
      )

    GenServer.call(server, {:get_all_by_type, type}, timeout)
  end

  def initiation_multiupdate(server_name \\ @server_name) do
    # setting a number of markers to zeroes
    DB.single_value_parameter_names()
    |> Enum.map(&{:put, &1, 0})
    |> multi_update(server_name)
  end

  @doc """
  Does all of the initialization of `OMG.DB` based on the configured path
  """
  def init(), do: do_init(@server_name, Application.fetch_env!(:omg_db, :path))

  def init(path) when is_binary(path) do
    :ok = Application.put_env(:omg_db, :path, path, persistent: true)
    do_init(@server_name, path)
  end

  def init(server_name), do: do_init(server_name, Application.fetch_env!(:omg_db, :path))
  def init(server_name, path), do: do_init(server_name, path)

  # File.mkdir_p is called at the application start
  # sobelow_skip ["Traversal"]
  defp do_init(server_name, path) do
    :ok = File.mkdir_p(path)

    with :ok <- server_name.init_storage(path),
         {:ok, started_apps} <- Application.ensure_all_started(:omg_db),
         :ok <- initiation_multiupdate(server_name) do
      started_apps |> Enum.reverse() |> Enum.each(fn app -> :ok = Application.stop(app) end)

      :ok
    else
      error ->
        _ = Logger.error("Unable to init: #{inspect(error)}")
        error
    end
  end
end


================================================
FILE: apps/omg_db/lib/omg_db/rocksdb/core.ex
================================================
# Copyright 2019-2020 OMG Network 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.DB.RocksDB.Core do
  @moduledoc """
  Responsible for converting type-aware, logic-specific queries and updates into rocksdb specific queries and updates
  """

  # adapter - testable, if we really really want to
  use Spandex.Decorators

  @single_value_parameter_names OMG.DB.single_value_parameter_names()

  # if we keep the prefix byte size consistent across all keys, we're able to use
  # prefix extractor to reduce the number of IO scans
  # more https://github.com/facebook/rocksdb/wiki/Prefix-Seek-API-Changes
  @keys_prefixes %{
    # watcher (Exit Processor) and child chain (Fresh Blocks)
    block: "block",
    # watcher (Exit Processor) and child chain (Block Queue)
    block_hash: "hashb",
    # watcher and child chain
    utxo: "utxoi",
    # watcher and child chain
    exit_info: "exiti",
    # watcher only
    in_flight_exit_info: "infle",
    # watcher only
    competitor_info: "compi",
    # watcher only
    spend: "spend",
    # watcher and child chain
    omg_eth_contracts: "omg_eth_contracts"
  }

  @key_types Map.keys(@keys_prefixes)

  def parse_multi_updates(db_updates), do: Enum.flat_map(db_updates, &parse_multi_update/1)

  @doc """
  Interprets the response from rocksdb and returns a success-decorated result
  """
  @spec decode_value({:ok, binary()} | :not_found) :: {:ok, term()} | :not_found
  def decode_value(db_response) do
    case decode_response(db_response) do
      :not_found -> :not_found
      other -> 
Download .txt
gitextract_2b551nix/

├── .circleci/
│   ├── ci_increase_chart_version.sh
│   ├── ci_publish.sh
│   ├── config.yml
│   ├── status.sh
│   └── test_runner.py
├── .formatter.exs
├── .githooks/
│   └── pre-commit
├── .github/
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── workflows/
│       ├── auto-merge-pr.yml
│       ├── auto-pr-for-branch-syncing.yml
│       └── enforce-changelog-labels.yml
├── .github_changelog_generator
├── .gitignore
├── .gitmodules
├── .releaserc.yaml
├── .tool-versions
├── AUTHORS
├── CHANGELOG.md
├── CODEOWNERS
├── Dockerfile.watcher
├── Dockerfile.watcher_info
├── LICENSE
├── Makefile
├── README.md
├── apps/
│   ├── omg_bus/
│   │   ├── lib/
│   │   │   ├── omg_bus/
│   │   │   │   ├── application.ex
│   │   │   │   ├── event.ex
│   │   │   │   ├── pubsub.ex
│   │   │   │   └── supervisor.ex
│   │   │   └── omg_bus.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── omg_bus/
│   │       │   └── event_test.exs
│   │       └── test_helper.exs
│   ├── omg_conformance/
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── omg_conformance/
│   │       │   └── conformance/
│   │       │       ├── merkle_proof_property_test.exs
│   │       │       ├── merkle_proof_test.exs
│   │       │       ├── signature_property_test.exs
│   │       │       └── signature_test.exs
│   │       ├── support/
│   │       │   └── conformance/
│   │       │       ├── merkle_proof_context.ex
│   │       │       ├── merkle_proofs.ex
│   │       │       ├── property.ex
│   │       │       ├── signatures_hashes.ex
│   │       │       └── signatures_hashes_case.ex
│   │       └── test_helper.exs
│   ├── omg_db/
│   │   ├── lib/
│   │   │   ├── db.ex
│   │   │   └── omg_db/
│   │   │       ├── application.ex
│   │   │       ├── measure.ex
│   │   │       ├── models/
│   │   │       │   └── payment_exit_info.ex
│   │   │       ├── release_tasks/
│   │   │       │   ├── init_key_value_db.ex
│   │   │       │   ├── init_keys_with_values.ex
│   │   │       │   └── set_key_value_db.ex
│   │   │       ├── rocks_db.ex
│   │   │       └── rocksdb/
│   │   │           ├── core.ex
│   │   │           └── server.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── fixtures.exs
│   │       ├── omg_db/
│   │       │   ├── application_test.exs
│   │       │   ├── db_test.exs
│   │       │   ├── models/
│   │       │   │   └── payment_exit_info_test.exs
│   │       │   ├── release_tasks/
│   │       │   │   ├── init_key_value_db_test.exs
│   │       │   │   ├── init_keys_with_values_test.exs
│   │       │   │   └── set_key_value_db_test.exs
│   │       │   └── rocks_db_test.exs
│   │       ├── support/
│   │       │   └── rocks_db_case.ex
│   │       └── test_helper.exs
│   ├── omg_eth/
│   │   ├── lib/
│   │   │   ├── eth.ex
│   │   │   └── omg_eth/
│   │   │       ├── application.ex
│   │   │       ├── blockchain/
│   │   │       │   ├── bit_helper.ex
│   │   │       │   ├── private_key.ex
│   │   │       │   ├── transaction/
│   │   │       │   │   ├── hash.ex
│   │   │       │   │   └── signature.ex
│   │   │       │   └── transaction.ex
│   │   │       ├── client.ex
│   │   │       ├── configuration.ex
│   │   │       ├── encoding/
│   │   │       │   └── contract_constructor.ex
│   │   │       ├── encoding.ex
│   │   │       ├── ethereum_height.ex
│   │   │       ├── ethereum_height_monitor/
│   │   │       │   └── alarm_handler.ex
│   │   │       ├── ethereum_height_monitor.ex
│   │   │       ├── metric/
│   │   │       │   └── ethereumex.ex
│   │   │       ├── release_tasks/
│   │   │       │   ├── set_contract.ex
│   │   │       │   ├── set_ethereum_block_time.ex
│   │   │       │   ├── set_ethereum_client.ex
│   │   │       │   ├── set_ethereum_events_check_interval.ex
│   │   │       │   └── set_ethereum_stalled_sync_threshold.ex
│   │   │       ├── root_chain/
│   │   │       │   ├── abi.ex
│   │   │       │   ├── abi_event_selector.ex
│   │   │       │   ├── abi_function_selector.ex
│   │   │       │   ├── event.ex
│   │   │       │   ├── fields.ex
│   │   │       │   ├── rpc.ex
│   │   │       │   └── submit_block.ex
│   │   │       ├── root_chain.ex
│   │   │       ├── supervisor.ex
│   │   │       └── transaction.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── fixtures.exs
│   │       ├── omg_eth/
│   │       │   ├── application_test.exs
│   │       │   ├── blockchain/
│   │       │   │   ├── bit_helper_test.exs
│   │       │   │   ├── transaction/
│   │       │   │   │   ├── hash_test.exs
│   │       │   │   │   └── signature_test.exs
│   │       │   │   └── transaction_test.exs
│   │       │   ├── client_test.exs
│   │       │   ├── encoding/
│   │       │   │   └── contract_constructor_test.exs
│   │       │   ├── encoding_test.exs
│   │       │   ├── eth_test.exs
│   │       │   ├── ethereum_height_monitor_test.exs
│   │       │   ├── release_tasks/
│   │       │   │   ├── set_contract_test.exs
│   │       │   │   ├── set_ethereum_block_time_test.exs
│   │       │   │   ├── set_ethereum_client_test.exs
│   │       │   │   ├── set_ethereum_events_check_interval_test.exs
│   │       │   │   └── set_ethereum_stalled_sync_threshold_test.exs
│   │       │   ├── root_chain/
│   │       │   │   ├── abi_test.exs
│   │       │   │   └── event_test.exs
│   │       │   └── root_chain_test.exs
│   │       ├── support/
│   │       │   ├── defaults.ex
│   │       │   ├── dev_geth.ex
│   │       │   ├── dev_helper.ex
│   │       │   ├── dev_node.ex
│   │       │   ├── root_chain_helper.ex
│   │       │   ├── snapshot_contracts.ex
│   │       │   ├── token.ex
│   │       │   ├── transaction_helper.ex
│   │       │   └── wait_for.ex
│   │       └── test_helper.exs
│   ├── omg_status/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── lib/
│   │   │   ├── omg_status/
│   │   │   │   ├── alert/
│   │   │   │   │   ├── alarm.ex
│   │   │   │   │   ├── alarm_handler.ex
│   │   │   │   │   └── alarm_printer.ex
│   │   │   │   ├── application.ex
│   │   │   │   ├── configuration.ex
│   │   │   │   ├── datadog_event/
│   │   │   │   │   ├── alarm_consumer.ex
│   │   │   │   │   └── alarm_handler.ex
│   │   │   │   ├── metric/
│   │   │   │   │   ├── datadog.ex
│   │   │   │   │   ├── event.ex
│   │   │   │   │   ├── statix.ex
│   │   │   │   │   ├── telemetry.ex
│   │   │   │   │   ├── tracer.ex
│   │   │   │   │   └── vmstats_sink.ex
│   │   │   │   ├── monitor/
│   │   │   │   │   ├── memory_monitor.ex
│   │   │   │   │   └── statsd_monitor.ex
│   │   │   │   ├── release_tasks/
│   │   │   │   │   ├── set_application.ex
│   │   │   │   │   ├── set_logger.ex
│   │   │   │   │   ├── set_sentry.ex
│   │   │   │   │   └── set_tracer.ex
│   │   │   │   └── sentry_filter.ex
│   │   │   └── status.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── omg_status/
│   │       │   ├── alert/
│   │       │   │   └── alarm_printer_test.exs
│   │       │   ├── datadog_event/
│   │       │   │   └── alarm_consumer_test.exs
│   │       │   ├── integration/
│   │       │   │   └── alarms_test.exs
│   │       │   ├── metric/
│   │       │   │   └── datadog_test.exs
│   │       │   ├── monitor/
│   │       │   │   ├── memory_monitor_test.exs
│   │       │   │   └── statsd_monitor_test.exs
│   │       │   └── release_tasks/
│   │       │       ├── set_logger_test.exs
│   │       │       ├── set_sentry_test.exs
│   │       │       └── set_tracer_test.exs
│   │       ├── sentry_filter_test.exs
│   │       └── test_helper.exs
│   ├── omg_utils/
│   │   ├── lib/
│   │   │   ├── omg_utils/
│   │   │   │   ├── app_version.ex
│   │   │   │   ├── http_rpc/
│   │   │   │   │   ├── encoding.ex
│   │   │   │   │   ├── error.ex
│   │   │   │   │   ├── response.ex
│   │   │   │   │   └── validators/
│   │   │   │   │       └── base.ex
│   │   │   │   ├── paginator.ex
│   │   │   │   └── remote_ip.ex
│   │   │   └── utils.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── omg_utils/
│   │       │   ├── app_version_tet.exs
│   │       │   ├── http_rpc/
│   │       │   │   ├── encoding_test.exs
│   │       │   │   ├── response_test.exs
│   │       │   │   └── validators/
│   │       │   │       └── base_test.exs
│   │       │   └── remote_ip_test.exs
│   │       └── test_helper.exs
│   ├── omg_watcher/
│   │   ├── lib/
│   │   │   ├── omg_watcher/
│   │   │   │   ├── api/
│   │   │   │   │   ├── account.ex
│   │   │   │   │   ├── alarm.ex
│   │   │   │   │   ├── configuration.ex
│   │   │   │   │   ├── in_flight_exit.ex
│   │   │   │   │   ├── status.ex
│   │   │   │   │   ├── status_cache/
│   │   │   │   │   │   ├── external.ex
│   │   │   │   │   │   └── storage.ex
│   │   │   │   │   ├── status_cache.ex
│   │   │   │   │   ├── transaction.ex
│   │   │   │   │   └── utxo.ex
│   │   │   │   ├── application.ex
│   │   │   │   ├── block.ex
│   │   │   │   ├── block_getter/
│   │   │   │   │   ├── block_application.ex
│   │   │   │   │   ├── core.ex
│   │   │   │   │   ├── measure.ex
│   │   │   │   │   ├── status.ex
│   │   │   │   │   └── supervisor.ex
│   │   │   │   ├── block_getter.ex
│   │   │   │   ├── block_validator.ex
│   │   │   │   ├── child_manager.ex
│   │   │   │   ├── configuration.ex
│   │   │   │   ├── coordinator_setup.ex
│   │   │   │   ├── crypto.ex
│   │   │   │   ├── datadog_event/
│   │   │   │   │   ├── contract_event_consumer.ex
│   │   │   │   │   └── encode.ex
│   │   │   │   ├── ethereum_event_aggregator.ex
│   │   │   │   ├── ethereum_event_listener/
│   │   │   │   │   ├── core.ex
│   │   │   │   │   └── measure.ex
│   │   │   │   ├── ethereum_event_listener.ex
│   │   │   │   ├── event.ex
│   │   │   │   ├── exit_processor/
│   │   │   │   │   ├── canonicity.ex
│   │   │   │   │   ├── competitor_info.ex
│   │   │   │   │   ├── core.ex
│   │   │   │   │   ├── double_spend.ex
│   │   │   │   │   ├── exit_info.ex
│   │   │   │   │   ├── finalizations.ex
│   │   │   │   │   ├── in_flight_exit_info.ex
│   │   │   │   │   ├── known_tx.ex
│   │   │   │   │   ├── measure.ex
│   │   │   │   │   ├── piggyback.ex
│   │   │   │   │   ├── request.ex
│   │   │   │   │   ├── standard_exit.ex
│   │   │   │   │   ├── tools.ex
│   │   │   │   │   └── tx_appendix.ex
│   │   │   │   ├── exit_processor.ex
│   │   │   │   ├── fees/
│   │   │   │   │   └── fee_filter.ex
│   │   │   │   ├── fees.ex
│   │   │   │   ├── http_rpc/
│   │   │   │   │   ├── adapter.ex
│   │   │   │   │   └── client.ex
│   │   │   │   ├── merge_transaction_validator.ex
│   │   │   │   ├── merkle.ex
│   │   │   │   ├── monitor.ex
│   │   │   │   ├── output.ex
│   │   │   │   ├── raw_data.ex
│   │   │   │   ├── release_tasks/
│   │   │   │   │   ├── set_application.ex
│   │   │   │   │   ├── set_ethereum_events_check_interval.ex
│   │   │   │   │   ├── set_exit_processor_sla_margin.ex
│   │   │   │   │   └── set_tracer.ex
│   │   │   │   ├── root_chain_coordinator/
│   │   │   │   │   ├── core.ex
│   │   │   │   │   ├── measure.ex
│   │   │   │   │   └── service.ex
│   │   │   │   ├── root_chain_coordinator.ex
│   │   │   │   ├── signature.ex
│   │   │   │   ├── state/
│   │   │   │   │   ├── core.ex
│   │   │   │   │   ├── measure.ex
│   │   │   │   │   ├── measurement_calculation.ex
│   │   │   │   │   ├── transaction/
│   │   │   │   │   │   ├── fee.ex
│   │   │   │   │   │   ├── payment.ex
│   │   │   │   │   │   ├── recovered.ex
│   │   │   │   │   │   ├── signed.ex
│   │   │   │   │   │   ├── validator/
│   │   │   │   │   │   │   ├── fee_claim.ex
│   │   │   │   │   │   │   └── payment.ex
│   │   │   │   │   │   ├── validator.ex
│   │   │   │   │   │   └── witness.ex
│   │   │   │   │   ├── transaction.ex
│   │   │   │   │   └── utxo_set.ex
│   │   │   │   ├── state.ex
│   │   │   │   ├── supervisor.ex
│   │   │   │   ├── sync_supervisor.ex
│   │   │   │   ├── tracer.ex
│   │   │   │   ├── typed_data_hash/
│   │   │   │   │   ├── config.ex
│   │   │   │   │   ├── tools.ex
│   │   │   │   │   └── types.ex
│   │   │   │   ├── typed_data_hash.ex
│   │   │   │   ├── utxo/
│   │   │   │   │   └── position.ex
│   │   │   │   ├── utxo.ex
│   │   │   │   ├── utxo_exit/
│   │   │   │   │   └── core.ex
│   │   │   │   └── wire_format_types.ex
│   │   │   └── omg_watcher.ex
│   │   ├── mix.exs
│   │   └── test/
│   │       ├── fixtures.exs
│   │       ├── omg_watcher/
│   │       │   ├── api/
│   │       │   │   ├── account_test.exs
│   │       │   │   ├── alarm_test.exs
│   │       │   │   └── status_cache_test.exs
│   │       │   ├── block_getter/
│   │       │   │   └── core_test.exs
│   │       │   ├── block_test.exs
│   │       │   ├── block_validator_test.exs
│   │       │   ├── child_manager_test.exs
│   │       │   ├── crypto_test.exs
│   │       │   ├── datadog_event/
│   │       │   │   ├── contract_event_consumer_test.exs
│   │       │   │   └── encode_test.exs
│   │       │   ├── ethereum_event_aggregator_test.exs
│   │       │   ├── ethereum_event_listener/
│   │       │   │   └── core_test.exs
│   │       │   ├── exit_processor/
│   │       │   │   ├── canonicity_test.exs
│   │       │   │   ├── core/
│   │       │   │   │   └── state_interaction_test.exs
│   │       │   │   ├── core_test.exs
│   │       │   │   ├── exit_info_test.exs
│   │       │   │   ├── finalizations_test.exs
│   │       │   │   ├── in_flight_exit_info_test.exs
│   │       │   │   ├── persistence_test.exs
│   │       │   │   ├── piggyback_test.exs
│   │       │   │   ├── standard_exit_test.exs
│   │       │   │   └── tools_test.exs
│   │       │   ├── fees/
│   │       │   │   └── fee_filter_test.exs
│   │       │   ├── fees_test.exs
│   │       │   ├── http_rpc/
│   │       │   │   └── adapter_test.exs
│   │       │   ├── integration/
│   │       │   │   ├── block_getter_1_test.exs
│   │       │   │   ├── block_getter_2_test.exs
│   │       │   │   ├── block_getter_3_test.exs
│   │       │   │   ├── block_getter_4_test.exs
│   │       │   │   ├── block_getter_test.exs
│   │       │   │   ├── in_flight_exit_test.exs
│   │       │   │   ├── in_flight_exit_test_1_test.exs
│   │       │   │   ├── in_flight_exit_test_2_test.exs
│   │       │   │   ├── in_flight_exit_test_3_test.exs
│   │       │   │   ├── in_flight_exit_test_4_test.exs
│   │       │   │   ├── invalid_exit_1_test.exs
│   │       │   │   ├── invalid_exit_2_test.exs
│   │       │   │   ├── monitor_test.exs
│   │       │   │   ├── root_chain_coordinator_test.exs
│   │       │   │   └── test_server_test.exs
│   │       │   ├── merge_transaction_validator_test.exs
│   │       │   ├── merkle_test.exs
│   │       │   ├── output_test.exs
│   │       │   ├── raw_data_test.exs
│   │       │   ├── release_tasks/
│   │       │   │   ├── set_ethereum_events_check_interval_test.exs
│   │       │   │   ├── set_exit_processor_sla_margin_test.exs
│   │       │   │   └── set_tracer_test.exs
│   │       │   ├── root_chain_coordinator/
│   │       │   │   └── core_test.exs
│   │       │   ├── signature_test.exs
│   │       │   ├── state/
│   │       │   │   ├── core_test.exs
│   │       │   │   ├── measurement_calculation_test.exs
│   │       │   │   ├── persistence_test.exs
│   │       │   │   ├── transaction/
│   │       │   │   │   ├── fee_test.exs
│   │       │   │   │   ├── recovered_test.exs
│   │       │   │   │   └── witness_test.exs
│   │       │   │   ├── transaction_test.exs
│   │       │   │   └── utxo_set_test.exs
│   │       │   ├── state_test.exs
│   │       │   ├── supervisor_test.exs
│   │       │   ├── typed_data_hash_test.exs
│   │       │   ├── utxo/
│   │       │   │   └── position_test.exs
│   │       │   ├── utxo_exit/
│   │       │   │   └── core_test.exs
│   │       │   ├── utxo_test.exs
│   │       │   └── wire_format_types_test.exs
│   │       ├── support/
│   │       │   ├── dev_crypto.ex
│   │       │   ├── exit_processor/
│   │       │   │   ├── case.ex
│   │       │   │   └── test_helper.ex
│   │       │   ├── integration/
│   │       │   │   ├── bad_child_chain_server.ex
│   │       │   │   ├── deposit_helper.ex
│   │       │   │   ├── fixtures.exs
│   │       │   │   ├── test_helper.ex
│   │       │   │   └── test_server.ex
│   │       │   ├── signature_helper.ex
│   │       │   ├── test_helper.ex
│   │       │   └── watcher_helper.ex
│   │       └── test_helper.exs
│   ├── omg_watcher_info/
│   │   ├── lib/
│   │   │   ├── omg_watcher_info/
│   │   │   │   ├── api/
│   │   │   │   │   ├── account.ex
│   │   │   │   │   ├── block.ex
│   │   │   │   │   ├── deposit.ex
│   │   │   │   │   ├── stats.ex
│   │   │   │   │   └── transaction.ex
│   │   │   │   ├── application.ex
│   │   │   │   ├── block_applicator.ex
│   │   │   │   ├── db/
│   │   │   │   │   ├── block.ex
│   │   │   │   │   ├── eth_event.ex
│   │   │   │   │   ├── eth_event_txoutput.ex
│   │   │   │   │   ├── repo.ex
│   │   │   │   │   ├── transaction.ex
│   │   │   │   │   ├── txoutput.ex
│   │   │   │   │   └── types/
│   │   │   │   │       ├── atom_type.ex
│   │   │   │   │       ├── block/
│   │   │   │   │       │   └── chunk.ex
│   │   │   │   │       └── integer_type.ex
│   │   │   │   ├── http_rpc/
│   │   │   │   │   ├── adapter.ex
│   │   │   │   │   └── client.ex
│   │   │   │   ├── measure.ex
│   │   │   │   ├── order_fee_fetcher.ex
│   │   │   │   ├── release_tasks/
│   │   │   │   │   ├── init_postgresql_db.ex
│   │   │   │   │   └── set_tracer.ex
│   │   │   │   ├── supervisor.ex
│   │   │   │   ├── tracer.ex
│   │   │   │   ├── transaction.ex
│   │   │   │   └── utxo_selection.ex
│   │   │   └── watcher_info.ex
│   │   ├── mix.exs
│   │   ├── priv/
│   │   │   └── repo/
│   │   │       └── migrations/
│   │   │           ├── 20180813131000_create_block_table.exs
│   │   │           ├── 20180813131706_create_transaction_table.exs
│   │   │           ├── 20180813133000_create_ethevent_table.exs
│   │   │           ├── 20180813143343_create_txoutput_table.exs
│   │   │           ├── 20190314105410_alter_transactions_table_add_metadata_field.exs
│   │   │           ├── 20190315095855_alter_transactions_table_add_partitial_index.exs
│   │   │           ├── 20190408131000_add_missing_indices_to_txoutputs.exs
│   │   │           ├── 20190806111817_alter_txoutputs_ethevents_make_many_to_many_relation.exs
│   │   │           ├── 20190917165912_set_inserted_at_updated_at_to_epoc.exs
│   │   │           ├── 20200129051756_index_block_timestamp.exs
│   │   │           ├── 20200211064454_add_txtype_to_transaction_and_output.exs
│   │   │           ├── 20200214132000_add_and_fix_timestamps.exs
│   │   │           ├── 20200514115919_add_eth_height_to_eth_events.exs
│   │   │           └── 20200529085008_create_pending_block_table.exs
│   │   └── test/
│   │       ├── fixtures.exs
│   │       ├── omg_watcher_info/
│   │       │   ├── api/
│   │       │   │   ├── block_test.exs
│   │       │   │   ├── deposit_test.exs
│   │       │   │   ├── stats_test.exs
│   │       │   │   └── transaction_test.exs
│   │       │   ├── block_applicator_test.exs
│   │       │   ├── db/
│   │       │   │   ├── block/
│   │       │   │   │   └── chunk_test.exs
│   │       │   │   ├── block_test.exs
│   │       │   │   ├── eth_event_test.exs
│   │       │   │   ├── transaction_test.exs
│   │       │   │   └── txoutput_test.exs
│   │       │   ├── http_rpc/
│   │       │   │   └── adapter_test.exs
│   │       │   ├── order_fee_fetcher_test.exs
│   │       │   ├── release_tasks/
│   │       │   │   └── set_tracer_test.exs
│   │       │   ├── transaction_test.exs
│   │       │   └── utxo_selection_test.exs
│   │       ├── support/
│   │       │   ├── factories/
│   │       │   │   ├── block_factory.ex
│   │       │   │   ├── data_helper.ex
│   │       │   │   ├── eth_event_factory.ex
│   │       │   │   ├── transaction_factory.ex
│   │       │   │   └── txoutput_factory.ex
│   │       │   ├── factory.ex
│   │       │   └── test_server.ex
│   │       └── test_helper.exs
│   ├── omg_watcher_rpc/
│   │   ├── lib/
│   │   │   ├── application.ex
│   │   │   ├── configuration.ex
│   │   │   ├── release_tasks/
│   │   │   │   ├── set_api_mode.ex
│   │   │   │   ├── set_endpoint.ex
│   │   │   │   └── set_tracer.ex
│   │   │   ├── tracer.ex
│   │   │   ├── web/
│   │   │   │   ├── controllers/
│   │   │   │   │   ├── account.ex
│   │   │   │   │   ├── alarm.ex
│   │   │   │   │   ├── block.ex
│   │   │   │   │   ├── challenge.ex
│   │   │   │   │   ├── configuration.ex
│   │   │   │   │   ├── deposit.ex
│   │   │   │   │   ├── fallback.ex
│   │   │   │   │   ├── fee.ex
│   │   │   │   │   ├── in_flight_exit.ex
│   │   │   │   │   ├── stats.ex
│   │   │   │   │   ├── status.ex
│   │   │   │   │   ├── transaction.ex
│   │   │   │   │   └── utxo.ex
│   │   │   │   ├── endpoint.ex
│   │   │   │   ├── plugs/
│   │   │   │   │   ├── health.ex
│   │   │   │   │   ├── method_param_filter.ex
│   │   │   │   │   └── supported_watcher_modes.ex
│   │   │   │   ├── response.ex
│   │   │   │   ├── router.ex
│   │   │   │   ├── serializers/
│   │   │   │   │   └── base.ex
│   │   │   │   ├── sockets/
│   │   │   │   │   └── socket.ex
│   │   │   │   ├── validators/
│   │   │   │   │   ├── account_constraints.ex
│   │   │   │   │   ├── block_constraints.ex
│   │   │   │   │   ├── deposit_constraints.ex
│   │   │   │   │   ├── helpers.ex
│   │   │   │   │   ├── merge_constraints.ex
│   │   │   │   │   ├── order.ex
│   │   │   │   │   ├── transaction_constraints.ex
│   │   │   │   │   └── typed_data_signed.ex
│   │   │   │   └── views/
│   │   │   │       ├── account.ex
│   │   │   │       ├── alarm.ex
│   │   │   │       ├── block.ex
│   │   │   │       ├── challenge.ex
│   │   │   │       ├── configuration.ex
│   │   │   │       ├── deposit.ex
│   │   │   │       ├── error.ex
│   │   │   │       ├── fee.ex
│   │   │   │       ├── in_flight_exit.ex
│   │   │   │       ├── stats.ex
│   │   │   │       ├── status.ex
│   │   │   │       ├── transaction.ex
│   │   │   │       └── utxo.ex
│   │   │   └── web.ex
│   │   ├── mix.exs
│   │   ├── priv/
│   │   │   └── swagger/
│   │   │       ├── info_api_specs/
│   │   │       │   ├── account/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── alarm/
│   │   │       │   │   ├── alarms_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── batch_transaction/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── block/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── configuration/
│   │   │       │   │   ├── configuration_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── deposit/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── fees/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── response_schemas.yaml
│   │   │       │   ├── responses.yaml
│   │   │       │   ├── stats/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── swagger.yaml
│   │   │       │   └── transaction/
│   │   │       │       ├── paths.yaml
│   │   │       │       ├── request_bodies.yaml
│   │   │       │       ├── response_schemas.yaml
│   │   │       │       ├── responses.yaml
│   │   │       │       └── schemas.yaml
│   │   │       ├── info_api_specs.yaml
│   │   │       ├── security_critical_api_specs/
│   │   │       │   ├── account/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── alarm/
│   │   │       │   │   ├── alarms_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── batch_transaction/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── block/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── configuration/
│   │   │       │   │   ├── configuration_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── in_flight_exit/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── response_schemas.yaml
│   │   │       │   ├── responses.yaml
│   │   │       │   ├── status/
│   │   │       │   │   ├── byzantine_events_schema.yml
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   ├── swagger.yaml
│   │   │       │   ├── transaction/
│   │   │       │   │   ├── paths.yaml
│   │   │       │   │   ├── request_bodies.yaml
│   │   │       │   │   ├── response_schemas.yaml
│   │   │       │   │   ├── responses.yaml
│   │   │       │   │   └── schemas.yaml
│   │   │       │   └── utxo/
│   │   │       │       ├── paths.yaml
│   │   │       │       ├── request_bodies.yaml
│   │   │       │       ├── response_schemas.yaml
│   │   │       │       ├── responses.yaml
│   │   │       │       └── schemas.yaml
│   │   │       ├── security_critical_api_specs.yaml
│   │   │       ├── shared/
│   │   │       │   ├── paths.yaml
│   │   │       │   ├── request_bodies.yaml
│   │   │       │   └── schemas.yaml
│   │   │       └── swagger.md
│   │   └── test/
│   │       ├── omg_watcher_rpc/
│   │       │   ├── release_tasks/
│   │       │   │   ├── set_endpoint_test.exs
│   │       │   │   └── set_tracer_test.exs
│   │       │   ├── tracer_test.exs
│   │       │   └── web/
│   │       │       ├── conn_case.ex
│   │       │       ├── controllers/
│   │       │       │   ├── account_test.exs
│   │       │       │   ├── alarm_test.exs
│   │       │       │   ├── block_test.exs
│   │       │       │   ├── challenge_test.exs
│   │       │       │   ├── deposit_test.exs
│   │       │       │   ├── enforce_content_plug_test.exs
│   │       │       │   ├── fallback_test.exs
│   │       │       │   ├── fee_test.exs
│   │       │       │   ├── in_flight_exit_test.exs
│   │       │       │   ├── stats_test.exs
│   │       │       │   ├── status_test.exs
│   │       │       │   ├── transaction_test.exs
│   │       │       │   └── utxo_test.exs
│   │       │       ├── data_case.ex
│   │       │       ├── plugs/
│   │       │       │   ├── method_param_filter_test.exs
│   │       │       │   └── supported_watcher_modes_test.exs
│   │       │       ├── response_test.exs
│   │       │       ├── router_test.exs
│   │       │       ├── validators/
│   │       │       │   ├── account_contraints_test.exs
│   │       │       │   ├── block_constraints_test.exs
│   │       │       │   ├── merge_constraints_test.exs
│   │       │       │   ├── transaction_constraints_test.exs
│   │       │       │   └── typed_data_signed_test.exs
│   │       │       ├── view_case.ex
│   │       │       └── views/
│   │       │           └── transaction_test.exs
│   │       └── test_helper.exs
│   └── xomg_tasks/
│       ├── lib/
│       │   ├── mix/
│       │   │   └── tasks/
│       │   │       ├── watcher.ex
│       │   │       └── watcher_info.ex
│       │   └── utils.ex
│       ├── mix.exs
│       └── test/
│           └── test_helper.exs
├── bin/
│   ├── generate-localchain-env
│   ├── revert
│   ├── rocksdb
│   ├── setup
│   ├── variables
│   └── variables_test_barebone
├── config/
│   ├── .credo.exs
│   ├── config.exs
│   ├── credo/
│   │   ├── license_header.ex
│   │   └── require_parentheses_on_zero_arity_defs.ex
│   ├── dev.exs
│   ├── prod.exs
│   ├── releases.exs
│   └── test.exs
├── contract_addresses_template.env
├── coveralls.json
├── dialyzer.ignore-warnings
├── docker/
│   ├── create_databases.sql
│   ├── geth/
│   │   ├── command
│   │   └── geth-blank-password
│   ├── nginx/
│   │   ├── geth_nginx.conf
│   │   ├── nginx.conf
│   │   └── nginx.reorg.conf
│   └── static_feefeed/
│       └── file.json
├── docker-compose-infura.yml
├── docker-compose-watcher.yml
├── docker-compose.datadog.yml
├── docker-compose.dev.yml
├── docker-compose.feefeed.yml
├── docker-compose.reorg.yml
├── docker-compose.specs.yml
├── docker-compose.yml
├── docs/
│   ├── api_specs/
│   │   ├── errors.md
│   │   ├── index.html.md
│   │   └── status_events_specs.md
│   ├── architecture.md
│   ├── branching.md
│   ├── deployment_configuration.md
│   ├── details.md
│   ├── dex_design.md
│   ├── exit_validation.md
│   ├── fee_design.md
│   ├── in_flight_exit_scenarios.md
│   ├── install.md
│   ├── morevp.md
│   ├── perf_test_result_dumps.md
│   ├── run_local_watcher.md
│   ├── source_consumption_log.md
│   ├── stack_architecture.md
│   ├── standard_vs_in_flight_exits_interaction.md
│   ├── tesuji_blockchain_design.md
│   ├── transaction_validation.md
│   ├── unified_api.md
│   └── watcher_db_design.md
├── dummy
├── fees_setup.env
├── mix.exs
├── priv/
│   ├── dev-artifacts/
│   │   ├── README.md
│   │   ├── fee_specs.dev.json
│   │   └── fee_specs.test.json
│   └── perf/
│       ├── .formatter.exs
│       ├── .gitignore
│       ├── Dockerfile
│       ├── Makefile
│       ├── README.md
│       ├── apps/
│       │   └── load_test/
│       │       ├── .formatter.exs
│       │       ├── .gitignore
│       │       ├── README.md
│       │       ├── lib/
│       │       │   ├── application.ex
│       │       │   ├── child_chain/
│       │       │   │   ├── abi/
│       │       │   │   │   ├── abi_event_selector.ex
│       │       │   │   │   ├── abi_function_selector.ex
│       │       │   │   │   └── fields.ex
│       │       │   │   ├── abi.ex
│       │       │   │   ├── deposit.ex
│       │       │   │   ├── exit.ex
│       │       │   │   ├── transaction.ex
│       │       │   │   ├── utxos.ex
│       │       │   │   └── watcher_sync.ex
│       │       │   ├── connection/
│       │       │   │   ├── child_chain.ex
│       │       │   │   ├── connection_defaults.ex
│       │       │   │   ├── watcher_info.ex
│       │       │   │   └── watcher_security.ex
│       │       │   ├── ethereum/
│       │       │   │   ├── account.ex
│       │       │   │   ├── bit_helper.ex
│       │       │   │   ├── crypto.ex
│       │       │   │   ├── ethereum.ex
│       │       │   │   ├── hash.ex
│       │       │   │   ├── nonce_tracker.ex
│       │       │   │   └── transaction/
│       │       │   │       ├── signature.ex
│       │       │   │       └── transaction.ex
│       │       │   ├── performance.ex
│       │       │   ├── runner/
│       │       │   │   ├── childchain.ex
│       │       │   │   ├── deposits.ex
│       │       │   │   ├── smoke.ex
│       │       │   │   ├── standard_exits.ex
│       │       │   │   ├── transactions.ex
│       │       │   │   ├── utxos_load.ex
│       │       │   │   └── watcher_info.ex
│       │       │   ├── scenario/
│       │       │   │   ├── account_transactions.ex
│       │       │   │   ├── create_utxos.ex
│       │       │   │   ├── deposits.ex
│       │       │   │   ├── fund_account.ex
│       │       │   │   ├── many_standard_exits.ex
│       │       │   │   ├── smoke.ex
│       │       │   │   ├── spend_eth_utxo.ex
│       │       │   │   ├── start_standard_exit.ex
│       │       │   │   ├── transactions.ex
│       │       │   │   └── watcher_status.ex
│       │       │   ├── service/
│       │       │   │   ├── datadog/
│       │       │   │   │   ├── api.ex
│       │       │   │   │   └── dummy_statix.ex
│       │       │   │   ├── datadog.ex
│       │       │   │   ├── faucet.ex
│       │       │   │   ├── metrics.ex
│       │       │   │   ├── sleeper.ex
│       │       │   │   └── sync.ex
│       │       │   ├── test_runner/
│       │       │   │   ├── config.ex
│       │       │   │   └── help.ex
│       │       │   ├── test_runner.ex
│       │       │   ├── utils/
│       │       │   │   └── encoding.ex
│       │       │   └── watcher_info/
│       │       │       ├── balance.ex
│       │       │       ├── client.ex
│       │       │       ├── transaction.ex
│       │       │       └── utxo.ex
│       │       ├── mix.exs
│       │       └── test/
│       │           ├── load_test/
│       │           │   ├── runner/
│       │           │   │   ├── childchain_test.exs
│       │           │   │   ├── smoke_test.exs
│       │           │   │   ├── standard_exit_test.exs
│       │           │   │   ├── utxos_load_test.exs
│       │           │   │   └── watcher_info_test.exs
│       │           │   └── service/
│       │           │       └── datadog/
│       │           │           └── api_test.exs
│       │           └── test_helper.exs
│       ├── config/
│       │   ├── .credo.exs
│       │   ├── config.exs
│       │   ├── dev.exs
│       │   ├── stress.exs
│       │   └── test.exs
│       ├── mix.exs
│       └── scripts/
│           └── generate_api_client.sh
├── rel/
│   └── env.sh.eex
├── rootfs/
│   ├── watcher_entrypoint
│   └── watcher_info_entrypoint
├── snapshot_reorg.env
└── snapshots.env
Download .txt
Showing preview only (296K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3043 symbols across 523 files)

FILE: .circleci/test_runner.py
  function create_job (line 10) | def create_job(test_runner: str) -> str:
  function check_job_completed (line 32) | def check_job_completed(test_runner: str, job_id: str):
  function check_job_result (line 53) | def check_job_result(test_runner: str, job_id: str):
  function get_envs (line 69) | def get_envs() -> dict:
  function start_workflow (line 82) | def start_workflow():
  function set_logger (line 92) | def set_logger():

FILE: apps/omg_bus/lib/omg_bus.ex
  class OMG.Bus (line 15) | defmodule OMG.Bus

FILE: apps/omg_bus/lib/omg_bus/application.ex
  class OMG.Bus.Application (line 15) | defmodule OMG.Bus.Application
    method start (line 20) | def start(_type, _args) do

FILE: apps/omg_bus/lib/omg_bus/event.ex
  class OMG.Bus.Event (line 15) | defmodule OMG.Bus.Event

FILE: apps/omg_bus/lib/omg_bus/pubsub.ex
  class OMG.Bus.PubSub (line 15) | defmodule OMG.Bus.PubSub
    method child_spec (line 31) | def child_spec(args \\ []) do

FILE: apps/omg_bus/lib/omg_bus/supervisor.ex
  class OMG.Bus.Supervisor (line 15) | defmodule OMG.Bus.Supervisor
    method start_link (line 22) | def start_link() do
    method init (line 26) | def init(:ok) do

FILE: apps/omg_bus/mix.exs
  class OMG.Bus.MixProject (line 1) | defmodule OMG.Bus.MixProject
    method project (line 4) | def project() do
    method application (line 20) | def application() do
    method version (line 28) | defp version() do
    method elixirc_paths (line 37) | defp elixirc_paths(:prod), do: ["lib"]
    method elixirc_paths (line 38) | defp elixirc_paths(:dev), do: ["lib"]
    method elixirc_paths (line 39) | defp elixirc_paths(:test), do: ["lib", "test/support"]
    method deps (line 41) | defp deps(), do: [{:phoenix_pubsub, "~> 2.0"}]

FILE: apps/omg_bus/test/omg_bus/event_test.exs
  class OMG.Bus.EventTest (line 15) | defmodule OMG.Bus.EventTest

FILE: apps/omg_conformance/mix.exs
  class OMG.Conformance.MixProject (line 1) | defmodule OMG.Conformance.MixProject
    method project (line 4) | def project() do
    method application (line 20) | def application() do
    method version (line 26) | defp version() do
    method elixirc_paths (line 34) | defp elixirc_paths(:prod), do: ["lib"]
    method elixirc_paths (line 35) | defp elixirc_paths(:dev), do: ["lib"]
    method elixirc_paths (line 36) | defp elixirc_paths(:test), do: ["lib", "test/support"]
    method deps (line 38) | defp deps() do

FILE: apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs
  class OMG.Conformance.MerkleProofPropertyTest (line 15) | defmodule OMG.Conformance.MerkleProofPropertyTest

FILE: apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs
  class OMG.Conformance.MerkleProofTest (line 15) | defmodule OMG.Conformance.MerkleProofTest

FILE: apps/omg_conformance/test/omg_conformance/conformance/signature_property_test.exs
  class OMG.Conformance.SignaturePropertyTest (line 15) | defmodule OMG.Conformance.SignaturePropertyTest

FILE: apps/omg_conformance/test/omg_conformance/conformance/signature_test.exs
  class OMG.Conformance.SignatureTest (line 15) | defmodule OMG.Conformance.SignatureTest

FILE: apps/omg_conformance/test/support/conformance/merkle_proof_context.ex
  class Support.Conformance.MerkleProofContext (line 15) | defmodule Support.Conformance.MerkleProofContext
    method correct (line 29) | def correct() do
    method mutated_leaf (line 45) | def mutated_leaf(%__MODULE__{} = base) do
    method mutated_txindex (line 66) | def mutated_txindex(%__MODULE__{} = base) do
    method mutated_proof (line 80) | def mutated_proof(%__MODULE__{} = base) do
    method mutated_to_prove_sth_else (line 91) | def mutated_to_prove_sth_else(%__MODULE__{} = base) do
    method zero_out_leaf (line 104) | defp zero_out_leaf(%__MODULE__{} = base) do
    method random_leaf (line 108) | defp random_leaf(%__MODULE__{} = base) do
    method trimmed_leaf (line 114) | defp trimmed_leaf(%__MODULE__{} = base) do
    method expanded_leaf (line 122) | defp expanded_leaf(%__MODULE__{} = base) do
    method get_other_leaf (line 128) | defp get_other_leaf(%__MODULE__{} = base) do
    method bitwise_modify_proof (line 140) | defp bitwise_modify_proof(%__MODULE__{} = base) do
    method chunkwise_modify_proof (line 147) | defp chunkwise_modify_proof(%__MODULE__{} = base) do
    method insert_zero_chunk (line 158) | defp insert_zero_chunk(%__MODULE__{} = base) do
    method insert_leaf_chunk (line 165) | defp insert_leaf_chunk(%__MODULE__{} = base) do
    method drop_chunk (line 172) | defp drop_chunk(%__MODULE__{} = base) do
    method swap_neighbors (line 179) | defp swap_neighbors(%__MODULE__{} = base) do
    method bitwise_append (line 195) | defp bitwise_append(%__MODULE__{} = base) do
    method prescribed_binary (line 209) | defp prescribed_binary(), do: union(@prescribed_binaries)
    method pragmatic_binary (line 210) | defp pragmatic_binary(), do: union([binary(), prescribed_binary()])
    method non_empty_binary (line 212) | defp non_empty_binary(), do: such_that(b <- pragmatic_binary(), when: ...
    method chunk (line 217) | defp chunk(proof), do: for(<<chunk::256 <- proof>>, do: <<chunk::256>>)
    method unchunk (line 218) | defp unchunk(chunked_proof), do: Enum.join(chunked_proof)

FILE: apps/omg_conformance/test/support/conformance/merkle_proofs.ex
  class Support.Conformance.MerkleProofs (line 15) | defmodule Support.Conformance.MerkleProofs
    method solidity_proof_valid (line 27) | def solidity_proof_valid(leaf, index, root_hash, proof, contract) do
    method assert_contract_reverted (line 49) | defp assert_contract_reverted(chopped_reason_binary_result) do
    method call_contract (line 58) | defp call_contract(contract, signature, args, return_types) do
    method decode_answer (line 71) | defp decode_answer(enc_return, return_types) do

FILE: apps/omg_conformance/test/support/conformance/property.ex
  class Support.Conformance.PropertyGenerators (line 15) | defmodule Support.Conformance.PropertyGenerators
    method payment_tx (line 29) | def payment_tx() do
    method distinct_payment_txs (line 40) | def distinct_payment_txs() do
    method tx_binary_with_mutation (line 63) | def tx_binary_with_mutation() do
    method tx_binary_with_rlp_mutation (line 76) | def tx_binary_with_rlp_mutation() do
    method is_pair_of_distinct_terms? (line 86) | defp is_pair_of_distinct_terms?({base_term, new_term}), do: base_term ...
    method non_zero_address (line 88) | defp non_zero_address(), do: union([exactly(<<1::160>>), binary(20)])
    method address (line 89) | defp address(), do: union([exactly(<<0::160>>), exactly(<<1::160>>), b...
    method hash (line 90) | defp hash(), do: union([exactly(<<0::256>>), exactly(<<1::256>>), bina...
    method injectable_binary (line 92) | defp injectable_binary() do
    method valid_blknum (line 118) | defp valid_blknum(), do: integer(0, @max_blknum)
    method valid_txndex (line 119) | defp valid_txndex(), do: integer(0, @max_txindex)
    method valid_oindex (line 120) | defp valid_oindex(), do: integer(0, @transaction_offset - 1)
    method valid_input_tuple (line 123) | defp valid_input_tuple() do
    method valid_output_tuple (line 133) | defp valid_output_tuple() do
    method valid_inputs_list (line 139) | defp valid_inputs_list() do
    method valid_outputs_list (line 143) | defp valid_outputs_list() do
    method mutated_hash (line 147) | defp mutated_hash(base_hash) do
    method mutated_inputs (line 152) | defp mutated_inputs(inputs) do
    method mutated_outputs (line 157) | defp mutated_outputs(outputs) do
    method prepend_binary (line 162) | defp prepend_binary(base_binary) do
    method apend_binary (line 166) | defp apend_binary(base_binary) do
    method substring_binary (line 170) | defp substring_binary(base_binary) do
    method insert_into_binary (line 182) | defp insert_into_binary(base_binary) do
    method mutate_binary (line 190) | defp mutate_binary(base_binary) do
    method inject_extra_item (line 208) | defp inject_extra_item(base_rlp_items) do
    method try_reversing (line 213) | defp try_reversing(rlp_item), do: rlp_item
    method swap_in_rlp (line 215) | defp swap_in_rlp([]), do: rlp_item_generator()
    method rlp_item_generator (line 232) | defp rlp_item_generator(),
    method mutate_sub_rlp (line 235) | defp mutate_sub_rlp(base_rlp_items) do
    method rlp_mutate_binary (line 244) | defp rlp_mutate_binary(base_binary) do

FILE: apps/omg_conformance/test/support/conformance/signatures_hashes.ex
  class Support.Conformance.SignaturesHashes (line 15) | defmodule Support.Conformance.SignaturesHashes
    method verify_distinct (line 29) | def verify_distinct(tx1, tx2, contract) do
    method verify (line 41) | def verify(tx, contract) do
    method verify_both_error (line 48) | def verify_both_error(some_binary, contract) do
    method verify_distinct_or_erroring (line 66) | def verify_distinct_or_erroring(tx1_binary, tx2_binary, contract) do
    method solidity_hash! (line 101) | defp solidity_hash!(tx, contract) do
    method solidity_hash (line 106) | defp solidity_hash(%{} = tx, contract), do: tx |> Transaction.raw_txby...
    method elixir_hash (line 115) | defp elixir_hash(%{} = tx), do: TypedDataHash.hash_struct(tx)
    method elixir_hash (line 116) | defp elixir_hash(encoded_tx), do: encoded_tx |> Transaction.decode!() ...
    method assert_contract_reverted (line 118) | defp assert_contract_reverted(result) do
    method call_contract (line 123) | defp call_contract(contract, signature, args, return_types) do
    method decode_answer (line 136) | defp decode_answer(enc_return, return_types) do

FILE: apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex
  class Support.Conformance.SignaturesHashesCase (line 15) | defmodule Support.Conformance.SignaturesHashesCase

FILE: apps/omg_db/lib/db.ex
  class OMG.DB (line 15) | defmodule OMG.DB
    method start_link (line 68) | def start_link(args), do: RocksDB.start_link(args)
    method child_spec (line 70) | def child_spec(), do: RocksDB.child_spec()
    method child_spec (line 71) | def child_spec(args), do: RocksDB.child_spec(args)
    method init (line 73) | def init(path) do
    method init (line 77) | def init() do
    method initiation_multiupdate (line 85) | def initiation_multiupdate(), do: RocksDB.initiation_multiupdate()
    method initiation_multiupdate (line 86) | def initiation_multiupdate(server), do: RocksDB.initiation_multiupdate...
    method multi_update (line 89) | def multi_update(db_updates), do: RocksDB.multi_update(db_updates)
    method multi_update (line 90) | def multi_update(db_updates, server), do: RocksDB.multi_update(db_upda...
    method blocks (line 92) | def blocks(blocks_to_fetch), do: RocksDB.blocks(blocks_to_fetch)
    method blocks (line 93) | def blocks(blocks_to_fetch, server), do: RocksDB.blocks(blocks_to_fetc...
    method utxos (line 95) | def utxos(), do: RocksDB.utxos()
    method utxos (line 96) | def utxos(server), do: RocksDB.utxos(server)
    method utxo (line 98) | def utxo(utxo_pos), do: RocksDB.utxo(utxo_pos)
    method utxo (line 99) | def utxo(utxo_pos, server), do: RocksDB.utxo(utxo_pos, server)
    method competitors_info (line 101) | def competitors_info(), do: RocksDB.competitors_info()
    method competitors_info (line 102) | def competitors_info(server), do: RocksDB.competitors_info(server)
    method spent_blknum (line 104) | def spent_blknum(utxo_pos), do: RocksDB.spent_blknum(utxo_pos)
    method spent_blknum (line 105) | def spent_blknum(utxo_pos, server), do: RocksDB.spent_blknum(utxo_pos,...
    method block_hashes (line 107) | def block_hashes(block_numbers_to_fetch), do: RocksDB.block_hashes(blo...
    method block_hashes (line 108) | def block_hashes(block_numbers_to_fetch, server), do: RocksDB.block_ha...
    method child_top_block_number (line 110) | def child_top_block_number(), do: RocksDB.child_top_block_number()
    method get_single_value (line 112) | def get_single_value(parameter_name), do: RocksDB.get_single_value(par...
    method get_single_value (line 113) | def get_single_value(parameter_name, server), do: RocksDB.get_single_v...
    method batch_get (line 119) | def batch_get(type, specific_keys), do: RocksDB.batch_get(type, specif...
    method batch_get (line 120) | def batch_get(type, specific_keys, opts), do: RocksDB.batch_get(type, ...
    method get_all_by_type (line 125) | def get_all_by_type(type), do: RocksDB.get_all_by_type(type)
    method get_all_by_type (line 126) | def get_all_by_type(type, opts), do: RocksDB.get_all_by_type(type, opts)
    method single_value_parameter_names (line 131) | def single_value_parameter_names() do

FILE: apps/omg_db/lib/omg_db/application.ex
  class OMG.DB.Application (line 15) | defmodule OMG.DB.Application
    method start (line 20) | def start(_type, _args) do
    method start_phase (line 28) | def start_phase(:attach_telemetry, :normal, _phase_args) do

FILE: apps/omg_db/lib/omg_db/measure.ex
  class OMG.DB.Measure (line 15) | defmodule OMG.DB.Measure
    method supported_events (line 40) | def supported_events(), do: @supported_events

FILE: apps/omg_db/lib/omg_db/models/payment_exit_info.ex
  class OMG.DB.Models.PaymentExitInfo (line 15) | defmodule OMG.DB.Models.PaymentExitInfo
    method exit_info (line 27) | def exit_info(utxo_pos, server \\ @server_name) do
    method all_exit_infos (line 37) | def all_exit_infos(server \\ @server_name) do
    method all_in_flight_exits_infos (line 41) | def all_in_flight_exits_infos(server \\ @server_name) do

FILE: apps/omg_db/lib/omg_db/release_tasks/init_key_value_db.ex
  class OMG.DB.ReleaseTasks.InitKeyValueDB (line 15) | defmodule OMG.DB.ReleaseTasks.InitKeyValueDB
    method run (line 23) | def run() do
    method process (line 29) | defp process(path) do
    method init_kv_db (line 36) | defp init_kv_db(path) do
    method on_load (line 47) | defp on_load() do

FILE: apps/omg_db/lib/omg_db/release_tasks/init_keys_with_values.ex
  class OMG.DB.ReleaseTasks.InitKeysWithValues (line 15) | defmodule OMG.DB.ReleaseTasks.InitKeysWithValues
    method run (line 23) | def run() do
    method set_single_value (line 39) | defp set_single_value({key, init_val}) do

FILE: apps/omg_db/lib/omg_db/release_tasks/set_key_value_db.ex
  class OMG.DB.ReleaseTasks.SetKeyValueDB (line 15) | defmodule OMG.DB.ReleaseTasks.SetKeyValueDB
    method init (line 21) | def init(args) do
    method load (line 25) | def load(config, args) do
    method set_db (line 39) | defp set_db(config, root_path, release) do
    method get_env (line 47) | defp get_env(key), do: System.get_env(key)
    method on_load (line 49) | defp on_load() do

FILE: apps/omg_db/lib/omg_db/rocks_db.ex
  class OMG.DB.RocksDB (line 15) | defmodule OMG.DB.RocksDB
    method start_link (line 33) | def start_link(args) do
    method child_spec (line 37) | def child_spec() do
    method child_spec (line 48) | def child_spec([db_path: _db_path, name: server_name] = args) do
    method multi_update (line 56) | def multi_update(db_updates, server_name \\ @server_name) do
    method blocks (line 61) | def blocks(blocks_to_fetch, server_name \\ @server_name)
    method blocks (line 63) | def blocks([], _server_name), do: {:ok, []}
    method blocks (line 65) | def blocks(blocks_to_fetch, server_name) do
    method utxos (line 69) | def utxos(server_name \\ @server_name) do
    method utxo (line 74) | def utxo(utxo_pos, server_name \\ @server_name) do
    method competitors_info (line 78) | def competitors_info(server_name \\ @server_name) do
    method spent_blknum (line 83) | def spent_blknum(utxo_pos, server_name \\ @server_name) do
    method block_hashes (line 87) | def block_hashes(block_numbers_to_fetch, server_name \\ @server_name) do
    method child_top_block_number (line 91) | def child_top_block_number(server_name \\ @server_name) do
    method get_single_value (line 98) | def get_single_value(parameter_name, server_name \\ @server_name) do
    method batch_get (line 109) | def batch_get(type, specific_keys, opts \\ []) do
    method get_all_by_type (line 129) | def get_all_by_type(type, opts \\ []) do
    method initiation_multiupdate (line 141) | def initiation_multiupdate(server_name \\ @server_name) do
    method init (line 151) | def init(), do: do_init(@server_name, Application.fetch_env!(:omg_db, ...
    method init (line 158) | def init(server_name), do: do_init(server_name, Application.fetch_env!...
    method init (line 159) | def init(server_name, path), do: do_init(server_name, path)
    method do_init (line 163) | defp do_init(server_name, path) do

FILE: apps/omg_db/lib/omg_db/rocksdb/core.ex
  class OMG.DB.RocksDB.Core (line 15) | defmodule OMG.DB.RocksDB.Core
    method parse_multi_updates (line 49) | def parse_multi_updates(db_updates), do: Enum.flat_map(db_updates, &pa...
    method decode_value (line 55) | def decode_value(db_response) do
    method decode_values (line 67) | def decode_values(encoded_enumerable) do
    method key_for_item (line 85) | defp key_for_item(:block, %{hash: hash} = _block), do: key(:block, hash)
    method key_for_item (line 86) | defp key_for_item(:utxo, {position, _utxo}), do: key(:utxo, position)
    method key_for_item (line 87) | defp key_for_item(:spend, {position, _blknum}), do: key(:spend, position)
    method key_for_item (line 88) | defp key_for_item(:exit_info, {position, _exit_info}), do: key(:exit_i...
    method key_for_item (line 89) | defp key_for_item(:in_flight_exit_info, {position, _info}), do: key(:i...
    method key_for_item (line 90) | defp key_for_item(:competitor_info, {position, _info}), do: key(:compe...
    method parse_multi_update (line 93) | defp parse_multi_update({:put, :block, %{number: number, hash: hash} =...
    method parse_multi_update (line 100) | defp parse_multi_update({:put, type, item}), do: [{:put, key_for_item(...
    method parse_multi_update (line 101) | defp parse_multi_update({:delete, type, item}), do: [{:delete, key(typ...
    method encode_value (line 103) | defp encode_value(:spend, {_position, blknum}), do: :erlang.term_to_bi...
    method encode_value (line 104) | defp encode_value(_type, value), do: :erlang.term_to_binary(value)
    method decode_response (line 107) | defp decode_response(db_response) do
    method do_filter_keys (line 121) | defp do_filter_keys(reference, prefix) do
    method search (line 128) | defp search(_reference, _iterator, {:error, :invalid_iterator}, acc), ...
    method search (line 129) | defp search(reference, iterator, {:ok, _key, value}, acc), do: do_sear...
    method do_search (line 131) | defp do_search(reference, iterator, acc) do

FILE: apps/omg_db/lib/omg_db/rocksdb/server.ex
  class OMG.DB.RocksDB.Server (line 15) | defmodule OMG.DB.RocksDB.Server
    method init_storage (line 38) | def init_storage(db_path) do
    method do_init_storage (line 42) | defp do_init_storage(db_path) do
    method start_link (line 48) | def start_link([db_path: _db_path, name: name] = args) do
    method init (line 53) | def init(db_path: db_path, name: name) do
    method handle_info (line 76) | def handle_info(:send_metrics, state) do
    method handle_call (line 81) | def handle_call({:multi_update, db_updates}, _from, state) do
    method handle_call (line 85) | def handle_call({:blocks, blocks_to_fetch}, _from, state) do
    method handle_call (line 89) | def handle_call(:utxos, _from, state) do
    method handle_call (line 93) | def handle_call({:utxo, utxo_pos}, _from, state) do
    method handle_call (line 97) | def handle_call({:block_hashes, block_numbers_to_fetch}, _from, state) do
    method handle_call (line 101) | def handle_call(:competitors_info, _from, state) do
    method handle_call (line 110) | def handle_call({:spent_blknum, utxo_pos}, _from, state) do
    method handle_call (line 114) | def handle_call({:get, type, specific_keys}, _from, state) do
    method handle_call (line 124) | def handle_call({:get_all_by_type, type}, _from, state) do
    method terminate (line 130) | def terminate(_reason, %__MODULE__{db_ref: db_ref}) do
    method do_multi_update (line 134) | defp do_multi_update(db_updates, state) do
    method do_blocks (line 143) | defp do_blocks(blocks_to_fetch, state) do
    method do_utxos (line 155) | defp do_utxos(state) do
    method do_utxo (line 160) | defp do_utxo(utxo_pos, state) do
    method do_block_hashes (line 165) | defp do_block_hashes(block_numbers_to_fetch, state) do
    method do_competitors_info (line 175) | defp do_competitors_info(state) do
    method do_get_single_value (line 180) | defp do_get_single_value(parameter, state) do
    method do_spent_blknum (line 190) | defp do_spent_blknum(utxo_pos, state) do
    method do_get_all_by_type (line 203) | defp do_get_all_by_type(type, db_ref) do
    method create_stats_table (line 207) | defp create_stats_table(name) do
    method table_settings (line 219) | defp table_settings() do
    method write (line 228) | defp write(operations, %__MODULE__{db_ref: db_ref} = state) do
    method get_decoded_data_with_type_and_specific_key (line 233) | defp get_decoded_data_with_type_and_specific_key(type, specific_key, s...
    method get (line 248) | defp get(key, %__MODULE__{db_ref: db_ref} = state) do
    method get_all_by_type (line 253) | defp get_all_by_type(type, %__MODULE__{db_ref: db_ref} = state) do

FILE: apps/omg_db/mix.exs
  class OMG.DB.MixProject (line 1) | defmodule OMG.DB.MixProject
    method project (line 4) | def project() do
    method application (line 20) | def application() do
    method version (line 28) | defp version() do
    method elixirc_paths (line 37) | defp elixirc_paths(:prod), do: ["lib"]
    method elixirc_paths (line 38) | defp elixirc_paths(:dev), do: ["lib"]
    method elixirc_paths (line 39) | defp elixirc_paths(:test), do: ["lib", "test/support"]
    method deps (line 41) | defp deps() do

FILE: apps/omg_db/test/fixtures.exs
  class OMG.DB.Fixtures (line 15) | defmodule OMG.DB.Fixtures

FILE: apps/omg_db/test/omg_db/application_test.exs
  class OMG.DB.ApplicationTest (line 15) | defmodule OMG.DB.ApplicationTest

FILE: apps/omg_db/test/omg_db/db_test.exs
  class OMG.DBTest (line 15) | defmodule OMG.DBTest
    method create_write (line 105) | defp create_write(:utxo = type, pid) do
    method create_write (line 115) | defp create_write(:competitor_info = type, pid) do
    method write (line 122) | defp write(db_writes, pid), do: OMG.DB.multi_update(db_writes, pid)
    method get_raw_values (line 123) | defp get_raw_values(db_writes), do: Enum.map(db_writes, &elem(&1, 2))
    method restart (line 125) | defp restart(dir, pid) do

FILE: apps/omg_db/test/omg_db/models/payment_exit_info_test.exs
  class OMG.DB.PaymentExitInfoTest (line 15) | defmodule OMG.DB.PaymentExitInfoTest
    method create_write (line 79) | defp create_write(:exit_info = type, pid) do
    method create_write (line 87) | defp create_write(:in_flight_exit_info = type, pid) do
    method write (line 94) | defp write(db_writes, pid), do: OMG.DB.multi_update(db_writes, pid)
    method get_raw_values (line 95) | defp get_raw_values(db_writes), do: Enum.map(db_writes, &elem(&1, 2))

FILE: apps/omg_db/test/omg_db/release_tasks/init_key_value_db_test.exs
  class OMG.DB.ReleaseTasks.InitKeyValueDBTest (line 15) | defmodule OMG.DB.ReleaseTasks.InitKeyValueDBTest

FILE: apps/omg_db/test/omg_db/release_tasks/init_keys_with_values_test.exs
  class OMG.DB.ReleaseTasks.InitKeysWithValuesTest (line 15) | defmodule OMG.DB.ReleaseTasks.InitKeysWithValuesTest

FILE: apps/omg_db/test/omg_db/release_tasks/set_key_value_db_test.exs
  class OMG.DB.ReleaseTasks.SetKeyValueDBTest (line 15) | defmodule OMG.DB.ReleaseTasks.SetKeyValueDBTest

FILE: apps/omg_db/test/omg_db/rocks_db_test.exs
  class OMG.RocksDBTest (line 15) | defmodule OMG.RocksDBTest
    method create_write (line 123) | defp create_write(:utxo = type, pid) do
    method create_write (line 133) | defp create_write(:competitor_info = type, pid) do
    method write (line 140) | defp write(db_writes, pid), do: OMG.DB.multi_update(db_writes, pid)
    method get_raw_values (line 141) | defp get_raw_values(db_writes), do: Enum.map(db_writes, &elem(&1, 2))
    method restart (line 143) | defp restart(dir, pid) do

FILE: apps/omg_db/test/support/rocks_db_case.ex
  class OMG.DB.RocksDBCase (line 15) | defmodule OMG.DB.RocksDBCase

FILE: apps/omg_eth/lib/eth.ex
  class OMG.Eth (line 15) | defmodule OMG.Eth
    method get_block_timestamp_by_number (line 42) | def get_block_timestamp_by_number(height) do
    method submit_block (line 54) | def submit_block(hash, nonce, gas_price) do

FILE: apps/omg_eth/lib/omg_eth/application.ex
  class OMG.Eth.Application (line 15) | defmodule OMG.Eth.Application
    method start (line 25) | def start(_type, _args) do
    method start_phase (line 37) | def start_phase(:attach_telemetry, :normal, _phase_args) do
    method valid_contracts (line 51) | defp valid_contracts() do

FILE: apps/omg_eth/lib/omg_eth/blockchain/bit_helper.ex
  class OMG.Eth.Blockchain.BitHelper (line 15) | defmodule OMG.Eth.Blockchain.BitHelper
    method kec (line 42) | def kec(data) do
    method encode_unsigned (line 64) | def encode_unsigned(0), do: <<>>
    method encode_unsigned (line 65) | def encode_unsigned(n), do: :binary.encode_unsigned(n)

FILE: apps/omg_eth/lib/omg_eth/blockchain/private_key.ex
  class OMG.Eth.Blockchain.PrivateKey (line 15) | defmodule OMG.Eth.Blockchain.PrivateKey
    method get (line 21) | def get() do
    method maybe_hex (line 27) | defp maybe_hex(hex_data, type \\ :raw)
    method maybe_hex (line 28) | defp maybe_hex(nil, _), do: nil
    method maybe_hex (line 29) | defp maybe_hex(hex_data, :raw), do: load_raw_hex(hex_data)
    method load_raw_hex (line 32) | defp load_raw_hex("0x" <> hex_data), do: load_raw_hex(hex_data)
    method load_raw_hex (line 37) | defp load_raw_hex(hex_data) do

FILE: apps/omg_eth/lib/omg_eth/blockchain/transaction.ex
  class OMG.Eth.Blockchain.Transaction (line 15) | defmodule OMG.Eth.Blockchain.Transaction
    method serialize (line 78) | def serialize(trx, include_vrs \\ true) do

FILE: apps/omg_eth/lib/omg_eth/blockchain/transaction/hash.ex
  class OMG.Eth.Blockchain.Transaction.Hash (line 15) | defmodule OMG.Eth.Blockchain.Transaction.Hash
    method transaction_hash (line 57) | def transaction_hash(trx, chain_id \\ nil) do
    method sign_hash (line 90) | def sign_hash(hash, private_key, chain_id \\ nil) do

FILE: apps/omg_eth/lib/omg_eth/blockchain/transaction/signature.ex
  class OMG.Eth.Blockchain.Transaction.Signature (line 15) | defmodule OMG.Eth.Blockchain.Transaction.Signature
    method sign_transaction (line 49) | def sign_transaction(trx, private_key, chain_id \\ nil) do

FILE: apps/omg_eth/lib/omg_eth/client.ex
  class OMG.Eth.Client (line 14) | defmodule OMG.Eth.Client
    method get_ethereum_height (line 22) | def get_ethereum_height(client \\ Ethereumex.HttpClient) do
    method node_ready (line 34) | def node_ready(client \\ Ethereumex.HttpClient) do

FILE: apps/omg_eth/lib/omg_eth/configuration.ex
  class OMG.Eth.Configuration (line 15) | defmodule OMG.Eth.Configuration
    method contract_semver (line 21) | def contract_semver() do
    method network (line 25) | def network() do
    method min_exit_period_seconds (line 30) | def min_exit_period_seconds() do
    method ethereum_block_time_seconds (line 35) | def ethereum_block_time_seconds() do
    method contracts (line 40) | def contracts() do
    method txhash_contract (line 45) | def txhash_contract() do
    method authority_address (line 50) | def authority_address() do
    method environment (line 55) | def environment() do
    method child_block_interval (line 60) | def child_block_interval() do
    method eth_node (line 65) | def eth_node() do
    method ethereum_events_check_interval_ms (line 70) | def ethereum_events_check_interval_ms() do
    method ethereum_stalled_sync_threshold_ms (line 75) | def ethereum_stalled_sync_threshold_ms() do

FILE: apps/omg_eth/lib/omg_eth/encoding.ex
  class OMG.Eth.Encoding (line 15) | defmodule OMG.Eth.Encoding
    method to_hex (line 32) | def to_hex(non_hex)
    method from_hex (line 43) | def from_hex("0x" <> encoded, format \\ :lower), do: Base.decode16!(en...
    method int_from_hex (line 51) | def int_from_hex("0x" <> encoded) do
    method encode_constructor_params (line 74) | def encode_constructor_params(types_values) do

FILE: apps/omg_eth/lib/omg_eth/encoding/contract_constructor.ex
  class OMG.Eth.Encoding.ContractConstructor (line 15) | defmodule OMG.Eth.Encoding.ContractConstructor
    method extract_params (line 37) | def extract_params(types_values) do

FILE: apps/omg_eth/lib/omg_eth/ethereum_height.ex
  class OMG.Eth.EthereumHeight (line 15) | defmodule OMG.Eth.EthereumHeight
    method get (line 26) | def get() do
    method start_link (line 30) | def start_link(args) do
    method init (line 34) | def init(opts) do
    method handle_call (line 44) | def handle_call(:get, _from, ethereum_height) do
    method handle_info (line 48) | def handle_info({:internal_event_bus, :ethereum_new_height, new_height...
    method get_ethereum_height (line 54) | defp get_ethereum_height() do
    method eth (line 61) | defp eth(), do: Application.get_env(:omg_eth, :eth_integration_module,...

FILE: apps/omg_eth/lib/omg_eth/ethereum_height_monitor.ex
  class OMG.Eth.EthereumHeightMonitor (line 15) | defmodule OMG.Eth.EthereumHeightMonitor
    method start_link (line 62) | def start_link(args) do
    method init (line 70) | def init(opts) do
    method handle_continue (line 88) | def handle_continue(:first_check, state) do
    method handle_info (line 93) | def handle_info({:ssl_closed, _}, state) do
    method handle_info (line 98) | def handle_info(:check_new_height, state) do
    method handle_cast (line 118) | def handle_cast({:set_alarm, :ethereum_connection_error}, state) do
    method handle_cast (line 122) | def handle_cast({:clear_alarm, :ethereum_connection_error}, state) do
    method handle_cast (line 126) | def handle_cast({:set_alarm, :ethereum_stalled_sync}, state) do
    method handle_cast (line 130) | def handle_cast({:clear_alarm, :ethereum_stalled_sync}, state) do
    method update_height (line 139) | defp update_height(state, :error), do: state
    method update_height (line 141) | defp update_height(state, height) do
    method stalled? (line 149) | defp stalled?(height, previous_height, synced_at, stall_threshold_ms) do
    method fetch_height (line 160) | defp fetch_height(eth_module) do
    method broadcast_on_new_height (line 172) | defp broadcast_on_new_height(_event_bus_module, :error), do: :ok
    method broadcast_on_new_height (line 177) | defp broadcast_on_new_height(event_bus_module, height) do
    method install_alarm_handler (line 186) | defp install_alarm_handler() do
    method connection_alarm (line 195) | defp connection_alarm(alarm_module, connection_alarm_raised, raise_alarm)
    method connection_alarm (line 197) | defp connection_alarm(alarm_module, false, :error) do
    method connection_alarm (line 205) | defp connection_alarm(_alarm_module, _, _), do: :ok
    method stall_alarm (line 209) | defp stall_alarm(alarm_module, stall_alarm_raised, raise_alarm)
    method stall_alarm (line 211) | defp stall_alarm(alarm_module, false, true) do
    method stall_alarm (line 215) | defp stall_alarm(alarm_module, true, false) do
    method stall_alarm (line 219) | defp stall_alarm(_alarm_module, _, _), do: :ok

FILE: apps/omg_eth/lib/omg_eth/ethereum_height_monitor/alarm_handler.ex
  class OMG.Eth.EthereumHeightMonitor.AlarmHandler (line 15) | defmodule OMG.Eth.EthereumHeightMonitor.AlarmHandler
    method init (line 27) | def init(_args) do
    method handle_call (line 31) | def handle_call(_request, state), do: {:ok, :ok, state}
    method handle_event (line 33) | def handle_event({:set_alarm, {:ethereum_connection_error, %{reporter:...
    method handle_event (line 39) | def handle_event({:clear_alarm, {:ethereum_connection_error, %{reporte...
    method handle_event (line 45) | def handle_event({:set_alarm, {:ethereum_stalled_sync, %{reporter: @re...
    method handle_event (line 51) | def handle_event({:clear_alarm, {:ethereum_stalled_sync, %{reporter: @...
    method handle_event (line 57) | def handle_event(event, state) do

FILE: apps/omg_eth/lib/omg_eth/metric/ethereumex.ex
  class OMG.Eth.Metric.Ethereumex (line 15) | defmodule OMG.Eth.Metric.Ethereumex
    method supported_events (line 20) | def supported_events(), do: [:ethereumex]
    method handle_event (line 22) | def handle_event([:ethereumex], %{counter: counter}, %{method_name: me...

FILE: apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex
  class OMG.Eth.ReleaseTasks.SetContract (line 15) | defmodule OMG.Eth.ReleaseTasks.SetContract
    method init (line 36) | def init(args) do
    method load (line 40) | def load(config, args) do
    method get_external_data (line 97) | defp get_external_data(plasma_framework, rpc_api) do
    method merge_configuration (line 138) | defp merge_configuration(_, _, _, _, _, _, _, _), do: exit(@error)
    method get_min_exit_period (line 140) | defp get_min_exit_period(plasma_framework_contract, rpc_api) do
    method get_contract_semver (line 147) | defp get_contract_semver(plasma_framework_contract, rpc_api) do
    method get_child_block_interval (line 154) | defp get_child_block_interval(plasma_framework_contract, rpc_api) do
    method exit_game_contract_address (line 161) | defp exit_game_contract_address(plasma_framework_contract, tx_type, rp...
    method get_vault (line 168) | defp get_vault(plasma_framework_contract, id, rpc_api) do
    method call (line 175) | defp call(plasma_framework_contract, signature, args, rpc_api) do
    method call (line 180) | defp call(plasma_framework_contract, signature, args, 0, rpc_api) do
    method call (line 184) | defp call(plasma_framework_contract, signature, args, retries_left, rp...
    method get_env (line 195) | defp get_env(key), do: System.get_env(key)
    method get_network (line 197) | defp get_network(nil), do: exit(@error)
    method get_network (line 199) | defp get_network(data) do
    method on_load (line 209) | defp on_load() do

FILE: apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_block_time.ex
  class OMG.Eth.ReleaseTasks.SetEthereumBlockTime (line 15) | defmodule OMG.Eth.ReleaseTasks.SetEthereumBlockTime
    method init (line 25) | def init(args) do
    method load (line 29) | def load(config, _args) do
    method get_ethereum_block_time (line 35) | defp get_ethereum_block_time() do
    method get_env (line 47) | defp get_env(key), do: System.get_env(key)
    method validate_integer (line 50) | defp validate_integer(_, default), do: default
    method on_load (line 52) | defp on_load() do

FILE: apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_client.ex
  class OMG.Eth.ReleaseTasks.SetEthereumClient (line 15) | defmodule OMG.Eth.ReleaseTasks.SetEthereumClient
    method init (line 24) | def init(args) do
    method load (line 28) | def load(config, _args) do
    method get_ethereum_rpc_url (line 41) | defp get_ethereum_rpc_url() do
    method get_rpc_client_type (line 48) | defp get_rpc_client_type() do
    method validate_rpc_client_type (line 58) | defp validate_rpc_client_type(_value, default),
    method to_rpc_client_type (line 61) | defp to_rpc_client_type("GETH"), do: :geth
    method to_rpc_client_type (line 62) | defp to_rpc_client_type("PARITY"), do: :parity
    method to_rpc_client_type (line 63) | defp to_rpc_client_type("INFURA"), do: :infura
    method to_rpc_client_type (line 64) | defp to_rpc_client_type(_), do: exit("You need to choose between geth,...
    method validate_string (line 67) | defp validate_string(_, default), do: default
    method get_env (line 69) | defp get_env(key), do: System.get_env(key)
    method on_load (line 71) | defp on_load() do

FILE: apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_events_check_interval.ex
  class OMG.Eth.ReleaseTasks.SetEthereumEventsCheckInterval (line 15) | defmodule OMG.Eth.ReleaseTasks.SetEthereumEventsCheckInterval
    method init (line 27) | def init(args) do
    method load (line 31) | def load(config, _args) do
    method get_interval_ms (line 42) | defp get_interval_ms() do
    method get_env (line 52) | defp get_env(key), do: System.get_env(key)
    method validate_integer (line 55) | defp validate_integer(_, default), do: default
    method on_load (line 57) | defp on_load() do

FILE: apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold.ex
  class OMG.Eth.ReleaseTasks.SetEthereumStalledSyncThreshold (line 15) | defmodule OMG.Eth.ReleaseTasks.SetEthereumStalledSyncThreshold
    method init (line 23) | def init(args) do
    method load (line 27) | def load(config, _args) do
    method stalled_sync_threshold_ms (line 33) | defp stalled_sync_threshold_ms() do
    method get_env (line 45) | defp get_env(key), do: System.get_env(key)
    method validate_integer (line 48) | defp validate_integer(_, default), do: default
    method on_load (line 50) | defp on_load() do

FILE: apps/omg_eth/lib/omg_eth/root_chain.ex
  class OMG.Eth.RootChain (line 15) | defmodule OMG.Eth.RootChain
    method get_mined_child_block (line 34) | def get_mined_child_block() do
    method next_child_block (line 40) | def next_child_block() do
    method blocks (line 46) | def blocks(mined_num) do
    method get_block_submitted_events (line 58) | def get_block_submitted_events(from_height, to_height) do
    method get_standard_exit_structs (line 73) | def get_standard_exit_structs(exit_ids) do
    method get_in_flight_exit_structs (line 85) | def get_in_flight_exit_structs(in_flight_exit_ids) do
    method get_root_deployment_height (line 100) | def get_root_deployment_height() do
    method get_external_data (line 116) | defp get_external_data(contract_address, signature, args) do

FILE: apps/omg_eth/lib/omg_eth/root_chain/abi.ex
  class OMG.Eth.RootChain.Abi (line 14) | defmodule OMG.Eth.RootChain.Abi
    method decode_function (line 24) | def decode_function(enriched_data, signature) do
    method decode_function (line 30) | def decode_function(enriched_data) do
    method decode_log (line 42) | def decode_log(log) do
    method common_parse_event (line 74) | def common_parse_event(
    method decode_function_call_result (line 95) | defp decode_function_call_result(%{function: "startExit"} = function_s...
    method decode_function_call_result (line 102) | defp decode_function_call_result(function_spec, values) do

FILE: apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex
  class OMG.Eth.RootChain.AbiEventSelector (line 15) | defmodule OMG.Eth.RootChain.AbiEventSelector
    method exit_started (line 23) | def exit_started() do
    method in_flight_exit_started (line 36) | def in_flight_exit_started() do
    method in_flight_exit_deleted (line 49) | def in_flight_exit_deleted() do
    method in_flight_exit_challenged (line 62) | def in_flight_exit_challenged() do
    method deposit_created (line 75) | def deposit_created() do
    method in_flight_exit_input_piggybacked (line 88) | def in_flight_exit_input_piggybacked() do
    method in_flight_exit_output_piggybacked (line 101) | def in_flight_exit_output_piggybacked() do
    method block_submitted (line 114) | def block_submitted() do
    method exit_finalized (line 127) | def exit_finalized() do
    method in_flight_exit_challenge_responded (line 140) | def in_flight_exit_challenge_responded() do
    method exit_challenged (line 155) | def exit_challenged() do
    method in_flight_exit_input_blocked (line 168) | def in_flight_exit_input_blocked() do
    method in_flight_exit_output_blocked (line 181) | def in_flight_exit_output_blocked() do
    method in_flight_exit_input_withdrawn (line 194) | def in_flight_exit_input_withdrawn() do
    method in_flight_exit_output_withdrawn (line 207) | def in_flight_exit_output_withdrawn() do

FILE: apps/omg_eth/lib/omg_eth/root_chain/abi_function_selector.ex
  class OMG.Eth.RootChain.AbiFunctionSelector (line 15) | defmodule OMG.Eth.RootChain.AbiFunctionSelector
    method start_exit (line 21) | def start_exit() do
    method start_standard_exit (line 40) | def start_standard_exit() do
    method challenge_in_flight_exit_not_canonical (line 52) | def challenge_in_flight_exit_not_canonical() do
    method start_in_flight_exit (line 86) | def start_in_flight_exit() do
    method min_exit_period (line 114) | def min_exit_period() do
    method get_version (line 127) | def get_version() do
    method exit_games (line 140) | def exit_games() do
    method vaults (line 153) | def vaults() do
    method child_block_interval (line 166) | def child_block_interval() do
    method next_child_block (line 179) | def next_child_block() do
    method blocks (line 192) | def blocks() do
    method standard_exits (line 205) | def standard_exits() do
    method in_flight_exits (line 222) | def in_flight_exits() do

FILE: apps/omg_eth/lib/omg_eth/root_chain/event.ex
  class OMG.Eth.RootChain.Event (line 14) | defmodule OMG.Eth.RootChain.Event
    method get_events (line 21) | def get_events(wanted_events) do
    method events (line 35) | defp events() do
    method describe_event (line 43) | defp describe_event(selector) do
    method build_types_string (line 47) | defp build_types_string(types), do: build_types_string(types, "")
    method build_types_string (line 48) | defp build_types_string([], string), do: string
    method build_types_string (line 50) | defp build_types_string([{type, size} | [] = types], string) do
    method build_types_string (line 54) | defp build_types_string([{type, size} | types], string) do
    method build_types_string (line 58) | defp build_types_string([type | [] = types], string) do
    method build_types_string (line 62) | defp build_types_string([type | types], string) do
    method get_event (line 66) | def get_event(events, wanted_event_name, acc) do

FILE: apps/omg_eth/lib/omg_eth/root_chain/fields.ex
  class OMG.Eth.RootChain.Fields (line 15) | defmodule OMG.Eth.RootChain.Fields
    method rename (line 21) | def rename(data, %ABI.FunctionSelector{function: "DepositCreated"}) do
    method rename (line 30) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitInputPig...
    method rename (line 50) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitOutputPi...
    method rename (line 68) | def rename(data, %ABI.FunctionSelector{function: "BlockSubmitted"}) do
    method rename (line 73) | def rename(data, %ABI.FunctionSelector{function: "ExitFinalized"}) do
    method rename (line 78) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitDeleted"...
    method rename (line 83) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitChalleng...
    method rename (line 93) | def rename(data, %ABI.FunctionSelector{function: "ExitChallenged"}) do
    method rename (line 101) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitChalleng...
    method rename (line 111) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitOutputBl...
    method rename (line 126) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitInputBlo...
    method rename (line 141) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitStarted"...
    method rename (line 150) | def rename(data, %ABI.FunctionSelector{function: "ExitStarted"}) do
    method rename (line 159) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitInputWit...
    method rename (line 167) | def rename(data, %ABI.FunctionSelector{function: "InFlightExitOutputWi...
    method rename (line 175) | def rename(data, %ABI.FunctionSelector{function: "startInFlightExit"}) do
    method rename (line 187) | def rename(data, %ABI.FunctionSelector{function: "startStandardExit"}) do
    method rename (line 199) | def rename(data, %ABI.FunctionSelector{function: "startExit"}) do
    method rename (line 218) | def rename(data, %ABI.FunctionSelector{function: "challengeInFlightExi...
    method reduce_naming (line 235) | defp reduce_naming(data, contracts_naming) do

FILE: apps/omg_eth/lib/omg_eth/root_chain/rpc.ex
  class OMG.Eth.RootChain.Rpc (line 14) | defmodule OMG.Eth.RootChain.Rpc
    method call_contract (line 22) | def call_contract(client \\ Ethereumex.HttpClient, contract, signature...
    method get_ethereum_events (line 27) | def get_ethereum_events(block_from, block_to, [_ | _] = signatures, [_...
    method get_ethereum_events (line 49) | def get_ethereum_events(block_from, block_to, [_ | _] = signatures, co...
    method get_ethereum_events (line 53) | def get_ethereum_events(block_from, block_to, signature, [_ | _] = con...
    method get_ethereum_events (line 57) | def get_ethereum_events(block_from, block_to, signature, contract) do
    method get_call_data (line 61) | def get_call_data(root_chain_txhash) do
    method event_topic_for_signature (line 70) | defp event_topic_for_signature(signature) do
    method handle_result (line 76) | defp handle_result(logs, topics, topics_and_signatures) do
    method handle_result (line 81) | defp handle_result([], _topics, _topics_and_signatures, acc), do: acc
    method handle_result (line 83) | defp handle_result([%{"removed" => true} | _logs], _topics, _topics_an...
    method handle_result (line 87) | defp handle_result([log | logs], topics, topics_and_signatures, acc) do
    method put_signature (line 93) | defp put_signature(log, signature), do: Map.put(log, :event_signature,...

FILE: apps/omg_eth/lib/omg_eth/root_chain/submit_block.ex
  class OMG.Eth.RootChain.SubmitBlock (line 15) | defmodule OMG.Eth.RootChain.SubmitBlock
    method submit (line 36) | def submit(backend, hash, nonce, gas_price, from, contract) do
    method contract_transact (line 52) | defp contract_transact(:infura = backend, _from, to, signature, args, ...
    method contract_transact (line 75) | defp contract_transact(backend, from, to, signature, args, opts) do
    method encode_tx_data (line 86) | defp encode_tx_data(signature, args) do
    method encode_all_integer_opts (line 92) | defp encode_all_integer_opts(opts) do

FILE: apps/omg_eth/lib/omg_eth/supervisor.ex
  class OMG.Eth.Supervisor (line 15) | defmodule OMG.Eth.Supervisor
    method start_link (line 26) | def start_link() do
    method init (line 30) | def init(:ok) do

FILE: apps/omg_eth/lib/omg_eth/transaction.ex
  class OMG.Eth.Transaction (line 15) | defmodule OMG.Eth.Transaction
    method send (line 29) | def send(backend, txmap) do
    method transact (line 33) | defp transact(:geth, txmap) do
    method transact (line 42) | defp transact(:infura, transaction_data) do

FILE: apps/omg_eth/mix.exs
  class OMG.Eth.MixProject (line 1) | defmodule OMG.Eth.MixProject
    method project (line 6) | def project() do
    method application (line 22) | def application() do
    method version (line 30) | defp version() do
    method elixirc_paths (line 40) | defp elixirc_paths(:prod), do: ["lib"]
    method elixirc_paths (line 41) | defp elixirc_paths(:dev), do: ["lib", "test/support"]
    method elixirc_paths (line 42) | defp elixirc_paths(:test), do: ["lib", "test/support"]
    method deps (line 44) | defp deps() do

FILE: apps/omg_eth/test/fixtures.exs
  class OMG.Eth.Fixtures (line 15) | defmodule OMG.Eth.Fixtures
    method has_exit_queue (line 73) | defp has_exit_queue(vault_id, token) do
    method call_contract (line 79) | defp call_contract(contract, signature, args, return_types) do
    method decode_answer (line 85) | defp decode_answer(enc_return, return_types) do

FILE: apps/omg_eth/test/omg_eth/application_test.exs
  class OMG.Eth.ApplicationTest (line 15) | defmodule OMG.Eth.ApplicationTest

FILE: apps/omg_eth/test/omg_eth/blockchain/bit_helper_test.exs
  class OMG.Eth.Blockchain.BitHelperTest (line 15) | defmodule OMG.Eth.Blockchain.BitHelperTest

FILE: apps/omg_eth/test/omg_eth/blockchain/transaction/hash_test.exs
  class OMG.Eth.Blockchain.Transaction.HashTest (line 15) | defmodule OMG.Eth.Blockchain.Transaction.HashTest

FILE: apps/omg_eth/test/omg_eth/blockchain/transaction/signature_test.exs
  class OMG.Eth.Blockchain.Transaction.SignatureTest (line 15) | defmodule OMG.Eth.Blockchain.Transaction.SignatureTest

FILE: apps/omg_eth/test/omg_eth/blockchain/transaction_test.exs
  class OMG.Eth.Blockchain.TransactionTest (line 15) | defmodule OMG.Eth.Blockchain.TransactionTest

FILE: apps/omg_eth/test/omg_eth/client_test.exs
  class OMG.Eth.ClientTest (line 15) | defmodule OMG.Eth.ClientTest

FILE: apps/omg_eth/test/omg_eth/encoding/contract_constructor_test.exs
  class OMG.Eth.Encoding.ContractConstructorTest (line 15) | defmodule OMG.Eth.Encoding.ContractConstructorTest

FILE: apps/omg_eth/test/omg_eth/encoding_test.exs
  class OMG.Eth.EncodingTest (line 15) | defmodule OMG.Eth.EncodingTest

FILE: apps/omg_eth/test/omg_eth/eth_test.exs
  class OMG.EthTest (line 15) | defmodule OMG.EthTest

FILE: apps/omg_eth/test/omg_eth/ethereum_height_monitor_test.exs
  class OMG.Eth.EthereumHeightMonitorTest (line 15) | defmodule OMG.Eth.EthereumHeightMonitorTest
    method pull_client_alarm (line 149) | defp pull_client_alarm(_, 0), do: {:cant_match, Alarm.all()}
    method pull_client_alarm (line 151) | defp pull_client_alarm(match, n) do
  class EthereumClientMock (line 166) | defmodule EthereumClientMock
    method start_link (line 174) | def start_link(), do: GenServer.start_link(__MODULE__, [], name: __MOD...
    method get_ethereum_height (line 176) | def get_ethereum_height(), do: GenServer.call(__MODULE__, :get_ethereu...
    method set_faulty_response (line 178) | def set_faulty_response(faulty), do: GenServer.call(__MODULE__, {:set_...
    method set_long_response (line 180) | def set_long_response(milliseconds), do: GenServer.call(__MODULE__, {:...
    method set_stalled (line 182) | def set_stalled(stalled), do: GenServer.call(__MODULE__, {:set_stalled...
    method reset_state (line 184) | def reset_state(), do: GenServer.call(__MODULE__, :reset_state)
    method stop (line 186) | def stop(), do: GenServer.stop(__MODULE__, :normal)
    method init (line 188) | def init(_), do: {:ok, @initial_state}
    method handle_call (line 190) | def handle_call(:reset_state, _, _state), do: {:reply, :ok, @initial_s...
    method handle_call (line 192) | def handle_call({:set_faulty_response, true}, _, state), do: {:reply, ...
    method handle_call (line 193) | def handle_call({:set_faulty_response, false}, _, state), do: {:reply,...
    method handle_call (line 195) | def handle_call({:set_long_response, milliseconds}, _, state) do
    method handle_call (line 199) | def handle_call({:set_stalled, true}, _, state), do: {:reply, :ok, %{s...
    method handle_call (line 200) | def handle_call({:set_stalled, false}, _, state), do: {:reply, :ok, %{...
    method handle_call (line 204) | def handle_call(:get_ethereum_height, _, %{faulty: true} = state) do
    method handle_call (line 213) | def handle_call(:get_ethereum_height, _, state) do
    method next_height (line 217) | defp next_height(height, false), do: height + 1
    method next_height (line 218) | defp next_height(height, true), do: height
  class EventBusListener (line 221) | defmodule EventBusListener
    method start (line 224) | def start(parent), do: GenServer.start(__MODULE__, parent)
    method init (line 226) | def init(parent) do
    method handle_info (line 231) | def handle_info({:internal_event_bus, :ethereum_new_height, _height}, ...

FILE: apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs
  class OMG.Eth.ReleaseTasks.SetContractTest (line 15) | defmodule OMG.Eth.ReleaseTasks.SetContractTest
    method start (line 200) | defp start(port) do
    method loop (line 210) | defp loop(sock) do
    method handle (line 222) | defp handle(conn) do
  class Rpc (line 238) | defmodule Rpc
    method call_contract (line 239) | def call_contract(_, "vaults(uint256)", _) do
    method call_contract (line 243) | def call_contract(_, "exitGames(uint256)", _) do
    method call_contract (line 248) | def call_contract(_, "childBlockInterval()", _) do
    method call_contract (line 252) | def call_contract(_, "getVersion()", _) do
    method call_contract (line 257) | def call_contract(_, "minExitPeriod()", _) do

FILE: apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_block_time_test.exs
  class OMG.Eth.ReleaseTasks.SetEthereumBlockTimeTest (line 15) | defmodule OMG.Eth.ReleaseTasks.SetEthereumBlockTimeTest

FILE: apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_client_test.exs
  class OMG.Eth.ReleaseTasks.SetEthereumClientTest (line 15) | defmodule OMG.Eth.ReleaseTasks.SetEthereumClientTest

FILE: apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_events_check_interval_test.exs
  class OMG.Eth.ReleaseTasks.SetEthereumEventsCheckIntervalTest (line 15) | defmodule OMG.Eth.ReleaseTasks.SetEthereumEventsCheckIntervalTest

FILE: apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold_test.exs
  class OMG.Eth.ReleaseTasks.SetEthereumStalledSyncThresholdTest (line 15) | defmodule OMG.Eth.ReleaseTasks.SetEthereumStalledSyncThresholdTest

FILE: apps/omg_eth/test/omg_eth/root_chain/abi_test.exs
  class OMG.Eth.RootChain.AbiTest (line 15) | defmodule OMG.Eth.RootChain.AbiTest

FILE: apps/omg_eth/test/omg_eth/root_chain/event_test.exs
  class OMG.RootChain.EventTest (line 14) | defmodule OMG.RootChain.EventTest

FILE: apps/omg_eth/test/omg_eth/root_chain_test.exs
  class OMG.Eth.RootChainTest (line 15) | defmodule OMG.Eth.RootChainTest
    method deposit_then_start_exit (line 66) | defp deposit_then_start_exit(owner, amount, currency) do
    method exit_id_from_receipt (line 91) | defp exit_id_from_receipt(%{"logs" => logs}) do
    method add_queue (line 107) | defp add_queue(authority_address) do
    method deposit_transaction (line 115) | defp deposit_transaction(amount_in_wei, address, currency) do
    method deposit (line 121) | defp deposit(owner, token, amount) do

FILE: apps/omg_eth/test/support/defaults.ex
  class OMG.Eth.Defaults (line 15) | defmodule OMG.Eth.Defaults
    method tx_defaults (line 29) | def tx_defaults() do

FILE: apps/omg_eth/test/support/dev_geth.ex
  class OMG.Eth.DevGeth (line 15) | defmodule OMG.Eth.DevGeth
    method start (line 30) | def start() do
    method init (line 64) | def init(cmd) do
    method handle_info (line 73) | def handle_info({:stdout, pid, stdout}, %{os_proc: pid} = state) do
    method handle_call (line 91) | def handle_call(:ready?, _from, state) do
    method launch (line 97) | defp launch(cmd) do
    method wait_for_rpc (line 111) | defp wait_for_rpc(pid) do
    method start_link (line 120) | defp start_link(cmd) do
    method ready? (line 124) | defp ready?(pid) do

FILE: apps/omg_eth/test/support/dev_helper.ex
  class Support.DevHelper (line 15) | defmodule Support.DevHelper
    method import_unlock_fund (line 47) | def import_unlock_fund(account, opts \\ []) do
    method deploy_sync! (line 84) | def deploy_sync!({:ok, txhash} = transaction_submission_result) do
    method wait_for_root_chain_block (line 91) | def wait_for_root_chain_block(awaited_eth_height, timeout \\ 600_000) do
    method wait_for_next_child_block (line 101) | def wait_for_next_child_block(blknum) do
    method create_account_from_secret (line 113) | def create_account_from_secret(account, passphrase) do
    method fund_address_from_faucet (line 126) | defp fund_address_from_faucet(account_enc, opts) do
    method unlock_if_possible (line 147) | defp unlock_if_possible(account_enc) do
    method get_reason (line 153) | defp get_reason(txhash) do
    method abi_decode_reason (line 162) | defp abi_decode_reason(result) do

FILE: apps/omg_eth/test/support/dev_node.ex
  class Support.DevNode (line 15) | defmodule Support.DevNode
    method start (line 21) | def start() do

FILE: apps/omg_eth/test/support/root_chain_helper.ex
  class Support.RootChainHelper (line 15) | defmodule Support.RootChainHelper
    method start_exit (line 47) | def start_exit(utxo_pos, tx_bytes, proof, from) do
    method piggyback_in_flight_exit_on_input (line 66) | def piggyback_in_flight_exit_on_input(in_flight_tx, input_index, from) do
    method piggyback_in_flight_exit_on_output (line 80) | def piggyback_in_flight_exit_on_output(in_flight_tx, output_index, fro...
    method deposit (line 94) | def deposit(tx_bytes, value, from) do
    method deposit_from (line 108) | def deposit_from(tx, from) do
    method add_exit_queue (line 115) | def add_exit_queue(vault_id, token) do
    method challenge_exit (line 133) | def challenge_exit(exit_id, exiting_tx, challenge_tx, input_index, cha...
    method activate_child_chain (line 145) | def activate_child_chain(from \\ nil) do
    method in_flight_exit (line 154) | def in_flight_exit(
    method process_exits (line 177) | def process_exits(vault_id, token, top_exit_id, exits_to_process, from...
    method challenge_in_flight_exit_not_canonical (line 189) | def challenge_in_flight_exit_not_canonical(
    method respond_to_non_canonical_challenge (line 217) | def respond_to_non_canonical_challenge(
    method challenge_in_flight_exit_input_spent (line 235) | def challenge_in_flight_exit_input_spent(
    method challenge_in_flight_exit_output_spent (line 261) | def challenge_in_flight_exit_output_spent(
    method deposit_blknum_from_receipt (line 284) | def deposit_blknum_from_receipt(%{"logs" => logs}) do

FILE: apps/omg_eth/test/support/snapshot_contracts.ex
  class Support.SnapshotContracts (line 15) | defmodule Support.SnapshotContracts
    method parse_contracts (line 20) | def parse_contracts() do

FILE: apps/omg_eth/test/support/token.ex
  class OMG.Eth.Token (line 15) | defmodule OMG.Eth.Token
    method mint (line 31) | def mint(owner, amount, token, opts \\ []) do
    method approve (line 47) | def approve(from, spender, amount, token, opts \\ []) do

FILE: apps/omg_eth/test/support/transaction_helper.ex
  class OMG.Eth.TransactionHelper (line 15) | defmodule OMG.Eth.TransactionHelper
    method contract_transact (line 24) | def contract_transact(backend, from, to, signature, args, opts \\ []) do
    method encode_tx_data (line 35) | defp encode_tx_data(signature, args) do
    method encode_all_integer_opts (line 41) | defp encode_all_integer_opts(opts) do

FILE: apps/omg_eth/test/support/wait_for.ex
  class Support.WaitFor (line 15) | defmodule Support.WaitFor
    method eth_rpc (line 23) | def eth_rpc(timeout \\ 10_000) do
    method eth_receipt (line 43) | def eth_receipt(txhash, timeout \\ 15_000) do
    method ok (line 61) | def ok(f, timeout \\ 5_000) do
    method repeat_until_ok (line 67) | defp repeat_until_ok(f) do

FILE: apps/omg_status/lib/omg_status/alert/alarm.ex
  class OMG.Status.Alert.Alarm (line 15) | defmodule OMG.Status.Alert.Alarm
    method alarm_types (line 39) | def alarm_types(),
    method statsd_client_connection (line 52) | def statsd_client_connection(reporter),
    method ethereum_connection_error (line 56) | def ethereum_connection_error(reporter),
    method ethereum_stalled_sync (line 60) | def ethereum_stalled_sync(reporter),
    method boot_in_progress (line 64) | def boot_in_progress(reporter),
    method invalid_fee_source (line 68) | def invalid_fee_source(reporter),
    method main_supervisor_halted (line 72) | def main_supervisor_halted(reporter),
    method system_memory_too_high (line 76) | def system_memory_too_high(reporter),
    method block_submit_stalled (line 80) | def block_submit_stalled(reporter),
    method set (line 84) | def set(alarm), do: do_raise(alarm)
    method clear (line 87) | def clear(alarm), do: do_clear(alarm)
    method clear_all (line 89) | def clear_all() do
    method all (line 93) | def all() do
    method do_raise (line 97) | defp do_raise(alarm) do
    method do_clear (line 105) | defp do_clear(alarm) do

FILE: apps/omg_status/lib/omg_status/alert/alarm_handler.ex
  class OMG.Status.Alert.AlarmHandler (line 15) | defmodule OMG.Status.Alert.AlarmHandler
    method install (line 22) | def install() do
    method table_name (line 35) | def table_name(), do: @table_name
    method init (line 40) | def init(_args) do
    method handle_call (line 46) | def handle_call(:get_alarms, %{alarms: alarms} = state), do: {:ok, ala...
    method handle_event (line 48) | def handle_event({:set_alarm, new_alarm}, %{alarms: alarms} = state) do
    method handle_event (line 62) | def handle_event({:clear_alarm, alarm_id}, %{alarms: alarms}) do
    method handle_event (line 72) | def handle_event(_event, state) do
    method terminate (line 76) | def terminate(:swap, state), do: {__MODULE__, state}
    method terminate (line 77) | def terminate(_, _), do: :ok
    method table_setup (line 79) | defp table_setup() do
    method table_settings (line 83) | defp table_settings(), do: [:named_table, :set, :protected, read_concu...

FILE: apps/omg_status/lib/omg_status/alert/alarm_printer.ex
  class OMG.Status.AlarmPrinter (line 15) | defmodule OMG.Status.AlarmPrinter
    method start_link (line 24) | def start_link(args) do
    method init (line 28) | def init(args) do
    method handle_info (line 34) | def handle_info(:print_alarms, state) do

FILE: apps/omg_status/lib/omg_status/application.ex
  class OMG.Status.Application (line 15) | defmodule OMG.Status.Application
    method start (line 30) | def start(_type, _args) do
    method start_phase (line 79) | def start_phase(:install_alarm_handler, _start_type, _phase_args) do
    method spandex_datadog_options (line 83) | defp spandex_datadog_options() do
    method spandex_datadog_options (line 93) | defp spandex_datadog_options(config_host, config_port, config_batch_si...

FILE: apps/omg_status/lib/omg_status/configuration.ex
  class OMG.Status.Configuration (line 15) | defmodule OMG.Status.Configuration
    method system_memory_check_interval_ms (line 24) | def system_memory_check_interval_ms() do
    method system_memory_high_threshold (line 29) | def system_memory_high_threshold() do
    method datadog_disabled? (line 34) | def datadog_disabled?() do
    method release (line 39) | def release() do
    method current_version (line 44) | def current_version() do

FILE: apps/omg_status/lib/omg_status/datadog_event/alarm_consumer.ex
  class OMG.Status.DatadogEvent.AlarmConsumer (line 15) | defmodule OMG.Status.DatadogEvent.AlarmConsumer
    method prepare_child (line 35) | def prepare_child(opts) do
    method start_link (line 42) | def start_link(args) do
    method init (line 49) | def init(args) do
    method handle_cast (line 62) | def handle_cast(alarm, state) do
    method create_event_data (line 84) | defp create_event_data(title, message, options) do
    method tags (line 89) | defp tags(aggregation_key, release, current_version, _timestamp) do
    method install_alarm_handler (line 96) | defp install_alarm_handler(alarm_handler, dd_alarm_handler) do

FILE: apps/omg_status/lib/omg_status/datadog_event/alarm_handler.ex
  class OMG.Status.DatadogEvent.AlarmHandler (line 15) | defmodule OMG.Status.DatadogEvent.AlarmHandler
    method init (line 22) | def init([reporter]) do
    method handle_call (line 26) | def handle_call(_request, reporter), do: {:ok, :ok, reporter}
    method handle_event (line 28) | def handle_event({:set_alarm, _alarm_details} = alarm, reporter) do
    method handle_event (line 33) | def handle_event({:clear_alarm, _alarm_details} = alarm, reporter) do
    method handle_event (line 38) | def handle_event(event, reporter) do

FILE: apps/omg_status/lib/omg_status/metric/datadog.ex
  class OMG.Status.Metric.Datadog (line 15) | defmodule OMG.Status.Metric.Datadog
    method start_link (line 30) | def start_link(), do: GenServer.start_link(__MODULE__, [], [])
    method init (line 32) | def init(_opts) do
    method handle_info (line 40) | def handle_info({:EXIT, port, reason}, %Statix.Conn{sock: __MODULE__} ...

FILE: apps/omg_status/lib/omg_status/metric/event.ex
  class OMG.Status.Metric.Event (line 15) | defmodule OMG.Status.Metric.Event
    method name (line 63) | def name(:transaction_submission), do: "transaction_submission"
    method name (line 64) | def name(:transaction_submission_success), do: "transaction_submission...
    method name (line 65) | def name(:transaction_submission_failed), do: "transaction_submission_...
    method name (line 66) | def name(:pending_transactions), do: "pending_transactions"
    method name (line 67) | def name(:block_transactions), do: "block_transactions"
    method name (line 68) | def name(:block_submission_attempt), do: "block_submission_attempt"
    method name (line 69) | def name(:block_submission_success), do: "block_submission_success"
    method name (line 70) | def name(:block_submission_gas), do: "block_submission_gas"
    method name (line 71) | def name(:block_queue_blknum_submitting), do: "block_queue_blknum_subm...
    method name (line 72) | def name(:block_queue_blknum_submitted), do: "block_queue_blknum_submi...
    method name (line 73) | def name(:block_queue_num_blocks_stalled), do: "block_queue_num_blocks...
    method name (line 74) | def name(:authority_balance), do: "authority_balance"
    method name (line 75) | def name(:balance), do: "balance"
    method name (line 76) | def name(:unique_users), do: "unique_users"
    method name (line 77) | def name(:block_getter_message_queue_len), do: "block_getter_message_q...
    method name (line 78) | def name(:watcher_exit_processor_message_queue_len), do: "watcher_exit...
    method name (line 79) | def name(:eventer_message_queue_len), do: "eventer_message_queue_len"
    method name (line 80) | def name(:db_message_queue_len), do: "db_message_queue_len"
    method name (line 81) | def name(:write), do: "db_write"
    method name (line 82) | def name(:read), do: "db_read"
    method name (line 83) | def name(:multiread), do: "db_multiread"
    method events_name (line 94) | defp events_name(:depositor), do: "depositor_ethereum_events"
    method events_name (line 95) | defp events_name(:in_flight_exit), do: "in_flight_exit_ethereum_events"
    method events_name (line 96) | defp events_name(:piggyback), do: "piggyback_ethereum_events"
    method events_name (line 97) | defp events_name(:exiter), do: "exiter_ethereum_events"
    method events_name (line 98) | defp events_name(:exit_processor), do: "exit_processor_ethereum_events"
    method events_name (line 99) | defp events_name(:exit_finalizer), do: "exit_finalizer_ethereum_events"
    method events_name (line 100) | defp events_name(:exit_challenger), do: "exit_challenger_ethereum_events"
    method events_name (line 101) | defp events_name(:in_flight_exit_processor), do: "in_flight_exit_proce...
    method events_name (line 102) | defp events_name(:in_flight_exit_deleted_processor), do: "in_flight_ex...
    method events_name (line 103) | defp events_name(:piggyback_processor), do: "piggyback_processor_ether...
    method events_name (line 104) | defp events_name(:competitor_processor), do: "competitor_processor_eth...
    method events_name (line 105) | defp events_name(:challenges_responds_processor), do: "challenges_resp...
    method events_name (line 106) | defp events_name(:piggyback_challenges_processor), do: "piggyback_chal...
    method events_name (line 107) | defp events_name(:ife_exit_finalizer), do: "ife_exit_finalizer_ethereu...
    method message_queue_len_name (line 109) | defp message_queue_len_name(:block_queue), do: "block_queue_message_qu...
    method message_queue_len_name (line 110) | defp message_queue_len_name(:depositor), do: "depositor_message_queue_...
    method message_queue_len_name (line 111) | defp message_queue_len_name(:in_flight_exit), do: "in_flight_exit_mess...
    method message_queue_len_name (line 112) | defp message_queue_len_name(:piggyback), do: "piggyback_message_queue_...
    method message_queue_len_name (line 113) | defp message_queue_len_name(:exiter), do: "exiter_message_queue_len"
    method message_queue_len_name (line 114) | defp message_queue_len_name(:exit_processor), do: "exit_processor_mess...
    method message_queue_len_name (line 115) | defp message_queue_len_name(:exit_finalizer), do: "exit_finalizer_mess...
    method message_queue_len_name (line 116) | defp message_queue_len_name(:exit_challenger), do: "exit_challenger_me...
    method message_queue_len_name (line 117) | defp message_queue_len_name(:in_flight_exit_processor), do: "in_flight...
    method message_queue_len_name (line 118) | defp message_queue_len_name(:piggyback_processor), do: "piggyback_proc...
    method message_queue_len_name (line 119) | defp message_queue_len_name(:competitor_processor), do: "competitor_pr...
    method message_queue_len_name (line 120) | defp message_queue_len_name(:challenges_responds_processor), do: "chal...
    method message_queue_len_name (line 121) | defp message_queue_len_name(:piggyback_challenges_processor), do: "pig...
    method message_queue_len_name (line 122) | defp message_queue_len_name(:ife_exit_finalizer), do: "ife_exit_finali...

FILE: apps/omg_status/lib/omg_status/metric/statix.ex
  class OMG.Status.Metric.Statix (line 14) | defmodule OMG.Status.Metric.Statix

FILE: apps/omg_status/lib/omg_status/metric/telemetry.ex
  class OMG.Status.Metric.Telemetry (line 15) | defmodule OMG.Status.Metric.Telemetry
    method start_link (line 23) | def start_link(arg) do
    method init (line 27) | def init(arg) do
    method metrics (line 51) | defp metrics() do

FILE: apps/omg_status/lib/omg_status/metric/tracer.ex
  class OMG.Status.Metric.Tracer (line 15) | defmodule OMG.Status.Metric.Tracer

FILE: apps/omg_status/lib/omg_status/metric/vmstats_sink.ex
  class OMG.Status.Metric.VmstatsSink (line 14) | defmodule OMG.Status.Metric.VmstatsSink
    method prepare_child (line 26) | def prepare_child() do
    method base_key (line 30) | defp base_key(), do: Application.get_env(:vmstats, :base_key)
    method collect (line 33) | def collect(:counter, key, value), do: _ = Datadog.gauge(key, value)
    method collect (line 35) | def collect(:gauge, key, value), do: _ = Datadog.gauge(key, value)
    method collect (line 37) | def collect(:timing, key, value), do: _ = Datadog.timing(key, value)

FILE: apps/omg_status/lib/omg_status/monitor/memory_monitor.ex
  class OMG.Status.Monitor.MemoryMonitor (line 15) | defmodule OMG.Status.Monitor.MemoryMonitor
    method start_link (line 44) | def start_link(args) do
    method init (line 49) | def init([_ | _] = opts) do
    method init (line 69) | def init(_args) do
    method handle_continue (line 75) | def handle_continue(:first_check, state) do
    method handle_info (line 80) | def handle_info(:check, state) do
    method handle_cast (line 88) | def handle_cast(:set_alarm, state) do
    method handle_cast (line 92) | def handle_cast(:clear_alarm, state) do
    method handle_call (line 99) | def handle_call(_request, state), do: {:ok, :ok, state}
    method handle_event (line 101) | def handle_event({:set_alarm, {:system_memory_too_high, %{reporter: __...
    method handle_event (line 107) | def handle_event({:clear_alarm, {:system_memory_too_high, %{reporter: ...
    method handle_event (line 113) | def handle_event(event, state) do
    method system_memory_exceed_threshold? (line 122) | defp system_memory_exceed_threshold?(memsup_module, threshold) do
    method get_memory (line 130) | defp get_memory(memsup_module) do
    method raise_clear (line 149) | defp raise_clear(alarm_module, false, true) do
    method raise_clear (line 153) | defp raise_clear(alarm_module, true, false) do
    method raise_clear (line 157) | defp raise_clear(_alarm_module, true, true), do: :ok
    method raise_clear (line 159) | defp raise_clear(_alarm_module, false, false), do: :ok
    method install_alarm_handler (line 161) | defp install_alarm_handler() do

FILE: apps/omg_status/lib/omg_status/monitor/statsd_monitor.ex
  class OMG.Status.Monitor.StatsdMonitor (line 15) | defmodule OMG.Status.Monitor.StatsdMonitor
    method start_link (line 39) | def start_link(args) do
    method init (line 43) | def init([_ | _] = opts) do
    method init (line 63) | def init(_args) do
    method handle_info (line 67) | def handle_info({:EXIT, _, reason}, state) do
    method handle_info (line 75) | def handle_info(:connect, state) do
    method handle_cast (line 82) | def handle_cast(:clear_alarm, state) do
    method handle_cast (line 86) | def handle_cast(:set_alarm, state) do
    method terminate (line 90) | def terminate(_, _), do: :ok
    method handle_call (line 95) | def handle_call(_request, state), do: {:ok, :ok, state}
    method handle_event (line 97) | def handle_event({:clear_alarm, {:statsd_client_connection, %{reporter...
    method handle_event (line 103) | def handle_event({:set_alarm, {:statsd_client_connection, %{reporter: ...
    method handle_event (line 110) | def handle_event(event, state) do
    method raise_clear (line 119) | defp raise_clear(_alarm_module, true, false), do: :ok
    method raise_clear (line 121) | defp raise_clear(alarm_module, false, false),
    method raise_clear (line 124) | defp raise_clear(alarm_module, true, _),
    method raise_clear (line 127) | defp raise_clear(_alarm_module, false, _), do: :ok
    method install_alarm_handler (line 129) | defp install_alarm_handler() do

FILE: apps/omg_status/lib/omg_status/release_tasks/set_application.ex
  class OMG.Status.ReleaseTasks.SetApplication (line 15) | defmodule OMG.Status.ReleaseTasks.SetApplication
    method init (line 19) | def init(args) do
    method load (line 23) | def load(config, release: release, current_version: current_version) do

FILE: apps/omg_status/lib/omg_status/release_tasks/set_logger.ex
  class OMG.Status.ReleaseTasks.SetLogger (line 15) | defmodule OMG.Status.ReleaseTasks.SetLogger
    method init (line 23) | def init(args) do
    method load (line 27) | def load(config, _args) do
    method get_logger_backend (line 42) | defp get_logger_backend() do
    method get_env (line 52) | defp get_env(key), do: System.get_env(key)
    method validate_string (line 54) | defp validate_string(nil, default), do: default
    method validate_string (line 55) | defp validate_string(value, default), do: do_validate_string(String.up...
    method do_validate_string (line 56) | defp do_validate_string("CONSOLE", _default), do: :console
    method do_validate_string (line 57) | defp do_validate_string("INK", _default), do: Ink
    method do_validate_string (line 58) | defp do_validate_string(_, default), do: default
    method on_load (line 60) | defp on_load() do

FILE: apps/omg_status/lib/omg_status/release_tasks/set_sentry.ex
  class OMG.Status.ReleaseTasks.SetSentry (line 15) | defmodule OMG.Status.ReleaseTasks.SetSentry
    method init (line 23) | def init(args) do
    method load (line 27) | def load(config, release: release, current_version: current_version) do
    method get_app_env (line 71) | defp get_app_env() do
    method get_hostname (line 77) | defp get_hostname() do
    method get_rpc_client_type (line 84) | defp get_rpc_client_type() do
    method get_env (line 91) | defp get_env(key), do: System.get_env(key)
    method validate_rpc_client_type (line 96) | defp validate_rpc_client_type(_value, default),
    method to_rpc_client_type (line 99) | defp to_rpc_client_type("GETH"), do: :geth
    method to_rpc_client_type (line 100) | defp to_rpc_client_type("PARITY"), do: :parity
    method to_rpc_client_type (line 101) | defp to_rpc_client_type("INFURA"), do: :infura
    method to_rpc_client_type (line 102) | defp to_rpc_client_type(_), do: exit("ETH_NODE must be either GETH, PA...
    method validate_string (line 105) | defp validate_string(_, default), do: default

FILE: apps/omg_status/lib/omg_status/release_tasks/set_tracer.ex
  class OMG.Status.ReleaseTasks.SetTracer (line 15) | defmodule OMG.Status.ReleaseTasks.SetTracer
    method init (line 22) | def init(args) do
    method load (line 26) | def load(config, args) do
    method get_hostname (line 73) | defp get_hostname() do
    method get_dd_disabled (line 80) | defp get_dd_disabled() do
    method get_app_env (line 87) | defp get_app_env() do
    method get_dd_hostname (line 93) | defp get_dd_hostname(default) do
    method get_dd_port (line 99) | defp get_dd_port(default) do
    method get_dd_spandex_port (line 105) | defp get_dd_spandex_port(default) do
    method get_batch_size (line 111) | def get_batch_size() do
    method validate_hostname (line 119) | defp validate_hostname(_), do: exit("HOSTNAME is not set correctly.")
    method get_sync_threshold (line 121) | def get_sync_threshold() do
    method get_env (line 129) | defp get_env(key) do
    method validate_bool (line 134) | defp validate_bool(_, default), do: default
    method to_bool (line 136) | defp to_bool("TRUE"), do: true
    method to_bool (line 137) | defp to_bool("FALSE"), do: false
    method to_bool (line 138) | defp to_bool(_), do: exit("DD_DISABLED either true or false.")
    method validate_string (line 141) | defp validate_string(_, default), do: default
    method validate_integer (line 144) | defp validate_integer(_, default), do: default
    method on_load (line 146) | defp on_load() do

FILE: apps/omg_status/lib/omg_status/sentry_filter.ex
  class OMG.Status.SentryFilter (line 15) | defmodule OMG.Status.SentryFilter
    method exclude_exception? (line 23) | def exclude_exception?(%MatchError{term: {:error, :nxdomain}}, _), do:...
    method exclude_exception? (line 26) | def exclude_exception?(%Phoenix.NotAcceptableError{plug_status: 406}, ...
    method exclude_exception? (line 28) | def exclude_exception?(%Plug.Parsers.RequestTooLargeError{}, _), do: true
    method exclude_exception? (line 30) | def exclude_exception?(%CaseClauseError{term: {:error, :econnrefused}}...
    method exclude_exception? (line 32) | def exclude_exception?(_, _), do: false

FILE: apps/omg_status/lib/status.ex
  class OMG.Status (line 15) | defmodule OMG.Status
    method is_healthy (line 36) | def is_healthy() do

FILE: apps/omg_status/mix.exs
  class OMG.Status.Mixfile (line 1) | defmodule OMG.Status.Mixfile
    method project (line 4) | def project() do
    method elixirc_paths (line 21) | defp elixirc_paths(:prod), do: ["lib"]
    method elixirc_paths (line 22) | defp elixirc_paths(:dev), do: ["lib"]
    method elixirc_paths (line 23) | defp elixirc_paths(:test), do: ["lib", "test/support"]
    method application (line 25) | def application() do
    method version (line 34) | defp version() do
    method deps (line 42) | defp deps(),

FILE: apps/omg_status/test/omg_status/alert/alarm_printer_test.exs
  class OMG.Status.Alert.AlarmPrinterTest (line 15) | defmodule OMG.Status.Alert.AlarmPrinterTest
  class Alarm (line 75) | defmodule Alarm
    method all (line 76) | def all(), do: [1, 2, 3]

FILE: apps/omg_status/test/omg_status/datadog_event/alarm_consumer_test.exs
  class OMG.Status.DatadogEvent.AlarmConsumerTest (line 15) | defmodule OMG.Status.DatadogEvent.AlarmConsumerTest
  class DatadogEventMock (line 48) | defmodule DatadogEventMock
    method event (line 51) | def event(_title, "%{test_pid: :" <> rest = _message, _options) do
  class DatadogAlarmHandlerMock (line 58) | defmodule DatadogAlarmHandlerMock
    method init (line 59) | def init([alarm_consumer_process]) do
    method handle_event (line 63) | def handle_event({:set_alarm, {:ethereum_connection_error, _details}} ...
    method handle_event (line 68) | def handle_event({:clear_alarm, {:ethereum_connection_error, _details}...
  class DatadogAlarmMock (line 74) | defmodule DatadogAlarmMock
    method init (line 75) | def init(_) do
    method add_alarm_handler (line 79) | def add_alarm_handler(module, args) do
    method set_alarm (line 83) | def set_alarm(alarm) do
    method clear_alarm (line 87) | def clear_alarm(alarm_id) do

FILE: apps/omg_status/test/omg_status/integration/alarms_test.exs
  class OMG.Status.Alert.AlarmTest (line 15) | defmodule OMG.Status.Alert.AlarmTest
    method get_alarms (line 89) | defp get_alarms(ids), do: Enum.filter(Alarm.all(), fn {id, _desc} -> i...

FILE: apps/omg_status/test/omg_status/metric/datadog_test.exs
  class OMG.Status.Metric.DatadogTest (line 15) | defmodule OMG.Status.Metric.DatadogTest

FILE: apps/omg_status/test/omg_status/monitor/memory_monitor_test.exs
  class OMG.Status.Monitor.MemoryMonitorTest (line 15) | defmodule OMG.Status.Monitor.MemoryMonitorTest
    method set_memsup (line 66) | defp set_memsup(memory_data) do
  class Alarm (line 70) | defmodule Alarm
    method start_link (line 73) | def start_link(parent) do
    method init (line 77) | def init([parent]) do
    method system_memory_too_high (line 81) | def system_memory_too_high(reporter) do
    method set (line 85) | def set({:system_memory_too_high, _}) do
    method clear (line 89) | def clear({:system_memory_too_high, _}) do
    method handle_call (line 93) | def handle_call(:got_raise_alarm, _, state) do
    method handle_call (line 97) | def handle_call(:got_clear_alarm, _, state) do
  class Memsup (line 102) | defmodule Memsup
    method start_link (line 105) | def start_link() do
    method init (line 109) | def init(_) do
    method get_system_memory_data (line 120) | def get_system_memory_data() do
    method handle_call (line 124) | def handle_call(:get_system_memory_data, _, state) do

FILE: apps/omg_status/test/omg_status/monitor/statsd_monitor_test.exs
  class OMG.Status.Monitor.StatsdMonitorTest (line 15) | defmodule OMG.Status.Monitor.StatsdMonitorTest
  class Alarm (line 57) | defmodule Alarm
    method start (line 60) | def start(parent) do
    method init (line 64) | def init([parent]) do
    method statsd_client_connection (line 68) | def statsd_client_connection(reporter),
    method set (line 71) | def set({:statsd_client_connection, _details}) do
    method clear (line 75) | def clear({:statsd_client_connection, _details}) do
    method handle_call (line 79) | def handle_call(:got_raise_alarm, _, state) do
    method handle_call (line 83) | def handle_call(:got_clear_alarm, _, state) do
  class StasdWrapper (line 88) | defmodule StasdWrapper
    method start_link (line 91) | def start_link() do
    method init (line 95) | def init(_) do

FILE: apps/omg_status/test/omg_status/release_tasks/set_logger_test.exs
  class OMG.Status.ReleaseTasks.SetLoggerTest (line 15) | defmodule OMG.Status.ReleaseTasks.SetLoggerTest

FILE: apps/omg_status/test/omg_status/release_tasks/set_sentry_test.exs
  class OMG.Status.ReleaseTasks.SetSentryTest (line 15) | defmodule OMG.Status.ReleaseTasks.SetSentryTest

FILE: apps/omg_status/test/omg_status/release_tasks/set_tracer_test.exs
  class OMG.Status.ReleaseTasks.SetTracerTest (line 15) | defmodule OMG.Status.ReleaseTasks.SetTracerTest
  class System (line 132) | defmodule System
    method start_link (line 133) | def start_link(args), do: GenServer.start_link(__MODULE__, args, [])
    method get_env (line 134) | def get_env(key), do: __MODULE__ |> Process.get() |> GenServer.call({:...
    method put_env (line 135) | def put_env(key, value), do: __MODULE__ |> Process.get() |> GenServer....
    method init (line 136) | def init(_), do: {:ok, %{}}
    method handle_call (line 138) | def handle_call({:get_env, key}, _, state) do
    method handle_call (line 142) | def handle_call({:put_env, key, value}, _, state) do

FILE: apps/omg_status/test/sentry_filter_test.exs
  class OMG.Status.SentryFilterTest (line 15) | defmodule OMG.Status.SentryFilterTest

FILE: apps/omg_utils/lib/omg_utils/app_version.ex
  class OMG.Utils.AppVersion (line 15) | defmodule OMG.Utils.AppVersion
    method version (line 24) | def version(app) do

FILE: apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex
  class OMG.Utils.HttpRPC.Encoding (line 15) | defmodule OMG.Utils.HttpRPC.Encoding
    method to_hex (line 27) | def to_hex(binary), do: "0x" <> Base.encode16(binary, case: :lower)
    method from_hex (line 35) | def from_hex("0x" <> hexstr), do: Base.decode16(hexstr, case: :mixed)
    method from_hex (line 36) | def from_hex(_), do: {:error, :invalid_hex}
    method from_hex! (line 40) | def from_hex!("0x" <> encoded), do: Base.decode16!(encoded, case: :lower)

FILE: apps/omg_utils/lib/omg_utils/http_rpc/error.ex
  class OMG.Utils.HttpRPC.Error (line 15) | defmodule OMG.Utils.HttpRPC.Error
    method serialize (line 25) | def serialize(code, description, messages \\ nil) do
    method add_messages (line 35) | defp add_messages(data, nil), do: data
    method add_messages (line 36) | defp add_messages(data, messages), do: Map.put_new(data, :messages, me...

FILE: apps/omg_utils/lib/omg_utils/http_rpc/response.ex
  class OMG.Utils.HttpRPC.Response (line 15) | defmodule OMG.Utils.HttpRPC.Response
    method serialize_page (line 23) | def serialize_page(data, data_paging) do
    method serialize (line 33) | def serialize(%{object: :error} = error) do
    method serialize (line 37) | def serialize(data) do
    method sanitize (line 51) | def sanitize(response)
    method sanitize (line 54) | def sanitize(%DateTime{} = datetime) do
    method sanitize (line 70) | def sanitize({:skip_hex_encode, bin}), do: bin
    method sanitize (line 71) | def sanitize({{key, value}, _}), do: Map.put_new(%{}, key, value)
    method sanitize (line 72) | def sanitize({key, value}), do: Map.put_new(%{}, key, value)
    method sanitize (line 73) | def sanitize(value), do: value
    method do_filter (line 75) | defp do_filter(map_or_struct) do
    method sanitize_map (line 88) | defp sanitize_map(map) do
    method to_map (line 102) | defp to_map(struct), do: Map.drop(struct, [:__struct__, :__meta__])
    method to_response (line 104) | defp to_response(data, result) do

FILE: apps/omg_utils/lib/omg_utils/http_rpc/validators/base.ex
  class OMG.Utils.HttpRPC.Validator.Base (line 15) | defmodule OMG.Utils.HttpRPC.Validator.Base
    method expect (line 58) | def expect(map, key, opts) do
    method error (line 75) | def error(parent_name, {:validation_error, child_name, reason}),
    method all_success_or_error (line 85) | def all_success_or_error(result_list) do
    method integer (line 102) | def integer({_, [_ | _]} = err), do: err
    method integer (line 104) | def integer({val, []}), do: {val, [:integer]}
    method optional (line 108) | def optional(acc), do: acc
    method optional (line 112) | def optional(acc, _), do: acc
    method hex (line 115) | def hex({_, [_ | _]} = err), do: err
    method hex (line 117) | def hex({str, []}) do
    method length (line 128) | def length({_, [_ | _]} = err, _len), do: err
    method length (line 136) | def length({val, []}, len), do: {val, length: len}
    method max_length (line 139) | def max_length({_, [_ | _]} = err, _len), do: err
    method max_length (line 141) | def max_length({val, []}, len), do: {val, max_length: len}
    method min_length (line 144) | def min_length({_, [_ | _]} = err, _len), do: err
    method min_length (line 146) | def min_length({val, []}, len), do: {val, min_length: len}
    method greater (line 149) | def greater({_, [_ | _]} = err, _b), do: err
    method greater (line 152) | def greater({val, []}, bound), do: {val, greater: bound}
    method lesser (line 155) | def lesser({_, [_ | _]} = err, _b), do: err
    method lesser (line 158) | def lesser({val, []}, bound), do: {val, lesser: bound}
    method list (line 161) | def list(tuple, mapper \\ nil)
    method list (line 162) | def list({_, [_ | _]} = err, _), do: err
    method list (line 165) | def list({val, _}, _), do: {val, [:list]}
    method map (line 168) | def map(tuple, parser \\ nil)
    method map (line 169) | def map({_, [_ | _]} = err, _), do: err
    method map (line 179) | def map({val, _}, _), do: {val, [:map]}
    method list_processor (line 181) | defp list_processor(val, mapper) do
    method get (line 200) | defp get(map, key), do: {Map.get(map, key, :missing), []}
    method validate (line 203) | defp validate({validator, args}, acc), do: Kernel.apply(__MODULE__, va...
    method replace_aliases (line 205) | defp replace_aliases(validators) do
    method validator_name (line 219) | defp validator_name({v, _}), do: v

FILE: apps/omg_utils/lib/omg_utils/paginator.ex
  class OMG.Utils.Paginator (line 14) | defmodule OMG.Utils.Paginator

FILE: apps/omg_utils/lib/omg_utils/remote_ip.ex
  class OMG.Utils.RemoteIP (line 14) | defmodule OMG.Utils.RemoteIP
    method init (line 22) | def init(options), do: options
    method call (line 24) | def call(conn, _opts) do
    method parse_and_set_ip (line 39) | defp parse_and_set_ip(conn, _ip), do: conn
    method parse_ip (line 54) | defp parse_ip(conn, _), do: conn

FILE: apps/omg_utils/lib/utils.ex
  class OMG.Utils (line 15) | defmodule OMG.Utils

FILE: apps/omg_utils/mix.exs
  class Utils.MixProject (line 1) | defmodule Utils.MixProject
    method project (line 4) | def project() do
    method application (line 20) | def application() do
    method version (line 24) | defp version() do
    method elixirc_paths (line 33) | defp elixirc_paths(:prod), do: ["lib"]
    method elixirc_paths (line 34) | defp elixirc_paths(:dev), do: ["lib"]
    method elixirc_paths (line 35) | defp elixirc_paths(:test), do: ["lib", "test/support"]

FILE: apps/omg_utils/test/omg_utils/app_version_tet.exs
  class OMG.Utils.AppVersionTest (line 15) | defmodule OMG.Utils.AppVersionTest

FILE: apps/omg_utils/test/omg_utils/http_rpc/encoding_test.exs
  class OMG.Utils.HttpRPC.EncodingTest (line 15) | defmodule OMG.Utils.HttpRPC.EncodingTest

FILE: apps/omg_utils/test/omg_utils/http_rpc/response_test.exs
  class OMG.Utils.HttpRPC.ResponseTest (line 15) | defmodule OMG.Utils.HttpRPC.ResponseTest
    method unload_ecto (line 162) | defp unload_ecto() do
    method load_ecto (line 168) | defp load_ecto(), do: true = Code.ensure_loaded?(Ecto)

FILE: apps/omg_utils/test/omg_utils/http_rpc/validators/base_test.exs
  class OMG.Utils.HttpRPC.Validator.BaseTest (line 15) | defmodule OMG.Utils.HttpRPC.Validator.BaseTest

FILE: apps/omg_utils/test/omg_utils/remote_ip_test.exs
  class OMG.Utils.RemoteIPTest (line 14) | defmodule OMG.Utils.RemoteIPTest

FILE: apps/omg_watcher/lib/omg_watcher.ex
  class OMG.Watcher (line 15) | defmodule OMG.Watcher

FILE: apps/omg_watcher/lib/omg_watcher/api/account.ex
  class OMG.Watcher.API.Account (line 15) | defmodule OMG.Watcher.API.Account
    method get_exitable_utxos (line 29) | def get_exitable_utxos(address) do
    method filter_standard_exiting_utxos (line 49) | defp filter_standard_exiting_utxos(standard_exitable_utxos, active_exi...

FILE: apps/omg_watcher/lib/omg_watcher/api/alarm.ex
  class OMG.Watcher.API.Alarm (line 15) | defmodule OMG.Watcher.API.Alarm
    method get_alarms (line 23) | def get_alarms(), do: {:ok, Alarm.all()}

FILE: apps/omg_watcher/lib/omg_watcher/api/configuration.ex
  class OMG.Watcher.API.Configuration (line 15) | defmodule OMG.Watcher.API.Configuration
    method get_configuration (line 23) | def get_configuration() do

FILE: apps/omg_watcher/lib/omg_watcher/api/in_flight_exit.ex
  class OMG.Watcher.API.InFlightExit (line 15) | defmodule OMG.Watcher.API.InFlightExit
    method get_in_flight_exit (line 38) | def get_in_flight_exit(txbytes) do
    method get_competitor (line 60) | def get_competitor(txbytes) do
    method prove_canonical (line 69) | def prove_canonical(txbytes) do
    method get_input_challenge_data (line 78) | def get_input_challenge_data(txbytes, input_index) do
    method get_output_challenge_data (line 87) | def get_output_challenge_data(txbytes, output_index) do
    method find_input_data (line 91) | defp find_input_data(tx) do
    method find_single_input_data (line 99) | defp find_single_input_data(input_utxo_pos, {:ok, {proofs, txbyteses, ...

FILE: apps/omg_watcher/lib/omg_watcher/api/status.ex
  class OMG.Watcher.API.Status (line 15) | defmodule OMG.Watcher.API.Status
    method get_status (line 26) | def get_status() do

FILE: apps/omg_watcher/lib/omg_watcher/api/status_cache.ex
  class OMG.Watcher.API.StatusCache (line 15) | defmodule OMG.Watcher.API.StatusCache
    method get (line 36) | def get() do
    method start_link (line 40) | def start_link(args) do
    method init (line 45) | def init(opts) do
    method handle_info (line 60) | def handle_info({:internal_event_bus, :ethereum_new_height, eth_block_...
    method handle_info (line 65) | def handle_info({:ssl_closed, _}, state) do
    method key (line 70) | defp key() do

FILE: apps/omg_watcher/lib/omg_watcher/api/status_cache/external.ex
  class OMG.Watcher.API.StatusCache.External (line 15) | defmodule OMG.Watcher.API.StatusCache.External
    method get_ethereum_height (line 45) | def get_ethereum_height() do
    method get_status (line 55) | def get_status(eth_block_number) do
    method syncing? (line 91) | defp syncing?() do
    method get_validated_child_block_number (line 95) | defp get_validated_child_block_number() do
    method contract_map_from_hex (line 101) | defp contract_map_from_hex(contract_map) do

FILE: apps/omg_watcher/lib/omg_watcher/api/status_cache/storage.ex
  class OMG.Watcher.API.StatusCache.Storage (line 15) | defmodule OMG.Watcher.API.StatusCache.Storage
    method update_status (line 23) | def update_status(ets, key, eth_block_number, integration_module) do
    method ensure_ets_init (line 28) | def ensure_ets_init(status_cache) do

FILE: apps/omg_watcher/lib/omg_watcher/api/transaction.ex
  class OMG.Watcher.API.Transaction (line 15) | defmodule OMG.Watcher.API.Transaction
    method batch_submit (line 36) | def batch_submit(signed_txs) do
    method submit (line 42) | def submit(%Transaction.Signed{} = signed_tx) do

FILE: apps/omg_watcher/lib/omg_watcher/api/utxo.ex
  class OMG.Watcher.API.Utxo (line 15) | defmodule OMG.Watcher.API.Utxo
    method create_challenge (line 44) | def create_challenge(utxo) do
    method compose_utxo_exit (line 54) | def compose_utxo_exit(Utxo.position(blknum, _, _) = utxo_pos) do

FILE: apps/omg_watcher/lib/omg_watcher/application.ex
  class OMG.Watcher.Application (line 15) | defmodule OMG.Watcher.Application
    method start (line 24) | def start(_type, _args) do
    method start_root_supervisor (line 29) | def start_root_supervisor() do
    method start_phase (line 50) | def start_phase(:attach_telemetry, :normal, _phase_args) do

FILE: apps/omg_watcher/lib/omg_watcher/block.ex
  class OMG.Watcher.Block (line 15) | defmodule OMG.Watcher.Block
    method hashed_txs_at (line 44) | def hashed_txs_at(txs, blknum) do
    method to_api_format (line 54) | def to_api_format(%__MODULE__{number: blknum} = struct_block) do
    method inclusion_proof (line 86) | def inclusion_proof(%__MODULE__{transactions: transactions}, txindex),...

FILE: apps/omg_watcher/lib/omg_watcher/block_getter.ex
  class OMG.Watcher.BlockGetter (line 15) | defmodule OMG.Watcher.BlockGetter
    method get_events (line 62) | def get_events(), do: __MODULE__.Status.get_events()
    method start_link (line 64) | def start_link(args) do
    method init (line 72) | def init(args) do
    method handle_continue (line 139) | def handle_continue({:apply_block_step, :execute_transactions, block_a...
    method handle_continue (line 156) | def handle_continue({:apply_block_step, :run_block_download_task, bloc...
    method handle_continue (line 161) | def handle_continue({:apply_block_step, :close_and_apply_block, block_...
    method handle_continue (line 182) | def handle_continue({:apply_block_step, :check_validity}, state) do
    method handle_cast (line 192) | def handle_cast({:apply_block, %BlockApplication{} = block_application...
    method handle_info (line 218) | def handle_info(msg, state)
    method handle_info (line 220) | def handle_info(:producer, state), do: do_producer(state)
    method handle_info (line 221) | def handle_info({_ref, {:downloaded_block, response}}, state), do: do_...
    method handle_info (line 222) | def handle_info({:DOWN, _ref, :process, _pid, :normal} = _process, sta...
    method handle_info (line 223) | def handle_info(:sync, state), do: do_sync(state)
    method handle_info (line 225) | def handle_info(:send_metrics, state) do
    method handle_info (line 230) | def handle_info({:ssl_closed, _}, state) do
    method do_producer (line 239) | defp do_producer(state) do
    method do_downloaded_block (line 254) | defp do_downloaded_block(response, state) do
    method do_sync (line 270) | defp do_sync(state) do
    method get_block_submitted_events (line 305) | defp get_block_submitted_events(block_from, block_to) do
    method run_block_download_task (line 309) | defp run_block_download_task(state) do
    method schedule_sync_height (line 324) | defp schedule_sync_height(block_getter_loops_interval_ms) do
    method schedule_producer (line 328) | defp schedule_producer(block_getter_loops_interval_ms) do
    method download_block (line 333) | defp download_block(requested_number, child_chain_url) do
    method check_in_to_coordinator (line 347) | defp check_in_to_coordinator(synced_height), do: RootChainCoordinator....
    method update_status (line 349) | defp update_status(%Core{} = state), do: Status.update(Core.chain_ok(s...
    method publish_events (line 351) | defp publish_events([%{event_signature: event_signature} | _] = data) do
    method publish_events (line 361) | defp publish_events([]), do: :ok

FILE: apps/omg_watcher/lib/omg_watcher/block_getter/block_application.ex
  class OMG.Watcher.BlockGetter.BlockApplication (line 15) | defmodule OMG.Watcher.BlockGetter.BlockApplication
    method new (line 41) | def new(block, recovered_txs, block_timestamp) do

FILE: apps/omg_watcher/lib/omg_watcher/block_getter/core.ex
  class OMG.Watcher.BlockGetter.Core (line 15) | defmodule OMG.Watcher.BlockGetter.Core
    method init (line 147) | def init(
    method chain_ok (line 189) | def chain_ok(%__MODULE__{chain_status: chain_status, events: events}),...
    method apply_block (line 195) | def apply_block(%__MODULE__{} = state, %BlockApplication{
    method get_eth_range_for_block_submitted_events (line 218) | def get_eth_range_for_block_submitted_events(
    method get_blocks_to_apply (line 234) | def get_blocks_to_apply(
    method get_numbers_of_blocks_to_download (line 250) | def get_numbers_of_blocks_to_download(
    method get_numbers_of_blocks_to_download (line 309) | def get_numbers_of_blocks_to_download(state, _next_child) do
    method validate_download_response (line 325) | def validate_download_response(
    method validate_download_response (line 344) | def validate_download_response({:error, _} = error, requested_hash, re...
    method handle_downloaded_block (line 367) | def handle_downloaded_block(
    method validate_executions (line 403) | def validate_executions(tx_execution_results, %{hash: hash, number: bl...
    method consider_exits (line 419) | def consider_exits(%__MODULE__{} = state, {:ok, _}), do: state
    method consider_exits (line 421) | def consider_exits(%__MODULE__{} = state, {{:error, :unchallenged_exit...
    method init_opts_valid? (line 430) | defp init_opts_valid?(opts) do
    method do_get_blocks_to_apply (line 446) | defp do_get_blocks_to_apply(%__MODULE__{} = state, [], coordinator_hei...
    method do_get_blocks_to_apply (line 452) | defp do_get_blocks_to_apply(
    method final_blknums (line 492) | defp final_blknums(new_submissions) do
    method log_downloading_blocks (line 501) | defp log_downloading_blocks(_next_child, []), do: :ok
    method log_downloading_blocks (line 503) | defp log_downloading_blocks(next_child, blocks_numbers) do
    method get_blknum (line 507) | defp get_blknum({:ok, %{number: number}}), do: number
    method get_blknum (line 508) | defp get_blknum({:ok, %PotentialWithholdingReport{blknum: blknum}}), d...
    method get_blknum (line 509) | defp get_blknum({:error, {_error_type, _hash, number}}), do: number
    method validate_downloaded_block (line 511) | defp validate_downloaded_block(
    method validate_downloaded_block (line 530) | defp validate_downloaded_block(
    method validate_downloaded_block (line 539) | defp validate_downloaded_block(
    method not_queued_up_yet? (line 564) | defp not_queued_up_yet?(number, unapplied_blocks), do: not Map.has_key...
    method expected_to_queue_up? (line 566) | defp expected_to_queue_up?(number, %{num_of_highest_block_being_downlo...
    method recover_all_txs (line 569) | defp recover_all_txs(transactions) do
    method all_tx_executions_ok? (line 580) | defp all_tx_executions_ok?(tx_execution_results) do
    method add_distinct_event (line 588) | defp add_distinct_event(%__MODULE__{events: events} = state, event) do
    method set_chain_status (line 594) | defp set_chain_status(state, status), do: %{state | chain_status: status}
  class Config (line 35) | defmodule Config
  class PotentialWithholdingReport (line 57) | defmodule PotentialWithholdingReport
  class PotentialWithholding (line 71) | defmodule PotentialWithholding

FILE: apps/omg_watcher/lib/omg_watcher/block_getter/measure.ex
  class OMG.Watcher.BlockGetter.Measure (line 15) | defmodule OMG.Watcher.BlockGetter.Measure
    method supported_events (line 26) | def supported_events(), do: @supported_events
    method handle_event (line 28) | def handle_event([:process, BlockGetter], _, _state, _config) do

FILE: apps/omg_watcher/lib/omg_watcher/block_getter/status.ex
  class OMG.Watcher.BlockGetter.Status (line 15) | defmodule OMG.Watcher.BlockGetter.Status
    method start_link (line 27) | def start_link() do
    method update (line 35) | def update(status), do: Agent.update(__MODULE__, fn _old_status -> sta...
    method get_events (line 42) | def get_events(), do: Agent.get(__MODULE__, fn status -> {:ok, status}...

FILE: apps/omg_watcher/lib/omg_watcher/block_getter/supervisor.ex
  class OMG.Watcher.BlockGetter.Supervisor (line 15) | defmodule OMG.Watcher.BlockGetter.Supervisor
    method start_link (line 26) | def start_link(args) do
    method init (line 30) | def init(args) do

FILE: apps/omg_watcher/lib/omg_watcher/block_validator.ex
  class OMG.Watcher.BlockValidator (line 15) | defmodule OMG.Watcher.BlockValidator
    method stateless_validate (line 37) | def stateless_validate(submitted_block) do
    method verify_merkle_root (line 49) | defp verify_merkle_root(block, transactions) do
    method verify_transactions (line 64) | defp verify_transactions(transactions) do
    method number_of_transactions_within_limit (line 79) | defp number_of_transactions_within_limit([]), do: {:error, :empty_block}
    method number_of_transactions_within_limit (line 85) | defp number_of_transactions_within_limit(_transactions), do: :ok
    method verify_no_duplicate_inputs (line 88) | defp verify_no_duplicate_inputs(transactions) do
    method verify_fee_transactions (line 99) | defp verify_fee_transactions(transactions) do
    method expected_index (line 109) | defp expected_index(transactions, identified_fee_transactions) do
    method unique_fee_transaction_per_currency (line 120) | defp unique_fee_transaction_per_currency(identified_fee_transactions) do
    method is_fee (line 129) | defp is_fee(%Transaction.Recovered{signed_tx: %Transaction.Signed{raw_...
    method is_fee (line 133) | defp is_fee(_), do: false
    method get_fee_output (line 135) | defp get_fee_output(fee_transaction) do

FILE: apps/omg_watcher/lib/omg_watcher/child_manager.ex
  class OMG.Watcher.ChildManager (line 15) | defmodule OMG.Watcher.ChildManager
    method start_link (line 23) | def start_link(args) do
    method init (line 27) | def init(args) do
    method handle_info (line 33) | def handle_info(:health_checkin, state) do

FILE: apps/omg_watcher/lib/omg_watcher/configuration.ex
  class OMG.Watcher.Configuration (line 15) | defmodule OMG.Watcher.Configuration
    method exit_processor_sla_margin (line 20) | def exit_processor_sla_margin() do
    method exit_processor_sla_margin_forced (line 24) | def exit_processor_sla_margin_forced() do
    method metrics_collection_interval (line 28) | def metrics_collection_interval() do
    method block_getter_reorg_margin (line 32) | def block_getter_reorg_margin() do
    method maximum_block_withholding_time_ms (line 36) | def maximum_block_withholding_time_ms() do
    method maximum_number_of_unapplied_blocks (line 40) | def maximum_number_of_unapplied_blocks() do
    method child_chain_url (line 44) | def child_chain_url() do
    method exit_finality_margin (line 48) | def exit_finality_margin() do
    method deposit_finality_margin (line 53) | def deposit_finality_margin() do
    method fee_claimer_address (line 58) | def fee_claimer_address() do
    method ethereum_events_check_interval_ms (line 63) | def ethereum_events_check_interval_ms() do
    method coordinator_eth_height_check_interval_ms (line 68) | def coordinator_eth_height_check_interval_ms() do

FILE: apps/omg_watcher/lib/omg_watcher/coordinator_setup.ex
  class OMG.Watcher.CoordinatorSetup (line 15) | defmodule OMG.Watcher.CoordinatorSetup
    method coordinator_setup (line 32) | def coordinator_setup(

FILE: apps/omg_watcher/lib/omg_watcher/crypto.ex
  class OMG.Watcher.Crypto (line 15) | defmodule OMG.Watcher.Crypto
    method hash (line 45) | def hash(message), do: Crypto.keccak_hash(message)
    method recover_address (line 51) | def recover_address(<<digest::binary-size(32)>>, <<packed_signature::b...
    method generate_address (line 68) | def generate_address(<<pub::binary-size(64)>>) do

FILE: apps/omg_watcher/lib/omg_watcher/datadog_event/contract_event_consumer.ex
  class OMG.Watcher.DatadogEvent.ContractEventConsumer (line 15) | defmodule OMG.Watcher.DatadogEvent.ContractEventConsumer
    method prepare_child (line 32) | def prepare_child(opts \\ []) do
    method start_link (line 43) | def start_link(args) do
    method init (line 51) | def init(args) do
    method handle_info (line 62) | def handle_info({:internal_event_bus, :enqueue_block, _omg_block}, sta...
    method handle_info (line 71) | def handle_info({:internal_event_bus, :data, data}, state) do
    method create_event_data (line 88) | defp create_event_data(title, message, options) do
    method tags (line 93) | defp tags(aggregation_key, release, current_version, _timestamp) do

FILE: apps/omg_watcher/lib/omg_watcher/datadog_event/encode.ex
  class OMG.Watcher.DatadogEvent.Encode (line 15) | defmodule OMG.Watcher.DatadogEvent.Encode

FILE: apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex
  class OMG.Watcher.EthereumEventAggregator (line 14) | defmodule OMG.Watcher.EthereumEventAggregator
    method deposit_created (line 31) | def deposit_created(server \\ __MODULE__, from_block, to_block) do
    method exit_started (line 36) | def exit_started(server \\ __MODULE__, from_block, to_block) do
    method exit_finalized (line 41) | def exit_finalized(server \\ __MODULE__, from_block, to_block) do
    method exit_challenged (line 46) | def exit_challenged(server \\ __MODULE__, from_block, to_block) do
    method in_flight_exit_started (line 51) | def in_flight_exit_started(server \\ __MODULE__, from_block, to_block) do
    method in_flight_exit_deleted (line 56) | def in_flight_exit_deleted(server \\ __MODULE__, from_block, to_block) do
    method in_flight_exit_piggybacked (line 61) | def in_flight_exit_piggybacked(server \\ __MODULE__, from_block, to_bl...
    method in_flight_exit_challenged (line 67) | def in_flight_exit_challenged(server \\ __MODULE__, from_block, to_blo...
    method in_flight_exit_challenge_responded (line 72) | def in_flight_exit_challenge_responded(server \\ __MODULE__, from_bloc...
    method in_flight_exit_blocked (line 77) | def in_flight_exit_blocked(server \\ __MODULE__, from_block, to_block) do
    method in_flight_exit_withdrawn (line 82) | def in_flight_exit_withdrawn(server \\ __MODULE__, from_block, to_bloc...
    method start_link (line 93) | def start_link(opts) do
    method init (line 97) | def init(opts) do
    method handle_call (line 130) | def handle_call({:in_flight_exit_withdrawn, from_block, to_block}, _, ...
    method handle_call (line 148) | def handle_call({:in_flight_exit_blocked, from_block, to_block}, _, st...
    method handle_call (line 167) | def handle_call({:in_flight_exit_piggybacked, from_block, to_block}, _...
    method handle_call (line 186) | def handle_call({name, from_block, to_block}, _, state) do
    method handle_continue (line 205) | def handle_continue(new_height_blknum, state) do
    method retrieve_and_store_logs (line 211) | defp retrieve_and_store_logs(from_block, to_block, state) do
    method get_logs (line 218) | defp get_logs(from_height, to_height, state) do
    method enrich_logs_with_call_data (line 224) | defp enrich_logs_with_call_data(decoded_logs, state) do
    method store_logs (line 245) | defp store_logs(decoded_logs, from_block, to_block, state) do
    method delete_old_logs (line 294) | defp delete_old_logs(new_height_blknum, state) do
    method retrieve_log (line 309) | defp retrieve_log(signature, from_block, to_block, state) do
    method from_hex (line 357) | defp from_hex("0x" <> encoded), do: Base.decode16!(encoded, case: :lower)

FILE: apps/omg_watcher/lib/omg_watcher/ethereum_event_listener.ex
  class OMG.Watcher.EthereumEventListener (line 15) | defmodule OMG.Watcher.EthereumEventListener
    method start_link (line 61) | def start_link(config) do
    method prepare_child (line 71) | def prepare_child(opts \\ []) do
    method init (line 87) | def init(init) do
    method handle_continue (line 96) | def handle_continue(
    method handle_info (line 132) | def handle_info(:send_metrics, {state, callbacks}) do
    method handle_info (line 150) | def handle_info(:sync, {state, callbacks}) do
    method sync_height (line 168) | defp sync_height(state, callbacks, sync_guide) do
    method get_events (line 185) | defp get_events({{from, to}, state}, get_events_callback) do
    method get_events (line 190) | defp get_events({:dont_fetch_events, state}, _callback) do
    method schedule_get_events (line 194) | defp schedule_get_events(ethereum_events_check_interval_ms) do
    method publish_events (line 198) | defp publish_events([%{event_signature: event_signature} | _] = data) do
    method publish_events (line 206) | defp publish_events([]), do: :ok

FILE: apps/omg_watcher/lib/omg_watcher/ethereum_event_listener/core.ex
  class OMG.Watcher.EthereumEventListener.Core (line 15) | defmodule OMG.Watcher.EthereumEventListener.Core
    method init (line 55) | def init(
    method calc_events_range_set_height (line 83) | def calc_events_range_set_height(state, sync_guide) do

FILE: apps/omg_watcher/lib/omg_watcher/ethereum_event_listener/measure.ex
  class OMG.Watcher.EthereumEventListener.Measure (line 15) | defmodule OMG.Watcher.EthereumEventListener.Measure
    method supported_events (line 35) | def supported_events(), do: @supported_events
    method handle_event (line 37) | def handle_event([:process, OMG.Watcher.EthereumEventListener], %{even...
    method handle_event (line 41) | def handle_event([:process, OMG.Watcher.EthereumEventListener], %{}, s...
    method handle_event (line 50) | def handle_event([:trace, _], %{}, state, _config) do

FILE: apps/omg_watcher/lib/omg_watcher/event.ex
  class OMG.Watcher.Event (line 15) | defmodule OMG.Watcher.Event
  class AddressReceived (line 58) | defmodule AddressReceived
  class AddressSpent (line 74) | defmodule AddressSpent
  class ExitFinalized (line 90) | defmodule ExitFinalized
  class InvalidBlock (line 106) | defmodule InvalidBlock
  class BlockWithholding (line 121) | defmodule BlockWithholding
  class InvalidExit (line 135) | defmodule InvalidExit
  class UnchallengedExit (line 167) | defmodule UnchallengedExit
  class NonCanonicalIFE (line 201) | defmodule NonCanonicalIFE
  class UnchallengedNonCanonicalIFE (line 214) | defmodule UnchallengedNonCanonicalIFE
  class InvalidIFEChallenge (line 229) | defmodule InvalidIFEChallenge
  class PiggybackAvailable (line 242) | defmodule PiggybackAvailable
  class InvalidPiggyback (line 260) | defmodule InvalidPiggyback
  class UnchallengedPiggyback (line 277) | defmodule UnchallengedPiggyback

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor.ex
  class OMG.Watcher.ExitProcessor (line 15) | defmodule OMG.Watcher.ExitProcessor
    method start_link (line 54) | def start_link(args) do
    method new_exits (line 70) | def new_exits([]), do: {:ok, []}
    method new_exits (line 72) | def new_exits(exits) do
    method new_in_flight_exits (line 88) | def new_in_flight_exits([]), do: {:ok, []}
    method new_in_flight_exits (line 90) | def new_in_flight_exits(in_flight_exit_started_events) do
    method delete_in_flight_exits (line 102) | def delete_in_flight_exits([]), do: {:ok, []}
    method delete_in_flight_exits (line 104) | def delete_in_flight_exits(in_flight_exit_deleted_events) do
    method finalize_exits (line 120) | def finalize_exits([]), do: {:ok, []}
    method finalize_exits (line 122) | def finalize_exits(finalizations) do
    method piggyback_exits (line 135) | def piggyback_exits([]), do: {:ok, []}
    method piggyback_exits (line 137) | def piggyback_exits(piggybacks) do
    method challenge_exits (line 150) | def challenge_exits([]), do: {:ok, []}
    method challenge_exits (line 152) | def challenge_exits(challenges) do
    method new_ife_challenges (line 169) | def new_ife_challenges([]), do: {:ok, []}
    method new_ife_challenges (line 171) | def new_ife_challenges(challenges) do
    method respond_to_in_flight_exits_challenges (line 186) | def respond_to_in_flight_exits_challenges([]), do: {:ok, []}
    method respond_to_in_flight_exits_challenges (line 188) | def respond_to_in_flight_exits_challenges(responds) do
    method challenge_piggybacks (line 201) | def challenge_piggybacks([]), do: {:ok, []}
    method challenge_piggybacks (line 203) | def challenge_piggybacks(challenges) do
    method finalize_in_flight_exits (line 221) | def finalize_in_flight_exits([]), do: {:ok, []}
    method finalize_in_flight_exits (line 223) | def finalize_in_flight_exits(finalizations) do
    method check_validity (line 239) | def check_validity() do
    method check_validity (line 243) | def check_validity(timeout) do
    method get_active_in_flight_exits (line 251) | def get_active_in_flight_exits() do
    method get_competitor_for_ife (line 267) | def get_competitor_for_ife(txbytes) do
    method prove_canonical_for_ife (line 281) | def prove_canonical_for_ife(txbytes) do
    method get_input_challenge_data (line 293) | def get_input_challenge_data(txbytes, input_index) do
    method get_output_challenge_data (line 307) | def get_output_challenge_data(txbytes, output_index) do
    method create_challenge (line 319) | def create_challenge(exiting_utxo_pos) do
    method init (line 341) | def init(
    method handle_call (line 377) | def handle_call({:new_exits, exits}, _from, state) do
    method handle_call (line 401) | def handle_call({:new_in_flight_exits, exits}, _from, state) do
    method handle_call (line 428) | def handle_call({:delete_in_flight_exits, deletions}, _from, state) do
    method handle_call (line 439) | def handle_call({:finalize_exits, exits}, _from, state) do
    method handle_call (line 450) | def handle_call({:piggyback_exits, exits}, _from, state) do
    method handle_call (line 468) | def handle_call({:challenge_exits, exits}, _from, state) do
    method handle_call (line 474) | def handle_call({:new_ife_challenges, challenges}, _from, state) do
    method handle_call (line 483) | def handle_call({:challenge_piggybacks, challenges}, _from, state) do
    method handle_call (line 492) | def handle_call({:respond_to_in_flight_exits_challenges, responds}, _f...
    method handle_call (line 501) | def handle_call({:finalize_in_flight_exits, finalizations}, _from, sta...
    method handle_call (line 531) | def handle_call(:check_validity, _from, state) do
    method handle_call (line 542) | def handle_call(:get_active_in_flight_exits, _from, state) do
    method handle_call (line 546) | def handle_call({:get_competitor_for_ife, txbytes}, _from, state) do
    method handle_call (line 560) | def handle_call({:prove_canonical_for_ife, txbytes}, _from, state) do
    method handle_call (line 566) | def handle_call({:get_input_challenge_data, txbytes, input_index}, _fr...
    method handle_call (line 575) | def handle_call({:get_output_challenge_data, txbytes, output_index}, _...
    method handle_call (line 586) | def handle_call({:create_challenge, exiting_utxo_pos}, _from, state) do
    method handle_info (line 600) | def handle_info(:send_metrics, state) do
    method fill_request_with_standard_challenge_data (line 605) | defp fill_request_with_standard_challenge_data(%ExitProcessor.Request{...
    method fill_request_with_spending_data (line 611) | defp fill_request_with_spending_data(request, state) do
    method update_with_ife_txs_from_blocks (line 622) | defp update_with_ife_txs_from_blocks(state) do
    method run_status_gets (line 638) | defp run_status_gets(%ExitProcessor.Request{eth_height_now: nil, blknu...
    method get_utxo_existence (line 646) | defp get_utxo_existence(%ExitProcessor.Request{utxos_to_check: positio...
    method get_ife_input_utxo_existence (line 649) | defp get_ife_input_utxo_existence(%ExitProcessor.Request{ife_input_utx...
    method do_utxo_exists? (line 652) | defp do_utxo_exists?(positions) do
    method get_spending_blocks (line 658) | defp get_spending_blocks(%ExitProcessor.Request{spends_to_get: positio...
    method get_ife_input_spending_blocks (line 662) | defp get_ife_input_spending_blocks(%ExitProcessor.Request{ife_input_sp...
    method do_get_spending_blocks (line 666) | defp do_get_spending_blocks(spent_positions_to_get) do
    method do_get_blocks (line 675) | defp do_get_blocks(blknums) do
    method do_get_spent_blknum (line 684) | defp do_get_spent_blknum(position) do
    method collect_invalidities_and_state_db_updates (line 688) | defp collect_invalidities_and_state_db_updates(
    method put_timestamp_and_sft (line 704) | defp put_timestamp_and_sft(
    method publish_internal_bus_events (line 727) | defp publish_internal_bus_events([], _), do: :ok

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/canonicity.ex
  class OMG.Watcher.ExitProcessor.Canonicity (line 15) | defmodule OMG.Watcher.ExitProcessor.Canonicity
    method get_ife_txs_with_competitors (line 73) | def get_ife_txs_with_competitors(state, known_txs_by_input, eth_height...
    method get_invalid_ife_challenges (line 107) | def get_invalid_ife_challenges(%Core{in_flight_exits: ifes}) do
    method get_competitor_for_ife (line 125) | def get_competitor_for_ife(
    method prove_canonical_for_ife (line 146) | def prove_canonical_for_ife(%Core{} = state, ife_txbytes) do
    method prepare_competitor_response (line 153) | defp prepare_competitor_response(
    method prepare_canonical_response (line 178) | defp prepare_canonical_response(%InFlightExitInfo{tx: tx, tx_seen_in_b...
    method maybe_calculate_proof (line 181) | defp maybe_calculate_proof(nil, _), do: <<>>
    method maybe_calculate_proof (line 183) | defp maybe_calculate_proof(Utxo.position(blknum, txindex, _), blocks) do
    method get_competitor (line 189) | defp get_competitor(known_txs_by_input, signed_ife_tx) do
    method check_viable_competitor (line 198) | defp check_viable_competitor(ife, utxo_pos),
    method check_is_invalidly_challenged (line 201) | defp check_is_invalidly_challenged(ife),

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/competitor_info.ex
  class OMG.Watcher.ExitProcessor.CompetitorInfo (line 15) | defmodule OMG.Watcher.ExitProcessor.CompetitorInfo
    method new (line 75) | def new(%{call_data: %{competing_tx: tx_bytes, competing_tx_input_inde...
    method do_new (line 78) | defp do_new(tx_bytes, competing_input_index, competing_input_signature...

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/core.ex
  class OMG.Watcher.ExitProcessor.Core (line 15) | defmodule OMG.Watcher.ExitProcessor.Core
    method init (line 119) | def init(
    method check_sla_margin (line 151) | def check_sla_margin(sla_margin, sla_margin_forced, min_exit_period_se...
    method check_sla_margin (line 153) | def check_sla_margin(sla_margin, true, min_exit_period_seconds, ethere...
    method check_sla_margin (line 161) | def check_sla_margin(sla_margin, false, min_exit_period_seconds, ether...
    method exit_key_by_exit_id (line 167) | def exit_key_by_exit_id(%__MODULE__{exit_ids: exit_ids}, exit_id), do:...
    method new_exits (line 177) | def new_exits(state, new_exits, exit_contract_statuses)
    method new_exits (line 183) | def new_exits(%__MODULE__{exits: exits, exit_ids: exit_ids} = state, n...
    method challenge_exits (line 205) | def challenge_exits(%__MODULE__{exits: exits} = state, challenges) do
    method get_positions_from_events (line 218) | defp get_positions_from_events(exits) do
    method new_in_flight_exits (line 228) | def new_in_flight_exits(state, new_ifes_events, contract_statuses)
    method new_in_flight_exits (line 234) | def new_in_flight_exits(%__MODULE__{in_flight_exits: ifes} = state, ne...
    method ife_db_updates (line 249) | defp ife_db_updates(%__MODULE__{in_flight_exits: ifes}, updated_ife_ke...
    method new_ife_challenges (line 265) | def new_ife_challenges(%__MODULE__{} = state, challenges_events) do
    method append_new_competitors (line 273) | defp append_new_competitors(%__MODULE__{competitors: competitors} = st...
    method respond_to_in_flight_exits_challenges (line 281) | def respond_to_in_flight_exits_challenges(%__MODULE__{} = state, respo...
    method challenge_piggybacks (line 286) | def challenge_piggybacks(%__MODULE__{} = state, challenges) do
    method consume_events (line 296) | defp consume_events(%__MODULE__{} = state, events, event_field_f, ife_...
    method process_reducing_events_f (line 307) | defp process_reducing_events_f(event_field_f, ife_f) do
    method do_determine_utxo_existence_to_get (line 353) | defp do_determine_utxo_existence_to_get(%__MODULE__{in_flight_exits: i...
    method determine_spends_to_get (line 383) | def determine_spends_to_get(
    method determine_ife_spends_to_get (line 413) | def determine_ife_spends_to_get(
    method handle_spent_blknum_result (line 437) | def handle_spent_blknum_result(spent_blknum_result, spent_positions_to...
    method get_ifes_to_piggyback (line 526) | defp get_ifes_to_piggyback(%__MODULE__{in_flight_exits: ifes}) do
    method prepare_available_piggyback (line 534) | defp prepare_available_piggyback(%InFlightExitInfo{tx: signed_tx} = if...
    method get_active_in_flight_exits (line 567) | def get_active_in_flight_exits(%__MODULE__{in_flight_exits: ifes}) do
    method active_standard_exiting_utxos (line 577) | def active_standard_exiting_utxos(db_exits) do
    method active_in_flight_exiting_inputs (line 589) | def active_in_flight_exiting_inputs(db_exits) do
    method prepare_in_flight_exit (line 597) | defp prepare_in_flight_exit({txhash, ife_info}) do
    method find_ifes_in_blocks (line 613) | def find_ifes_in_blocks(
    method zero_address? (line 638) | defp zero_address?(address) do
    method sla_margin_safe? (line 642) | defp sla_margin_safe?(exit_processor_sla_margin, min_exit_period_secon...
    method delete_in_flight_exits (line 649) | def delete_in_flight_exits(state, deletions) do

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/double_spend.ex
  class OMG.Watcher.ExitProcessor.DoubleSpend (line 15) | defmodule OMG.Watcher.ExitProcessor.DoubleSpend
    method find_competitor (line 40) | def find_competitor(known_txs_by_input, tx) do
    method all_double_spends_by_index (line 65) | def all_double_spends_by_index(indexed_utxo_positions, known_txs_by_in...
    method all_distinct_spends_of_inputs (line 76) | defp all_distinct_spends_of_inputs(known_txs_by_input, inputs, tx) do

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/exit_info.ex
  class OMG.Watcher.ExitProcessor.ExitInfo (line 15) | defmodule OMG.Watcher.ExitProcessor.ExitInfo
    method new (line 62) | def new(
    method new_key (line 91) | def new_key(_contract_status, exit_info),
    method utxo_pos_for (line 94) | defp utxo_pos_for(%{call_data: %{utxo_pos: utxo_pos_enc}} = _exit_info),
    method do_new (line 98) | defp do_new(contract_status, fields) do
    method make_event_data (line 104) | def make_event_data(type, position, exit_info) do
    method make_db_update (line 113) | def make_db_update({position, exit_info}) do
    method from_db_kv (line 131) | def from_db_kv({db_utxo_pos, exit_info}) do
    method parse_contract_exit_status (line 155) | defp parse_contract_exit_status({exitable, _, _, _, _, _}), do: exitable
    method calculate_sft (line 172) | def calculate_sft(blknum, exit_block_timestamp, utxo_creation_timestam...

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/finalizations.ex
  class OMG.Watcher.ExitProcessor.Finalizations (line 15) | defmodule OMG.Watcher.ExitProcessor.Finalizations
    method finalize_exits (line 51) | def finalize_exits(%Core{exits: exits} = state, {valid_finalizations, ...
    method activate_on_invalid_finalization (line 68) | defp activate_on_invalid_finalization(%Core{exits: exits} = state, inv...
    method prepare_utxo_exits_for_in_flight_exit_finalizations (line 97) | def prepare_utxo_exits_for_in_flight_exit_finalizations(%Core{in_fligh...
    method ife_id_to_binary (line 116) | defp ife_id_to_binary(finalization),
    method get_all_finalized_ifes_by_ife_contract_id (line 119) | defp get_all_finalized_ifes_by_ife_contract_id(finalizations, ifes) do
    method known_piggybacks? (line 144) | defp known_piggybacks?(finalizations, ifes_by_id) do
    method finalization_not_piggybacked? (line 153) | defp finalization_not_piggybacked?(
    method combine_utxo_exits_with_finalization (line 159) | defp combine_utxo_exits_with_finalization(
    method get_exiting_positions (line 178) | defp get_exiting_positions(ife, output_index, :input) do
    method get_exiting_positions (line 184) | defp get_exiting_positions(ife, output_index, :output) do
    method finalize_in_flight_exits (line 203) | def finalize_in_flight_exits(%Core{in_flight_exits: ifes} = state, fin...
    method finalize_single_exit (line 232) | defp finalize_single_exit(
    method activate_on_invalid_utxo_exits (line 250) | defp activate_on_invalid_utxo_exits({ifes_by_id, updated_ifes}, invali...

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/in_flight_exit_info.ex
  class OMG.Watcher.ExitProcessor.InFlightExitInfo (line 15) | defmodule OMG.Watcher.ExitProcessor.InFlightExitInfo
    method new_kv (line 102) | def new_kv(
    method do_new (line 122) | defp do_new(tx_bytes, tx_signatures, contract_status, fields) do
    method parse_contract_in_flight_exit_status (line 144) | defp parse_contract_in_flight_exit_status({_, timestamp, _, _, _, _, _...
    method prepare_tx (line 146) | defp prepare_tx(tx_bytes, tx_signatures) do
    method get_input_utxos (line 200) | def get_input_utxos(in_flight_exits) do
    method assert_utxo_pos_type (line 210) | defp assert_utxo_pos_type(nil), do: :ok
    method assert_utxo_pos_type (line 213) | defp assert_utxo_pos_type(:no_position), do: :ok
    method from_db_kv (line 215) | def from_db_kv({ife_hash, fields}) do
    method assert_types (line 244) | defp assert_types(fields, keys, assertion) do
    method piggyback (line 273) | def piggyback(ife, index)
    method piggyback (line 282) | def piggyback(%__MODULE__{}, _), do: {:error, :non_existent_exit}
    method piggyback_exit (line 284) | defp piggyback_exit(%{is_piggybacked: false, is_finalized: false, is_c...
    method piggyback_exit (line 287) | defp piggyback_exit(_), do: {:error, :cannot_piggyback}
    method challenge (line 290) | def challenge(ife, competitor_position)
    method challenge (line 292) | def challenge(%__MODULE__{oldest_competitor: nil} = ife, competitor_po...
    method challenge (line 295) | def challenge(%__MODULE__{oldest_competitor: current_oldest} = ife, co...
    method respond_to_challenge (line 314) | def respond_to_challenge(ife, tx_position)
    method respond_to_challenge (line 316) | def respond_to_challenge(%__MODULE__{oldest_competitor: current_oldest...
    method respond_to_challenge (line 326) | def respond_to_challenge(%__MODULE__{}, _), do: {:error, :cannot_respond}
    method get_active_output_piggybacks_positions (line 350) | def get_active_output_piggybacks_positions(%__MODULE__{tx_seen_in_bloc...
    method get_active_output_piggybacks_positions (line 352) | def get_active_output_piggybacks_positions(
    method unchallenged_piggybacks_by_ife (line 360) | def unchallenged_piggybacks_by_ife(%__MODULE__{tx: tx} = ife, :input) do
    method unchallenged_piggybacks_by_ife (line 370) | def unchallenged_piggybacks_by_ife(%__MODULE__{} = ife, :output) do
    method index_output_position (line 379) | defp index_output_position(position) do
    method actively_piggybacked_inputs (line 384) | def actively_piggybacked_inputs(ife) do
    method actively_piggybacked_outputs (line 389) | def actively_piggybacked_outputs(ife) do
    method is_active? (line 395) | def is_active?(%__MODULE__{} = ife, combined_index) do
    method is_unchallenged? (line 402) | def is_unchallenged?(%__MODULE__{} = ife, combined_index) do
    method activate (line 407) | def activate(%__MODULE__{} = ife) do
    method should_be_seeked_in_blocks? (line 411) | def should_be_seeked_in_blocks?(%__MODULE__{} = ife),
    method is_invalidly_challenged? (line 421) | def is_invalidly_challenged?(%__MODULE__{is_canonical: true}), do: false
    method is_invalidly_challenged? (line 422) | def is_invalidly_challenged?(%__MODULE__{tx_seen_in_blocks_at: nil}), ...
    method is_invalidly_challenged? (line 424) | def is_invalidly_challenged?(%__MODULE__{
    method to_contract_id (line 434) | def to_contract_id(id), do: <<id::192>>
    method is_viable_competitor? (line 441) | def is_viable_competitor?(
    method is_viable_competitor? (line 447) | def is_viable_competitor?(
    method is_relevant? (line 453) | def is_relevant?(%__MODULE__{relevant_from_blknum: relevant_from_blknu...
    method is_finalized? (line 466) | defp is_finalized?(%__MODULE__{exit_map: map}, combined_index) do
    method is_challenged? (line 475) | defp is_challenged?(%__MODULE__{exit_map: map}, combined_index) do
    method do_is_viable_competitor? (line 484) | defp do_is_viable_competitor?(nil, nil, _competitor_pos), do: true
    method do_is_viable_competitor? (line 486) | defp do_is_viable_competitor?(_seen_at_pos, _oldest_pos, nil), do: false
    method do_is_viable_competitor? (line 488) | defp do_is_viable_competitor?(nil, oldest_pos, competitor_pos), do: is...
    method do_is_viable_competitor? (line 490) | defp do_is_viable_competitor?(seen_at_pos, nil, competitor_pos), do: i...
    method do_is_viable_competitor? (line 492) | defp do_is_viable_competitor?(seen_at_pos, oldest_pos, competitor_pos),
    method is_older? (line 496) | defp is_older?(Utxo.position(_, _, _), :no_position), do: true
    method is_older? (line 498) | defp is_older?(:no_position, Utxo.position(_, _, _)), do: false
    method is_older? (line 500) | defp is_older?(Utxo.position(tx1_blknum, tx1_index, _), Utxo.position(...
    method decode_position_possibly_exceeding (line 504) | defp decode_position_possibly_exceeding(encoded_position) do

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/known_tx.ex
  class OMG.Watcher.ExitProcessor.KnownTx (line 15) | defmodule OMG.Watcher.ExitProcessor.KnownTx
    method new (line 38) | def new(%Transaction.Signed{} = signed_tx, Utxo.position(_, _, _) = ut...
    method new (line 41) | def new(%Transaction.Signed{} = signed_tx),
    method get_positions_by_txhash (line 44) | def get_positions_by_txhash(blocks) do
    method get_blocks_by_blknum (line 52) | def get_blocks_by_blknum(blocks),
    method find_tx_in_blocks (line 55) | def find_tx_in_blocks(txhash, positions_by_tx_hash, blocks_by_blknum) do
    method group_txs_by_input (line 71) | def group_txs_by_input(all_known_txs) do
    method get_all_from_blocks_appendix (line 80) | def get_all_from_blocks_appendix(blocks, %Core{} = processor) do
    method get_all_from (line 86) | defp get_all_from(%Core{} = processor) do
    method get_all_from (line 91) | defp get_all_from(%Block{transactions: txs, number: blknum}) do
    method sort_blocks (line 101) | defp sort_blocks(blocks), do: blocks |> Enum.sort_by(fn %Block{number:...
    method is_older? (line 103) | def is_older?(%__MODULE__{utxo_pos: utxo_pos1}, %__MODULE__{utxo_pos: ...

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/measure.ex
  class OMG.Watcher.ExitProcessor.Measure (line 15) | defmodule OMG.Watcher.ExitProcessor.Measure
    method handle_event (line 25) | def handle_event([:process, ExitProcessor], _, _state, _config) do

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/piggyback.ex
  class OMG.Watcher.ExitProcessor.Piggyback (line 15) | defmodule OMG.Watcher.ExitProcessor.Piggyback
    method get_input_challenge_data (line 75) | def get_input_challenge_data(request, state, txbytes, input_index) do
    method get_output_challenge_data (line 82) | def get_output_challenge_data(request, state, txbytes, output_index) do
    method get_invalid_piggybacks_events (line 95) | def get_invalid_piggybacks_events(
    method all_invalid_piggybacks_by_ife (line 119) | defp all_invalid_piggybacks_by_ife(ifes_values, known_txs_by_input) do
    method to_events (line 124) | defp to_events(piggybacks_by_ife, to_event) do
    method to_invalid_piggyback_event (line 130) | defp to_invalid_piggyback_event({txbytes, type_materials_pairs}) do
    method to_unchallenged_piggyback_event (line 138) | defp to_unchallenged_piggyback_event({txbytes, type_materials_pairs}) do
    method group_by_txbytes (line 147) | defp group_by_txbytes(invalid_piggybacks) do
    method invalid_piggyback_indices (line 153) | defp invalid_piggyback_indices(type_materials_pairs, pb_type) do
    method invalid_piggybacks_by_ife (line 163) | defp invalid_piggybacks_by_ife(known_txs_by_input, pb_type, ifes) do
    method ife_has_something? (line 176) | defp ife_has_something?({_ife, finds_for_ife}), do: !Enum.empty?(finds...
    method ife_has_something? (line 177) | defp ife_has_something?({_ife, _, finds_for_ife}), do: !Enum.empty?(fi...
    method get_piggyback_challenge_data (line 181) | defp get_piggyback_challenge_data(%ExitProcessor.Request{blocks_result...
    method produce_invalid_piggyback_proof (line 191) | defp produce_invalid_piggyback_proof(ife, known_txs_by_input, {pb_type...
    method get_proofs_for_particular_ife (line 199) | defp get_proofs_for_particular_ife(ife, pb_type, known_txs_by_input) do
    method get_proof_for_particular_piggyback (line 209) | defp get_proof_for_particular_piggyback(pb_index, proof_materials) do
    method prepare_piggyback_challenge_response (line 221) | defp prepare_piggyback_challenge_response(ife, {:input, input_index}, ...
    method prepare_piggyback_challenge_response (line 233) | defp prepare_piggyback_challenge_response(ife, {:output, _output_index...

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/request.ex
  class OMG.Watcher.ExitProcessor.Request (line 15) | defmodule OMG.Watcher.ExitProcessor.Request

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/standard_exit.ex
  class OMG.Watcher.ExitProcessor.StandardExit (line 15) | defmodule OMG.Watcher.ExitProcessor.StandardExit
    method exiting_positions (line 58) | def exiting_positions(%Core{} = state) do
    method get_invalid (line 69) | def get_invalid(%Core{sla_margin: sla_margin} = state, utxo_exists?, e...
    method spending_txhash_for_exit_at (line 102) | defp spending_txhash_for_exit_at(utxo_pos) do
    method do_get_blocks (line 119) | defp do_get_blocks(blknums) do
    method determine_standard_challenge_queries (line 132) | def determine_standard_challenge_queries(
    method ensure_challengeable (line 178) | defp ensure_challengeable(spending_blknum_response, ife_response)
    method ensure_challengeable (line 180) | defp ensure_challengeable([%Block{} = block], _), do: {:ok, block}
    method ensure_challengeable (line 182) | defp ensure_challengeable(_, _), do: {:error, :utxo_not_spent}
    method get_ife_based_on_utxo (line 185) | defp get_ife_based_on_utxo(Utxo.position(_, _, _) = utxo_pos, %Core{} ...
    method get_double_spend_for_standard_exit (line 198) | defp get_double_spend_for_standard_exit(%Block{transactions: txs}, utx...
    method get_double_spend_for_standard_exit (line 204) | defp get_double_spend_for_standard_exit(%KnownTx{} = known_tx, utxo_po...
    method get_invalid_exits_based_on_ifes (line 211) | defp get_invalid_exits_based_on_ifes(tx_appendix, active_exits) do
    method get_double_spends_by_utxo_pos (line 229) | defp get_double_spends_by_utxo_pos(Utxo.position(_, _, oindex) = utxo_...
    method get_ife_txs_by_spent_input (line 233) | defp get_ife_txs_by_spent_input(tx_appendix) do
    method get_exit (line 239) | defp get_exit(exits, exiting_pos) do
    method active_exits (line 246) | defp active_exits(%Core{exits: exits}),
  class Challenge (line 22) | defmodule Challenge

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/tools.ex
  class OMG.Watcher.ExitProcessor.Tools (line 15) | defmodule OMG.Watcher.ExitProcessor.Tools
    method only_utxos_checked_and_missing (line 49) | def only_utxos_checked_and_missing(utxo_positions, utxo_exists?) do
    method find_sig (line 58) | def find_sig(%Transaction.Signed{sigs: sigs, raw_tx: raw_tx}, owner) do
    method find_sig! (line 77) | def find_sig!(tx, owner) do
    method txs_different (line 82) | def txs_different(tx1, tx2), do: Transaction.raw_txhash(tx1) != Transa...
    method get_ife (line 84) | def get_ife(ife_tx, ifes) do
    method to_bus_events_data (line 102) | def to_bus_events_data(eth_events_with_exiting_utxos) do
    method to_bus_events_reducer (line 106) | defp to_bus_events_reducer(
    method to_bus_events_reducer (line 127) | defp to_bus_events_reducer(%{omg_data: %{piggyback_type: :input}}, bus...
    method to_bus_events_reducer (line 132) | defp to_bus_events_reducer(

FILE: apps/omg_watcher/lib/omg_watcher/exit_processor/tx_appendix.ex
  class OMG.Watcher.ExitProcessor.TxAppendix (line 15) | defmodule OMG.Watcher.ExitProcessor.TxAppendix
    method get_all (line 30) | def get_all(%ExitProcessor.Core{in_flight_exits: ifes, competitors: co...

FILE: apps/omg_watcher/lib/omg_watcher/fees.ex
  class OMG.Watcher.Fees (line 15) | defmodule OMG.Watcher.Fees
    method check_if_covered (line 82) | def check_if_covered(_, :ignore_fees), do: :ok
    method check_if_covered (line 86) | def check_if_covered(implicit_paid_fee_by_currency, accepted_fees) do
    method check_positive_amounts (line 94) | defp check_positive_amounts([], :no_fees_required), do: :ok
    method check_positive_amounts (line 95) | defp check_positive_amounts(_, :no_fees_required), do: {:error, :overp...
    method check_positive_amounts (line 98) | defp check_positive_amounts([], _), do: {:error, :fees_not_covered}
    method check_positive_amounts (line 102) | defp check_positive_amounts([{currency, paid_fee}], accepted_fees) do
    method check_positive_amounts (line 112) | defp check_positive_amounts(_, _), do: {:error, :multiple_potential_cu...
    method remove_zero_fees (line 114) | defp remove_zero_fees(implicit_paid_fee_by_currency) do
    method check_if_exact_match (line 120) | defp check_if_exact_match([current_amount | _] = amounts, paid_fee) do
    method for_transaction (line 159) | def for_transaction(transaction, fee_map) do
    method get_fee_for_type (line 166) | defp get_fee_for_type(%Transaction.Recovered{signed_tx: %Transaction.S...
    method get_fee_for_type (line 173) | defp get_fee_for_type(_, _fee_map), do: %{}

FILE: apps/omg_watcher/lib/omg_watcher/fees/fee_filter.ex
  class OMG.Watcher.Fees.FeeFilter (line 15) | defmodule OMG.Watcher.Fees.FeeFilter
    method filter (line 92) | def filter(fees, []), do: {:ok, fees}
    method filter (line 93) | def filter(fees, nil), do: {:ok, fees}
    method filter (line 95) | def filter(fees, tx_types, currencies) do
    method filter_tx_type (line 101) | defp filter_tx_type(fees, []), do: {:ok, fees}
    method filter_tx_type (line 102) | defp filter_tx_type(fees, nil), do: {:ok, fees}
    method filter_tx_type (line 104) | defp filter_tx_type(fees, tx_types) do
    method validate_tx_types (line 108) | defp validate_tx_types(tx_types, fees) do
    method filter_currency (line 117) | defp filter_currency(fees, []), do: {:ok, fees}
    method filter_currency (line 118) | defp filter_currency(fees, nil), do: {:ok, fees}
    method filter_currency (line 120) | defp filter_currency(fees, currencies) do
    method validate_currencies (line 126) | defp validate_currencies(currencies, fees) do
    method do_filter_currencies (line 135) | defp do_filter_currencies(currencies, fees) do

FILE: apps/omg_watcher/lib/omg_watcher/http_rpc/adapter.ex
  class OMG.Watcher.HttpRPC.Adapter (line 15) | defmodule OMG.Watcher.HttpRPC.Adapter
    method rpc_post (line 27) | def rpc_post(body, path, url) do
    method get_unparsed_response_body (line 45) | def get_unparsed_response_body({:ok, %HTTPoison.Response{} = response}),
    method get_unparsed_response_body (line 48) | def get_unparsed_response_body(%HTTPoison.Response{status_code: 200, b...
    method get_unparsed_response_body (line 51) | def get_unparsed_response_body(%HTTPoison.Response{body: error}),
    method get_unparsed_response_body (line 54) | def get_unparsed_response_body({:error, %HTTPoison.Error{reason: :econ...
    method get_unparsed_response_body (line 58) | def get_unparsed_response_body({:error, %HTTPoison.Error{reason: reaso...
    method get_unparsed_response_body (line 62) | def get_unparsed_response_body(error), do: error
    method get_response_body (line 70) | def get_response_body(http_response) do

FILE: apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex
  class OMG.Watcher.HttpRPC.Client (line 15) | defmodule OMG.Watcher.HttpRPC.Client
    method get_block (line 36) | def get_block(hash, url), do: call(%{hash: Encoding.to_hex(hash)}, "bl...
    method submit (line 42) | def submit(tx, url), do: call(%{transaction: Encoding.to_hex(tx)}, "tr...
    method batch_submit (line 48) | def batch_submit(txs, url) do
    method call (line 52) | defp call(params, path, url) do
    method decode_response (line 57) | defp decode_response({:ok, %{transactions: transactions, blknum: numbe...
    method decode_response (line 66) | defp decode_response({:ok, %{txhash: _hash} = response}) do
    method decode_response (line 74) | defp decode_response(error), do: error
    method decode_response (line 76) | defp decode_response([], acc) do
    method decode_response (line 80) | defp decode_response([%{txhash: _hash} = transaction_response | respon...
    method decode_response (line 85) | defp decode_response([%{error: error} | response], acc) do
    method decode16! (line 89) | defp decode16!(hexstr) do

FILE: apps/omg_watcher/lib/omg_watcher/merge_transaction_validator.ex
  class OMG.Watcher.MergeTransactionValidator (line 15) | defmodule OMG.Watcher.MergeTransactionValidator
    method is_merge_transaction? (line 31) | def is_merge_transaction?(recovered_transaction) do
    method is_payment? (line 42) | defp is_payment?(%Transaction.Recovered{signed_tx: %{raw_tx: %Transact...
    method is_payment? (line 43) | defp is_payment?(_), do: false
    method only_fungible_tokens? (line 45) | defp only_fungible_tokens?(tx),
    method has_same_account? (line 48) | defp has_same_account?(%Transaction.Recovered{witnesses: witnesses} = ...
    method has_single_currency? (line 58) | defp has_single_currency?(tx) do
    method has_less_outputs_than_inputs? (line 65) | defp has_less_outputs_than_inputs?(tx) do
    method has_less_outputs_than_inputs? (line 72) | defp has_less_outputs_than_inputs?(inputs, outputs), do: length(inputs...
    method single? (line 74) | defp single?(list), do: 1 == list |> Enum.uniq() |> length()

FILE: apps/omg_watcher/lib/omg_watcher/merkle.ex
  class OMG.Watcher.Merkle (line 15) | defmodule OMG.Watcher.Merkle
    method create_tx_proof (line 28) | def create_tx_proof(txs_bytes, txindex) do
    method hash (line 36) | def hash(hashed_txs) do
    method build (line 44) | defp build(txs_bytes) do
    method prove (line 52) | defp prove(tx_bytes, txindex) do

FILE: apps/omg_watcher/lib/omg_watcher/monitor.ex
  class OMG.Watcher.Monitor (line 15) | defmodule OMG.Watcher.Monitor
    method health_checkin (line 41) | def health_checkin() do
    method start_link (line 45) | def start_link(args) do
    method init (line 49) | def init([alarm_module, child_spec]) do
    method init (line 59) | def init(_args) do
    method handle_call (line 66) | def handle_call(_request, state), do: {:ok, :ok, state}
    method handle_event (line 68) | def handle_event({:clear_alarm, {:ethereum_connection_error, _}}, stat...
    method handle_event (line 75) | def handle_event(event, state) do
    method handle_info (line 83) | def handle_info({:EXIT, _from, reason}, state) do
    method handle_cast (line 91) | def handle_cast(:health_checkin, state) do
    method handle_cast (line 98) | def handle_cast(:start_child, state) do
    method start_child (line 105) | defp start_child(%{id: _name, start: {child_module, function, args}} =...
    method start_child (line 110) | defp start_child(%Child{pid: pid, spec: spec} = child) do
    method subscribe_to_alarms (line 122) | defp subscribe_to_alarms() do
  class Child (line 22) | defmodule Child

FILE: apps/omg_watcher/lib/omg_watcher/output.ex
  class OMG.Output (line 15) | defmodule OMG.Output
    method reconstruct (line 51) | def reconstruct(_rlp_data)
    method reconstruct (line 63) | def reconstruct([_raw_type, [_owner, _currency, _amount]]), do: {:erro...
    method reconstruct (line 64) | def reconstruct(_), do: {:error, :malformed_outputs}
    method get_data_for_rlp (line 76) | def get_data_for_rlp(%__MODULE__{owner: owner, currency: currency, amo...
    method clean_and_validate_data (line 81) | defp clean_and_validate_data([raw_type, [owner, currency, amount]]) do
    method non_zero_owner? (line 91) | defp non_zero_owner?(<<0::160>>), do: {:error, :output_guard_cant_be_z...
    method non_zero_owner? (line 92) | defp non_zero_owner?(_), do: {:ok, :valid}
    method valid_output_type? (line 95) | defp valid_output_type?(_), do: {:error, :unrecognized_output_type}

FILE: apps/omg_watcher/lib/omg_watcher/raw_data.ex
  class OMG.Watcher.RawData (line 15) | defmodule OMG.Watcher.RawData
    method parse_address (line 45) | def parse_address(binary)
    method parse_address (line 46) | def parse_address(<<_::160>> = address_bytes), do: {:ok, address_bytes}
    method parse_address (line 47) | def parse_address(_), do: {:error, :malformed_address}
    method parse_uint256 (line 54) | def parse_uint256(<<0>> <> _binary), do: {:error, :leading_zeros_in_en...
    method parse_uint256 (line 57) | def parse_uint256(_), do: {:error, :malformed_uint256}

FILE: apps/omg_watcher/lib/omg_watcher/release_tasks/set_application.ex
  class OMG.Watcher.ReleaseTasks.SetApplication (line 15) | defmodule OMG.Watcher.ReleaseTasks.SetApplication
    method init (line 19) | def init(args) do
    method load (line 23) | def load(config, release: release, current_version: current_version) do

FILE: apps/omg_watcher/lib/omg_watcher/release_tasks/set_ethereum_events_check_interval.ex
  class OMG.Watcher.ReleaseTasks.SetEthereumEventsCheckInterval (line 15) | defmodule OMG.Watcher.ReleaseTasks.SetEthereumEventsCheckInterval
    method init (line 27) | def init(args) do
    method load (line 31) | def load(config, _args) do
    method get_interval_ms (line 39) | defp get_interval_ms() do
    method get_env (line 49) | defp get_env(key), do: System.get_env(key)
    method validate_integer (line 52) | defp validate_integer(_, default), do: default
    method on_load (line 54) | def on_load() do

FILE: apps/omg_watcher/lib/omg_watcher/release_tasks/set_exit_processor_sla_margin.ex
  class OMG.Watcher.ReleaseTasks.SetExitProcessorSLAMargin (line 15) | defmodule OMG.Watcher.ReleaseTasks.SetExitProcessorSLAMargin
    method init (line 27) | def init(args) do
    method load (line 31) | def load(config, _args) do
    method get_exit_processor_sla_margin (line 42) | defp get_exit_processor_sla_margin() do
    method get_exit_processor_sla_forced (line 48) | defp get_exit_processor_sla_forced() do
    method get_env (line 54) | defp get_env(key), do: System.get_env(key)
    method validate_int (line 57) | defp validate_int(_, default), do: default
    method validate_bool (line 60) | defp validate_bool(_, default), do: default
    method to_bool (line 62) | defp to_bool("TRUE"), do: true
    method to_bool (line 63) | defp to_bool("FALSE"), do: false
    method to_bool (line 64) | defp to_bool(_), do: exit("#{@system_env_name_force} either true or fa...
    method to_int (line 66) | defp to_int(value) do

FILE: apps/omg_watcher/lib/omg_watcher/release_tasks/set_tracer.ex
  class OMG.Watcher.ReleaseTasks.SetTracer (line 15) | defmodule OMG.Watcher.ReleaseTasks.SetTracer
    method init (line 21) | def init(args) do
    method load (line 25) | def load(config, args) do
    method get_dd_disabled (line 49) | defp get_dd_disabled() do
    method get_app_env (line 57) | defp get_app_env() do
    method get_env (line 63) | defp get_env(key) do
    method validate_bool (line 68) | defp validate_bool(_, default), do: default
    method to_bool (line 70) | defp to_bool("TRUE"), do: true
    method to_bool (line 71) | defp to_bool("FALSE"), do: false
    method to_bool (line 72) | defp to_bool(_), do: exit("DD_DISABLED either true or false.")
    method validate_app_env (line 75) | defp validate_app_env(nil), do: exit("APP_ENV must be set.")
    method on_load (line 77) | defp on_load() do

FILE: apps/omg_watcher/lib/omg_watcher/root_chain_coordinator.ex
  class OMG.Watcher.RootChainCoordinator (line 14) | defmodule OMG.Watcher.RootChainCoordinator
    method start_link (line 44) | def start_link(configs_services) do
    method check_in (line 54) | def check_in(synced_height, service_name) do
    method get_sync_info (line 63) | def get_sync_info() do
    method get_ethereum_heights (line 71) | def get_ethereum_heights() do
    method init (line 75) | def init({args, configs_services}) do
    method handle_info (line 94) | def handle_info(:send_metrics, state) do
    method handle_info (line 99) | def handle_info(:update_root_chain_height, state) do
    method handle_call (line 105) | def handle_call({:check_in, synced_height, service_name}, {pid, _ref},...
    method handle_call (line 112) | def handle_call(:get_sync_info, {pid, _}, state) do
    method handle_call (line 116) | def handle_call(:get_ethereum_heights, _from, state) do
    method schedule_get_ethereum_height (line 120) | defp schedule_get_ethereum_height(interval) do
    method request_sync (line 124) | defp request_sync(services) do
    method safe_send (line 128) | defp safe_send(registered_name_or_pid, msg) do
  class SyncGuide (line 27) | defmodule SyncGuide

FILE: apps/omg_watcher/lib/omg_watcher/root_chain_coordinator/core.ex
  class OMG.Watcher.RootChainCoordinator.Core (line 14) | defmodule OMG.Watcher.RootChainCoordinator.Core
    method init (line 68) | def init(configs_services, root_chain_height) do
    method get_ethereum_heights (line 136) | def get_ethereum_heights(%__MODULE__{root_chain_height: root_chain_hei...
    method finality_margin_for (line 141) | defp finality_margin_for(config), do: Keyword.get(config, :finality_ma...
    method finality_margin_for! (line 142) | defp finality_margin_for!(config), do: Keyword.fetch!(config, :finalit...
    method consider_finality (line 145) | defp consider_finality(sync_height, config, root_chain_height),
    method get_height_of_awaited (line 149) | defp get_height_of_awaited([], %__MODULE__{root_chain_height: root_cha...
    method get_height_of_awaited (line 157) | defp get_height_of_awaited({single_awaited, :no_margin}, %__MODULE__{c...
    method get_height_of_awaited (line 161) | defp get_height_of_awaited(awaited, state),
    method all_services_checked_in? (line 165) | defp all_services_checked_in?(%__MODULE__{configs_services: configs_se...
    method allowed? (line 170) | defp allowed?(configs_services, service_name), do: Map.has_key?(config...
    method update_service_synced_height (line 172) | defp update_service_synced_height(state, pid, new_reported_sync_height...

FILE: apps/omg_watcher/lib/omg_watcher/root_chain_coordinator/measure.ex
  class OMG.Watcher.RootChainCoordinator.Measure (line 15) | defmodule OMG.Watcher.RootChainCoordinator.Measure
    method handle_event (line 25) | def handle_event([:process, RootChainCoordinator], _, state, _config) do

FILE: apps/omg_watcher/lib/omg_watcher/root_chain_coordinator/service.ex
  class OMG.Watcher.RootChainCoordinator.Service (line 14) | defmodule OMG.Watcher.RootChainCoordinator.Service

FILE: apps/omg_watcher/lib/omg_watcher/signature.ex
  class OMG.Watcher.Signature (line 15) | defmodule OMG.Watcher.Signature
    method recover_public (line 58) | def recover_public(hash, v, r, s, chain_id \\ nil) do
    method recover_public (line 94) | def recover_public(hash, <<r::integer-size(256), s::integer-size(256),...
    method uses_chain_id? (line 99) | defp uses_chain_id?(v) do
    method pad (line 104) | defp pad(binary, desired_length) do

FILE: apps/omg_watcher/lib/omg_watcher/state.ex
  class OMG.Watcher.State (line 15) | defmodule OMG.Watcher.State
    method start_link (line 54) | def start_link(opts) do
    method exec (line 68) | def exec(tx, input_fees) do
    method close_block (line 81) | def close_block() do
    method deposit (line 92) | def deposit([]), do: {:ok, []}
    method deposit (line 94) | def deposit(deposits) do
    method exit_utxos (line 109) | def exit_utxos([]), do: {:ok, [], {[], []}}
    method exit_utxos (line 111) | def exit_utxos(exiting_utxo_triggers) do
    method utxo_exists? (line 119) | def utxo_exists?(utxo) do
    method get_status (line 130) | def get_status() do
    method init (line 139) | def init(opts) do
    method handle_info (line 155) | def handle_info(:send_metrics, state) do
    method handle_call (line 177) | def handle_call({:exec, tx, fees}, _from, state) do
    method handle_call (line 195) | def handle_call({:deposit, deposits}, _from, state) do
    method handle_call (line 205) | def handle_call({:exit_utxos, exiting_utxo_triggers}, _from, state) do
    method handle_call (line 216) | def handle_call({:utxo_exists, utxo_pos}, _from, state) do
    method handle_call (line 223) | def handle_call(:get_status, _from, state) do
    method handle_call (line 227) | def handle_call(:close_block, _from, state) do
    method publish_block_to_event_bus (line 234) | defp publish_block_to_event_bus(block) do
    method fetch_utxos_from_db (line 241) | defp fetch_utxos_from_db(utxo_pos_list, state) do
    method utxo_from_db (line 248) | defp utxo_from_db(input_pointer) do

FILE: apps/omg_watcher/lib/omg_watcher/state/core.ex
  class OMG.Watcher.State.Core (line 15) | defmodule OMG.Watcher.State.Core
    method extract_initial_state (line 162) | def extract_initial_state(:not_found, _child_block_interval, _fee_clai...
    method utxo_processed? (line 170) | def utxo_processed?(utxo_pos, %Core{utxos: utxos, recently_spent: rece...
    method with_utxos (line 179) | def with_utxos(%Core{utxos: utxos} = state, db_utxos) do
    method exec (line 193) | def exec(%Core{} = state, %Transaction.Recovered{} = tx, fees) do
    method standard_exitable_utxos (line 215) | def standard_exitable_utxos(utxos_query_result, address) do
    method form_block (line 230) | def form_block(state) do
    method deposit (line 262) | def deposit(deposits, %Core{utxos: utxos} = state) do
    method extract_exiting_utxo_positions (line 286) | def extract_exiting_utxo_positions(exit_infos, state)
    method extract_exiting_utxo_positions (line 288) | def extract_exiting_utxo_positions([], %Core{}), do: []
    method extract_exiting_utxo_positions (line 291) | def extract_exiting_utxo_positions([%{utxo_pos: _} | _] = utxo_positio...
    method extract_exiting_utxo_positions (line 295) | def extract_exiting_utxo_positions([%{call_data: %{utxo_pos: _}} | _] ...
    method extract_exiting_utxo_positions (line 304) | def extract_exiting_utxo_positions([%{call_data: %{in_flight_tx: _}} |...
    method extract_exiting_utxo_positions (line 314) | def extract_exiting_utxo_positions(
    method extract_exiting_utxo_positions (line 324) | def extract_exiting_utxo_positions(
    method extract_exiting_utxo_positions (line 337) | def extract_exiting_utxo_positions([Utxo.position(_, _, _) | _] = utxo...
    method exit_utxos (line 345) | def exit_utxos([], %Core{} = state), do: {:ok, {[], {[], []}}, state}
    method exit_utxos (line 347) | def exit_utxos(
    method utxo_exists? (line 368) | def utxo_exists?(Utxo.position(_blknum, _txindex, _oindex) = utxo_pos,...
    method get_status (line 376) | def get_status(%__MODULE__{height: height, tx_index: tx_index, pending...
    method add_pending_tx (line 381) | defp add_pending_tx(%Core{pending_txs: pending_txs, tx_index: tx_index...
    method apply_tx (line 391) | defp apply_tx(
    method handle_fees (line 417) | defp handle_fees(state, %Transaction.Recovered{signed_tx: %{raw_tx: %T...
    method handle_fees (line 425) | defp handle_fees(state, _tx, fees_paid) do
    method utxo_to_exitable_utxo_map (line 431) | defp utxo_to_exitable_utxo_map(%Utxo{output: %{output_type: otype} = o...
    method collect_fees (line 441) | defp collect_fees(%Core{fees_paid: fees_paid} = state, token_surpluses...
    method disallow_payments (line 451) | defp disallow_payments(state), do: %Core{state | fee_claiming_started:...
    method flush_collected_fees_for_token (line 453) | defp flush_collected_fees_for_token(state, %Output{currency: token}) do
    method get_effects (line 459) | defp get_effects(tx, blknum, tx_index) do
    method utxos_from (line 463) | defp utxos_from(tx, blknum, tx_index) do
    method deposit_to_utxo (line 477) | defp deposit_to_utxo(deposit) do
    method find_utxo_matching_piggyback (line 490) | defp find_utxo_matching_piggyback(piggyback_events, state) do

FILE: apps/omg_watcher/lib/omg_watcher/state/measure.ex
  class OMG.Watcher.State.Measure (line 15) | defmodule OMG.Watcher.State.Measure
    method supported_events (line 31) | def supported_events(), do: @supported_events
    method handle_event (line 33) | def handle_event([:process, State], _, %Core{} = state, _config) do
    method handle_event (line 54) | def handle_event([:pending_transactions, Core], %{new_tx: _new_tx}, _,...
    method handle_event (line 58) | def handle_event([:block_transactions, Core], %{txs: txs}, _, _config) do

FILE: apps/omg_watcher/lib/omg_watcher/state/measurement_calculation.ex
  class OMG.Watcher.State.MeasurementCalculation (line 14) | defmodule OMG.Watcher.State.MeasurementCalculation
    method calculate (line 23) | def calculate(%Core{utxos: utxos}) do
    method unique_users (line 36) | defp unique_users(utxos) do
    method balance (line 47) | defp balance(utxos) do

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction.ex
  class OMG.Watcher.State.Transaction (line 15) | defmodule OMG.Watcher.State.Transaction
    method dispatching_reconstruct (line 65) | def dispatching_reconstruct([_raw_type | _raw_tx_rlp_decoded_chunks]),...
    method dispatching_reconstruct (line 66) | def dispatching_reconstruct(_), do: {:error, :malformed_transaction}
    method decode (line 69) | def decode(tx_bytes) do
    method decode! (line 74) | def decode!(tx_bytes) do
    method try_exrlp_decode (line 79) | defp try_exrlp_decode(tx_bytes) do
    method encode (line 85) | defp encode(transaction) do
    method hash (line 90) | defp hash(tx) do
    method get_inputs (line 100) | def get_inputs(%__MODULE__.Recovered{signed_tx: signed_tx}), do: get_i...
    method get_inputs (line 101) | def get_inputs(%__MODULE__.Signed{raw_tx: raw_tx}), do: get_inputs(raw...
    method get_inputs (line 102) | def get_inputs(tx), do: Transaction.Protocol.get_inputs(tx)
    method get_outputs (line 108) | def get_outputs(%__MODULE__.Recovered{signed_tx: signed_tx}), do: get_...
    method get_outputs (line 109) | def get_outputs(%__MODULE__.Signed{raw_tx: raw_tx}), do: get_outputs(r...
    method get_outputs (line 110) | def get_outputs(tx), do: Transaction.Protocol.get_outputs(tx)
    method raw_txbytes (line 116) | def raw_txbytes(%__MODULE__.Recovered{signed_tx: signed_tx}), do: raw_...
    method raw_txbytes (line 117) | def raw_txbytes(%__MODULE__.Signed{raw_tx: raw_tx}), do: raw_txbytes(r...
    method raw_txbytes (line 118) | def raw_txbytes(raw_tx), do: encode(raw_tx)
    method raw_txhash (line 124) | def raw_txhash(%__MODULE__.Recovered{tx_hash: hash}), do: hash
    method raw_txhash (line 125) | def raw_txhash(%__MODULE__.Signed{raw_tx: raw_tx}), do: raw_txhash(raw...
    method raw_txhash (line 126) | def raw_txhash(raw_tx), do: hash(raw_tx)

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction/fee.ex
  class OMG.Watcher.State.Transaction.Fee (line 15) | defmodule OMG.Watcher.State.Transaction.Fee
    method new (line 43) | def new(blknum, {owner, currency, amount}) do
    method new_output (line 56) | def new_output(owner, currency, amount) do
    method reconstruct (line 68) | def reconstruct([tx_type, outputs_rlp, nonce_rlp]) do
    method reconstruct (line 74) | def reconstruct(_), do: {:error, :malformed_transaction}
    method reconstruct_outputs (line 76) | defp reconstruct_outputs(outputs_rlp) do
    method reconstruct_nonce (line 87) | defp reconstruct_nonce(_), do: {:error, :malformed_nonce}
    method only_allowed_output_types? (line 89) | defp only_allowed_output_types?([%Output{}]), do: true
    method only_allowed_output_types? (line 90) | defp only_allowed_output_types?(_), do: false
    method to_nonce (line 93) | defp to_nonce(blknum, token) do

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction/payment.ex
  class OMG.Watcher.State.Transaction.Payment (line 15) | defmodule OMG.Watcher.State.Transaction.Payment
    method new (line 75) | def new(inputs, outputs, metadata \\ @zero_metadata)
    method reconstruct (line 87) | def reconstruct([tx_type, inputs_rlp, outputs_rlp, tx_data_rlp, metada...
    method reconstruct (line 96) | def reconstruct(_), do: {:error, :malformed_transaction}
    method new_input (line 100) | defp new_input({blknum, txindex, oindex}), do: Utxo.position(blknum, t...
    method new_output (line 102) | defp new_output({owner, currency, amount}) do
    method reconstruct_inputs (line 111) | defp reconstruct_inputs(inputs_rlp) do
    method reconstruct_outputs (line 116) | defp reconstruct_outputs([]), do: {:error, :empty_outputs}
    method reconstruct_outputs (line 118) | defp reconstruct_outputs(outputs_rlp) do
    method check_tx_data (line 124) | defp check_tx_data(0), do: :ok
    method check_tx_data (line 125) | defp check_tx_data(_), do: {:error, :malformed_tx_data}
    method reconstruct_metadata (line 128) | defp reconstruct_metadata(_), do: {:error, :malformed_metadata}
    method parse_inputs (line 130) | defp parse_inputs(inputs_rlp) do
    method parse_outputs (line 140) | defp parse_outputs(outputs_rlp) do
    method only_allowed_output_types? (line 151) | defp only_allowed_output_types?(outputs),
    method parse_input! (line 154) | defp parse_input!(encoded), do: OMG.Watcher.Utxo.Position.decode!(enco...

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction/recovered.ex
  class OMG.Watcher.State.Transaction.Recovered (line 15) | defmodule OMG.Watcher.State.Transaction.Recovered
    method recover_from (line 56) | def recover_from(encoded_signed_tx) do
    method recover_from! (line 66) | def recover_from!(encoded_signed_tx) do
    method recover_from_struct (line 72) | defp recover_from_struct(%Transaction.Signed{} = signed_tx, signed_tx_...
    method valid? (line 84) | defp valid?(%Transaction.Signed{raw_tx: raw_tx} = tx) do
    method generic_valid? (line 90) | defp generic_valid?(%Transaction.Signed{raw_tx: raw_tx}) do
    method no_duplicate_inputs? (line 97) | defp no_duplicate_inputs?(inputs) do

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction/signed.ex
  class OMG.Watcher.State.Transaction.Signed (line 15) | defmodule OMG.Watcher.State.Transaction.Signed
    method encode (line 40) | def encode(%__MODULE__{raw_tx: %{} = raw_tx, sigs: sigs}) do
    method decode (line 49) | def decode(signed_tx_bytes) do
    method decode! (line 58) | def decode!(signed_tx_bytes) do
    method get_witnesses (line 68) | def get_witnesses(%Transaction.Signed{sigs: []}), do: {:ok, %{}}
    method get_witnesses (line 70) | def get_witnesses(%Transaction.Signed{raw_tx: raw_tx, sigs: raw_witnes...
    method get_reversed_witnesses (line 82) | defp get_reversed_witnesses(raw_txhash, raw_tx, raw_witnesses) do
    method get_witness (line 88) | defp get_witness(raw_txhash, raw_tx, raw_witness, {:ok, witnesses}) do
    method generic_decode (line 97) | defp generic_decode(signed_tx_bytes) do
    method reconstruct (line 103) | def reconstruct([raw_witnesses | typed_tx_rlp_decoded_chunks]) do
    method reconstruct (line 110) | def reconstruct(_), do: {:error, :malformed_transaction}

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction/validator.ex
  class OMG.Watcher.State.Transaction.Validator (line 15) | defmodule OMG.Watcher.State.Transaction.Validator
    method can_process_tx (line 41) | def can_process_tx(%Core{} = state, %Transaction.Recovered{} = tx, fee...
    method validate_block_size (line 45) | defp validate_block_size(%Core{tx_index: number_of_transactions_in_blo...
    method dispatch_validation (line 54) | defp dispatch_validation(state, %Transaction.Recovered{signed_tx: %{ra...
    method dispatch_validation (line 58) | defp dispatch_validation(

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction/validator/fee_claim.ex
  class OMG.Watcher.State.Transaction.Validator.FeeClaim (line 15) | defmodule OMG.Watcher.State.Transaction.Validator.FeeClaim
    method can_claim_fees (line 28) | def can_claim_fees(
    method make_outputs (line 41) | defp make_outputs(owner, fees_paid) do

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction/validator/payment.ex
  class OMG.Watcher.State.Transaction.Validator.Payment (line 15) | defmodule OMG.Watcher.State.Transaction.Validator.Payment
    method can_apply_tx (line 41) | def can_apply_tx(state, tx, fees) do
    method inputs_not_from_future_block? (line 57) | defp inputs_not_from_future_block?(%Core{height: blknum}, inputs) do
    method authorized? (line 66) | defp authorized?(outputs_spent, witnesses) do
    method can_spend? (line 74) | defp can_spend?(%Output{owner: owner}, witness), do: owner == witness

FILE: apps/omg_watcher/lib/omg_watcher/state/transaction/witness.ex
  class OMG.Watcher.State.Transaction.Witness (line 15) | defmodule OMG.Watcher.State.Transaction.Witness
    method valid? (line 30) | def valid?(_), do: false
    method signature_length? (line 39) | defp signature_length?(_sig), do: false

FILE: apps/omg_watcher/lib/omg_watcher/state/utxo_set.ex
  class OMG.Watcher.State.UtxoSet (line 15) | defmodule OMG.Watcher.State.UtxoSet
    method init (line 39) | def init(utxos_query_result) do
    method get_by_inputs (line 52) | def get_by_inputs(utxos, inputs) do
    method apply_effects (line 61) | def apply_effects(utxos, spent_input_pointers, new_utxos_map) do
    method db_updates (line 70) | def db_updates(spent_input_pointers, new_utxos_map) do
    method exists? (line 77) | def exists?(utxos, input_pointer),
    method find_matching_utxo (line 86) | def find_matching_utxo(utxos, requested_txhash, oindex) do
    method filter_owned_by (line 96) | def filter_owned_by(utxos, address) do
    method zip_with_positions (line 105) | def zip_with_positions(utxos) do
    method get_utxos_by_inputs (line 109) | defp get_utxos_by_inputs(utxos, inputs) do
    method get_utxo (line 113) | defp get_utxo(utxos, position, {:ok, acc}) do
    method utxo_to_db_put (line 120) | defp utxo_to_db_put({input_pointer, utxo}),
    method utxo_to_db_delete (line 123) | defp utxo_to_db_delete(input_pointer),
    method utxo_kv_get_position (line 127) | defp utxo_kv_get_position(utxo_kv)
    method utxo_kv_get_position (line 128) | defp utxo_kv_get_position({Utxo.position(_, _, _) = utxo_pos, _utxo}),...
    method utxo_kv_get_position (line 129) | defp utxo_kv_get_position({_non_utxo_pos_input_pointer, %{utxo_pos: Ut...
    method utxo_kv_get_owner (line 132) | defp utxo_kv_get_owner(utxo_kv)
    method utxo_kv_get_owner (line 133) | defp utxo_kv_get_owner({_input_pointer, %Utxo{output: %{owner: owner}}...
    method utxo_kv_get_owner (line 134) | defp utxo_kv_get_owner({%{owner: owner}, _output_without_owner_specifi...
    method utxo_kv_created_by? (line 136) | defp utxo_kv_created_by?({_input_pointer, %Utxo{creating_txhash: reque...
    method utxo_kv_created_by? (line 137) | defp utxo_kv_created_by?({_input_pointer, %Utxo{}}, _), do: false
    method utxo_kv_has_oindex_equal? (line 139) | defp utxo_kv_has_oindex_equal?(utxo_kv, oindex) do

FILE: apps/omg_watcher/lib/omg_watcher/supervisor.ex
  class OMG.Watcher.Supervisor (line 15) | defmodule OMG.Watcher.Supervisor
    method start_link (line 30) | def start_link() do
    method init (line 34) | def init(:ok) do
    method create_event_consumer_children (line 65) | defp create_event_consumer_children() do
    method is_disabled? (line 102) | defp is_disabled?(), do: Application.get_env(:omg_watcher, Tracer)[:di...

FILE: apps/omg_watcher/lib/omg_watcher/sync_supervisor.ex
  class OMG.Watcher.SyncSupervisor (line 15) | defmodule OMG.Watcher.SyncSupervisor
    method status_cache (line 37) | def status_cache() do
    method events_bucket (line 41) | def events_bucket() do
    method start_link (line 45) | def start_link(args) do
    method init (line 49) | def init(args) do
    method children (line 70) | defp children(args) do
    method ensure_ets_init (line 231) | defp ensure_ets_init(events_bucket) do

FILE: apps/omg_watcher/lib/omg_watcher/tracer.ex
  class OMG.Watcher.Tracer (line 15) | defmodule OMG.Watcher.Tracer

FILE: apps/omg_watcher/lib/omg_watcher/typed_data_hash.ex
  class OMG.Watcher.TypedDataHash (line 15) | defmodule OMG.Watcher.TypedDataHash
    method hash_struct (line 48) | def hash_struct(%Transaction.Payment{} = raw_tx, domain_separator \\ n...
    method hash_transaction (line 54) | def hash_transaction(%Transaction.Payment{} = raw_tx) do

FILE: apps/omg_watcher/lib/omg_watcher/typed_data_hash/config.ex
  class OMG.Watcher.TypedDataHash.Config (line 15) | defmodule OMG.Watcher.TypedDataHash.Config
    method domain_data_from_config (line 30) | def domain_data_from_config() do
    method domain_separator_from_config (line 45) | def domain_separator_from_config() do

FILE: apps/omg_watcher/lib/omg_watcher/typed_data_hash/tools.ex
  class OMG.Watcher.TypedDataHash.Tools (line 15) | defmodule OMG.Watcher.TypedDataHash.Tools
    method domain_separator (line 52) | def domain_separator(
    method hash_transaction (line 80) | def hash_transaction(plasma_framework_tx_type, inputs, outputs, metada...
    method hash_input (line 114) | def hash_input(Utxo.position(blknum, txindex, oindex)) do
    method hash_output (line 126) | def hash_output(%Output{

FILE: apps/omg_watcher/lib/omg_watcher/typed_data_hash/types.ex
  class OMG.Watcher.TypedDataHash.Types (line 15) | defmodule OMG.Watcher.TypedDataHash.Types
    method eip712_types_specification (line 65) | def eip712_types_specification(),

FILE: apps/omg_watcher/lib/omg_watcher/utxo.ex
  class OMG.Watcher.Utxo (line 15) | defmodule OMG.Watcher.Utxo

FILE: apps/omg_watcher/lib/omg_watcher/utxo/position.ex
  class OMG.Watcher.Utxo.Position (line 15) | defmodule OMG.Watcher.Utxo.Position
    method decode! (line 76) | def decode!(encoded) do
    method to_db_key (line 133) | def to_db_key(Utxo.position(blknum, txindex, oindex)), do: {blknum, tx...
    method from_db_key (line 153) | def from_db_key({:input_pointer, _output_type, db_value}), do: from_db...
    method get_data_for_rlp (line 171) | def get_data_for_rlp(Utxo.position(blknum, txindex, oindex)) do

FILE: apps/omg_watcher/lib/omg_watcher/utxo_exit/core.ex
  class OMG.Watcher.UtxoExit.Core (line 15) | defmodule OMG.Watcher.UtxoExit.Core
    method compose_block_standard_exit (line 28) | def compose_block_standard_exit(:not_found, _), do: {:error, :utxo_not...
    method compose_block_standard_exit (line 30) | def compose_block_standard_exit(db_block, Utxo.position(blknum, txinde...
    method compose_deposit_standard_exit (line 48) | def compose_deposit_standard_exit({:ok, {db_utxo_pos, db_utxo_value}}) do
    method compose_deposit_standard_exit (line 64) | def compose_deposit_standard_exit(:not_found), do: {:error, :no_deposi...
    method get_tx_by_index (line 66) | defp get_tx_by_index(sorted_txs, txindex) do
    method get_output_by_index (line 75) | defp get_output_by_index(tx, Utxo.position(_, _, oindex)) do

FILE: apps/omg_watcher/lib/omg_watcher/wire_format_types.ex
  class OMG.Watcher.WireFormatTypes (line 15) | defmodule OMG.Watcher.WireFormatTypes
    method tx_type_modules (line 65) | def tx_type_modules(), do: @tx_type_modules
    method module_tx_types (line 71) | def module_tx_types(), do: @module_tx_types
    method output_type_modules (line 90) | def output_type_modules(), do: @output_type_modules

FILE: apps/omg_watcher/mix.exs
  class OMG.Watcher.MixProject (line 1) | defmodule OMG.Watcher.MixProject
    method project (line 4) | def project() do
    method application (line 21) | def application() do
    method version (line 29) | defp version() do
    method elixirc_paths (line 38) | defp elixirc_paths(:prod), do: ["lib"]
    method elixirc_paths (line 39) | defp elixirc_paths(:dev), do: ["lib"]
    method elixirc_paths (line 40) | defp elixirc_paths(:test), do: ["lib", "test/support"]
    method deps (line 42) | defp deps() do

FILE: apps/omg_watcher/test/fixtures.exs
  class OMG.Watcher.Fixtures (line 15) | defmodule OMG.Watcher.Fixtures
    method wait_for_web (line 108) | defp wait_for_web(), do: wait_for_web(100)
    method wait_for_web (line 110) | defp wait_for_web(counter) do

FILE: apps/omg_watcher/test/omg_watcher/api/account_test.exs
  class OMG.Watcher.API.AccountTest (line 15) | defmodule OMG.Watcher.API.AccountTest

FILE: apps/omg_watcher/test/omg_watcher/api/alarm_test.exs
  class OMG.Watcher.API.AlarmTest (line 15) | defmodule OMG.Watcher.API.AlarmTest

FILE: apps/omg_watcher/test/omg_watcher/api/status_cache_test.exs
  class OMG.Watcher.API.StatusCacheTest (line 15) | defmodule OMG.Watcher.API.StatusCacheTest
  class IntegrationModuleMock (line 55) | defmodule IntegrationModuleMock
    method get_status (line 56) | def get_status(eth_block_number) do
    method get_ethereum_height (line 60) | def get_ethereum_height() do
  class BusMock (line 65) | defmodule BusMock
    method subscribe (line 66) | def subscribe(_, _) do

FILE: apps/omg_watcher/test/omg_watcher/block_getter/core_test.exs
  class OMG.Watcher.BlockGetter.CoreTest (line 15) | defmodule OMG.Watcher.BlockGetter.CoreTest
    method assert_check (line 28) | def assert_check(result, status, value) do
    method assert_check (line 33) | def assert_check(result, value) do
    method handle_downloaded_block (line 38) | defp handle_downloaded_block(state, {:ok, block}, error, events) do
    method handle_downloaded_block (line 43) | defp handle_downloaded_block(state, {:ok, block}) do
    method handle_downloaded_block (line 48) | defp handle_downloaded_block(state, block) do
    method process_single_block (line 145) | defp process_single_block(%Block{hash: requested_hash} = block) do
    method init_state (line 705) | defp init_state(opts \\ []) do

FILE: apps/omg_watcher/test/omg_watcher/block_test.exs
  class OMG.Watcher.BlockTest (line 15) | defmodule OMG.Watcher.BlockTest
    method eth (line 26) | defp eth(), do: <<0::160>>

FILE: apps/omg_watcher/test/omg_watcher/block_validator_test.exs
  class OMG.WatcherRPC.Web.Validator.BlockValidatorTest (line 15) | defmodule OMG.WatcherRPC.Web.Validator.BlockValidatorTest
    method derive_merkle_root (line 230) | defp(derive_merkle_root(transactions)) do

FILE: apps/omg_watcher/test/omg_watcher/child_manager_test.exs
  class OMG.Watcher.ChildManagerTest (line 15) | defmodule OMG.Watcher.ChildManagerTest
  class Monitor (line 32) | defmodule Monitor
    method start (line 35) | def start(parent) do
    method init (line 39) | def init([parent]) do
    method health_checkin (line 43) | def health_checkin() do
    method handle_cast (line 47) | def handle_cast(:health_checkin, state) do

FILE: apps/omg_watcher/test/omg_watcher/crypto_test.exs
  class OMG.Watcher.CryptoTest (line 15) | defmodule OMG.Watcher.CryptoTest

FILE: apps/omg_watcher/test/omg_watcher/datadog_event/contract_event_consumer_test.exs
  class OMG.Watcher.DatadogEvent.ContractEventConsumerTest (line 15) | defmodule OMG.Watcher.DatadogEvent.ContractEventConsumerTest
  class DatadogEventMock (line 68) | defmodule DatadogEventMock
    method event (line 69) | def event(title, message, options) do

FILE: apps/omg_watcher/test/omg_watcher/datadog_event/encode_test.exs
  class OMG.Watcher.DatadogEvent.EncodeTest (line 15) | defmodule OMG.Watcher.DatadogEvent.EncodeTest

FILE: apps/omg_watcher/test/omg_watcher/ethereum_event_aggregator_test.exs
  class OMG.Watcher.EthereumEventAggregatorTest (line 14) | defmodule OMG.Watcher.EthereumEventAggregatorTest
    method deposit_created_log (line 478) | def deposit_created_log(block_number) do
    method exit_started_log (line 498) | def exit_started_log(block_number) do
    method in_flight_exit_output_piggybacked_log (line 516) | def in_flight_exit_output_piggybacked_log(block_number) do
    method in_flight_exit_input_piggybacked_log (line 535) | def in_flight_exit_input_piggybacked_log(block_number) do
    method in_flight_exit_deleted_log (line 554) | def in_flight_exit_deleted_log(block_number) do
    method start_standard_exit_log (line 572) | def start_standard_exit_log() do
    method from_hex (line 576) | defp from_hex("0x" <> encoded), do: Base.decode16!(encoded, case: :lower)
    method get_signature_from_event (line 578) | defp get_signature_from_event(events, name) do

FILE: apps/omg_watcher/test/omg_watcher/ethereum_event_listener/core_test.exs
  class OMG.Watcher.Watcher.EthereumEventListener.CoreTest (line 15) | defmodule OMG.Watcher.Watcher.EthereumEventListener.CoreTest
    method create_state (line 160) | defp create_state(height, opts \\ []) do
    method assert_range (line 175) | defp assert_range({range, state}, expect) do

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/canonicity_test.exs
  class OMG.Watcher.ExitProcessor.CanonicityTest (line 15) | defmodule OMG.Watcher.ExitProcessor.CanonicityTest

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/core/state_interaction_test.exs
  class OMG.Watcher.ExitProcessor.Core.StateInteractionTest (line 15) | defmodule OMG.Watcher.ExitProcessor.Core.StateInteractionTest
    method mock_utxo_exists (line 309) | defp mock_utxo_exists(%ExitProcessor.Request{utxos_to_check: positions...

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/core_test.exs
  class OMG.Watcher.ExitProcessor.CoreTest (line 15) | defmodule OMG.Watcher.ExitProcessor.CoreTest

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/exit_info_test.exs
  class OMG.Watcher.ExitProcessor.ExitInfoTest (line 15) | defmodule OMG.Watcher.ExitProcessor.ExitInfoTest

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/finalizations_test.exs
  class OMG.Watcher.ExitProcessor.FinalizationsTest (line 15) | defmodule OMG.Watcher.ExitProcessor.FinalizationsTest

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/in_flight_exit_info_test.exs
  class OMG.Watcher.ExitProcessor.InFlightExitInfoTest (line 15) | defmodule OMG.Watcher.ExitProcessor.InFlightExitInfoTest
    method ife_info_with_inputs (line 46) | defp ife_info_with_inputs(inputs) do

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/persistence_test.exs
  class OMG.Watcher.ExitProcessor.PersistenceTest (line 15) | defmodule OMG.Watcher.ExitProcessor.PersistenceTest
    method state_from (line 200) | defp state_from(db_pid) do
    method persist_common (line 211) | defp persist_common(processor, db_updates, db_pid) do
    method persist_new_exits (line 217) | defp persist_new_exits(processor, exit_events, contract_statuses, db_p...
    method persist_finalize_exits (line 222) | defp persist_finalize_exits(processor, validities, db_pid) do
    method persist_challenge_exits (line 227) | defp persist_challenge_exits(processor, utxo_positions, db_pid) do
    method persist_new_ifes (line 234) | defp persist_new_ifes(processor, txs, priv_keys, statuses \\ nil, db_p...
    method persist_new_piggybacks (line 246) | defp persist_new_piggybacks(processor, piggybacks, db_pid) do
    method persist_new_ife_challenges (line 251) | defp persist_new_ife_challenges(processor, challenges, db_pid) do
    method persist_respond_to_in_flight_exits_challenges (line 256) | defp persist_respond_to_in_flight_exits_challenges(processor, challeng...
    method persist_challenge_piggybacks (line 261) | defp persist_challenge_piggybacks(processor, piggybacks, db_pid) do
    method persist_finalize_ifes (line 266) | defp persist_finalize_ifes(processor, finalizations, db_pid) do

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/piggyback_test.exs
  class OMG.Watcher.ExitProcessor.PiggybackTest (line 15) | defmodule OMG.Watcher.ExitProcessor.PiggybackTest

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs
  class OMG.Watcher.ExitProcessor.StandardExitTest (line 15) | defmodule OMG.Watcher.ExitProcessor.StandardExitTest
    method start_se_from_deposit (line 561) | defp start_se_from_deposit(processor, exiting_pos, alice) do
    method start_se_from_block_tx (line 566) | defp start_se_from_block_tx(processor, exiting_pos, alice) do
    method get_bytes_sig (line 571) | defp get_bytes_sig(tx, sig_idx \\ 0), do: {Transaction.raw_txbytes(tx)...

FILE: apps/omg_watcher/test/omg_watcher/exit_processor/tools_test.exs
  class OMG.Watcher.ExitProcessor.ToolsTest (line 15) | defmodule OMG.Watcher.ExitProcessor.ToolsTest

FILE: apps/omg_watcher/test/omg_watcher/fees/fee_filter_test.exs
  class OMG.Watcher.Fees.FeeFilterTest (line 15) | defmodule OMG.Watcher.Fees.FeeFilterTest

FILE: apps/omg_watcher/test/omg_watcher/fees_test.exs
  class OMG.Watcher.FeesTest (line 15) | defmodule OMG.Watcher.FeesTest
  class DummyTransaction (line 188) | defmodule DummyTransaction
    method new (line 191) | def new(), do: %__MODULE__{}

FILE: apps/omg_watcher/test/omg_watcher/http_rpc/adapter_test.exs
  class OMG.Watcher.HttpRPC.AdapterTest (line 15) | defmodule OMG.Watcher.HttpRPC.AdapterTest

FILE: apps/omg_watcher/test/omg_watcher/integration/block_getter_1_test.exs
  class OMG.Watcher.Integration.BlockGetter1Test (line 15) | defmodule OMG.Watcher.Integration.BlockGetter1Test

FILE: apps/omg_watcher/test/omg_watcher/integration/block_getter_2_test.exs
  class OMG.Watcher.Integration.BlockGetter2Test (line 15) | defmodule OMG.Watcher.Integration.BlockGetter2Test

FILE: apps/omg_watcher/test/omg_watcher/integration/block_getter_3_test.exs
  class OMG.Watcher.Integration.BlockGetter3Test (line 15) | defmodule OMG.Watcher.Integration.BlockGetter3Test
    method get_next_blknum_nonce (line 88) | defp get_next_blknum_nonce(blknum) do

FILE: apps/omg_watcher/test/omg_watcher/integration/block_getter_4_test.exs
  class OMG.Watcher.Integration.BlockGetter4Test (line 15) | defmodule OMG.Watcher.Integration.BlockGetter4Test

FILE: apps/omg_watcher/test/omg_watcher/integration/block_getter_test.exs
  class OMG.Watcher.Integration.BlockGetterTest (line 15) | defmodule OMG.Watcher.Integration.BlockGetterTest

FILE: apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test.exs
  class OMG.Watcher.Integration.InFlightExitTest (line 15) | defmodule OMG.Watcher.Integration.InFlightExitTest
    method exit_in_flight (line 70) | defp exit_in_flight(%Transaction.Signed{} = tx, exiting_user) do
    method exit_in_flight (line 75) | defp exit_in_flight(get_in_flight_exit_response, exiting_user) do
    method exit_in_flight_and_wait_for_ife (line 87) | defp exit_in_flight_and_wait_for_ife(tx, exiting_user) do
    method piggyback_and_process_exits (line 93) | defp piggyback_and_process_exits(%Transaction.Signed{raw_tx: raw_tx}, ...

FILE: apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_1_test.exs
  class OMG.Watcher.Integration.InFlightExit1Test (line 15) | defmodule OMG.Watcher.Integration.InFlightExit1Test
    method exit_in_flight (line 130) | defp exit_in_flight(%Transaction.Signed{} = tx, exiting_user) do
    method exit_in_flight (line 135) | defp exit_in_flight(get_in_flight_exit_response, exiting_user) do
    method wait_for (line 147) | defp wait_for(expected_events) do

FILE: apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_2_test.exs
  class OMG.Watcher.Integration.InFlightExit2Test (line 15) | defmodule OMG.Watcher.Integration.InFlightExit2Test
    method exit_in_flight (line 116) | defp exit_in_flight(%Transaction.Signed{} = tx, exiting_user) do
    method exit_in_flight (line 121) | defp exit_in_flight(get_in_flight_exit_response, exiting_user) do
    method wait_for (line 133) | defp wait_for(expected_events) do

FILE: apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_3_test.exs
  class OMG.Watcher.Integration.InFlightExit3Test (line 15) | defmodule OMG.Watcher.Integration.InFlightExit3Test
    method piggyback_and_process_exits (line 65) | defp piggyback_and_process_exits(%Transaction.Signed{raw_tx: raw_tx}, ...
    method exit_in_flight (line 81) | defp exit_in_flight(%Transaction.Signed{} = tx, exiting_user) do
    method exit_in_flight (line 86) | defp exit_in_flight(get_in_flight_exit_response, exiting_user) do
    method wait_for (line 98) | defp wait_for(expected_events) do
    method wait_for_not_empty_in_flight_exits (line 115) | defp wait_for_not_empty_in_flight_exits() do
    method wait_for_empty_in_flight_exits (line 131) | defp wait_for_empty_in_flight_exits() do

FILE: apps/omg_watcher/test/omg_watcher/integration/in_flight_exit_test_4_test.exs
  class OMG.Watcher.Integration.InFlightExit4Test (line 15) | defmodule OMG.Watcher.Integration.InFlightExit4Test
    method exit_in_flight (line 58) | defp exit_in_flight(%Transaction.Signed{} = tx, exiting_user) do
    method exit_in_flight (line 63) | defp exit_in_flight(get_in_flight_exit_response, exiting_user) do
    method exit_in_flight_and_wait_for_ife (line 75) | defp exit_in_flight_and_wait_for_ife(tx, exiting_user) do
    method piggyback_and_process_exits (line 81) | defp piggyback_and_process_exits(%Transaction.Signed{raw_tx: raw_tx}, ...
    method wait_for (line 97) | defp wait_for(expected_events) do
    method wait_for_empty_in_flight_exits (line 114) | defp wait_for_empty_in_flight_exits() do

FILE: apps/omg_watcher/test/omg_watcher/integration/invalid_exit_1_test.exs
  class OMG.Watcher.Integration.InvalidExit1Test (line 15) | defmodule OMG.Watcher.Integration.InvalidExit1Test

FILE: apps/omg_watcher/test/omg_watcher/integration/invalid_exit_2_test.exs
  class OMG.Watcher.Integration.InvalidExit2Test (line 15) | defmodule OMG.Watcher.Integration.InvalidExit2Test

FILE: apps/omg_watcher/test/omg_watcher/integration/monitor_test.exs
  class OMG.Watcher.MonitorTest (line 15) | defmodule OMG.Watcher.MonitorTest
    method start_and_attach_a_child (line 105) | defp start_and_attach_a_child(opts) do
  class ChildProcess (line 116) | defmodule ChildProcess
    method prepare_child (line 123) | def prepare_child() do
    method start_link (line 127) | def start_link(_), do: GenServer.start_link(__MODULE__, [], name: __MO...
    method init (line 129) | def init(_), do: {:ok, %{}}
    method terminate (line 131) | def terminate(_reason, _) do

FILE: apps/omg_watcher/test/omg_watcher/integration/root_chain_coordinator_test.exs
  class OMG.Watcher.RootChainCoordinatorTest (line 15) | defmodule OMG.Watcher.RootChainCoordinatorTest

FILE: apps/omg_watcher/test/omg_watcher/integration/test_server_test.exs
  class OMG.Watcher.Integration.TestServerTest (line 15) | defmodule OMG.Watcher.Integration.TestServerTest

FILE: apps/omg_watcher/test/omg_watcher/merge_transaction_validator_test.exs
  class OMG.Watcher.MergeTransactionValidatorTest (line 15) | defmodule OMG.Watcher.MergeTransactionValidatorTest

FILE: apps/omg_watcher/test/omg_watcher/merkle_test.exs
  class OMG.Watcher.MerkleTest (line 15) | defmodule OMG.Watcher.MerkleTest

FILE: apps/omg_watcher/test/omg_watcher/output_test.exs
  class OMG.OutputTest (line 14) | defmodule OMG.OutputTest

FILE: apps/omg_watcher/test/omg_watcher/raw_data_test.exs
  class OMG.Watcher.RawDataTest (line 15) | defmodule OMG.Watcher.RawDataTest

FILE: apps/omg_watcher/test/omg_watcher/release_tasks/set_ethereum_events_check_interval_test.exs
  class OMG.Watcher.ReleaseTasks.SetEthereumEventsCheckIntervalTest (line 15) | defmodule OMG.Watcher.ReleaseTasks.SetEthereumEventsCheckIntervalTest

FILE: apps/omg_watcher/test/omg_watcher/release_tasks/set_exit_processor_sla_margin_test.exs
  class OMG.Watcher.ReleaseTasks.SetExitProcessorSLAMarginTest (line 15) | defmodule OMG.Watcher.ReleaseTasks.SetExitProcessorSLAMarginTest

FILE: apps/omg_watcher/test/omg_watcher/release_tasks/set_tracer_test.exs
  class OMG.Watcher.ReleaseTasks.SetTracerTest (line 15) | defmodule OMG.Watcher.ReleaseTasks.SetTracerTest
  class System (line 61) | defmodule System
    method start_link (line 62) | def start_link(args), do: GenServer.start_link(__MODULE__, args, [])
    method get_env (line 63) | def get_env(key), do: __MODULE__ |> Process.get() |> GenServer.call({:...
    method put_env (line 64) | def put_env(key, value), do: __MODULE__ |> Process.get() |> GenServer....
    method init (line 65) | def init(_), do: {:ok, %{}}
    method handle_call (line 67) | def handle_call({:get_env, key}, _, state) do
    method handle_call (line 71) | def handle_call({:put_env, key, value}, _, state) do

FILE: apps/omg_watcher/test/omg_watcher/root_chain_coordinator/core_test.exs
  class OMG.Watcher.RootChainCoordinator.CoreTest (line 14) | defmodule OMG.Watcher.RootChainCoordinator.CoreTest

FILE: apps/omg_watcher/test/omg_watcher/signature_test.exs
  class OMG.Watcher.SignatureTest (line 15) | defmodule OMG.Watcher.SignatureTest

FILE: apps/omg_watcher/test/omg_watcher/state/core_test.exs
  class OMG.Watcher.State.CoreTest (line 15) | defmodule OMG.Watcher.State.CoreTest
    method success? (line 1081) | defp success?(result) do
    method fail? (line 1086) | defp fail?(result, expected_error) do
    method same? (line 1091) | defp same?({{:error, _someerror}, state}, expected_state) do
    method same? (line 1096) | defp same?(state, expected_state) do
    method empty_block (line 1101) | defp empty_block(number \\ @blknum1) do
    method form_block_check (line 1107) | defp form_block_check(state) do
    method to_utxo_kv (line 1121) | defp to_utxo_kv({blknum, txindex, oindex, owner, currency, amount}),

FILE: apps/omg_watcher/test/omg_watcher/state/measurement_calculation_test.exs
  class OMG.Watcher.State.MeasurementCalculationTest (line 15) | defmodule OMG.Watcher.State.MeasurementCalculationTest

FILE: apps/omg_watcher/test/omg_watcher/state/persistence_test.exs
  class OMG.Watcher.State.PersistenceTest (line 15) | defmodule OMG.Watcher.State.PersistenceTest
    method persist_deposit (line 202) | defp persist_deposit(deposits) do
    method persist_form (line 211) | defp persist_form(:ok), do: persist_form()
    method persist_form (line 213) | defp persist_form() do
    method exec (line 223) | defp exec(:ok, tx), do: exec(tx)
    method exec (line 225) | defp exec(tx) do
    method persist_exit_utxos (line 234) | defp persist_exit_utxos(:ok, exit_infos), do: persist_exit_utxos(exit_...
    method persist_exit_utxos (line 236) | defp persist_exit_utxos(exit_infos) do
    method make_deposits (line 242) | defp make_deposits(list) do
    method restart_state (line 256) | defp restart_state() do

FILE: apps/omg_watcher/test/omg_watcher/state/transaction/fee_test.exs
  class OMG.Watcher.State.Transaction.FeeTest (line 15) | defmodule OMG.Watcher.State.Transaction.FeeTest

FILE: apps/omg_watcher/test/omg_watcher/state/transaction/recovered_test.exs
  class OMG.Watcher.State.Transaction.RecoveredTest (line 15) | defmodule OMG.Watcher.State.Transaction.RecoveredTest
    method assert_tx_usable (line 564) | defp assert_tx_usable(signed, state_core) do
    method parametrized_tester (line 571) | defp parametrized_tester({inputs, outputs}) do
    method good_tx_rlp_items (line 591) | defp good_tx_rlp_items() do

FILE: apps/omg_watcher/test/omg_watcher/state/transaction/witness_test.exs
  class OMG.Watcher.State.Transaction.WitnessTest (line 15) | defmodule OMG.Watcher.State.Transaction.WitnessTest

FILE: apps/omg_watcher/test/omg_watcher/state/transaction_test.exs
  class OMG.Watcher.State.TransactionTest (line 15) | defmodule OMG.Watcher.State.TransactionTest

FILE: apps/omg_watcher/test/omg_watcher/state/utxo_set_test.exs
  class OMG.Watcher.State.UtxoSetTest (line 15) | defmodule OMG.Watcher.State.UtxoSetTest

FILE: apps/omg_watcher/test/omg_watcher/state_test.exs
  class OMG.Watcher.StateTest (line 15) | defmodule OMG.Watcher.StateTest

FILE: apps/omg_watcher/test/omg_watcher/supervisor_test.exs
  class OMG.Watcher.SupervisorTest (line 14) | defmodule OMG.Watcher.SupervisorTest
    method initial_check_in (line 86) | defp initial_check_in(state, services, pid) do

FILE: apps/omg_watcher/test/omg_watcher/typed_data_hash_test.exs
  class OMG.Watcher.TypedDataHashTest (line 15) | defmodule OMG.Watcher.TypedDataHashTest

FILE: apps/omg_watcher/test/omg_watcher/utxo/position_test.exs
  class OMG.Watcher.Utxo.PositionTest (line 15) | defmodule OMG.Watcher.Utxo.PositionTest

FILE: apps/omg_watcher/test/omg_watcher/utxo_exit/core_test.exs
  class OMG.Watcher.UtxoExit.CoreTest (line 15) | defmodule OMG.Watcher.UtxoExit.CoreTest

FILE: apps/omg_watcher/test/omg_watcher/utxo_test.exs
  class OMG.Watcher.UtxoTest (line 14) | defmodule OMG.Watcher.UtxoTest

FILE: apps/omg_watcher/test/omg_watcher/wire_format_types_test.exs
  class OMG.Watcher.WireFormatTypesTest (line 15) | defmodule OMG.Watcher.WireFormatTypesTest

FILE: apps/omg_watcher/test/support/dev_crypto.ex
  class OMG.Watcher.DevCrypto (line 15) | defmodule OMG.Watcher.DevCrypto
    method generate_private_key (line 30) | def generate_private_key(), do: {:ok, :crypto.strong_rand_bytes(32)}
    method generate_public_key (line 36) | def generate_public_key(<<priv::binary-size(32)>>) do
    method sign (line 49) | def sign(%{} = tx, private_keys) do
    method signature (line 67) | def signature(tx, priv), do: do_signature(tx, priv)
    method do_signature (line 69) | defp do_signature(%{} = tx, priv) do
    method pack_signature (line 76) | defp pack_signature(v, r, s) do
    method der_to_raw (line 80) | defp der_to_raw(<<4::integer-size(8), data::binary>>), do: data
    method get_public_key (line 82) | defp get_public_key(private_key) do

FILE: apps/omg_watcher/test/support/exit_processor/case.ex
  class OMG.Watcher.ExitProcessor.Case (line 15) | defmodule OMG.Watcher.ExitProcessor.Case
    method invalid_piggyback_on_input (line 85) | defp invalid_piggyback_on_input(state, [tx | _], [ife_id | _], competi...
    method invalid_piggyback_on_output (line 109) | defp invalid_piggyback_on_output(alice, state, [tx | _], [ife_id | _]) do

FILE: apps/omg_watcher/test/support/exit_processor/test_helper.ex
  class OMG.Watcher.ExitProcessor.TestHelper (line 15) | defmodule OMG.Watcher.ExitProcessor.TestHelper
    method start_se_from (line 31) | def start_se_from(%Core{} = processor, tx, exiting_pos, opts \\ []) do
    method se_event_status (line 37) | def se_event_status(tx, exiting_pos, opts \\ []) do
    method start_ife_from (line 70) | def start_ife_from(%Core{} = processor, tx, opts \\ []) do
    method active_ife_status (line 82) | def active_ife_status(), do: {nil, 1, nil, nil, nil, nil, nil}
    method inactive_ife_status (line 83) | def inactive_ife_status(), do: {nil, 0, nil, nil, nil, nil, nil}
    method piggyback_ife_from (line 85) | def piggyback_ife_from(%Core{} = processor, tx_hash, output_index, pig...
    method ife_event (line 98) | def ife_event(tx, opts \\ []) do
    method ife_response (line 117) | def ife_response(tx, position),
    method ife_challenge (line 120) | def ife_challenge(tx, comp, opts \\ []) do
    method txbytes (line 139) | def txbytes(tx), do: Transaction.raw_txbytes(tx)
    method sigs (line 140) | def sigs(tx), do: tx.signed_tx.sigs
    method sig (line 141) | def sig(tx, idx \\ 0), do: tx |> sigs() |> Enum.at(idx)
    method assert_proof_sound (line 143) | def assert_proof_sound(proof_bytes) do
    method assert_events (line 150) | def assert_events(events, expected_events) do
    method check_validity_filtered (line 154) | def check_validity_filtered(request, processor, opts) do
    method not_included_competitor_pos (line 176) | defp not_included_competitor_pos() do

FILE: apps/omg_watcher/test/support/integration/bad_child_chain_server.ex
  class OMG.Watcher.Integration.BadChildChainServer (line 15) | defmodule OMG.Watcher.Integration.BadChildChainServer
    method prepare_route_to_inject_bad_block (line 31) | def prepare_route_to_inject_bad_block(context, bad_block, bad_block_ha...
    method prepare_route_to_inject_bad_block (line 56) | def prepare_route_to_inject_bad_block(context, %{hash: bad_block_hash}...

FILE: apps/omg_watcher/test/support/integration/deposit_helper.ex
  class Support.Integration.DepositHelper (line 15) | defmodule Support.Integration.DepositHelper
    method deposit_to_child_chain (line 29) | def deposit_to_child_chain(to, value, token \\ @eth)
    method deposit_to_child_chain (line 31) | def deposit_to_child_chain(to, value, @eth) do
    method process_deposit (line 55) | defp process_deposit(%{"blockNumber" => deposit_eth_height} = receipt) do
    method wait_deposit_recognized (line 60) | defp wait_deposit_recognized(deposit_eth_height) do

FILE: apps/omg_watcher/test/support/integration/fixtures.exs
  class OMG.Watcher.Integration.Fixtures (line 15) | defmodule OMG.Watcher.Integration.Fixtures
    method prepare_deposits (line 32) | defp prepare_deposits(alice, token_addr) do

FILE: apps/omg_watcher/test/support/integration/test_helper.ex
  class OMG.Watcher.Integration.TestHelper (line 15) | defmodule OMG.Watcher.Integration.TestHelper
    method wait_for_byzantine_events (line 28) | def wait_for_byzantine_events(event_names, timeout) do
    method wait_for_block_fetch (line 40) | def wait_for_block_fetch(block_number, timeout) do
    method wait_for_block_inserted_in_db (line 60) | def wait_for_block_inserted_in_db(block_number, timeout) do
    method wait_for_exit_processing (line 74) | def wait_for_exit_processing(exit_eth_height, timeout \\ 5_000) do
    method process_exits (line 81) | def process_exits(vault_id, token, user) do

FILE: a
Condensed preview — 737 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,032K chars).
[
  {
    "path": ".circleci/ci_increase_chart_version.sh",
    "chars": 1605,
    "preview": "#!/bin/sh\n\n\"\"\"\nThis is the script that would send a dispatch event to the helm chart repo to auto increase chart version"
  },
  {
    "path": ".circleci/ci_publish.sh",
    "chars": 1907,
    "preview": "#!/bin/sh\n\nset -e\n\necho_info() {\n    printf \"\\\\033[0;34m%s\\\\033[0;0m\\\\n\" \"$1\"\n}\n\necho_warn() {\n    printf \"\\\\033[0;33m%s"
  },
  {
    "path": ".circleci/config.yml",
    "chars": 43728,
    "preview": "version: 2.1\n\nexecutors:\n  metal:\n    docker:\n      - image: circleci/elixir:1.10.2\n      - image: circleci/postgres:9.6"
  },
  {
    "path": ".circleci/status.sh",
    "chars": 283,
    "preview": "#!/bin/sh\n\nretries=0\nstatus=1\n\n# Retries roughly every 5 seconds up to 2 minutes\nwhile [ $retries -lt 24 ];  do\n  alarms"
  },
  {
    "path": ".circleci/test_runner.py",
    "chars": 3190,
    "preview": "#!/usr/bin/python3\nimport logging\nimport os\nimport sys\nimport time\n\nimport requests\n\n\ndef create_job(test_runner: str) -"
  },
  {
    "path": ".formatter.exs",
    "chars": 677,
    "preview": "# Used by \"mix format\"\n[\n  inputs: [\n    \"config/*.exs\",\n    \"rel/config.exs\",\n    \"mix.exs\",\n    \"apps/*/mix.exs\",\n    "
  },
  {
    "path": ".githooks/pre-commit",
    "chars": 75,
    "preview": "#!/bin/sh\necho \"Is your code formatted?\"\nexec mix format --check-formatted\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "chars": 384,
    "preview": ":clipboard: Add associated issues, tickets, docs URL here.\n\n## Overview\n\nDescribe what your Pull Request is about in a f"
  },
  {
    "path": ".github/workflows/auto-merge-pr.yml",
    "chars": 1620,
    "preview": "name: Auto Merge PR without conflicts\n\non:\n  pull_request:\n    branches: [ master-v2 ]\n\njobs:\n  auto-merge-pr:\n    runs-"
  },
  {
    "path": ".github/workflows/auto-pr-for-branch-syncing.yml",
    "chars": 865,
    "preview": "name: Auto PR for syncing master to master-v2\n\non:\n  push:\n    branches: [master]\n\njobs:\n  auto-pr-for-branch-syncing:\n "
  },
  {
    "path": ".github/workflows/enforce-changelog-labels.yml",
    "chars": 975,
    "preview": "name: Enforce changelog labels\n\non:\n  pull_request:\n    types: [opened, labeled, unlabeled, synchronize, reopened]\n    b"
  },
  {
    "path": ".github_changelog_generator",
    "chars": 738,
    "preview": "# Issue/PR filter\nrelease-branch=master\nsince-tag=v0.4.8\nexclude-tags-regex=.*-pre.*\nunreleased=true\n\nissues=false\npull-"
  },
  {
    "path": ".gitignore",
    "chars": 1452,
    "preview": "# The directory Mix will write compiled artifacts to.\n/_build/\n\n# The directory Mix will write compiled artifacts to whe"
  },
  {
    "path": ".gitmodules",
    "chars": 116,
    "preview": "[submodule \"priv/cabbage\"]\n  path = priv/cabbage\n  url = https://github.com/omgnetwork/specs.git\n  branch = master\n\n"
  },
  {
    "path": ".releaserc.yaml",
    "chars": 793,
    "preview": "plugins:\n- - '@semantic-release/commit-analyzer'\n  - preset: 'angular'\n    releaseRules:\n      - type: 'refactor'\n      "
  },
  {
    "path": ".tool-versions",
    "chars": 40,
    "preview": "elixir 1.11.2\nerlang 23.1.4\nrust 1.46.0\n"
  },
  {
    "path": "AUTHORS",
    "chars": 20,
    "preview": "OMG Network Pte Ltd\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 19490,
    "preview": "# Changelog\n\n## [v1.0.5](https://github.com/omgnetwork/elixir-omg/tree/v1.0.5) (2020-10-01)\n\n[Full Changelog](https://gi"
  },
  {
    "path": "CODEOWNERS",
    "chars": 19,
    "preview": "mix.lock @InoMurko\n"
  },
  {
    "path": "Dockerfile.watcher",
    "chars": 2186,
    "preview": "FROM alpine:3.11\n\nLABEL maintainer=\"OMG Network Team <omg@omise.co>\"\nLABEL description=\"Official image for OMG Network ("
  },
  {
    "path": "Dockerfile.watcher_info",
    "chars": 2216,
    "preview": "FROM alpine:3.11\n\nLABEL maintainer=\"OMG Network Team <engineering@omg.network>\"\nLABEL description=\"Official image for OM"
  },
  {
    "path": "LICENSE",
    "chars": 9710,
    "preview": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AN"
  },
  {
    "path": "Makefile",
    "chars": 18838,
    "preview": "MAKEFLAGS += --silent\nOVERRIDING_START ?= start_iex\nOVERRIDING_VARIABLES ?= bin/variables\nSNAPSHOT ?= SNAPSHOT_MIX_EXIT_"
  },
  {
    "path": "README.md",
    "chars": 7048,
    "preview": "<img src=\"docs/assets/logo.png\" width=\"100\" height=\"100\" align=\"right\" />\n\nThe `elixir-omg` repository contains OMG Netw"
  },
  {
    "path": "apps/omg_bus/lib/omg_bus/application.ex",
    "chars": 736,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_bus/lib/omg_bus/event.ex",
    "chars": 1156,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_bus/lib/omg_bus/pubsub.ex",
    "chars": 2672,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_bus/lib/omg_bus/supervisor.ex",
    "chars": 998,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_bus/lib/omg_bus.ex",
    "chars": 757,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_bus/mix.exs",
    "chars": 1022,
    "preview": "defmodule OMG.Bus.MixProject do\n  use Mix.Project\n\n  def project() do\n    [\n      app: :omg_bus,\n      version: version("
  },
  {
    "path": "apps/omg_bus/test/omg_bus/event_test.exs",
    "chars": 1209,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_bus/test/test_helper.exs",
    "chars": 603,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/mix.exs",
    "chars": 984,
    "preview": "defmodule OMG.Conformance.MixProject do\n  use Mix.Project\n\n  def project() do\n    [\n      app: :omg_conformance,\n      v"
  },
  {
    "path": "apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_property_test.exs",
    "chars": 3691,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/test/omg_conformance/conformance/merkle_proof_test.exs",
    "chars": 2789,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/test/omg_conformance/conformance/signature_property_test.exs",
    "chars": 3504,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/test/omg_conformance/conformance/signature_test.exs",
    "chars": 3161,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/test/support/conformance/merkle_proof_context.ex",
    "chars": 7492,
    "preview": "# Copyright 2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not u"
  },
  {
    "path": "apps/omg_conformance/test/support/conformance/merkle_proofs.ex",
    "chars": 2875,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/test/support/conformance/property.ex",
    "chars": 8436,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/test/support/conformance/signatures_hashes.ex",
    "chars": 5685,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/test/support/conformance/signatures_hashes_case.ex",
    "chars": 1830,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_conformance/test/test_helper.exs",
    "chars": 720,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/db.ex",
    "chars": 6742,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/application.ex",
    "chars": 1187,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/measure.ex",
    "chars": 2436,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/models/payment_exit_info.ex",
    "chars": 1435,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/release_tasks/init_key_value_db.ex",
    "chars": 1543,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/release_tasks/init_keys_with_values.ex",
    "chars": 1531,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/release_tasks/set_key_value_db.ex",
    "chars": 1640,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/rocks_db.ex",
    "chars": 5719,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/rocksdb/core.ex",
    "chars": 5556,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/lib/omg_db/rocksdb/server.ex",
    "chars": 7666,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/mix.exs",
    "chars": 1683,
    "preview": "defmodule OMG.DB.MixProject do\n  use Mix.Project\n\n  def project() do\n    [\n      app: :omg_db,\n      version: version(),"
  },
  {
    "path": "apps/omg_db/test/fixtures.exs",
    "chars": 1166,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/omg_db/application_test.exs",
    "chars": 977,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/omg_db/db_test.exs",
    "chars": 4176,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/omg_db/models/payment_exit_info_test.exs",
    "chars": 3250,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/omg_db/release_tasks/init_key_value_db_test.exs",
    "chars": 2456,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/omg_db/release_tasks/init_keys_with_values_test.exs",
    "chars": 2027,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/omg_db/release_tasks/set_key_value_db_test.exs",
    "chars": 1695,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/omg_db/rocks_db_test.exs",
    "chars": 4849,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/support/rocks_db_case.ex",
    "chars": 1197,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_db/test/test_helper.exs",
    "chars": 795,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/eth.ex",
    "chars": 2439,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/application.ex",
    "chars": 2169,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/blockchain/bit_helper.ex",
    "chars": 2151,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/blockchain/private_key.ex",
    "chars": 1311,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/blockchain/transaction/hash.ex",
    "chars": 4659,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/blockchain/transaction/signature.ex",
    "chars": 2659,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/blockchain/transaction.ex",
    "chars": 3489,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/client.ex",
    "chars": 1465,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/configuration.ex",
    "chars": 2358,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/encoding/contract_constructor.ex",
    "chars": 1746,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/encoding.ex",
    "chars": 3164,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/ethereum_height.ex",
    "chars": 2096,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/ethereum_height_monitor/alarm_handler.ex",
    "chars": 2318,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/ethereum_height_monitor.ex",
    "chars": 7710,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/metric/ethereumex.ex",
    "chars": 934,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/release_tasks/set_contract.ex",
    "chars": 7429,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_block_time.ex",
    "chars": 1792,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_client.ex",
    "chars": 2552,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_events_check_interval.ex",
    "chars": 1979,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold.ex",
    "chars": 1721,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/root_chain/abi.ex",
    "chars": 3631,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/root_chain/abi_event_selector.ex",
    "chars": 6761,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/root_chain/abi_function_selector.ex",
    "chars": 6965,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/root_chain/event.ex",
    "chars": 2451,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/root_chain/fields.ex",
    "chars": 8507,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/root_chain/rpc.ex",
    "chars": 3349,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/root_chain/submit_block.ex",
    "chars": 2877,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/root_chain.ex",
    "chars": 3809,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/supervisor.ex",
    "chars": 1661,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/lib/omg_eth/transaction.ex",
    "chars": 1655,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/mix.exs",
    "chars": 1547,
    "preview": "defmodule OMG.Eth.MixProject do\n  use Mix.Project\n\n  require Logger\n\n  def project() do\n    [\n      app: :omg_eth,\n     "
  },
  {
    "path": "apps/omg_eth/test/fixtures.exs",
    "chars": 2872,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/application_test.exs",
    "chars": 2775,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/blockchain/bit_helper_test.exs",
    "chars": 709,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/blockchain/transaction/hash_test.exs",
    "chars": 723,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/blockchain/transaction/signature_test.exs",
    "chars": 733,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/blockchain/transaction_test.exs",
    "chars": 713,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/client_test.exs",
    "chars": 1396,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/encoding/contract_constructor_test.exs",
    "chars": 2497,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/encoding_test.exs",
    "chars": 2582,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/eth_test.exs",
    "chars": 1760,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/ethereum_height_monitor_test.exs",
    "chars": 7199,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/release_tasks/set_contract_test.exs",
    "chars": 10854,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_block_time_test.exs",
    "chars": 1544,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_client_test.exs",
    "chars": 2475,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_events_check_interval_test.exs",
    "chars": 1618,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/release_tasks/set_ethereum_stalled_sync_threshold_test.exs",
    "chars": 1628,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/root_chain/abi_test.exs",
    "chars": 46710,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/root_chain/event_test.exs",
    "chars": 1238,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/omg_eth/root_chain_test.exs",
    "chars": 4262,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/support/defaults.ex",
    "chars": 1215,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/support/dev_geth.ex",
    "chars": 3164,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/support/dev_helper.ex",
    "chars": 6149,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/support/dev_node.ex",
    "chars": 772,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/support/root_chain_helper.ex",
    "chars": 9894,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/support/snapshot_contracts.ex",
    "chars": 1365,
    "preview": "# Copyright 2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not u"
  },
  {
    "path": "apps/omg_eth/test/support/token.ex",
    "chars": 1625,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/support/transaction_helper.ex",
    "chars": 1474,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/support/wait_for.ex",
    "chars": 2242,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_eth/test/test_helper.exs",
    "chars": 856,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/.gitignore",
    "chars": 420,
    "preview": "# The directory Mix will write compiled artifacts to.\n/_build\n\n# If you run \"mix test --cover\", coverage assets end up h"
  },
  {
    "path": "apps/omg_status/README.md",
    "chars": 86,
    "preview": "# Status\nStatus is a umbrella application. Its purpose is to gather and send metrics.\n"
  },
  {
    "path": "apps/omg_status/lib/omg_status/alert/alarm.ex",
    "chars": 3711,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/alert/alarm_handler.ex",
    "chars": 2992,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/alert/alarm_printer.ex",
    "chars": 1637,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/application.ex",
    "chars": 3439,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/configuration.ex",
    "chars": 1474,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/datadog_event/alarm_consumer.ex",
    "chars": 3950,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/datadog_event/alarm_handler.ex",
    "chars": 1312,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/metric/datadog.ex",
    "chars": 1515,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/metric/event.ex",
    "chars": 7356,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/metric/statix.ex",
    "chars": 1379,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/metric/telemetry.ex",
    "chars": 2217,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/metric/tracer.ex",
    "chars": 762,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/metric/vmstats_sink.ex",
    "chars": 1533,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/monitor/memory_monitor.ex",
    "chars": 5181,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/monitor/statsd_monitor.ex",
    "chars": 4306,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/release_tasks/set_application.ex",
    "chars": 908,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/release_tasks/set_logger.ex",
    "chars": 1879,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/release_tasks/set_sentry.ex",
    "chars": 3442,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/release_tasks/set_tracer.ex",
    "chars": 5161,
    "preview": "# Copyright 2019-2019 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/omg_status/sentry_filter.ex",
    "chars": 1258,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/lib/status.ex",
    "chars": 1701,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/mix.exs",
    "chars": 1554,
    "preview": "defmodule OMG.Status.Mixfile do\n  use Mix.Project\n\n  def project() do\n    [\n      app: :omg_status,\n      version: versi"
  },
  {
    "path": "apps/omg_status/test/omg_status/alert/alarm_printer_test.exs",
    "chars": 3098,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/omg_status/datadog_event/alarm_consumer_test.exs",
    "chars": 2969,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/omg_status/integration/alarms_test.exs",
    "chars": 3191,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/omg_status/metric/datadog_test.exs",
    "chars": 1424,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/omg_status/monitor/memory_monitor_test.exs",
    "chars": 3837,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/omg_status/monitor/statsd_monitor_test.exs",
    "chars": 2927,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/omg_status/release_tasks/set_logger_test.exs",
    "chars": 1847,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/omg_status/release_tasks/set_sentry_test.exs",
    "chars": 2637,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/omg_status/release_tasks/set_tracer_test.exs",
    "chars": 6594,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/sentry_filter_test.exs",
    "chars": 1299,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_status/test/test_helper.exs",
    "chars": 697,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/lib/omg_utils/app_version.ex",
    "chars": 991,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/lib/omg_utils/http_rpc/encoding.ex",
    "chars": 1763,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/lib/omg_utils/http_rpc/error.ex",
    "chars": 1245,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/lib/omg_utils/http_rpc/response.ex",
    "chars": 3072,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/lib/omg_utils/http_rpc/validators/base.ex",
    "chars": 8121,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/lib/omg_utils/paginator.ex",
    "chars": 1751,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/lib/omg_utils/remote_ip.ex",
    "chars": 1460,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/lib/utils.ex",
    "chars": 635,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/mix.exs",
    "chars": 883,
    "preview": "defmodule Utils.MixProject do\n  use Mix.Project\n\n  def project() do\n    [\n      app: :omg_utils,\n      version: version("
  },
  {
    "path": "apps/omg_utils/test/omg_utils/app_version_tet.exs",
    "chars": 976,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/test/omg_utils/http_rpc/encoding_test.exs",
    "chars": 1182,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/test/omg_utils/http_rpc/response_test.exs",
    "chars": 5369,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/test/omg_utils/http_rpc/validators/base_test.exs",
    "chars": 11868,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/test/omg_utils/remote_ip_test.exs",
    "chars": 1796,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_utils/test/test_helper.exs",
    "chars": 604,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/account.ex",
    "chars": 2163,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/alarm.ex",
    "chars": 793,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/configuration.ex",
    "chars": 1131,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/in_flight_exit.ex",
    "chars": 3902,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/status.ex",
    "chars": 889,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/status_cache/external.ex",
    "chars": 4251,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/status_cache/storage.ex",
    "chars": 1210,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/status_cache.ex",
    "chars": 2279,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/transaction.ex",
    "chars": 1603,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/api/utxo.ex",
    "chars": 2145,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/application.ex",
    "chars": 2243,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/block.ex",
    "chars": 3072,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/block_getter/block_application.ex",
    "chars": 1457,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/block_getter/core.ex",
    "chars": 22401,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/block_getter/measure.ex",
    "chars": 1145,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/block_getter/status.ex",
    "chars": 1624,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/block_getter/supervisor.ex",
    "chars": 3339,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/block_getter.ex",
    "chars": 15134,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/block_validator.ex",
    "chars": 5378,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/child_manager.ex",
    "chars": 1194,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/configuration.ex",
    "chars": 2295,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/coordinator_setup.ex",
    "chars": 3326,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/crypto.ex",
    "chars": 2394,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/datadog_event/contract_event_consumer.ex",
    "chars": 3509,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/datadog_event/encode.ex",
    "chars": 1610,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  },
  {
    "path": "apps/omg_watcher/lib/omg_watcher/ethereum_event_aggregator.ex",
    "chars": 13482,
    "preview": "# Copyright 2019-2020 OMG Network Pte Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may "
  }
]

// ... and 537 more files (download for full content)

About this extraction

This page contains the full source code of the omisego/elixir-omg GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 737 files (2.7 MB), approximately 760.2k tokens, and a symbol index with 3043 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!