GithubHelp home page GithubHelp logo

Comments (4)

ixje avatar ixje commented on July 18, 2024

I have not looked at what getapplicationlog does, but notification events that triggered before the contract faulted can be logged/displayed with neo-python via config sc-debug-notify. Does that help?

sc-debug-notify - toggle printing smart contract Notify events on execution failure

from neo-boa.

hal0x2328 avatar hal0x2328 commented on July 18, 2024

notification events that triggered before the contract faulted can be logged/displayed with neo-python via config sc-debug-notify. Does that help?

Yes, that could eliminate the need for the extra print statement.

from neo-boa.

hal0x2328 avatar hal0x2328 commented on July 18, 2024

One other issue I am having with my bespoke assert implementation is that it appears to be impossible to have a void return type for a function. So unless I use something like

ret = sc_assert(something_is_true(), "Not true!")

I end up with an extra value on the evaluation stack at the end of execution, which is undesirable. But adding the unused variable assignment is also kind of inelegant.

from neo-boa.

hal0x2328 avatar hal0x2328 commented on July 18, 2024

I think I found the solution and it doesn't require any changes to neo-boa, just a little knowledge of Python internals:

OnError = RegisterAction('error', 'message')

def Main(operation, args):
    assert args[0] == True, 'Got false argument!'
    return True

def AssertionError(msg):
    OnError(msg)
    throw_if_null(0)

from neo-boa.

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.