Skip to content
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

fix: update LibWallet wallet_import_utxo method to include valid TariScript #3139

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

philipr-za
Copy link
Contributor

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. The metadata_signature and sender_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 the script_private_key. The final update is that the input_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 the input_data and script_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:

  • I'm merging against the development branch.
  • I have squashed my commits into a single commit.

@stringhandler stringhandler changed the title Update LibWallet wallet_import_utxo method to include valid TariScript fix: update LibWallet wallet_import_utxo method to include valid TariScript Jul 27, 2021
@aviator-app
Copy link
Contributor

aviator-app bot commented Jul 29, 2021

Waiting for approval before queuing

…cript

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. The `metadata_signature` and `sender_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 the `script_private_key`. The final update is that the `input_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` and`sender_offset_public_key` and updates the `input_data` and `script_private_key` in the same way as described above. This imported Faucet utxo is then successfully spent to another wallet.
Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@aviator-app
Copy link
Contributor

aviator-app bot commented Jul 29, 2021

PR queued successfully. Your position in queue is: 1

@aviator-app aviator-app bot merged commit cc6de2a into tari-project:development Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants