Currently, both assertSuccess and assertError allows you to specify a particular regex to be present in the log of the transaction. In most cases, this is enough to provide feedback on what the assert is testing. E.g.:
match '/SetAuthority/i' in log messages tells you that the transaction was successful and the SetAuthority log was found
There are scenarios where there is not a specific log message that you are interested, but you still would like to provide context to the assert. For example, when creating a candy machine, an assertSuccess will give you the default message 'transaction summary has no transaction error'. While the purpose of the assert was only to test whether the transaction succeeded or not, it would be useful to provide an optional log message that would replace the default one. E.g.:
Currently, both
assertSuccess
andassertError
allows you to specify a particular regex to be present in the log of the transaction. In most cases, this is enough to provide feedback on what the assert is testing. E.g.:match '/SetAuthority/i' in log messages
tells you that the transaction was successful and theSetAuthority
log was foundThere are scenarios where there is not a specific log message that you are interested, but you still would like to provide context to the assert. For example, when creating a candy machine, an
assertSuccess
will give you the default message'transaction summary has no transaction error'
. While the purpose of the assert was only to test whether the transaction succeeded or not, it would be useful to provide an optional log message that would replace the default one. E.g.:await tx.assertSuccess(t, [], 'candy machine created')
This could also be used in combination with
msgRxs
:await tx.assertSuccess(t, [/SetAuthority/i], 'authority changed')