Closed mFragaBA closed 1 month ago
- created a root
import
command (so now you domiden import (account|note) <args>
) and removed the ones underinput-notes
andaccount
Not for this PR: I'm wondering if we can have just miden import <filepaths> --no-verify
and the client will figure out based on the file whether it is importing accounts or notes. One way to do this is to add something like a 4-byte "magic" value in front of each file during serialization. This could then be used to identify the type of object we are dealing with.
- for
miden account show
we now show all account info and we remove the flags to show the vault/script/etc.
Similar thought to the ones discussed elsewhere (and probably not for this PR): for me personally, miden account --show <account_id>
would have been a more natural command.
- created a root
import
command (so now you domiden import (account|note) <args>
) and removed the ones underinput-notes
andaccount
Not for this PR: I'm wondering if we can have just
miden import <filepaths> --no-verify
and the client will figure out based on the file whether it is importing accounts or notes. One way to do this is to add something like a 4-byte "magic" value in front of each file during serialization. This could then be used to identify the type of object we are dealing with.
If we want to handle both, couldn't we just try deserializing into one of the two structs and if that fails we try with the other one? That should be doable in the current state
If we want to handle both, couldn't we just try deserializing into one of the two structs and if that fails we try with the other one? That should be doable in the current state
Yep - that would work too. With a "magic" value upfront, error messaging could be a bit cleaner - but that's a pretty minor thing.
You also don't risk having a file deserializing as an incorrect struct, which is probably not a likely scenario (especially considering the difference between eg accounts and notes) but that could definitely happen eventually.
addresses some points from #314, particularly the ones under the
Command changes
sectionFeedback changes:
miden
miden account show
we now show all account info and we remove the flags to show the vault/script/etc.import
command (so now you domiden import (account|note) <args>
) and removed the ones underinput-notes
andaccount
export
commandList
subcommand)Follow-up work (opening new issues before merge):
account --list
works andaccount list
does not, and similarly for other commandsAccountData
which is what we use to import account data.