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

Sapling operation new spend from several different sources feature + send/build decoupling. #1961

Merged

Conversation

furszy
Copy link

@furszy furszy commented Nov 10, 2020

Up until now, the sapling operation flow (shielded transaction building) only was allowing to create a transaction from a single address source (transparent or shielded). This means that the user needed to select from which address the wallet should take funds from to spend.

This PR introduces two main new features and several improvements over the sapling operation class.

Main features:
(1) spending from several transparent sources and (2) spending from several shielded sources. Both selected by the operation process automatically, no user input needed.

Secondary improvements:
(1) making the change address key optional, (2) decoupling sapling operation build and send process (this is needed in order to be able to create the tx on the GUI and raw shielded txs using the command line).

Refactoring:
(1) GetFilteredNotes SaplingPaymentAddress argument moved to optional so it can be omitted in the shielded funds selection process.

…serveKey argument.

Pass CReserveKey pointer instead of referece to CommitTransaction.
@furszy furszy self-assigned this Nov 10, 2020
@random-zebra random-zebra added this to the 5.0.0 milestone Nov 10, 2020
Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

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

Looking good.

src/sapling/sapling_operation.h Outdated Show resolved Hide resolved
src/sapling/sapling_operation.h Outdated Show resolved Hide resolved
@furszy furszy force-pushed the 2020_sapling_operation_from_differet_sources branch from 8d048ab to 9639f8b Compare November 10, 2020 17:44
@furszy
Copy link
Author

furszy commented Nov 10, 2020

Updated per zebra's feedback 👍

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

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

ACK 9639f8b

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK 9639f8b

@furszy furszy merged commit 740f958 into PIVX-Project:master Nov 12, 2020
furszy added a commit that referenced this pull request Nov 14, 2020
…lded_sendmany

634ddbf [Tests][Refactor] Check mempool in sapling_wallet.py (random-zebra)
0673634 [Tests] Add test for raw_shielded_sendmany (random-zebra)
07b666c [RPC] Introduce raw_shielded_sendmany (random-zebra)
30f3a09 [Refactoring] Remove testMode from SaplingOperation (random-zebra)
4b0fd27 [Test] shielded_sendmany: check from_transparent argument in unit test (random-zebra)
b8e28f8 [Test] Verify shielded_sendmany with generic fromAddress (random-zebra)
4241fbf [RPC] Add option to send from multiple addresses in shielded_sendmany (random-zebra)
60b7c9b [Trivial][RPC] Fix default fee in shielded_sendmany help (random-zebra)
952555f [Refactor] Introduce CreateShieldedTransaction auxiliary fun for RPC (random-zebra)

Pull request description:

  Add the option to `shielded_sendmany` to automatically select the inputs from any transparent or sapling address (inserting the string `"from_transparent"`/`"from_shielded"` instead of  the from-address)

  Create new  rpc `raw_shielded_sendmany` which creates (without committing) the shielded transaction and returns a json object.

  Update the functional tests.

  Based on top of:
  - [x] #1961

  Starts with `[Refactor] Introduce CreateShieldedTransaction auxiliary fun for RPC` (e014ff3)

ACKs for top commit:
  furszy:
    ACK 634ddbf and merging..

Tree-SHA512: cd4c3226a1782b86af9bd7915cd75decc94601962c2c40884381118f302bbe35ed2cfefc59962f40e05f5b858b57588edc3cfad7098b13ffbe30e203d801c39f
@furszy furszy deleted the 2020_sapling_operation_from_differet_sources branch November 29, 2022 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants