Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jan 11, 2025
1 parent 008d474 commit f435c39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ contract ContractClassRegisterer {
// TODO: We should be able to remove public_bytecode_commitment from the input if it's calculated in this function
// docs:start:pop_capsule
let packed_public_bytecode: [Field; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS] =
pop_capsule();
unsafe { pop_capsule() };
// docs:end:pop_capsule
// First field element contains the length of the bytecode
let bytecode_length_in_bytes: u32 = packed_public_bytecode[0] as u32;
Expand Down Expand Up @@ -121,7 +121,7 @@ contract ContractClassRegisterer {
function_data: InnerPrivateFunction,
) {
let private_bytecode: [Field; MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS] =
pop_capsule();
unsafe { pop_capsule() };

let event = ClassPrivateFunctionBroadcasted {
contract_class_id,
Expand Down Expand Up @@ -162,7 +162,7 @@ contract ContractClassRegisterer {
function_data: InnerUnconstrainedFunction,
) {
let unconstrained_bytecode: [Field; MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS] =
pop_capsule();
unsafe { pop_capsule() };
let event = ClassUnconstrainedFunctionBroadcasted {
contract_class_id,
artifact_metadata_hash,
Expand Down Expand Up @@ -203,7 +203,8 @@ contract ContractClassRegisterer {
// cannot prove non-registration. Therefore, it is possible that a malicious oracle might prevent sequencers
// from including transactions with calls to certain badly-broadcasted contracts.
// TODO(#8978): review correctness
let log_hash = emit_contract_class_unencrypted_log_private(contract_address, log, counter);
let log_hash =
unsafe { emit_contract_class_unencrypted_log_private(contract_address, log, counter) };

// 40 = addr (32) + raw log len (4) + processed log len (4)
context.contract_class_logs_hashes.push(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
use dep::aztec::{
note::{note_getter::{MAX_NOTES_PER_PAGE, view_notes}, note_viewer_options::NoteViewerOptions},
prelude::AztecAddress,
protocol_types::storage::map::derive_storage_slot_in_map,
test::helpers::test_environment::TestEnvironment,
};
use dep::aztec::{prelude::AztecAddress, test::helpers::test_environment::TestEnvironment};

use crate::EasyPrivateVoting;

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

let admin = env.create_account();
let admin = unsafe { 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 = unsafe {
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 f435c39

Please sign in to comment.