0xMiden / 0xMiden/rust-sdk

Improve `Address` handling in CLI

Aperta
#1,188 1 commento 1 reazione 0 assegnatari Vedi su GitHub
cli
Lingua principale
Rust
Stelle
78
Fork
129
Merge medio
4g 14h
PR unite (30g)
52

Descrizione

After the changes in https://github.com/0xMiden/miden-base/pull/1762 , account IDs weren't always able to be converted to bech32 addresses, specifically with faucets. Even for wallets, the conversion requires fetching the account interface so that the `Address` can be constructed. This is not ideal for the CLI as it required fetching the full account each time a bech32 address was meant to be shown.

We removed most of the bech32 instances in #1177 (it only remains in the `account --show` command). We should look to add them again after refactoring the client to allow for easier account address/interface fetching. At least the listing of account should show the address and maybe other commands as well.

> It's a bit unfortunate that we have to go to the store, and construct the full `Account` object for each of the accounts that we are tracking.
In the future, I think we could either just retrieve the account code and/or cache the account's addresses separately on the store. These should only really get updated if the account code gets updated, so they would be mostly static. Let's create an issue for this.
> The alternative for now is to now show the addresses when listing accounts, and instead only show them when the user focuses on a specific account (eg `miden-client account --show`)

_Originally posted by @igamigo in https://github.com/0xMiden/miden-client/pull/1177#discussion_r2298819502_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.