Code Monkey home page Code Monkey logo

Comments (6)

jeroenptrs avatar jeroenptrs commented on September 28, 2024

@robmoorman have you tried without the 0x in front of the scriptHash?

from api-functions.

robmoorman avatar robmoorman commented on September 28, 2024

He @jeroenptrs doesn't work either, with, without, or any combination with the hashes mentioned up here.

I'll try to add some more dummy prove smart contract operations to check if it's something with the address string in particular.

from api-functions.

robmoorman avatar robmoorman commented on September 28, 2024

Ok it's now the address, as the following operation also won't be invoked:

def Main(operation, args):
    if operation == 'GetName':
        return NAME

from api-functions.

robmoorman avatar robmoorman commented on September 28, 2024

Ok one step further, it seems that the following Promise causes the error:

export default function makeTestInvokeActions(sessionId, requestId) {
  const id = generateDAppActionId(sessionId, `${ID}-${requestId}`);

  return createActions(id, ({ net, scriptHash, operation, args }) => () => {
    return testInvoke({ net, scriptHash, operation, args });
  });
}

https://github.com/nos/client/blob/ca7d21e0600c238ddb6e8a28d056b018b858b920/src/actions/dapps/makeTestInvokeActions.js#L30:L36

When I mock this with the code below it works:

export default function makeTestInvokeActions(sessionId, requestId) {
  const id = generateDAppActionId(sessionId, `${ID}-${requestId}`);

  return createActions(id, ({ net, scriptHash, operation, args }) => () => {
    return new Promise((resolve, reject) => {
      resolve(['Some output'])
    })
  });
}

T.b.c.

from api-functions.

robmoorman avatar robmoorman commented on September 28, 2024

Ok, issue with not throwing the right error message (will make a PR on the client for this).

First of all the script hash, as you said, must not include the 0x, so e973b31b5d8cf928916f2a30a4611b2bed31af7e in this case.

Than after a breakdown, it errors on:

const { result } = await rpc.Query.invokeScript(script).execute(endpoint);

Error:

xhr.js:178 OPTIONS http://neo-nodes:30335/ net::ERR_NAME_NOT_RESOLVED

from api-functions.

robmoorman avatar robmoorman commented on September 28, 2024

Added 127.0.0.1 neo-nodes to my host files and testInvoke works!

from api-functions.

Related Issues (8)

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.