multiversx / mx-sdk-py

The MultiversX Python SDK.
MIT License
5 stars 0 forks source link

Support for instantiating address and bytes values from dictionary #80

Closed popenta closed 2 weeks ago

popenta commented 2 weeks ago

Previously, the AddresValue used to convert the value of set_payload to bytes. Added support to set payload from a dictionary like bellow:

AddressValue.set_payload(
    {
         "bech32": "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"
    }
)

or

AddressValue.set_payload(
    {
         "hex": "0139472eff6886771a982f3083da5d421f24c29181e63888228dc81ca60d69e1"
    }
)

BytesValue can now be set from a hex string, like so:

BytesValue.set_payload(
    {
         "hex": "68656c6c6f"
    }
)

Also now, an error is raised if someone tries to convert a dictionary to a list using convert_native_value_to_list.

github-actions[bot] commented 2 weeks ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  multiversx_sdk/abi
  address_value.py
  bytes_value.py
  shared.py
Project Total  

This report was generated by python-coverage-comment-action