Skip to content

Fix bug with project root generation - #146

Merged
Arvolear merged 1 commit into
devfrom
feat/project-root
Sep 10, 2026
Merged

Fix bug with project root generation#146
Arvolear merged 1 commit into
devfrom
feat/project-root

Conversation

@ikripaka

@ikripaka ikripaka commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator
  • This PR suggests a bug fix and I've added the necessary tests.
  • This PR introduces a new feature and I've discussed the update in an Issue or with the team.
  • This PR is just a minor change like a typo fix.

Related to #139.

How to reproduce?

  • Create files simf/nested/nested_2/util.simf, simf/nested/nested_2/assert_eq.simf with such content.
    simf/nested/nested_2/util.simf
use merkle::build_root::{get_root, hash as and_hash};
use std::lib::asserts::assert_eq_32;

pub fn get_block_value_hash(prev_hash: u32, tx1: u32, tx2: u32) -> u32 {
    let root: u32 = get_root(tx1, tx2);
    jet::xor_32(prev_hash, root)
}

simf/nested/nested_2/assert_eq.simf

use std::lib::asserts::assert_eq_32;
use crate::nested::nested_2::util::get_block_value_hash;

fn main() {
    let first_value: u32 = 22;
    let second_value: u32 = 22;
    assert_eq_32(first_value, second_value);
}

Simplex will fail to generate the correct dependency root for a nested module.

Solution:

  • Build a dependency map starting from root, not from the parent directory to the contract.

* choose instead of parent - root directory for resolving crate dependencies
@ikripaka
ikripaka requested a review from Arvolear as a code owner September 4, 2026 13:48
@LesterEvSe
LesterEvSe self-requested a review September 7, 2026 09:27
@LesterEvSe

Copy link
Copy Markdown
Collaborator

LGTM

@Arvolear Arvolear left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@Arvolear
Arvolear merged commit a7d6b53 into dev Sep 10, 2026
9 checks passed
@Arvolear
Arvolear deleted the feat/project-root branch September 10, 2026 09:12
@LesterEvSe LesterEvSe linked an issue Sep 10, 2026 that may be closed by this pull request
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.

Add project root to Simplex.toml file

3 participants