{"action":"created","issue":{"url":"https://api.github.com/repos/CityOfZion/neo-python/issues/234","repository_url":"https://api.github.com/repos/CityOfZion/neo-python","labels_url":"https://api.github.com/repos/CityOfZion/neo-python/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/CityOfZion/neo-python/issues/234/comments","events_url":"https://api.github.com/repos/CityOfZion/neo-python/issues/234/events","html_url":"https://github.com/CityOfZion/neo-python/issues/234","id":297954763,"number":234,"title":"Import contract_addr error","user":{"login":"brianlenz","id":2305088,"avatar_url":"https://avatars1.githubusercontent.com/u/2305088?v=4","gravatar_id":"","url":"https://api.github.com/users/brianlenz","html_url":"https://github.com/brianlenz","followers_url":"https://api.github.com/users/brianlenz/followers","following_url":"https://api.github.com/users/brianlenz/following{/other_user}","gists_url":"https://api.github.com/users/brianlenz/gists{/gist_id}","starred_url":"https://api.github.com/users/brianlenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianlenz/subscriptions","organizations_url":"https://api.github.com/users/brianlenz/orgs","repos_url":"https://api.github.com/users/brianlenz/repos","events_url":"https://api.github.com/users/brianlenz/events{/privacy}","received_events_url":"https://api.github.com/users/brianlenz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-16T23:52:22Z","updated_at":"2018-02-17T23:37:08Z","closed_at":null,"author_association":"NONE","body":"This appears to be a relatively new issue on the latest `master` and `development` branches. There's an error when running `import contract_addr`. The contract exists, and it appears (?) the address is added successfully to the wallet, but this error happens.\r\n\r\n```\r\nneo> import contract_addr ea492d921336c468cd1603adb0d655097289b3ee 03fd99039dff3a731d47a7779df1e6edae67fdce4be1e02ab86aee47eb15091352\r\n[I 180216 15:46:21 UserWallet:191] contract does not exist yet\r\nCould not execute command: a bytes-like object is required, not 'str'\r\n  File \".../.pyenv/versions/3.5.4/lib/python3.5/threading.py\", line 882, in _bootstrap\r\n    self._bootstrap_inner()\r\n  File \".../.pyenv/versions/3.5.4/lib/python3.5/threading.py\", line 914, in _bootstrap_inner\r\n    self.run()\r\n  File \".../.pyenv/versions/3.5.4/lib/python3.5/threading.py\", line 862, in run\r\n    self._target(*self._args, **self._kwargs)\r\n  File \".../neo-python/venv/lib/python3.5/site-packages/twisted/_threads/_threadworker.py\", line 46, in work\r\n    task()\r\n  File \".../neo-python/venv/lib/python3.5/site-packages/twisted/_threads/_team.py\", line 190, in doWork\r\n    task()\r\n  File \".../neo-python/venv/lib/python3.5/site-packages/twisted/python/threadpool.py\", line 250, in inContext\r\n    result = inContext.theWork()\r\n  File \".../neo-python/venv/lib/python3.5/site-packages/twisted/python/threadpool.py\", line 266, in <lambda>\r\n    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)\r\n  File \".../neo-python/venv/lib/python3.5/site-packages/twisted/python/context.py\", line 122, in callWithContext\r\n    return self.currentContext().callWithContext(ctx, func, *args, **kw)\r\n  File \".../neo-python/venv/lib/python3.5/site-packages/twisted/python/context.py\", line 85, in callWithContext\r\n    return func(*args,**kw)\r\n  File \"prompt.py\", line 915, in run\r\n    traceback.print_stack()\r\nTraceback (most recent call last):\r\n  File \"prompt.py\", line 868, in run\r\n    self.do_import(arguments)\r\n  File \"prompt.py\", line 332, in do_import\r\n    return ImportContractAddr(self.Wallet, arguments[1:])\r\n  File \".../neo-python/neo/Prompt/Commands/LoadSmartContract.py\", line 50, in ImportContractAddr\r\n    wallet.AddContract(verification_contract)\r\n  File \".../neo-python/neo/Implementations/Wallets/peewee/UserWallet.py\", line 197, in AddContract\r\n    db_contract = Contract.create(RawData=contract.ToArray(),\r\n  File \".../neo-python/neo/SmartContract/Contract.py\", line 170, in ToArray\r\n    return Helper.ToArray(self)\r\n  File \".../neo-python/neo/Core/Helper.py\", line 75, in ToArray\r\n    value.Serialize(writer)\r\n  File \".../neo-python/neo/SmartContract/Contract.py\", line 159, in Serialize\r\n    writer.WriteVarBytes(self.Script)\r\n  File \".../neo-python/venv/lib/python3.5/site-packages/neocore/IO/BinaryWriter.py\", line 356, in WriteVarBytes\r\n    return self.WriteBytes(value, unhex=False)\r\n  File \".../neo-python/venv/lib/python3.5/site-packages/neocore/IO/BinaryWriter.py\", line 104, in WriteBytes\r\n    return self.stream.write(value)\r\nTypeError: a bytes-like object is required, not 'str'\r\n```"},"comment":{"url":"https://api.github.com/repos/CityOfZion/neo-python/issues/comments/366479692","html_url":"https://github.com/CityOfZion/neo-python/issues/234#issuecomment-366479692","issue_url":"https://api.github.com/repos/CityOfZion/neo-python/issues/234","id":366479692,"user":{"login":"jpankalainen","id":4744723,"avatar_url":"https://avatars3.githubusercontent.com/u/4744723?v=4","gravatar_id":"","url":"https://api.github.com/users/jpankalainen","html_url":"https://github.com/jpankalainen","followers_url":"https://api.github.com/users/jpankalainen/followers","following_url":"https://api.github.com/users/jpankalainen/following{/other_user}","gists_url":"https://api.github.com/users/jpankalainen/gists{/gist_id}","starred_url":"https://api.github.com/users/jpankalainen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpankalainen/subscriptions","organizations_url":"https://api.github.com/users/jpankalainen/orgs","repos_url":"https://api.github.com/users/jpankalainen/repos","events_url":"https://api.github.com/users/jpankalainen/events{/privacy}","received_events_url":"https://api.github.com/users/jpankalainen/received_events","type":"User","site_admin":false},"created_at":"2018-02-17T23:37:08Z","updated_at":"2018-02-17T23:37:08Z","author_association":"NONE","body":"Can't repro with the latest with the exact same input. Can you get the latest and verify that the issue still occurs? If so, can you give more accurate repro steps?"}}
{"actor":{"display_login":"jpankalainen"}}