Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pprint posted data to etherscan #538

Merged
merged 2 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,9 @@ Verification with Etherscan

::

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name EndpointRegistry --chain-id 3
python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --chain-id 3

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name SecretRegistry --chain-id 3

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name TokenNetworkRegistry --chain-id 3

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name ServiceRegistry --chain-id 3

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name MonitoringService --chain-id 3

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name OneToN --chain-id 3

python -m raiden_contracts.deploy.etherscan_verify --apikey ETHERSCAN_APIKEY --contract-name UserDeposit --chain-id 3
If the command exists with status code 0, Etherscan has verified all contracts against Solidity sources.


Making a Release
Expand Down
11 changes: 10 additions & 1 deletion raiden_contracts/deploy/etherscan_verify.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import click
import pprint
import requests
import subprocess
from time import sleep
Expand Down Expand Up @@ -157,7 +158,7 @@ def post_data_for_etherscan_verification(
# Typo is intentional. Etherscan does not like the correct spelling.
'constructorArguements': constructor_args,
}
print({k: v for k, v in data.items() if k is not 'sourceCode'})
pprint.pprint({k: v for k, v in data.items() if k is not 'sourceCode'})
return data


Expand Down Expand Up @@ -211,6 +212,14 @@ def etherscan_verify_contract(chain_id: int, apikey: str, source_module: str, co
print('Retrying...')
sleep(5)
raise TimeoutError(manual_submission_guide)
else:
if content["result"] == "Contract source code already verified":
return
else:
raise ValueError(
'Etherscan submission failed for an unknown reason\n' +
manual_submission_guide,
)


def guid_status(etherscan_api: str, guid: str):
Expand Down