Skip to content

Commit

Permalink
fix: run scarb fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Jan 9, 2025
1 parent 5653715 commit 35a8607
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
23 changes: 15 additions & 8 deletions src/messaging/component.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ mod messaging_cpt {
);

assert(
self.sn_to_appc_messages.read(message_hash) == MessageToAppchainStatus::Pending(nonce),
self
.sn_to_appc_messages
.read(message_hash) == MessageToAppchainStatus::Pending(nonce),
errors::NO_MESSAGE_TO_CANCEL
);

Expand Down Expand Up @@ -312,12 +314,15 @@ mod messaging_cpt {

// We can't have the detail of the message here, so we emit a dummy event
// with at least the message hash.
self.emit(MessageToStarknetReceived {
message_hash: msg_hash,
from: 0.try_into().unwrap(),
to: 0.try_into().unwrap(),
payload: array![].span()
});
self
.emit(
MessageToStarknetReceived {
message_hash: msg_hash,
from: 0.try_into().unwrap(),
to: 0.try_into().unwrap(),
payload: array![].span()
}
);

i += 1;
};
Expand Down Expand Up @@ -398,7 +403,9 @@ mod messaging_cpt {

// On the L1, they use the Fee in front of the message hash, not the nonce.
// Here, we have an enum to explicitly indicate that the message is sealed.
self.sn_to_appc_messages.write(message_hash, MessageToAppchainStatus::Sealed);
self
.sn_to_appc_messages
.write(message_hash, MessageToAppchainStatus::Sealed);

self
.emit(
Expand Down
5 changes: 1 addition & 4 deletions src/messaging/tests/test_messaging.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,7 @@ fn sn_to_appchain_messages_ok() {
from_address: from, to_address: to, :selector, payload: payload.span(), nonce: 0
);
let is_pending_before = mock.sn_to_appchain_messages(message_hash);
assert(
is_pending_before == MessageToAppchainStatus::NotSent,
'Should not be pending before'
);
assert(is_pending_before == MessageToAppchainStatus::NotSent, 'Should not be pending before');

snf::start_cheat_caller_address(from, from);
let (message_hash, nonce) = mock.send_message_to_appchain(to, selector, payload.span());
Expand Down

0 comments on commit 35a8607

Please sign in to comment.