You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to define custom human-readable names for any hash (scripts and pubkeys) in the pcOptHashNames options of the pretty printing options PrettyCookedOpts.
This is usually set statically once before running a trace.
However there are cases when this approach has limits.
For instance, given a parameterized script whose parameter will be some element from the chain (a spent UTxO for example when minting nfts), we don't have the information beforehand to add an entry to the table. Hence, there can't be any human readable name for hashes corresponding to parameterized scripts.
It would be a nice quality of life feature if these names could be updated in the course of a trace in the block chain state (where and how should be investigated).
At the end of execution, the resulting value of the custom names table would be used for pretty printing.
The text was updated successfully, but these errors were encountered:
There is another improvement of this naming feature that could be coupled to this issue:
At the moment, we use the option pcOptHashNames to store a map of names to replace associated hashes in the pretty printer. This is very convenient. However, we also have a default map of names defaultHashNames which is problematic because it is overridden very easily when the user specifies new hashes. The cheatsheet does mention how to not override it, but still it is inconvenient. What we could do instead is have this default list hard coded in the pretty printer. When printing a hash, we would proceed as follows:
look up for it the provided map
look up for it in the default hardcoded map when absent from the map above
print the hash if absent from both
This way we keep the current behavior that you can override the default, but it is no longer required to manually mention the default names in the option (and it has to be at the end) when specifying new names.
This changes would come alongside a new option pcOptDisableDefaultName which would be set to False by default and which would disable to search in the default name list when set to True, just in case user really don't want to see those default names, and see hashes instead for some reason.
It is possible to define custom human-readable names for any hash (scripts and pubkeys) in the
pcOptHashNames
options of the pretty printing optionsPrettyCookedOpts
.This is usually set statically once before running a trace.
However there are cases when this approach has limits.
For instance, given a parameterized script whose parameter will be some element from the chain (a spent UTxO for example when minting nfts), we don't have the information beforehand to add an entry to the table. Hence, there can't be any human readable name for hashes corresponding to parameterized scripts.
It would be a nice quality of life feature if these names could be updated in the course of a trace in the block chain state (where and how should be investigated).
At the end of execution, the resulting value of the custom names table would be used for pretty printing.
The text was updated successfully, but these errors were encountered: