-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add view functions for status of messages (#34)
* feat: add view functions for status of messages * Update src/messaging/tests/test_messaging.cairo Co-authored-by: glihm <[email protected]> * Update src/messaging/interface.cairo Co-authored-by: glihm <[email protected]> * Update src/messaging/interface.cairo Co-authored-by: glihm <[email protected]> * improve test * Ran formatter * Update returns to an enum * update name * updated the bindings --------- Co-authored-by: glihm <[email protected]>
- Loading branch information
1 parent
ff8853f
commit 517ea2b
Showing
6 changed files
with
1,090 additions
and
803 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,14 @@ | ||
pub type MessageHash = felt252; | ||
pub type Nonce = felt252; | ||
|
||
#[derive(Serde, Drop, Eq, PartialEq)] | ||
pub enum MessageToAppchainStatus { | ||
SealedOrNotSent, // sn->appc: The nonce is 0 for the message hash. | ||
Pending: Nonce, // sn->appc: The nonce > 0. | ||
} | ||
|
||
#[derive(Serde, Drop, Eq, PartialEq)] | ||
pub enum MessageToStarknetStatus { | ||
NothingToConsume, // appc->sn: the ref count is 0. | ||
ReadyToConsume: felt252 // appc->sn: the ref count > 0. | ||
} |