From 79e682c3a9704581294d1734df6c505476f962c5 Mon Sep 17 00:00:00 2001 From: gcranju <134275268+gcranju@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:48:02 +0545 Subject: [PATCH] fix: address to hex prefix 0 (#350) * fix: adding store to cap for transferrable * fix: address to hex prefix 0 * fix: versioning --------- Co-authored-by: gcranju <075bct064.ranju@pcampus.edu.np> --- contracts/sui/xcall/sources/main.move | 2 +- contracts/sui/xcall/sources/utils.move | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contracts/sui/xcall/sources/main.move b/contracts/sui/xcall/sources/main.move index 6152f54f..abf6ac0d 100644 --- a/contracts/sui/xcall/sources/main.move +++ b/contracts/sui/xcall/sources/main.move @@ -54,7 +54,7 @@ module xcall::main { const EInvalidConnectionId:u64 =15; const MAX_DATA_SIZE: u64 = 2048; - const CURRENT_VERSION: u64 = 1; + const CURRENT_VERSION: u64 = 2; /*************Events*****************/ diff --git a/contracts/sui/xcall/sources/utils.move b/contracts/sui/xcall/sources/utils.move index ee049e16..66e0ff9d 100644 --- a/contracts/sui/xcall/sources/utils.move +++ b/contracts/sui/xcall/sources/utils.move @@ -36,7 +36,9 @@ module xcall::xcall_utils { public fun address_to_hex_string(address:&address): String { let bytes = bcs::to_bytes(address); let hex_bytes = hex::encode(bytes); - string::utf8(hex_bytes) + let mut prefix = string::utf8(b"0x"); + prefix.append(string::utf8(hex_bytes)); + prefix } public fun address_from_hex_string(str: &String): address {