Skip to content

Commit

Permalink
Github Action: Update contract
Browse files Browse the repository at this point in the history
  • Loading branch information
critesjosh committed Dec 18, 2024
1 parent c5eedc9 commit 7a44921
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/main.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod test;
mod test;
use dep::aztec::macros::aztec;

#[aztec]
Expand Down
12 changes: 3 additions & 9 deletions src/test/first.nr
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
use crate::test::utils;

use dep::aztec::test::{helpers::{cheatcodes, test_environment::TestEnvironment}};
use dep::aztec::oracle::{execution::get_block_number, storage::storage_read};
use dep::aztec::protocol_types::storage::map::derive_storage_slot_in_map;
use dep::aztec::note::note_getter::{MAX_NOTES_PER_PAGE, view_notes};
use dep::aztec::note::note_viewer_options::NoteViewerOptions;
use dep::aztec::hash::compute_secret_hash;

use dep::aztec::{oracle::{execution::{get_block_number, get_contract_address}, storage::storage_read}};

use crate::EasyPrivateVoting;

Expand Down Expand Up @@ -82,7 +76,7 @@ unconstrained fn test_cast_vote_with_separate_accounts() {
let bob = env.create_account();

let candidate = 101;

env.impersonate(alice);
env.advance_block_by(1);
EasyPrivateVoting::at(voting_contract_address).cast_vote(candidate).call(&mut env.private());
Expand All @@ -106,7 +100,7 @@ unconstrained fn test_fail_vote_twice() {
let alice = env.create_account();

let candidate = 101;

env.impersonate(alice);
env.advance_block_by(1);
EasyPrivateVoting::at(voting_contract_address).cast_vote(candidate).call(&mut env.private());
Expand Down
2 changes: 2 additions & 0 deletions src/test/mod.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod first;
mod utils;
9 changes: 6 additions & 3 deletions src/test/utils.nr
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use dep::aztec::{
prelude::AztecAddress, test::helpers::{test_environment::TestEnvironment},
note::{note_getter::{MAX_NOTES_PER_PAGE, view_notes}, note_viewer_options::NoteViewerOptions},
prelude::AztecAddress,
protocol_types::storage::map::derive_storage_slot_in_map,
note::{note_getter::{MAX_NOTES_PER_PAGE, view_notes}, note_viewer_options::NoteViewerOptions}
test::helpers::test_environment::TestEnvironment,
};

use crate::EasyPrivateVoting;
Expand All @@ -12,7 +13,9 @@ pub fn setup() -> (&mut TestEnvironment, AztecAddress, AztecAddress) {
let admin = env.create_account();

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

0 comments on commit 7a44921

Please sign in to comment.