From 216ef102b33c4ef03c1a7b680a678eb5c572fe58 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Wed, 10 Apr 2024 10:15:31 +0300 Subject: [PATCH] cleanup --- .../interaction/markers/esdt_system_sc_address.rs | 12 ++++++++++-- .../system_proxy/legacy_system_sc_proxy.rs | 2 +- .../src/scenario/model/transaction/tx_response.rs | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/framework/base/src/types/interaction/markers/esdt_system_sc_address.rs b/framework/base/src/types/interaction/markers/esdt_system_sc_address.rs index e43ee5f2ce..f9d1f94ce2 100644 --- a/framework/base/src/types/interaction/markers/esdt_system_sc_address.rs +++ b/framework/base/src/types/interaction/markers/esdt_system_sc_address.rs @@ -24,12 +24,20 @@ const SYSTEM_SC_ADDRESS_ANNOTATION: &str = pub struct ESDTSystemSCAddress; impl ESDTSystemSCAddress { - pub fn managed_address(self) -> ManagedAddress + pub fn to_managed_address(self) -> ManagedAddress where Api: ManagedTypeApi, { ManagedAddress::from(SYSTEM_SC_ADDRESS_BYTES) } + + pub fn to_bech32_str(&self) -> &str { + SYSTEM_SC_ADDRESS_BECH32 + } + + pub fn to_bech32_string(&self) -> alloc::string::String { + SYSTEM_SC_ADDRESS_BECH32.into() + } } impl AnnotatedValue, ManagedAddress> for ESDTSystemSCAddress @@ -41,7 +49,7 @@ where } fn to_value(&self, _env: &TxScEnv) -> ManagedAddress { - ESDTSystemSCAddress.managed_address() + ESDTSystemSCAddress.to_managed_address() } } diff --git a/framework/base/src/types/interaction/system_proxy/legacy_system_sc_proxy.rs b/framework/base/src/types/interaction/system_proxy/legacy_system_sc_proxy.rs index 35486c6c04..c19fe2e4e6 100644 --- a/framework/base/src/types/interaction/system_proxy/legacy_system_sc_proxy.rs +++ b/framework/base/src/types/interaction/system_proxy/legacy_system_sc_proxy.rs @@ -471,7 +471,7 @@ where } pub fn esdt_system_sc_address(&self) -> ManagedAddress { - ESDTSystemSCAddress.managed_address() + ESDTSystemSCAddress.to_managed_address() } fn esdt_system_sc_call_no_args( diff --git a/framework/scenario/src/scenario/model/transaction/tx_response.rs b/framework/scenario/src/scenario/model/transaction/tx_response.rs index a2dbed5f5a..d4171c6590 100644 --- a/framework/scenario/src/scenario/model/transaction/tx_response.rs +++ b/framework/scenario/src/scenario/model/transaction/tx_response.rs @@ -194,7 +194,7 @@ impl TxResponse { fn process_new_issued_token_identifier(mut self) -> Self { for scr in self.api_scrs.iter() { - if scr.sender.to_string() != ESDTSystemSCAddress.to_string() { + if scr.sender.to_bech32_string().unwrap() != ESDTSystemSCAddress.to_bech32_string() { continue; }