-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,018 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
noir-projects/noir-contracts/contracts/counter_contract/src/test.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use dep::aztec::{prelude::AztecAddress, test::helpers::test_environment::TestEnvironment}; | ||
use crate::Counter; | ||
|
||
pub unconstrained fn setup(initial_value: Field) -> (&mut TestEnvironment, AztecAddress, AztecAddress, AztecAddress) { | ||
// Setup env, generate keys | ||
let mut env = TestEnvironment::new(); | ||
let owner = env.create_account(); | ||
let outgoing_viewer = env.create_account(); | ||
env.impersonate(owner); | ||
// Deploy contract and initialize | ||
let initializer = | ||
Counter::interface().initialize(initial_value as u64, owner, outgoing_viewer); | ||
let counter_contract = env.deploy_self("Counter").with_private_initializer(initializer); | ||
let contract_address = counter_contract.to_address(); | ||
(&mut env, contract_address, owner, outgoing_viewer) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.