Rewrite deserialiseFromCBOR using asum with Alternative Maybe#1130
Rewrite deserialiseFromCBOR using asum with Alternative Maybe#1130
deserialiseFromCBOR using asum with Alternative Maybe#1130Conversation
Add HasTypeProxy and SerialiseAsCBOR instances for AnyScript era, enabling CBOR serialisation/deserialisation of both simple and plutus scripts using the ledger's native Script era encoding format. Closes #1088
Uses eqT to handle the existential lang in AnyPlutusScript, delegating to the underlying Eq instances on SimpleScript and PlutusScriptInEra. Also adds Typeable lang constraint to the AnyPlutusScript constructor.
Adds genAnyScript and genSimpleScriptInEra generators, along with roundtrip and garbage-input property tests for SerialiseAsCBOR AnyScript.
Co-authored-by: carbolymer <228866+carbolymer@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
deserialiseFromCBOR using asum with Alternative Maybe
|
@copilot You are Alexis King. Rewrite your changes so that they are more readable, but avoid nesting and pattern matching. |
Co-authored-by: carbolymer <228866+carbolymer@users.noreply.github.com>
Done in 6e1e76c. The logic is now split into three named helpers in the
|
25d9af4 to
7a76968
Compare
asumwithAlternative MaybetryNativeScriptnamed helper (point-free)tryPlutusScriptnamed helper (flat do-notation in Maybe monad)maybe (Left ...) RightwithmaybeToRightcombinatoreither (const Nothing) JustwithrightToMaybecombinatornoParseErrorconstant🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.