Skip to content

Commit

Permalink
fix: clean up decode_hash function
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeytimoshin committed Jan 27, 2025
1 parent d532c7e commit 301544d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdk-libs/client/src/indexer/photon_indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,9 @@ impl<R: RpcConnection> Indexer<R> for PhotonIndexer<R> {
}

fn decode_hash(account: &str) -> [u8; 32] {
let bytes = bs58::decode(account).into_vec().unwrap();
let mut arr = [0u8; 32];
arr.copy_from_slice(&bytes);
bs58::decode(account)
.into(&mut arr)
.expect("Failed to decode base58 string");
arr
}

0 comments on commit 301544d

Please sign in to comment.