neo-python icon indicating copy to clipboard operation
neo-python copied to clipboard

Support named parameter type entry for sc build commands

Open ixje opened this issue 6 years ago • 4 comments

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.

ixje avatar Dec 31 '18 10:12 ixje

I'd like to implement this.

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

LysanderGG avatar Jan 06 '19 06:01 LysanderGG

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

ixje avatar Jan 06 '19 07:01 ixje

@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.

jseagrave21 avatar Jan 06 '19 13:01 jseagrave21

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)

ixje avatar Jan 06 '19 13:01 ixje