Skip to content

refactor(sncast): Migrate to accounts repository and new domain models - #4551

Open
integraledelebesgue wants to merge 1 commit into
refactor/sncast-runtime-signerfrom
refactor/sncast-native-account-repository
Open

refactor(sncast): Migrate to accounts repository and new domain models#4551
integraledelebesgue wants to merge 1 commit into
refactor/sncast-runtime-signerfrom
refactor/sncast-native-account-repository

Conversation

@integraledelebesgue

@integraledelebesgue integraledelebesgue commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Introduced changes

This PR makes use of the previously introduced concepts. Old functions that leak the abstractions of account storage and signer technology become replaced with new solutions.

Checklist

  • Linked relevant issue
  • Updated relevant documentation
  • Added relevant tests
  • Performed self-review of the code
  • Added changes to CHANGELOG.md

@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from 103c0e8 to ab8ca11 Compare August 19, 2026 16:13
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from ab8ca11 to d279588 Compare August 19, 2026 16:20
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from d279588 to a81c88b Compare August 19, 2026 16:33
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch 3 times, most recently from 0c7741b to d7515b6 Compare August 20, 2026 13:54
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch 2 times, most recently from c376b11 to 14cadac Compare August 20, 2026 14:10
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from 14cadac to 658f454 Compare August 20, 2026 14:29
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch 2 times, most recently from 8352ba5 to 588aa90 Compare August 20, 2026 15:22
@integraledelebesgue integraledelebesgue changed the title refactor(sncast): route native accounts through repository refactor(sncast): Migrate to AccountRepository Aug 20, 2026
@integraledelebesgue integraledelebesgue changed the title refactor(sncast): Migrate to AccountRepository refactor(sncast): Migrate to accounts repository Aug 20, 2026
@integraledelebesgue integraledelebesgue changed the title refactor(sncast): Migrate to accounts repository refactor(sncast): Migrate to accounts repository and new domain models Aug 20, 2026
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from 588aa90 to 3350f05 Compare August 20, 2026 15:58
@integraledelebesgue
integraledelebesgue marked this pull request as ready for review August 20, 2026 16:08
@integraledelebesgue
integraledelebesgue requested a review from a team as a code owner August 20, 2026 16:08
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from f6f51aa to 3d3231d Compare August 26, 2026 10:50
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from 3d3231d to cf969f7 Compare August 26, 2026 11:23
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from cf969f7 to 497da46 Compare August 26, 2026 18:44
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch 2 times, most recently from a955c52 to af96a51 Compare August 27, 2026 11:01
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from af96a51 to a63c67e Compare August 27, 2026 11:35
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch 2 times, most recently from 62890c0 to 3b57318 Compare August 28, 2026 15:04
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch from 3b57318 to ffe5afc Compare August 28, 2026 15:14
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch 2 times, most recently from b5ed7d8 to 913a473 Compare August 28, 2026 15:20
@integraledelebesgue
integraledelebesgue force-pushed the refactor/sncast-native-account-repository branch 2 times, most recently from 73923ea to 59524de Compare August 28, 2026 15:51
Comment thread crates/sncast/src/starknet_commands/account/deploy.rs Outdated
Comment on lines 83 to +95
fn read_and_flatten(
accounts_file: &Utf8PathBuf,
repository: &AccountRepository,
display_private_keys: bool,
) -> anyhow::Result<HashMap<String, AccountDataRepresentationMessage>> {
let networks: NestedMap<AccountData> = read_and_parse_json_file(accounts_file)?;
let mut result = HashMap::new();
) -> anyhow::Result<BTreeMap<String, AccountDataRepresentationMessage>> {
let registry = repository.load()?.registry;
let mut result = BTreeMap::new();

for (network, accounts) in networks.iter().sorted_by_key(|(name, _)| *name) {
for (network, accounts) in registry.networks() {
for (name, data) in accounts.iter().sorted_by_key(|(name, _)| *name) {
let mut data_repr = AccountDataRepresentationMessage::new(data, display_private_keys);

data_repr.set_network(network);
result.insert(name.to_owned(), data_repr);
data_repr.set_network(network.as_str());
result.insert(name.to_string(), data_repr);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result is keyed by account name only, so two accounts with the same name in different networks collide. The second insert overwrites the first and one silently drops from the listing. Can we key by (network, name)?

Comment thread crates/sncast/src/starknet_commands/account/deploy.rs
Comment thread crates/sncast/src/starknet_commands/account/import.rs Outdated
Comment thread crates/sncast/src/starknet_commands/account/mod.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants