Skip to content
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

Add support to 'await' the contract run command #433

Open
lock9 opened this issue Jan 23, 2024 · 2 comments
Open

Add support to 'await' the contract run command #433

lock9 opened this issue Jan 23, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lock9
Copy link
Contributor

lock9 commented Jan 23, 2024

Is your feature request related to a problem? Please describe.
Neo Express will only return the transaction results if you send the --results flag. However, these transactions aren't saved. If we use the --account parameter, the transaction is saved but the response is the transaction hash and not the results.

Describe the solution you'd like
Add a flag or equivalent to the contract run feature (using an account parameter) to return the transaction results instead of the transaction hash.

Additional context
The output can be too verbose if we include all the transaction fields. It could print the existing 'results' fields plus the transaction hash:

VM State:     FAULT
Gas Consumed: 1111470
Exception:   Index was outside the bounds of the array.
Transaction: <hash>
@lock9 lock9 added the enhancement New feature or request label Jan 23, 2024
@cschuchardt88 cschuchardt88 added this to the 3.8 milestone Jul 19, 2024
@chenzhitong
Copy link
Member

chenzhitong commented Aug 7, 2024

Is it possible to do it this way:
Call the contract once with --result flag, then send the transaction out with --account flag, although the transaction hash will change, the script executed will be the same.
This would accomplish what you need, output the contract execution result, and send the transaction.

I think the "options" parameter of the neoxp command is now too much and a bit complicated to use. It's better not to add new options. (if the above is feasible)

@chenzhitong
Copy link
Member

The output can be too verbose if we include all the transaction fields. It could print the existing 'results' fields plus the transaction hash:
VM State: FAULT
Gas Consumed: 1111470
Exception: Index was outside the bounds of the array.
Transaction:

I think the most important reason is that the result of running locally may be different from the result of the transaction executing on the blockchain (e.g. the execution result is related to the block height, related to the random number, related to the storage area), and directly outputting the execution result and the transaction will cause an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants