Initial cleanup. Reduces duplication of code, especially around
constructing transactions, resetting the activation heights, and setting
up the EXPECT calls for accepting and rejecting tests.
Also adds a bunch of comments explaining the test plan and what
particular parts of the test are doing.
Add Sapling support to z_getbalance and z_gettotalbalance
Also includes preparatory changes for various other RPCs that depend on `GetFilteredNotes` etc.
Closes#3214.
Revise help output for z_sendmany
The previous version of the usage message for z_sendmany used the word "Change"
in an ambiguous way.
The intent was to describe "Change" the noun that indicates the portion of a
transaction's funds that are returned to the payer, however the context did not
provide an immediate cue to differentiate from the verb form meaning
"to alter". Indeed, in other help strings in the same file that meaning of the
word is correct, i.e. the verb form is used. Moreover a typo in the form of a
missing "a" later in the same sentence exacerbated the problem, by decreasing
readability precisely where context could reduce confusion.
generalize mininode.py protocol versioning
Fixes#2982 -- replace `overwintered` boolean argument to NodeConn constructor with a protocol version integer, so that adding Sapling (and beyond) will be easier.
This could in future be refactored to be generic over PaymentAddress and
NotePlaintext in the return type, but for now let's be explicit about which
returned notes are for Sprout vs Sapling, and handle them separately.
Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
Track Sapling notes and nullifiers in the wallet (in-memory only, no persistence to disk)
Part of #3061. Add in-memory tracking of Sapling notes and nullifiers to the wallet.
Set Sapling mainnet activation height
In mainnet, block #419200 is expected to appear on October 28, 2018, Zcash's birthday.
In testnet, block #280000 is expected about a week from now. (Current height is ~275249, plus 4032 blocks for a week, plus a little more just to make the number nice.)
These are the activation heights for Sapling in mainnet and testnet, respectively. Protocol version is also changed.
Always write the empty root down as the best root, since we may roll back
In [`3577de83`](3577de83aa) we started not writing the Sapling empty root down as the "best" anchor because we had changed the encodings and didn't want users who compiled from master to have inconsistent coindb's in the future if the encoding changed again for some reason.
However, if we don't write the empty root down then during rollbacks to Sapling activation we leave the best anchor on disk different from what's in the cache, which will trigger an assertion.
This reverts the change from `3577de83` since we've settled on the encodings.