fix: update LibWallet wallet_import_utxo
method to include valid TariScript
#3139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
wallet_import_utxo
FFI function in LibWallet just used defaults for a number of the new UTXO fields when importing a faucet UTXO. The Faucet UTXO provided by the client is just the spending key and amount. Themetadata_signature
andsender_offset_public_key
can both remain as default values as they are not used in spending an UTXO. A Nop script is assumed and the spending key is used as thescript_private_key
. The final update is that theinput_data
it set as the public key of the spending key.To test that the base node is happy for an UTXO imported in this way to be spent a Cucumber test is provided which imports a UTXO into a wallet and zeroes out the
metadata_signature
andsender_offset_public_key
and updates theinput_data
andscript_private_key
in the same way as described above. This imported Faucet utxo is then successfully spent to another wallet.How Has This Been Tested?
Cucumber test provided
Checklist:
development
branch.