diff --git a/account-decoder/src/lib.rs b/account-decoder/src/lib.rs index 108e1c1b3..4b83a7a31 100644 --- a/account-decoder/src/lib.rs +++ b/account-decoder/src/lib.rs @@ -37,12 +37,6 @@ pub enum UiAccountData { Binary64(String), } -impl From> for UiAccountData { - fn from(data: Vec) -> Self { - Self::Binary(bs58::encode(data).into_string()) - } -} - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[serde(rename_all = "camelCase")] pub enum UiAccountEncoding { @@ -59,7 +53,9 @@ impl UiAccount { additional_data: Option, ) -> Self { let data = match encoding { - UiAccountEncoding::Binary => account.data.into(), + UiAccountEncoding::Binary => { + UiAccountData::Binary(bs58::encode(account.data).into_string()) + } UiAccountEncoding::Binary64 => UiAccountData::Binary64(base64::encode(account.data)), UiAccountEncoding::JsonParsed => { if let Ok(parsed_data) = @@ -67,7 +63,7 @@ impl UiAccount { { UiAccountData::Json(parsed_data) } else { - account.data.into() + UiAccountData::Binary64(base64::encode(account.data)) } } };