|
|
@ -64,8 +64,6 @@ try: |
|
|
|
except KeyError: |
|
|
|
except KeyError: |
|
|
|
db_dir = None |
|
|
|
db_dir = None |
|
|
|
|
|
|
|
|
|
|
|
contract_storage = get_persistent_storage(db_dir) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
args = parser.parse_args() |
|
|
|
args = parser.parse_args() |
|
|
|
|
|
|
|
|
|
|
|
if (args.v): |
|
|
|
if (args.v): |
|
|
@ -155,14 +153,16 @@ elif (args.trace): |
|
|
|
else: |
|
|
|
else: |
|
|
|
print(str(i['pc']) + " " + i['op'] + ";\tSTACK: " + i['stack']) |
|
|
|
print(str(i['pc']) + " " + i['op'] + ";\tSTACK: " + i['stack']) |
|
|
|
|
|
|
|
|
|
|
|
elif (args.search): |
|
|
|
else: |
|
|
|
|
|
|
|
contract_storage = get_persistent_storage(db_dir) |
|
|
|
|
|
|
|
if (args.search): |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
contract_storage.search(args.search, searchCallback) |
|
|
|
contract_storage.search(args.search, searchCallback) |
|
|
|
except SyntaxError: |
|
|
|
except SyntaxError: |
|
|
|
exitWithError("Syntax error in search expression.") |
|
|
|
exitWithError("Syntax error in search expression.") |
|
|
|
|
|
|
|
|
|
|
|
elif (args.xrefs): |
|
|
|
elif (args.xrefs): |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
contract_hash = util.safe_decode(args.xrefs) |
|
|
|
contract_hash = util.safe_decode(args.xrefs) |
|
|
@ -175,14 +175,14 @@ elif (args.xrefs): |
|
|
|
except KeyError: |
|
|
|
except KeyError: |
|
|
|
exitWithError("Contract not found in the database.") |
|
|
|
exitWithError("Contract not found in the database.") |
|
|
|
|
|
|
|
|
|
|
|
elif (args.init_db): |
|
|
|
elif (args.init_db): |
|
|
|
if args.ipc: |
|
|
|
if args.ipc: |
|
|
|
contract_storage.initialize(args.rpchost, args.rpcport, args.sync_all, args.ipc) |
|
|
|
contract_storage.initialize(args.rpchost, args.rpcport, args.sync_all, args.ipc) |
|
|
|
else: |
|
|
|
else: |
|
|
|
contract_storage.initialize(args.rpchost, args.rpcport, args.sync_all, args.ipc) |
|
|
|
contract_storage.initialize(args.rpchost, args.rpcport, args.sync_all, args.ipc) |
|
|
|
|
|
|
|
|
|
|
|
elif (args.hash): |
|
|
|
elif (args.hash): |
|
|
|
print("0x" + utils.sha3(args.hash)[:4].hex()) |
|
|
|
print("0x" + utils.sha3(args.hash)[:4].hex()) |
|
|
|
|
|
|
|
|
|
|
|
else: |
|
|
|
else: |
|
|
|
parser.print_help() |
|
|
|
parser.print_help() |
|
|
|