Skip to content
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

Support ByteArray and List arguments to anoma prove CLI #3313

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

paulcadman
Copy link
Collaborator

@paulcadman paulcadman commented Feb 3, 2025

This PR adds support for two additional argument types fro the prove CLI:

  --arg ARG_TYPE:ARG       An argument to the program:
                           • bytearray:FILE where FILE is a file containing bytes that represent a ByteArray
                           • list:FILE where FILE is a file containing a newline delimited list of base64 encoded jammed nouns that represent a Nock list of jammed nouns

I tested these arguments with the following programs:

First a program that accepts an ed25519 signing key, this returns 64.

module Kudos.ReadSigningKey;

import Stdlib.Prelude open;
import Applib open;

main (signingKey : ByteArray) : Nat := size signingKey;

Secondly a program that accepts a list of encoded atoms, decodes them and takes the sum.

module Kudos.TestList;

import Stdlib.Prelude open;
import Applib open;

main (xsEncoded : List (Encoded Nat)) : Nat :=
  let
    xs := map Encode.decode xsEncoded;
  in for (acc := 0) (x in xs) {
    acc + x
  };

I tested this with the input containing the jammed atoms representing 1, 1 and 2:

DA==
DA==
SA==

@paulcadman paulcadman self-assigned this Feb 3, 2025
@paulcadman paulcadman added this to the 0.6.10 milestone Feb 3, 2025
The bytes of the input argument are interpreted as an Atom and wrapped
in a cell:

[size bytes]

where `size` is the number of bytes in `bytes`.
@paulcadman paulcadman force-pushed the prove-support-bytearray-and-list branch from 6178894 to cbc8d08 Compare February 3, 2025 17:54
src/Anoma/Effect/RunNockma.hs Show resolved Hide resolved
@janmasrovira janmasrovira merged commit 10abc06 into main Feb 3, 2025
4 checks passed
@janmasrovira janmasrovira deleted the prove-support-bytearray-and-list branch February 3, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants