refactor(sncast): Migrate to accounts repository and new domain models - #4551
Open
integraledelebesgue wants to merge 1 commit into
Open
Conversation
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 19, 2026 16:13
103c0e8 to
ab8ca11
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 19, 2026 16:20
ab8ca11 to
d279588
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 19, 2026 16:33
d279588 to
a81c88b
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
3 times, most recently
from
August 20, 2026 13:54
0c7741b to
d7515b6
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
2 times, most recently
from
August 20, 2026 14:10
c376b11 to
14cadac
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 20, 2026 14:29
14cadac to
658f454
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
2 times, most recently
from
August 20, 2026 15:22
8352ba5 to
588aa90
Compare
AccountRepository
AccountRepository
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 20, 2026 15:58
588aa90 to
3350f05
Compare
integraledelebesgue
marked this pull request as ready for review
August 20, 2026 16:08
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 26, 2026 10:50
f6f51aa to
3d3231d
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 26, 2026 11:23
3d3231d to
cf969f7
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 26, 2026 18:44
cf969f7 to
497da46
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
2 times, most recently
from
August 27, 2026 11:01
a955c52 to
af96a51
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 27, 2026 11:35
af96a51 to
a63c67e
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
2 times, most recently
from
August 28, 2026 15:04
62890c0 to
3b57318
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
from
August 28, 2026 15:14
3b57318 to
ffe5afc
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
2 times, most recently
from
August 28, 2026 15:20
b5ed7d8 to
913a473
Compare
integraledelebesgue
force-pushed
the
refactor/sncast-native-account-repository
branch
2 times, most recently
from
August 28, 2026 15:51
73923ea to
59524de
Compare
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); |
Contributor
There was a problem hiding this comment.
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)?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
CHANGELOG.md