-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e55ebb1
commit dbc6ddf
Showing
8 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
use crate::create_icp_sepolia_signer; | ||
use crate::create_icp_signer; | ||
use alloy::signers::Signer; | ||
|
||
/// Get the Ethereum address of the backend canister. | ||
#[ic_cdk::update] | ||
async fn get_address() -> Result<String, String> { | ||
let signer = create_icp_sepolia_signer().await; | ||
let signer = create_icp_signer().await; | ||
let address = signer.address(); | ||
Ok(address.to_string()) | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
use alloy::signers::Signer; | ||
|
||
use crate::create_icp_sepolia_signer; | ||
use crate::create_icp_signer; | ||
|
||
/// Let the backend canister sign a message. | ||
#[ic_cdk::update] | ||
async fn sign_message(message: String) -> Result<String, String> { | ||
let signer = create_icp_sepolia_signer().await; | ||
let signer = create_icp_signer().await; | ||
let signature = signer.sign_message(message.as_bytes()).await.unwrap(); | ||
Ok(format!("{:?}", signature)) | ||
} |
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