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
You need to implement PredefinedFunc("fromBase16", correctly (generalize existing implementation)
See val DeserializeFunc = PredefinedFunc("deserialize",
for an example of how to obtain SType value for the type T.
The type T should already be parsed by the parser.
there is already Base16 decoder, you can reuse is to get decodedBytes from String.
Then having decodedBytes and tpe: SType for T you can use ConstantSerializer to parse the bytes to obtain a value of type T ( as instance of ConstantNode(value, tpe))
The text was updated successfully, but these errors were encountered:
The task is to generalize existing implementation of
fromBase16
to allow embedding of arbitrary constants in ErgoScript sources.Implementation hints:
PredefinedFunc("fromBase16"
, correctly (generalize existing implementation)See
val DeserializeFunc = PredefinedFunc("deserialize",
for an example of how to obtain SType value for the type T.
The text was updated successfully, but these errors were encountered: