Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Apr 10, 2024
1 parent 46288c9 commit 216ef10
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@ const SYSTEM_SC_ADDRESS_ANNOTATION: &str =
pub struct ESDTSystemSCAddress;

impl ESDTSystemSCAddress {
pub fn managed_address<Api>(self) -> ManagedAddress<Api>
pub fn to_managed_address<Api>(self) -> ManagedAddress<Api>
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<Api> AnnotatedValue<TxScEnv<Api>, ManagedAddress<Api>> for ESDTSystemSCAddress
Expand All @@ -41,7 +49,7 @@ where
}

fn to_value(&self, _env: &TxScEnv<Api>) -> ManagedAddress<Api> {
ESDTSystemSCAddress.managed_address()
ESDTSystemSCAddress.to_managed_address()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ where
}

pub fn esdt_system_sc_address(&self) -> ManagedAddress<SA> {
ESDTSystemSCAddress.managed_address()
ESDTSystemSCAddress.to_managed_address()
}

fn esdt_system_sc_call_no_args(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 216ef10

Please sign in to comment.