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

"Wallet environment doesn't match HttpApiClient environment" on main-net #16

Open
wally-yu opened this issue Jun 13, 2019 · 3 comments
Open

Comments

@wally-yu
Copy link

Dear @sammchardy

I saw "Wallet environment doesn't match HttpApiClient environment" issue again, but this time on main-net.

Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from binance_chain.http import HttpApiClient
>>> from binance_chain.messages import TransferMsg
>>> from binance_chain.wallet import Wallet
>>> wallet = Wallet('ef5b7ba4eb6a7add623315e1edc90b3fc24ff107bc874e168d188ab9bd4_____')
>>> client = HttpApiClient()
>>> transfer_msg = TransferMsg(
...     wallet=wallet,
...     symbol='BNB',
...     amount=1,
...     to_address='bnb1r4gc5ftrkr9ez2khph4h5xxd0mf0hd75uux7gl',
...     memo='Thanks for the beer'
... )
>>>
>>> res = client.broadcast_msg(transfer_msg, sync=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yuwally/Documents/venv/p30/lib/python3.6/site-packages/binance_chain/http.py", line 367, in broadcast_msg
    raise BinanceChainBroadcastException("Wallet environment doesn't match HttpApiClient environment")
binance_chain.exceptions.BinanceChainBroadcastException: Wallet environment doesn't match HttpApiClient environment

this happens for version 0.1.19 as well as 0.1.10.

Could you please help give any suggestion on how to avoid this issue?

Thanks in advance.

@wxy122221
Copy link

I solved this issue putting the environment in wallet and client.

env = BinanceEnvironment.get_production_env()
wallet = Wallet('',env=env)
client = HttpApiClient(env)

@wally-yu
Copy link
Author

hi @wxy122221 ,
thanks for pointing out, i tried in my daytime, not work, but it works just now by adding production env :)

@wxy122221
Copy link

You are welcome! Looking forward to your SDK to place order. @wally-yu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants