fix: use base58 encoding for program_owner instead of hex

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
fryorcraken 2026-03-13 14:04:17 +11:00
parent 546c3d0986
commit e20860ea97
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
3 changed files with 9 additions and 7 deletions

1
Cargo.lock generated
View File

@ -8989,6 +8989,7 @@ dependencies = [
"amm_core",
"anyhow",
"async-stream",
"base58",
"base64 0.22.1",
"borsh",
"clap",

View File

@ -21,6 +21,7 @@ humantime-serde.workspace = true
humantime.workspace = true
tokio = { workspace = true, features = ["macros"] }
clap.workspace = true
base58.workspace = true
base64.workspace = true
borsh.workspace = true
hex.workspace = true

View File

@ -1,6 +1,7 @@
use std::{collections::HashMap, path::PathBuf, str::FromStr};
use anyhow::Result;
use base58::ToBase58;
use key_protocol::key_protocol_core::NSSAUserData;
use nssa::Account;
use nssa_core::account::Nonce;
@ -155,13 +156,12 @@ pub(crate) struct HumanReadableAccount {
impl From<Account> for HumanReadableAccount {
fn from(account: Account) -> Self {
let program_owner = hex::encode(
account
.program_owner
.iter()
.flat_map(|n| n.to_le_bytes())
.collect::<Vec<u8>>(),
);
let program_owner = account
.program_owner
.iter()
.flat_map(|n| n.to_le_bytes())
.collect::<Vec<u8>>()
.to_base58();
let data = hex::encode(account.data);
Self {
balance: account.balance,