CityOfZion / neo-python

Python Node and SDK for the NEO 2.x blockchain. For NEO 3.x go to our successor project neo-mamba
https://neo-python.readthedocs.io/en/latest/
MIT License
313 stars 189 forks source link

Support named parameter type entry for sc build commands #781

Open ixje opened 5 years ago

ixje commented 5 years ago

Current behavior

Do after #623 is merged.

Currently the sc build_run and sc load_run commands require numeric entry of the contract parameter types defined in https://github.com/CityOfZion/neo-python/blob/e3780126f9cf8175f9f3c7ad27f36f2baae20508/neo/SmartContract/ContractParameterType.py#L29-L39

Expected behavior

We can improve the user experience by allowing for named inputs, such that these numbers don't have to be remembered.

LysanderGG commented 5 years ago

I'd like to implement this.

I would suggest both complete names and some abbreviations, for instance "sig", "bool", "int", "str", "arr"

ixje commented 5 years ago

👌 ping @jseagrave21 to avoid double work; as you also indicated you might want to pick this up.

jseagrave21 commented 5 years ago

@LysanderGG go for it! I started investigating yesterday but don't have anything written yet. cc @ixje

I would suggest both complete names and some abbreviations, for instance "sig", "bool", "int", "str", "arr"

I like that it would support both. The original issue was that we didn't want the user to have to remember anything proprietary.

My original thought was requiring a list entry (like params for RPC) So, replace

070202

With

[string, integer, integer]

Also, I was toying with the idea of still supporting the original format. But that is definitely not a must imo.

ixje commented 5 years ago

I think it might be good to support the old format. There might be old tutorial out there that still use it, or people might prefer it (as it's less typing)