Skip to content

Commit

Permalink
Fix CKB_SUFFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Jul 25, 2024
1 parent d26a706 commit 7bb5c32
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions contracts/ccc-eth-lock/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn message_hash(msg: &str) -> [u8; 32] {
assert_eq!(msg.len(), 64);
// Text used to signify that a signed message follows and to prevent inadvertently signing a transaction.
const CKB_PREFIX: &str = "Signing a CKB transaction: 0x";
const CKB_SUFFIX: &str = "\n\nIMPORTANT: Please verify the integrity and authenticity of connected BTC wallet before signing this message\n";
const CKB_SUFFIX: &str = "\n\nIMPORTANT: Please verify the integrity and authenticity of connected Ethereum wallet before signing this message\n";
const ETH_PREFIX: &str = "Ethereum Signed Message:\n";
let mut data: Vec<u8> = Vec::new();
assert_eq!(ETH_PREFIX.len(), 25);
Expand Down Expand Up @@ -78,7 +78,6 @@ pub fn entry() -> Result<(), Error> {
.map_err(|_| Error::CanNotRecover)?
.to_encoded_point(false)
.to_bytes()[1..];
println_hex("pubkey_result", &pubkey_result);
assert!(pubkey_result.len() == 64);
let pubkey_hash_result = keccak160(&pubkey_result);
println_hex("pubkey_hash_result", pubkey_hash_result.as_ref());
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test_eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn message_hash(msg: &str) -> [u8; 32] {
assert_eq!(msg.len(), 64);
// Text used to signify that a signed message follows and to prevent inadvertently signing a transaction.
const CKB_PREFIX: &str = "Signing a CKB transaction: 0x";
const CKB_SUFFIX: &str = "\n\nIMPORTANT: Please verify the integrity and authenticity of connected BTC wallet before signing this message\n";
const CKB_SUFFIX: &str = "\n\nIMPORTANT: Please verify the integrity and authenticity of connected Ethereum wallet before signing this message\n";
const ETH_PREFIX: &str = "Ethereum Signed Message:\n";
let mut data: Vec<u8> = Vec::new();
assert_eq!(ETH_PREFIX.len(), 25);
Expand Down

0 comments on commit 7bb5c32

Please sign in to comment.