andelf / tronpy

TRON Python Client Library.
MIT License
204 stars 96 forks source link

get_bandwidth should be to_hex_address #97

Closed chjuheng closed 1 year ago

chjuheng commented 1 year ago

now

 ret = self.provider.make_request(
            "wallet/getaccountnet", {"address": keys.to_base58check_address(addr), "visible": True}
        )

should use to_hex_address

if use to_base58check_address

raise : "Error": "class org.tron.core.services.http.JsonFormat$ParseException : 2:16: INVALID hex String"

MrNaif2018 commented 1 year ago

It should definitely not use it. We pass visible=True so it uses base58check addresses. That's how it is implemented in all methods Most likely:

  1. Either your address is invalid
  2. Or your node is too old

Maybe they have removed the visible=True arg, but it means all other methods involving address won't work too, and I doubt it

chjuheng commented 1 year ago

I made a mistake, 4.0 does not have 'visible'. you have fix this.