This upgrades the macro that was used to assert that an instruction returned a program error during a test in simulation.
add support for localnet
RpcClient propagates program errors through a ClientError instead of ProgramError so this tries to destruct the generic error as each of those before failing, instead of requiring ProgramError.
move to function, macro is not needed
Maybe this was easier to get working as a macro but it also works as a function. Typically if the same job can be done with a function, I prefer to use a function, because it's more straightforward to deal with problems in concrete code than meta-code. It works with any std::error::Error that downcasts to a ProgramError or ClientError through anyhow.
consolidate duplicate implementations
There were two macros doing basically the same thing that now share the same function implementation under the hood. Backwards compatibility is retained, and the macros are only deprecated for now. I'm switching all the tests to use the function in jet-v2 orca branch. I propose deleting the macros soon once changes propagate to master in all dependents.
This upgrades the macro that was used to assert that an instruction returned a program error during a test in simulation.
add support for localnet
RpcClient propagates program errors through a ClientError instead of ProgramError so this tries to destruct the generic error as each of those before failing, instead of requiring ProgramError.
move to function, macro is not needed
Maybe this was easier to get working as a macro but it also works as a function. Typically if the same job can be done with a function, I prefer to use a function, because it's more straightforward to deal with problems in concrete code than meta-code. It works with any std::error::Error that downcasts to a ProgramError or ClientError through anyhow.
consolidate duplicate implementations
There were two macros doing basically the same thing that now share the same function implementation under the hood. Backwards compatibility is retained, and the macros are only deprecated for now. I'm switching all the tests to use the function in jet-v2 orca branch. I propose deleting the macros soon once changes propagate to master in all dependents.