Skip to content

Conversation

@random-zebra
Copy link

Instead of throwing an error, let's repack the json request and send it to shieldedsendmany.
This makes the integration of send-to-shield-address much easier for third-party services.

We keep the old implementation of sendmany for t->t transactions, until the two flows are properly abstracted.

Also fix a minor bug found in sendmany (not properly considering the fIncludeDelegated flag), and add capability to spend P2CS inside SaplingOperation.

Note: the same thing proposed here, could be done with the RPC sendtoaddress (future).

@random-zebra random-zebra added this to the 5.0.0 milestone Dec 2, 2020
@random-zebra random-zebra self-assigned this Dec 2, 2020
@random-zebra random-zebra force-pushed the 202011_RPC_sendmany-to-shieldedsendmany branch from 2274e7f to 8ecf222 Compare December 2, 2020 20:14
furszy
furszy previously approved these changes Dec 2, 2020
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

nice add man, code review ACK 8ecf222 . Can get merged at any time.

Would be good to have some tests using the sendmany shielded flow in the future. I know that it's mostly tested by the ones using shieldedsendmany but.. one or two more tests cases to cover this new introduction wouldn't hurt.

@random-zebra
Copy link
Author

@furszy test added :)

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

Nice, utACK daa5d7f . More than ready to get merged then :)

"2. \"amounts\" (string, required) A json object with addresses and amounts\n"
" {\n"
" \"address\":amount (numeric) The pivx address (either transparent or shielded) is the key,\n"
" the numeric amount in PIV is the value\n"
Copy link
Collaborator

Choose a reason for hiding this comment

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

no memo support?

Copy link
Author

Choose a reason for hiding this comment

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

that's not contemplated in sendmany.

Copy link
Collaborator

Choose a reason for hiding this comment

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

it could be though, since we're recreating the request further down and passing it on. I'm ok with excluding it for now, was just checking if this was intentional.

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.

utACK daa5d7f

@furszy furszy merged commit b01a1bb into PIVX-Project:master Dec 3, 2020
@Fuzzbawls Fuzzbawls added the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Dec 14, 2020
furszy added a commit that referenced this pull request Dec 14, 2020
…elded recipient

7dbd3bf Refactor: Decouple ShieldedSendManyTo from sendtoaddress/sendmany (random-zebra)
774c544 [Test] Add case for (shielded) sendtoaddress (random-zebra)
46fe147 [RPC] Redirect sendtoaddress to shieldedsendmany when shielded recipient (random-zebra)

Pull request description:

  Same as we did with `sendmany` on #2014 .
  Keep old implementation for transparent recipients.
  Add test case in `sapling_wallet` functional test (also currently running live on https://faucet.pivx.link/).

ACKs for top commit:
  Fuzzbawls:
    ACK 7dbd3bf
  furszy:
    utACK 7dbd3bf

Tree-SHA512: b7613ecd4828e7d1229810a179854c1b14c5aefee5a85738092b4256e15a981d39501b3e583f7d9c9ff08407cbfd61b18cd984fb0f4d7727e609b5a5924bcfc1
@random-zebra random-zebra removed the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Jan 3, 2021
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.

3 participants