Git Product home page Git Product logo

Comments (7)

cschuchardt88 avatar cschuchardt88 commented on June 20, 2024

That is not how it is done. There is no way in the VM to know what is hash160 or hash256

CSharp

var address = new UInt160(Convert.FromBase64String(byteStringValue));

from neo.

lock9 avatar lock9 commented on June 20, 2024

Hello,

Maybe not the VM, but the node. The types are stored in the contract manifest.

from neo.

cschuchardt88 avatar cschuchardt88 commented on June 20, 2024

That will change the interface and break all current apps using it.

from neo.

lock9 avatar lock9 commented on June 20, 2024

Yes, and this is too dangerous to change. The best solution might be to add another RPC endpoint and change the SDKs first.
We can argue that developers should use their own RPC nodes, but most applications use public RPC nodes. Then, it's probably ideal to introduce a new endpoint instead of changing the existing ones.

from neo.

cschuchardt88 avatar cschuchardt88 commented on June 20, 2024

That's to much. When a developer can easily change the base64 to bytes and reverse bytes.

from neo.

roman-khimov avatar roman-khimov commented on June 20, 2024

This can't be fixed, see neo-project/neo-modules#609 (comment)

from neo.

lock9 avatar lock9 commented on June 20, 2024

Why it can't be fixed if it's an RPC endpoint?

The 'GetInvokeResults' method is not part of the VM. It could accept an additional parameter to parse types using the manifest.

If the conversion fails, it's because there is a bug in the smart contract. Most compilers won't allow you to return different types. This can only happen using "incorrect" storage calls.

If the conversion fails, the developer can either fix their contract or omit the "parse types" parameter.

from neo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.