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

refactor: split into multiple packages #16

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/setup_aptos_cli/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Setup Aptos CLI
description: A composite action that sets up the Aptos CLI
inputs:
version:
description: 'The version of the Aptos CLI to install'
required: true
default: '4.0.0'
runs:
using: "composite"
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aptos_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
- uses: ./.github/actions/setup_aptos_cli
with:
version: 4.0.0
- name: Test
run: aptos move test
- name: test_contract
run: (cd libs && aptos move test --skip-fetch-latest-git-deps --skip-attribute-checks) & (cd verifier && aptos move test --skip-fetch-latest-git-deps --skip-attribute-checks)
9 changes: 4 additions & 5 deletions Move.toml → libs/Move.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
[package]
name = "navori"
name = "libs"
version = "1.0.0"
authors = []

[addresses]
verifier_addr = "0d86ef4ed97b15752707c861650d084d2ad181357b7f966a2e08a931c63187c7"
lib_addr = "_"

[dev-addresses]
lib_addr = "0x70c7fb94e185ce44f460f4fd8f9c38751bf9689ce8faefb7a216d8f224ec38fc"

[dependencies.AptosFramework]
git = "https://github.com/aptos-labs/aptos-core.git"
rev = "release-v.1.14"
rev = "aptos-release-v1.17"
subdir = "aptos-move/framework/aptos-framework"

[dev-dependencies]
6 changes: 3 additions & 3 deletions sources/libs/bytes.move → libs/sources/bytes.move
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module verifier_addr::bytes {
module lib_addr::bytes {
use std::bcs::to_bytes;
use std::vector;
use std::vector::{append, for_each_ref};
Expand Down Expand Up @@ -72,11 +72,11 @@ module verifier_addr::bytes {
}

#[test_only]
module verifier_addr::bytes_test {
module lib_addr::bytes_test {
use std::bcs::to_bytes;
use std::vector;

use verifier_addr::bytes::{pad, vec_to_bytes_be};
use lib_addr::bytes::{pad, vec_to_bytes_be};

#[test]
fun test_padding() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module verifier_addr::convert_memory {
module lib_addr::convert_memory {
use std::vector;

public fun copy_vec_to_memory(vec: vector<u256>, table: &mut vector<u256>, start_prt: u64) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module verifier_addr::prime_field_element_0 {
module lib_addr::prime_field_element_0 {
// This line is used for generating constants DO NOT REMOVE!
// 3618502788666131213697322783095070105623107215331596699973092056135872020481
const K_MODULUS: u256 = 0x800000000000011000000000000000000000000000000000000000000000001;
Expand Down
22 changes: 22 additions & 0 deletions verifier/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "navori"
version = "1.0.0"
authors = []

[addresses]
verifier_addr = "_"
lib_addr = "_"

[dev-addresses]
verifier_addr = "0x70c7fb94e185ce44f460f4fd8f9c38751bf9689ce8faefb7a216d8f224ec38fc"
lib_addr = "0x70c7fb94e185ce44f460f4fd8f9c38751bf9689ce8faefb7a216d8f224ec38f3"

[dependencies.AptosFramework]
git = "https://github.com/aptos-labs/aptos-core.git"
rev = "aptos-release-v1.17"
subdir = "aptos-move/framework/aptos-framework"

[dependencies]
libs = {local = "../libs"}

[dev-dependencies]
File renamed without changes.
4 changes: 2 additions & 2 deletions sources/fri_layer.move → verifier/sources/fri_layer.move
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module verifier_addr::fri_layer {
use std::vector;
use aptos_std::aptos_hash::keccak256;

use verifier_addr::bytes::{bytes32_to_u256, u256_to_bytes32};
use lib_addr::bytes::{bytes32_to_u256, u256_to_bytes32};
use verifier_addr::fri::{get_fri, update_fri};
use verifier_addr::fri_transform::transform_coset;
use verifier_addr::prime_field_element_0::{fmul, fpow};
use lib_addr::prime_field_element_0::{fmul, fpow};

// This line is used for generating constants DO NOT REMOVE!
// 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module verifier_addr::fri_statement_contract {
use aptos_std::aptos_hash::keccak256;
use aptos_framework::event::emit;

use verifier_addr::bytes::{bytes32_to_u256, u256_to_bytes32};
use verifier_addr::convert_memory::copy_vec_to_memory;
use lib_addr::bytes::{bytes32_to_u256, u256_to_bytes32};
use lib_addr::convert_memory::copy_vec_to_memory;
use verifier_addr::fact_registry::register_fact;
use verifier_addr::fri::{get_fri, new_fri, update_fri};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module verifier_addr::fri_transform {
use std::vector;

use verifier_addr::prime_field_element_0::fmul;
use lib_addr::prime_field_element_0::fmul;

// This line is used for generating constants DO NOT REMOVE!
// 3618502788666131213697322783095070105623107215331596699973092056135872020481
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module verifier_addr::merkle_statement_contract {
use aptos_std::math64::pow;
use aptos_framework::event;

use verifier_addr::bytes::{bytes32_to_u256, u256_to_bytes32};
use verifier_addr::convert_memory::copy_vec_to_memory;
use lib_addr::bytes::{bytes32_to_u256, u256_to_bytes32};
use lib_addr::convert_memory::copy_vec_to_memory;
use verifier_addr::fact_registry::register_fact;
use verifier_addr::fri::{get_fri, new_fri, update_fri};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module verifier_addr::merkle_verifier {
use aptos_std::aptos_hash::keccak256;
use aptos_framework::event;

use verifier_addr::bytes::{bytes32_to_u256, u256_to_bytes32};
use lib_addr::bytes::{bytes32_to_u256, u256_to_bytes32};
use verifier_addr::fri::{get_fri, update_fri};

// This line is used for generating constants DO NOT REMOVE!
Expand Down
File renamed without changes.
File renamed without changes.
Loading