tokenika / eosfactory

Python-based EOS smart-contract development & testing framework
http://eosfactory.io/
Other
243 stars 62 forks source link

Add support for taking python objects as data for actions #39

Closed andresberrios closed 6 years ago

andresberrios commented 6 years ago

This way users can build the data for actions using Python dicts, lists, or other JSONable objects instead of directly building the JSON string.

Closes https://github.com/tokenika/eosfactory/issues/38

jakub-zarembinski commented 6 years ago

Hi, thanks for the PR.

To make it work we needed to modify it a little bit and make it look like this:

if isinstance(data, dict):
  d = {}
  for key, value in data.items():
    d[key] = str(value)
  data = json_module.dumps(d)

Because of this modification we won't be using your PR directly but it will surely become part of our next release.

Thanks again!