-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Object reference not set to an instance of an object" after neo-express contract invoke when running Runtime.CheckWitness(owner) #12
Comments
Moving to the neo-express repo |
This appears to be an issue with NeoVM. As you point out, if you hardcode the response isOwner assignment, the problem goes away. Looking inside the neo-express code, after the invocation transaction is executed, a ContractParametersContext is created as part of the signing process. When calling runtime.checkWitness, the ContractParametersContext is invalid and we get an I'm going to transfer this bug to neo-vm repo and tag @lightszero and @lock9 for their attention |
apparently I can't transfer to neo-vm repo, but I've tagged the appropriate folks |
I validated that the script executes on production neo-cli/neo-gui. I modified the script to return isOwner and it returns false which is not correct, but it doesn't fault the way neo-express does during signing. I've asked @shargon to move this back to neo-express repo. @johnhoj I am not going to have time to troubleshoot this in the next week but I will try and fix whatever the problem is late next week |
For anyone who wishes to duplicate my verification, this is what I did
"stack": [
{
"type": "Boolean",
"value": false
}
], |
There was a bug in neo-express - it was attaching coin references to the invocation transaction even though the transaction fee was below the free transaction threshold. commit a8752a3 resolves that issue. The fix is in v 0.9.85 of neo-express. There's another fix that needs to go into neo-express, so I'm not going to push this build to nuget.org, but there are instructions for installing from our azure artifacts feed in the repo readme if you want to test it right away. However, what I've discovered is that neither neo-express nor neo-cli will sign the invocation transaction for this contract. @shargon suggested this might be the same issue as neo-project/neo-gui-2.x#305. Since there are no signatures, that means that I don't think CheckWitness will behave as expected. @johnhoj please feel free to open a new bug in the neo repo if you have further issues with this. |
Using this simple test contract:
with the standard setup of the neo-blockchain-toolkit works in debug mode (returns always true as defined in the default.neo-express.json) but throws an exception when running invoke from the terminal as follows:
C:...\NEP5>neo-express contract invoke NEP5 --account testWallet
Object reference not set to an instance of an object.
Usage: neo-express contract invoke [options]
Running the same contract after just changing the Runtime.CheckWitness line by:
bool isOwner = true;
works well. So I conclude is the call to CheckWitness that fails.
running main works in Debug NeoCompiler and in the de
NEP5.zip
The text was updated successfully, but these errors were encountered: