-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dev nockma encode
command
#3135
Conversation
e2d54e5
to
e43d753
Compare
e43d753
to
4f7bff9
Compare
1aeb72b
to
7e2238b
Compare
@@ -60,5 +55,5 @@ runNockma prog inputs = do | |||
res :: Response <- anomaRpc runNockGrpcUrl (Aeson.toJSON msg) >>= fromJSON | |||
logVerbose (mkAnsiText ("Response Payload:\n" <> Aeson.jsonEncodeToPrettyText res)) | |||
case res of | |||
ResponseProof x -> decodeJam64 x | |||
ResponseProof x -> decodeCue64 x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: decodeCue64
is correct here because the value of the 'proof' field is jammed - so we cue it to see the nock term?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just a matter of renaming decodeJam64
-> decodeCue64
. They are the same function. I could leave it to decodeJam64
if that's more intuitive. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed decodeJam64
in af0dd16 because it was a duplicate of decodeCue64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my dictionary 'jam = nock-encode', 'cue = nock-decode' - and then we overload 'encode / decode' here because we also have base64 encode/decode 😄
So decodeCue64 first base64-decodes the value of proof in response to a bytestring and then this is nock-decoded (i.e cued) to a nock term.
juvix dev nockma encode --help