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

bug: deploying a contract with no #[private] methods fails #10914

Open
wei3erHase opened this issue Dec 20, 2024 · 0 comments
Open

bug: deploying a contract with no #[private] methods fails #10914

wei3erHase opened this issue Dec 20, 2024 · 0 comments
Assignees
Labels
C-aztec.nr Component: Aztec smart contract framework from-community This originated from the community :)

Comments

@wei3erHase
Copy link

When trying to create a contract from scratch, started declaring storage and a few public functions (and empty constructor), but when using the same Noir deployment sequence as in the https://github.com/aztecprotocol/aztec-starter/ repo:

pub fn setup() -> (&mut TestEnvironment, AztecAddress, AztecAddress) {
    let mut env = unsafe { TestEnvironment::new() };

    let admin = unsafe { env.create_account() };

    let initializer_call_interface = MyContract::interface().constructor();
    let voting_contract = unsafe {
            env.deploy_self("MyContract").with_public_void_initializer(initializer_call_interface)
        };
    std::println(voting_contract);
    (&mut env, voting_contract.to_address(), admin)
}

The deployment failed with:

Invalid node count for Merkle tree: ...
// said found 1 but expecting 63

The problem was solved by adding an empty private method:

  #[private]
  fn some_private_method() {
      // private method code
  }
@Maddiaa0 Maddiaa0 added from-community This originated from the community :) C-aztec.nr Component: Aztec smart contract framework labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-aztec.nr Component: Aztec smart contract framework from-community This originated from the community :)
Projects
None yet
Development

No branches or pull requests

3 participants