N3developertoolkit / neo3-visual-tracker

Neo N3 blockchain explorer that is directly available within Visual Studio Code for developer usage and development scenarios.
https://marketplace.visualstudio.com/items?itemName=ngd-seattle.neo3-visual-tracker
MIT License
7 stars 11 forks source link

.neo-invoke.json should expect Hash160 parameters in big-endian #90

Open mialbu opened 3 years ago

mialbu commented 3 years ago

Description

When passing a Hash160 contract parameter in an invocation in a .neo-invoke.json, the hash is expected to be little-endian.

Suggestion

Since generally all interfaces handle contract hashes in big-endian, the .neo-invoke.json should also expect a big-endian in Hash160 contract parameters and the conversion to little-endian should be done internally.

To reproduce

I tried to pass the gas token hash as a Hash160 parameter to a method that then calls the gas token (the passed Hash160) to get the decimals.

Contract1

This invocation fails with the following exception:

VM STATE

When I pass the contract hash in little-endian (although still with 0x prefix) as follows, the transaction halts:

image

Extension Version

Neo N3 Visual DevTracker v2.1.45