You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expose locked_outputs or basically a duplication of it to users, so they manually can lock some outputs they don't want to be consumed in transactions?
Having two methods like .lock_output(output_id), .unlock_output(output_id) that add/remove this output id to/from the locked_outputs field of the wallet.
Motivation
For example one has a basic output with some metadata feature that one would like to keep and not consume in other transactions, then it would be nice if one can just call .lock_output(output_id), .unlock_output(output_id) to make it not available for transactions or later available again.
Requirements
Add .lock_output(output_id) or .lock_output(output_id, "my precious metadata output".to_string()) and .unlock_output(output_id) which make outputs not or available to the input selection
Make sure that users don't mess up transactions and that
Currently locked_outputs is a HashSet locked_outputs: HashSet<OutputId> that is automatically filled/cleared based on selecting inputs/transactions, if we allow to just unlock any output id there, users could mess it up (unlock outputs that are already used as inputs in txs) which could lead to conflicting transactions. And user defined outputs would be also removed automatically here
if that's not changed.
Therefore it might make sense to create a new HashSet for user defined locked outputs to keep them separated. Or maybe a HashMap<OutputId, Reason> would be better? Then users could even specify a reason for what they locked an output. Reason could be an enum like this
pubenumReason{// Used as input in a transaction.TransactionInput,// Locked by the user.Custom(String),}
Then .lock_output(output_id, "my precious metadata output".to_string())
Are you planning to do it yourself in a pull request?
No.
The text was updated successfully, but these errors were encountered:
Description
Expose
locked_outputs
or basically a duplication of it to users, so they manually can lock some outputs they don't want to be consumed in transactions?Having two methods like
.lock_output(output_id)
,.unlock_output(output_id)
that add/remove this output id to/from the locked_outputs field of the wallet.Motivation
For example one has a basic output with some metadata feature that one would like to keep and not consume in other transactions, then it would be nice if one can just call
.lock_output(output_id)
,.unlock_output(output_id)
to make it not available for transactions or later available again.Requirements
.lock_output(output_id)
or.lock_output(output_id, "my precious metadata output".to_string())
and.unlock_output(output_id)
which make outputs not or available to the input selectioniota-sdk/sdk/src/wallet/core/builder.rs
Line 276 in 8b55ee5
Open questions (optional)
Currently locked_outputs is a HashSet
locked_outputs: HashSet<OutputId>
that is automatically filled/cleared based on selecting inputs/transactions, if we allow to just unlock any output id there, users could mess it up (unlock outputs that are already used as inputs in txs) which could lead to conflicting transactions. And user defined outputs would be also removed automatically hereiota-sdk/sdk/src/wallet/core/builder.rs
Line 276 in 8b55ee5
Therefore it might make sense to create a new HashSet for user defined locked outputs to keep them separated. Or maybe a
HashMap<OutputId, Reason>
would be better? Then users could even specify a reason for what they locked an output.Reason
could be an enum like thisThen
.lock_output(output_id, "my precious metadata output".to_string())
Are you planning to do it yourself in a pull request?
No.
The text was updated successfully, but these errors were encountered: