Skip to content

Commit 2d5408f

Browse files
committed
chore: cleaning
1 parent eb009c9 commit 2d5408f

1 file changed

Lines changed: 4 additions & 25 deletions

File tree

src/models/account_enums.rs

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,36 +85,15 @@ pub struct Account {
8585
pub base64url: Address,
8686
}
8787

88-
impl Account {
89-
pub fn from_wc_and_address(workchain_id: i32, address: String) -> Self {
90-
let account = format!("{workchain_id}:{address}");
91-
let base64url = match StdAddr::from_str(&account) {
92-
Ok(account) => Address(account.display_base64_url(true).to_string()),
93-
Err(error) => {
94-
tracing::error!(
95-
workchain_id,
96-
address,
97-
?error,
98-
"failed to format account as base64url"
99-
);
100-
Address(account)
101-
}
102-
};
103-
104-
Self {
105-
workchain_id,
106-
hex: Address(address),
107-
base64url,
108-
}
109-
}
110-
}
111-
11288
impl From<AddressDb> for Account {
11389
fn from(a: AddressDb) -> Self {
90+
let account = StdAddr::from_str(&format!("{}:{}", a.workchain_id, a.hex)).unwrap();
91+
let base64url = Address(account.display_base64_url(true).to_string());
92+
11493
Self {
11594
workchain_id: a.workchain_id,
11695
hex: Address(a.hex),
117-
base64url: Address(a.base64url),
96+
base64url,
11897
}
11998
}
12099
}

0 commit comments

Comments
 (0)