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

Way to ignore return result check of invoked method in contract test framework #2312

Closed
alexvanin opened this issue Dec 20, 2021 · 1 comment
Labels
test Unit tests

Comments

@alexvanin
Copy link
Contributor

I had a contract with the method, that updates contract storage and returns some kind of ID. In the test, I had to call this method multiple times. ContractInvoker.Invoke method requires specific result, but in my case HALT state was enough to proceed. If I understand correctly, the only way to invoke method without result checking is to define such function in test code:

func invokeNoReturnValueCheck(t *testing.T, c *neotest.ContractInvoker, method string, args ...interface{}) util.Uint256 {
	tx := c.PrepareInvoke(t, method, args...)
	c.AddNewBlock(t, tx)
	c.CheckHalt(t, tx.Hash())

	return tx.Hash()
}

It would be nice to see an optional result check for contract method invocations in neotest library.

/cc @fyrchik

@fyrchik
Copy link
Contributor

fyrchik commented Dec 20, 2021

This is fixed in #2299 (e606d3c) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Unit tests
Projects
None yet
Development

No branches or pull requests

2 participants