|
1 |
| -use crate::types::point::Point; |
2 | 1 | use dep::protocol_types::{
|
3 | 2 | address::AztecAddress,
|
4 | 3 | constants::NUM_FIELDS_PER_SHA256,
|
| 4 | + grumpkin_point::GrumpkinPoint, |
5 | 5 | };
|
6 | 6 |
|
7 | 7 | // TODO: Should take encrypted data.
|
8 | 8 | #[oracle(emitEncryptedLog)]
|
9 |
| -fn emit_encrypted_log_oracle<N>(_contract_address: AztecAddress, _storage_slot: Field, _encryption_pub_key: Point, _preimage: [Field; N]) -> Field {} |
| 9 | +fn emit_encrypted_log_oracle<N>( |
| 10 | + _contract_address: AztecAddress, |
| 11 | + _storage_slot: Field, |
| 12 | + _encryption_pub_key: GrumpkinPoint, |
| 13 | + _preimage: [Field; N] |
| 14 | +) -> Field {} |
10 | 15 |
|
11 |
| -unconstrained pub fn emit_encrypted_log<N>(contract_address: AztecAddress, storage_slot: Field, encryption_pub_key: Point, preimage: [Field; N]) -> [Field; NUM_FIELDS_PER_SHA256] { |
| 16 | +unconstrained pub fn emit_encrypted_log<N>( |
| 17 | + contract_address: AztecAddress, |
| 18 | + storage_slot: Field, |
| 19 | + encryption_pub_key: GrumpkinPoint, |
| 20 | + preimage: [Field; N] |
| 21 | +) -> [Field; NUM_FIELDS_PER_SHA256] { |
12 | 22 | [emit_encrypted_log_oracle(contract_address, storage_slot, encryption_pub_key, preimage), 0]
|
13 | 23 | }
|
14 | 24 |
|
15 | 25 | #[oracle(emitUnencryptedLog)]
|
16 | 26 | fn emit_unencrypted_log_oracle<T>(_contract_address: AztecAddress, _event_selector: Field, _message: T) -> Field {}
|
17 | 27 |
|
18 |
| -unconstrained pub fn emit_unencrypted_log<T>(contract_address: AztecAddress, event_selector: Field, message: T) -> [Field; NUM_FIELDS_PER_SHA256] { |
| 28 | +unconstrained pub fn emit_unencrypted_log<T>( |
| 29 | + contract_address: AztecAddress, |
| 30 | + event_selector: Field, |
| 31 | + message: T |
| 32 | +) -> [Field; NUM_FIELDS_PER_SHA256] { |
19 | 33 | // https://github.com/AztecProtocol/aztec-packages/issues/885
|
20 | 34 | [emit_unencrypted_log_oracle(contract_address, event_selector, message), 0]
|
21 | 35 | }
|
0 commit comments