Closed gavinharris-dev closed 1 year ago
v0.13.37 adds a context
property to UserError
, which is filled with Datum
, Redeemer
and ScriptContext
for validator scripts throwing an error, and Redeemer
and ScriptContext
for minting scripts throwing an error.
Eg. error.context.Datum: string
Just wondering if you'd be open to adding in the args (CBOR Encoded) into an Attribute of UserError when thrown?
Change would be in
TxWitness::executeRedeemer
; something like:The
encodeArgs
would just loop thru the 3 Array entries converting theUplcDataValue
into CBOR Hex. Again something like:This would be useful for integration testing / validation as we can then take the 'args' and provide them into a run with a verion of the contract compiled without removing 'print' and 'trace' statements.