Skip to content

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

Closed

Description

@wei3erHase

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
  }

Activity

  1. added
    from-communityThis originated from the community :)
    C-aztec.nrComponent: Aztec smart contract framework
    on Dec 20, 2024
  2. sklppy88 commented on Jan 17, 2025

    @sklppy88
    Contributor

    Fix to this is on master and should be in the next release 🙏

  3. sklppy88 commented on Feb 10, 2025

    @sklppy88
    Contributor

    Closed as completed by #11421

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-aztec.nrComponent: Aztec smart contract frameworkfrom-communityThis originated from the community :)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions