Closed tomyrd closed 1 month ago
Probably for a different PR: would it make sense to store this info in the database somehow? Like for every input note we could have "consumed by" field which would be set to account ID which consumed the note and null otherwise.
I guess the difficulty here would be to figure out when to fill this field (e.g., when a transaction is submitted to the node, or when it is recorded on chain).
Probably for a different PR: would it make sense to store this info in the database somehow? Like for every input note we could have "consumed by" field which would be set to account ID which consumed the note and null otherwise.
I guess the difficulty here would be to figure out when to fill this field (e.g., when a transaction is submitted to the node, or when it is recorded on chain).
One way might be when we mark the transactions as Committed
Probably for a different PR: would it make sense to store this info in the database somehow? Like for every input note we could have "consumed by" field which would be set to account ID which consumed the note and null otherwise. I guess the difficulty here would be to figure out when to fill this field (e.g., when a transaction is submitted to the node, or when it is recorded on chain).
One way might be when we mark the transactions as
Committed
On the second thought, maybe storing account ID is not the right thing and what we should store is actually transaction ID (of the transaction in which the note was consumed).
One other thing that we should try to figure out how to do is to track more details information about note status. For example, I don't think we can currently tell if a note is in the process of being consumed (e.g., we created a transaction consuming this note, sent it to the network, but the transaction hasn't been included in a block yet) and how long it has remained in this state (e.g., have we sent a transaction 10 minutes or 10 days ago?). Let's create an issue to discuss this.
Closing this PR as a better solution was developed in #334
One of the changes requested in #314 is:
But we didn't have a way to get the account ID of the consumer of a note. This PR adds a new method to
Store
andClient
that does just that.