Commit Graph

16258 Commits

Author SHA1 Message Date
Kris Nuttycombe e8f23e3629 Add a test verifying the default addr is added when importing a Sapling key. 2022-03-28 19:47:19 -06:00
Kris Nuttycombe dba00530ee Ensure that legacy imported addresses are properly restored to the wallet.
The filter that restricted the restore of default Sapling addresses to
the wallet, which limited the restoration to those addresses associated
with the legacy key, was too restrictive; it meant that imported
addresses were not restored to the wallet. That check has been inverted,
such that we now restore the default address for any key that is not
associated with the mnemonic seed.
2022-03-28 19:47:19 -06:00
Kris Nuttycombe ad97298637 Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-28 19:46:21 -06:00
Kris Nuttycombe 44eb07a2bb Guard against invalid coercion of int to u32 in FindSpendableInputs 2022-03-28 19:46:21 -06:00
Kris Nuttycombe e07e355e01 Fix overzealous matching of Orchard FVKs to addresses.
It is possible for an address to be generated for a UFVK that
contains an Orchard FVK, but where the address does not contain
an Orchard receiver. Cache restoration was failing on startup
because we failed to allow for this case.
2022-03-28 19:46:21 -06:00
Kris Nuttycombe 0b8ee33bbd Add an RPC test that attempts a double-spend. 2022-03-28 19:46:21 -06:00
Kris Nuttycombe 66756d1a13 Improve error logging in walletdb.cpp 2022-03-28 19:46:21 -06:00
Sean Bowe 0a59f8c789 Rename constant in include file to avoid conflicts with btest 2022-03-28 19:45:25 -06:00
Sean Bowe a6425b46c6 Activate NU5 at start of DuplicateOrchardNullifier test. 2022-03-28 19:45:25 -06:00
Sean Bowe 9bee74e370 Revert "AddBogusOrchardSpends"
This reverts commit d33b0dd0105e66a4788f595412f1289632a6ba5d.
2022-03-28 19:45:25 -06:00
Sean Bowe 652a0df78d Hardcode transaction data for DuplicateOrchardNullifier test. 2022-03-28 19:45:25 -06:00
Sean Bowe 90b07d65be Add test that checks if a bundle containing duplicate Orchard nullifiers is rejected. 2022-03-28 19:45:25 -06:00
Sean Bowe dcc47bd882 AddBogusOrchardSpends 2022-03-28 19:45:25 -06:00
Kris Nuttycombe d4b2ec6359
Merge pull request #5762 from str4d/fix-orchard-conflicts-test
test: Fix `WalletTests.GetConflictedOrchardNotes` gtest
2022-03-28 19:39:44 -06:00
Jack Grigg 1e9bdcd0a2 test: Fix `WalletTests.GetConflictedOrchardNotes` gtest
The test was creating a fake shielding transaction, but by using a
single null `COutPoint` it was accidentally trying to create a coinbase
transaction, which was then rejected by the consistency checks on the
Rust side (which require that no inputs be provided for a coinbase
transaction, which by definition has no real inputs).
2022-03-29 00:26:22 +00:00
Jack Grigg ba7d3c41bf rust: Improve `PrecomputedTransactionData` construction errors
We now log separate errors for "provided inputs when signing a coinbase
transaction" and "provided the wrong number of inputs to a transaction".
2022-03-29 00:26:22 +00:00
Jack Grigg 7892888379 test: Improve gtest handling of `TransactionBuilderResult::GetTxOrThrow`
We can't directly use `EXPECT_NO_THROW` on a function that returns a
result; instead we manually call `GTEST_FAIL` if the builder result is
an error.
2022-03-29 00:26:22 +00:00
Jack Grigg 52e039ebd8 builder: Handle `std::ios_base::failure` exceptions during sighash
These can occur if e.g. `PrecomputedTransactionData` encounters an error
during parsing of its inputs on the Rust side.
2022-03-29 00:26:22 +00:00
Jack Grigg 8b68d73802 test: Print all logged errors to stdout during gtests
This makes it easier to figure out test failures caused by errors on the
Rust side, for which we generally log the error and then return a simple
failure condition (`false` or `nullptr`) which obscures the error on the
C++ side.

