Because the client now only saves notes as InputNoteRecord objects in the store when they are for an account that it is tracking, we need to make sure we provide a way to retrieve output notes as OutputNoteRecord. Currently this is not possible through the client (even though the store has methods for retrieving records of this table).
How should it be done?
I think the refactors could include:
Provide two client methods for retrieving notes: get_input_notes() and get_output_notes(). Both of these could include NoteFilter as they currently do, but we could add a NoteFilter::Unique(NoteId) for only retrieving one. This way, we remove get_input_note() and get_output_note() from the store (we can provide them on the client and they would call store.get_input_notes(NoteFilter::Unique(NoteId)) and the same for output note).
Provide conversions between InputNoteRecord and OutputNoteRecord through TryFrom. Whether the conversions are possible will be given by the current amount of information we have on the record. This enables clients to export output notes as input note records (for instance, the faucet website needs to do this, as it creates a note, stores it in the output notes table and then it has to export them as InputNoteRecord).
When is this task done?
When the client has 4 methods for notes: get_input_notes(), get_input_note(), get_output_notes(), get_outputs_notes().
When the store has 2 methods for notes; get_input_notes() and get_output_notes()
When we provide simple conversions between the InputNoteRecord and OutputNoteRecord types. Additionally, we want to make sure to provide conversions for the Note and InputNote types as well if possible (although these are already done I believe).
What should be done?
Because the client now only saves notes as
InputNoteRecord
objects in the store when they are for an account that it is tracking, we need to make sure we provide a way to retrieve output notes asOutputNoteRecord
. Currently this is not possible through the client (even though the store has methods for retrieving records of this table).How should it be done?
I think the refactors could include:
get_input_notes()
andget_output_notes()
. Both of these could includeNoteFilter
as they currently do, but we could add aNoteFilter::Unique(NoteId)
for only retrieving one. This way, we removeget_input_note()
andget_output_note()
from the store (we can provide them on the client and they would callstore.get_input_notes(NoteFilter::Unique(NoteId))
and the same for output note).InputNoteRecord
andOutputNoteRecord
throughTryFrom
. Whether the conversions are possible will be given by the current amount of information we have on the record. This enables clients to export output notes as input note records (for instance, the faucet website needs to do this, as it creates a note, stores it in the output notes table and then it has to export them asInputNoteRecord
).When is this task done?
get_input_notes()
,get_input_note()
,get_output_notes()
,get_outputs_notes()
.get_input_notes()
andget_output_notes()
InputNoteRecord
andOutputNoteRecord
types. Additionally, we want to make sure to provide conversions for theNote
andInputNote
types as well if possible (although these are already done I believe).Additional context
No response