As a newbie in Plutus and Haskell, I write code by printing/logging variables to see their value, which is the only reason why I managed to write Contract, off-chain Plutus part. My question is, are there any possible ways (even hacky ones, doesn't matter), to inspect variable value in on-chain, validator Plutus part.
I am aware of trace, traceIfFalse, etc. All of the functions can be found here: https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Trace.html But it doesn't help, as you can't inspect variables.
This enhancement seems to be dead: https://github.com/input-output-hk/plutus/issues/3164 Searched a lot of sources and found nothing useful. I am aware why it's difficult (BuiltInString, absence of Show), only asking for possible solutions/tricks/hacks and not for explanation why it's impossible.
This question is related: Logging in validator
Thanks
EDIT:
let's image I have a validator:
mkValidator :: Order -> Order -> OrderAction -> ScriptContext -> Bool
mkValidator o oDatum act ctx = True
how can I print the value of for example ctx (ScriptContext), or oDatum, then executing the whole script with Emulator, so that whole script compiles and I can see ctx Value somewhere in EmulatorTrace (or any other way)?
I mean something like this:
mkValidator o oDatum act ctx = trace "test" ctx && True
trace
? Could you include specific examples of what you're trying to do?