We add similar logic to the Boost test framework, but commented out by
default because it results in very verbose test output.
2022-03-29 00:26:22 +00:00
Kris Nuttycombe 0daa540128 Merge remote-tracking branch 'upstream/master' into nu5-consensus 2022-03-28 10:13:51 -06:00
Charlie O'Keefe ddcfc1c5b7
Merge pull request #5757 from nuttycom/fix/ua_error_improvement
Improve error message for when a UA is only usable after a future NU.
2022-03-27 10:56:15 -06:00
Kris Nuttycombe 021a8d1b4b Improve error message for when a UA is only usable after a future NU.
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-03-27 09:26:36 -06:00
Daira Hopwood dfea6c69d2 Repair `feature_zip239` RPC test by checking the debug log of node 0 rather than its stderr.
Since we no longer redirect stderr, this will correctly fail if stderr has unexpected output.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-27 08:37:03 +01:00
Daira Hopwood 65d96aaa10 Switch Jack Grigg's copyright on src/rust/{include/tracing.h, src/tracing_ffi.rs} to the
Zcash developers (with his permission).

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-26 18:56:34 +00:00
Daira Hopwood ac25936d0e contrib/debian/copyright: add license for Apache-2.0.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-26 18:48:31 +00:00
Daira Hopwood 21e5fa90af contrib/debian/copyright: add licenses of Rust dependencies that do not have Expat/MIT as an option.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-26 18:45:57 +00:00
Daira Hopwood 623f3568a7 contrib/debian/copyright: minor corrections and formatting
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-26 18:45:57 +00:00
Daira Hopwood 4d0c503ee5 contrib/debian/copyright: add license entries for Libtool macros.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2022-03-26 18:45:57 +00:00
Kris Nuttycombe 71bfbfa28e
Merge pull request #5727 from rex4539/typos
Fix typos
2022-03-26 08:54:10 -06:00
str4d e87b94d88d
Merge pull request #5737 from steven-ecc/5705-remove-orchard-experimental-flag
Remove the fExperimentalOrchardWallet flag and related logic
2022-03-26 13:08:50 +00:00
Steven Smith e375f4ace2 Remove the fExperimentalOrchardWallet flag and related logic 2022-03-25 21:46:09 -07:00
Kris Nuttycombe c73f4b3fda
Merge branch 'master' into typos 2022-03-25 22:05:26 -06:00
Kris Nuttycombe 79b0490661
Merge pull request #5732 from therealyingtong/test-conflicted-orchard-notes
Fix handling of Orchard notes in `CWallet::GetConflicts`.
2022-03-25 22:02:55 -06:00
Kris Nuttycombe 46190bca23
Merge pull request #5751 from nuttycom/feature/fix_rpc_docs
Add undocumented attributes to getinfo API help text.
2022-03-25 22:01:15 -06:00
Kris Nuttycombe 74f770426b
Apply suggestions from code review 2022-03-25 18:37:31 -06:00
str4d ffda9f1ccf
Merge pull request #5753 from superbaud/enforce-testnet-version
Disallow testnet peers with a protocol version older than 170040
2022-03-25 23:16:49 +00:00
str4d 696a49b30d
Merge pull request #5745 from str4d/orchard-shielded-coinbase-tests
Test Orchard shielded coinbase rules
2022-03-25 23:04:39 +00:00
sasha d10c0553f3
Merge pull request #5750 from nuttycom/defensive/scanwallet_nullptr_check
Assert that pindexStart cannot be null in CWallet::ScanForWalletTransactions
2022-03-25 16:02:05 -07:00
Charlie O'Keefe 72d2f302f2
Merge pull request #5752 from nuttycom/test/orchard_spend_rollback
Add test for rollback of an Orchard spend.
2022-03-25 17:01:21 -06:00
sasha d250b8cd88 Disallow testnet peers with a protocol version older than 170040 2022-03-25 15:02:32 -07:00
Kris Nuttycombe ecc1e5da0c Add missing filter to ensure only fully-transparent transactions end up in mapOrphans. 2022-03-25 15:10:44 -06:00
Kris Nuttycombe 9f4e5ef2cc Add test for rollback of an Orchard spend. 2022-03-25 15:10:42 -06:00
Charlie O'Keefe 212f2bfb41
Merge pull request #5719 from nuttycom/cleanup/rpc_address_naming
Rename fields in RPC results: unifiedaddress->address and type->(pool or address_type)
2022-03-25 14:05:36 -06:00
Kris Nuttycombe dc4afca405 Correctly return p2pkh/p2sh labels for z_listunifiedreceivers 2022-03-25 10:44:18 -06:00
Kris Nuttycombe 8630891c5a Improve consistency of RPC parameter and result attribute naming.
Make consistent use of "pool", "address type" and "receiver type",
in RPC documentaion, and deprecate bare uses of "type" in RPC APIs.

Fixes #5534

Co-authored-by: str4d <thestr4d@gmail.com>
2022-03-25 10:44:18 -06:00
Kris Nuttycombe 0b8a4e1985
Merge pull request #5714 from LarryRuane/2022-03-regtest-doc
Add regtest documentation to book
2022-03-25 09:59:11 -06:00
Kris Nuttycombe 1d73567f42 Add undocumented components to getinfo API. 2022-03-25 09:25:46 -06:00
Kris Nuttycombe 881e0f2ca8 Rename unifiedaddress->address in z_getaddressforaccount results
Fixes #5432
2022-03-25 08:29:56 -06:00
Kris Nuttycombe b9b5d47523 Assert that pindexStart cannot be null in CWallet::ScanForWalletTransactions 2022-03-25 08:23:51 -06:00
Marshall Gaucher 4a9bd59fef
Merge pull request #5743 from daira/no-banlist-on-reindex
Start with an empty banlist if -reindex is set
2022-03-25 06:37:11 -07:00