Skip to content

Commit

Permalink
fix: mailbox review
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 committed May 13, 2024
1 parent 3573bb9 commit 3c3e1cd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/contracts/client/mailboxclient.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ mod mailboxclient {
_message_body: Bytes,
_hook_metadata: Option<Bytes>,
_hook: Option<ContractAddress>
) {
) -> u256 {
let mailbox_address = self.mailbox.read();
let mailbox = IMailboxDispatcher { contract_address: mailbox_address };
mailbox
.quote_dispatch(
_destination_domain, _recipient, _message_body, _hook_metadata, _hook
);
)
}
}
}
4 changes: 2 additions & 2 deletions src/contracts/mailbox.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ pub mod mailbox {
use alexandria_bytes::{Bytes, BytesTrait, BytesStore};
use core::starknet::SyscallResultTrait;
use core::starknet::event::EventEmitter;
use hyperlane_starknet::contracts::libs::message::{Message, MessageTrait};
use hyperlane_starknet::contracts::libs::message::{Message, MessageTrait, HYPERLANE_VERSION};
use hyperlane_starknet::interfaces::{
IMailbox, IMailboxDispatcher, IMailboxDispatcherTrait, IInterchainSecurityModuleDispatcher,
IInterchainSecurityModuleDispatcherTrait, IPostDispatchHookDispatcher,
ISpecifiesInterchainSecurityModuleDispatcher,
ISpecifiesInterchainSecurityModuleDispatcherTrait, IPostDispatchHookDispatcherTrait,
HYPERLANE_VERSION, IMessageRecipientDispatcher, IMessageRecipientDispatcherTrait,
IMessageRecipientDispatcher, IMessageRecipientDispatcherTrait,
};
use openzeppelin::access::ownable::OwnableComponent;
use openzeppelin::upgrades::{interface::IUpgradeable, upgradeable::UpgradeableComponent};
Expand Down
4 changes: 1 addition & 3 deletions src/interfaces.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ pub enum ModuleType {
}


pub const HYPERLANE_VERSION: u8 = 3;

#[starknet::interface]
pub trait IMailbox<TContractState> {
fn initializer(
Expand Down Expand Up @@ -183,7 +181,7 @@ pub trait IMailboxClient<TContractState> {
_message_body: Bytes,
_hook_metadata: Option<Bytes>,
_hook: Option<ContractAddress>
);
) -> u256;
}


Expand Down
6 changes: 2 additions & 4 deletions src/tests/test_mailbox.cairo
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use alexandria_bytes::{Bytes, BytesTrait};
use hyperlane_starknet::contracts::libs::message::{Message, MessageTrait};
use hyperlane_starknet::contracts::libs::message::{Message, MessageTrait, HYPERLANE_VERSION};
use hyperlane_starknet::contracts::mailbox::mailbox;
use hyperlane_starknet::interfaces::IMessageRecipientDispatcherTrait;
use hyperlane_starknet::interfaces::{
IMailbox, IMailboxDispatcher, IMailboxDispatcherTrait, HYPERLANE_VERSION
};
use hyperlane_starknet::interfaces::{IMailbox, IMailboxDispatcher, IMailboxDispatcherTrait};
use hyperlane_starknet::tests::setup::{
setup, mock_setup, OWNER, LOCAL_DOMAIN, NEW_OWNER, DEFAULT_ISM, DEFAULT_HOOK, REQUIRED_HOOK,
NEW_DEFAULT_ISM, NEW_DEFAULT_HOOK, NEW_REQUIRED_HOOK, DESTINATION_DOMAIN, RECIPIENT_ADDRESS
Expand Down

0 comments on commit 3c3e1cd

Please sign in to comment.