Git Product home page Git Product logo

Comments (10)

incrypto32 avatar incrypto32 commented on August 28, 2024 1

@schmidsi since Address.fromString() is now available. i guess we can close this?

from graph-tooling.

azf20 avatar azf20 commented on August 28, 2024 1

I think this was imagined as a further convenience, but I agree that this is probably not necessary, closing 🙏

from graph-tooling.

yanivtal avatar yanivtal commented on August 28, 2024

Is there any way to overload bind to take an address or a string as a first parameter?

from graph-tooling.

Jannis avatar Jannis commented on August 28, 2024

Nope, overloading results in TypeScript compile errors like this one:

ERROR TS2300: Duplicate identifier 'index/LANDRegistry.bind'.

   static bind(address: string, blockHash: H256): LANDRegistry {
          ~~~~
 in index.ts(919,9)

from graph-tooling.

Jannis avatar Jannis commented on August 28, 2024

We may be able to use overload lists for this, assuming AssemblyScript allows it: https://blog.mariusschulz.com/2016/08/18/function-overloads-in-typescript#version-4-function-overloads. I can try that.

from graph-tooling.

Jannis avatar Jannis commented on August 28, 2024

Nah, doesn't work with AssemblyScript.

from graph-tooling.

MaxGraey avatar MaxGraey commented on August 28, 2024

It works in AssemblyScript but with some limitations. For now you need explicitly resolve all generic types for overloaded functions. In future this will be more fancy.

See this example

from graph-tooling.

Jannis avatar Jannis commented on August 28, 2024

@MaxGraey Oh sweet, we'll give that a shot. It looks good enough for the moment. Thanks for the pointer!

from graph-tooling.

leoyvens avatar leoyvens commented on August 28, 2024

What is this tracking now? Having the overloaded version? Because we do have Address.fromString.

from graph-tooling.

Jannis avatar Jannis commented on August 28, 2024

Yeah, multiple implementations of SmartContract.bind() (one with an Address, one with a string parameter). It is a low priority issue right now.

from graph-tooling.

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.