-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add method for exporting and importing notes #67
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good! I do have a few comments - some of them may be good to do in this PR, but others we can do in subsequent PRs (but let's create issues for them).
- I'd prefer
Client::import_note()
instead ofClient::insert_input_note()
. - In the future, we'd probably want to enable importing of both pending and committed notes (i.e.,
Note
vs.RecordedNote
). So, we might have to create a separate struct where note authentication info is optional. - For CLI command structure, I wonder if it would be better to have
import
andexport
be top level commands. So, we'd saymiden-client import note
to import a note.
Renamed
Created an issue for this, also related to #68 that implements an enum for Note/RecordedNote
Created an issue for this as well. I don't think it's necessary right now but as the project takes form we might want to do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you! I left one comment for the future inline.
pub fn import_input_note(&mut self, note: RecordedNote) -> Result<(), ClientError> { | ||
self.store | ||
.insert_input_note(¬e) | ||
.map_err(|err| err.into()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other thing to consider in the future: when we are importing notes with Merkle authentication paths, we'd probably want to make sure that the note actually exists in the chain and start monitoring its nullifiers. The former will require a call to the node RPC. For the latter we'll need to update a list of relevant tags in the state sync table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a TODO for this
In order to register notes that can be passed through a side channel, we need a method to import/export them