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

Example of drand library in Move. This also includes a needed fix in translate.rs. #51

Open
wants to merge 5 commits into
base: solana
Choose a base branch
from

Conversation

jcivlin
Copy link
Collaborator

@jcivlin jcivlin commented May 31, 2024

Move allows empty vectors, this fix provides missing conversion for this.

This fix allows full compilation (no source code changes required) of an drand library written in Sui move.

In particular spot this function:

    /// Derive a uniform vector from a drand signature.
    public fun derive_randomness(drand_sig: vector<u8>): vector<u8> {
        sha2_256(drand_sig)
    }

Note that drand_lib.moveis only an example, a test is not included in this PR, but a comment how to build the example was added to the beginning of file.

// Run it from current directory as move-mv-llvm-compiler -c ./drand_lib.move  -p ./Move.toml --test {-O|-S} -o <out_dir>

@jcivlin jcivlin marked this pull request as ready for review May 31, 2024 04:19
@jcivlin jcivlin requested a review from ksolana May 31, 2024 04:19
@jcivlin jcivlin self-assigned this May 31, 2024
@ksolana
Copy link
Collaborator

ksolana commented May 31, 2024

Please add the .ll output file as expected file.

}

/// Derive a uniform vector from a drand signature.
public fun derive_randomness(drand_sig: vector<u8>): vector<u8> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it an entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants