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

Address should not be calculated automatically in neo-python prompt.py #439

Closed igormcoelho closed 6 years ago

igormcoelho commented 6 years ago

Current behavior

This is the test code:

using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Services.Neo;
using System;
using System.Numerics;
namespace NeoContract1
{
    public class Contract1 : SmartContract
    {
        public static bool Main(string op, object[] arg)
        {
            Runtime.Notify(op);
            string arg1 = (string)arg[0];
            Runtime.Notify(arg1);
            return true;
        }
    }
}

I will put three different invocations (the second is strange because it interprets my string as I wanted to convert it to scripthash).

testinvoke 292313cbb1e0c663527c893d64182ddf87f450ff teste1 ["teste2"] b'teste1' b'teste2'

testinvoke 292313cbb1e0c663527c893d64182ddf87f450ff teste1 ["AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y"] b'teste1' b'#\xba\'\x03\xc52c\xe8\xd6\xe5"\xdc2 39\xdc\xd8\xee\xe9'

testinvoke 292313cbb1e0c663527c893d64182ddf87f450ff teste1 ["AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y"] b'teste1' b'AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y'

Expected behavior

testinvoke 292313cbb1e0c663527c893d64182ddf87f450ff teste1 ["AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y"] b'teste1' b'AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y'

testinvoke 292313cbb1e0c663527c893d64182ddf87f450ff teste1 [ AddressToScriptHash("AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y")] b'teste1' b'#\xba\'\x03\xc52c\xe8\xd6\xe5"\xdc2 39\xdc\xd8\xee\xe9'

I know this is verbose, and perhaps many people prefer things "automated", but it can limit the testing abilities of the user (like my case, where I simply cannot pass a regular address string).

How to reproduce

Your environment

Let us know in what environment you're running into the issue: Eco platform: https://neocompiler.io

jseagrave21 commented 6 years ago

Was this issue addressed in PR #483 ? cc @localhuman @ixje

ixje commented 6 years ago

Arguably. Let's see what @igormcoelho thinks of that PR in relation to his issue report.

ixje commented 6 years ago

ping @igormcoelho will close in 2 weeks if no reaction

igormcoelho commented 6 years ago

Oh! sorry for the delay! It looks like it has been addressed: "Adds ability to not parse address strings such as AeV59NyZtgj5AMQ7vY6yhr2MRvcfFeLWSb when inputting to smart contract by passing the --no-parse flag" Congratulations!

ixje commented 6 years ago

Thanks!