-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-testutils-feature-import
- Loading branch information
Showing
25 changed files
with
2,109 additions
and
326 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
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,49 @@ | ||
use soroban_sdk::{contractclient, Address, Bytes, BytesN, Env, String}; | ||
|
||
#[contractclient(name = "AxelarGatewayMessagingClient")] | ||
pub trait AxelarGatewayMessagingInterface { | ||
/// Sends a message to the specified destination chain and contarct address with a given payload. | ||
/// | ||
/// This function is the entry point for general message passing between chains. | ||
/// | ||
/// A registered chain name on Axelar must be used for `destination_chain`. | ||
fn call_contract( | ||
env: Env, | ||
caller: Address, | ||
destination_chain: String, | ||
destination_address: String, | ||
payload: Bytes, | ||
); | ||
|
||
/// Checks if a message is approved | ||
/// | ||
/// Determines whether a given message, identified by its `source_chain` and `message_id`, is approved. | ||
/// | ||
/// Returns true if a message with the given `payload_hash` is approved. | ||
fn is_message_approved( | ||
env: Env, | ||
source_chain: String, | ||
message_id: String, | ||
source_address: String, | ||
contract_address: Address, | ||
payload_hash: BytesN<32>, | ||
) -> bool; | ||
|
||
/// Checks if a message is executed. | ||
/// | ||
/// Returns true if the message is executed, false otherwise. | ||
fn is_message_executed(env: Env, source_chain: String, message_id: String) -> bool; | ||
|
||
/// Validates if a message is approved. If message was in approved status, status is updated to executed to avoid | ||
/// replay. | ||
/// | ||
/// `caller` must be the intended `destination_address` of the contract call for validation to succeed. | ||
fn validate_message( | ||
env: Env, | ||
caller: Address, | ||
source_chain: String, | ||
message_id: String, | ||
source_address: String, | ||
payload_hash: BytesN<32>, | ||
) -> bool; | ||
} |
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
Oops, something went wrong.