-
Notifications
You must be signed in to change notification settings - Fork 305
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
4 changed files
with
34 additions
and
29 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
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
28 changes: 1 addition & 27 deletions
28
noir-projects/noir-protocol-circuits/src/crates/types/src/abis/call_request.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
30 changes: 30 additions & 0 deletions
30
noir-projects/noir-protocol-circuits/src/crates/types/src/abis/caller_context.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,30 @@ | ||
use crate::address::AztecAddress; | ||
use dep::std::cmp::Eq; | ||
use crate::traits::Empty; | ||
|
||
struct CallerContext { | ||
msg_sender: AztecAddress, | ||
storage_contract_address: AztecAddress, | ||
} | ||
|
||
impl Eq for CallerContext { | ||
fn eq(self, caller_context: CallerContext) -> bool { | ||
caller_context.msg_sender.eq(self.msg_sender) | ||
& caller_context.storage_contract_address.eq(self.storage_contract_address) | ||
} | ||
} | ||
|
||
impl Empty for CallerContext { | ||
fn empty() -> Self { | ||
CallerContext { | ||
msg_sender: AztecAddress::zero(), | ||
storage_contract_address: AztecAddress::zero(), | ||
} | ||
} | ||
} | ||
|
||
impl CallerContext { | ||
pub fn is_empty(self) -> bool { | ||
self.msg_sender.is_zero() & self.storage_contract_address.is_zero() | ||
} | ||
} |