Skip to content

Commit

Permalink
MockMailbox Zero Address handling for custom hook
Browse files Browse the repository at this point in the history
  • Loading branch information
EgeCaner committed Feb 14, 2025
1 parent 83a814a commit 117a597
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cairo/crates/mocks/src/mock_mailbox.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,13 @@ pub mod MockMailbox {
hook: Option<ContractAddress>
) -> u256 {
let hook = match hook {
Option::Some(hook) => { hook },
Option::Some(hook) => {
if hook != contract_address_const::<0>() {
hook
} else {
self.default_hook.read()
}
},
Option::None(()) => { self.default_hook.read() }
};
let hook_metadata = match metadata {
Expand Down

0 comments on commit 117a597

Please sign in to comment.