Commit Graph

53 Commits

Author SHA1 Message Date
Kris Nuttycombe eb91c7869a Remove a use of KeyIO::DecodeDestination in z_shieldcoinbase 2022-01-07 11:49:09 -07:00
Kris Nuttycombe 20266ac911 Remove uses of KeyIO::DecodeDestination 2022-01-07 11:49:07 -07:00
Kris Nuttycombe b305ad2892 Remove the `InvalidEncoding` type from key & address variants.
The presence of this variant results in a situation where more
of the code than necessary needs to be aware of and handle
decoding failures. This change moves all handling of decoding
failures to the point of decoding.
2022-01-06 13:44:45 -07:00
Dimitris Apostolou e05c1ddf8a
Fix typos 2021-11-14 16:27:09 +02:00
Kris Nuttycombe d867a8dc67 Use lowerCamelCase for listaddresses JSON 2021-10-08 10:30:39 -06:00
Kris Nuttycombe 23507899a3 Consistently group Sapling addresses by IVK for every source. 2021-10-07 19:58:31 -06:00
Kris Nuttycombe 9e83d28afb Include `ImportedWatchOnly` as a PaymentAddressSource result. 2021-10-07 17:43:56 -06:00
Kris Nuttycombe 6b1d290789 Group legacy_hdseed Sapling addresses by account ID. 2021-10-07 13:48:55 -06:00
Kris Nuttycombe 6be880fe34 Correctly handle imported Sapling addresses
Update the tests to reflect the new listaddresses result
structure.
2021-10-06 20:39:52 -06:00
Kris Nuttycombe 64ecf700fc Add `listaddresses` RPC method.
Closes #5328
Fixes #5338
2021-10-06 13:55:26 -06:00
John Newbery 8af7e138ac [wallet] Kill accounts
This commit does the following changes:

- [wallet] Remove 'account' argument from GetLegacyBalance()
  - GetLegacyBalance() is never called with an account argument.
    Remove the argument and helper functions.
- [wallet] Remove CWallet::ListAccountCreditDebit()
  - Function no longer used.
- [wallet] Remove AccountMove()
  - Function no longer used.
- [wallet] Remove AddAccountingEntry()
  - Function no longer used.
- [wallet] Remove GetAccountCreditDebit()
  - Function no longer used.
- [wallet] Don't rewrite accounting entries when reordering wallet transactions.
 - Accounting entries are deprecated. Don't rewrite them to the wallet
   database when re-ordering transactions.
- [wallet] Remove WriteAccountingEntry()
  - Function no longer used.
- [wallet] Don't read acentry key-values from wallet on load.
- [wallet] Remove ListAccountCreditDebit()
  - Function no longer used.
- [wallet] Remove CAccountingEntry class
  - No longer used
- [wallet] Remove GetLabelDestination
  - Function no longer used.
- [wallet] Delete unused account functions
  - ReadAccount
  - WriteAccount
  - EraseAccount
  - DeleteLabel
- [wallet] Remove fromAccount argument from CommitTransaction()
- [wallet] Remove strFromAccount.
  - No longer used.
- [wallet] Remove strSentAccount from GetAmounts().
  - No longer used.
- [wallet] Update zapwallettxes comment to remove accounts.
- [wallet] Remove CAccount
  - No longer used
- [docs] fix typo in release notes for PR 14023

(cherry picked from commit c9c32e6b844fc79467b7e24c6c916142a0d08484)
2021-08-12 08:07:12 -06:00
John Newbery 3ef50b3647 [wallet] Remove wallet account RPCs
Also remove the RPC deprecation tests for accounts, and make one small
change to another wallet test that relies on account behaviour.

(cherry picked from commit f0dc850bf698f7377797d7d68365d4fc79b0221c)
2021-08-12 08:07:12 -06:00
Daira Hopwood 5e84362702 Reduce the default fee for z_* operations, and the "low fee penalty" threshold for mempool limiting, to 1000 zatoshis.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-18 12:37:03 -07:00
Homu dea50714f9 Auto merge of #4892 - str4d:boosted, r=str4d
Replace boost::variant and boost::optional with standard library

Includes a commit cherry-picked from https://github.com/bitcoin/bitcoin/pull/20419.

Closes #4821. Closes #4822.
2020-12-17 02:42:55 +00:00
Jack Grigg d8d0918951 scripted-diff: Migrate from boost::optional to std::optional
-BEGIN VERIFY SCRIPT-
sed -i 's/boost::none/std::nullopt/g' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h* ./src/*/*/*.cpp ;
sed -i 's/boost::optional/std::optional/g' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h* ./src/*/*/*.cpp ;
sed -i 's/std::optional<\(.*\)&>/std::optional<std::reference_wrapper<\1>>/' ./src/*/*.h ./src/*/*.cpp ;
sed -i 's/is_initialized()/has_value()/' ./src/*.cpp ./src/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include <boost\/optional.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include "boost\/optional.hpp"\n//' ./src/*.h ;
-END VERIFY SCRIPT-
2020-12-16 22:59:35 +00:00
Jack Grigg 521eb81a95 Add <optional> header to files that will need it 2020-12-16 22:59:34 +00:00
Jack Grigg b521cb8932 scripted-diff: Migrate from boost::variant to std::variant
-BEGIN VERIFY SCRIPT-
sed -i 's/boost::variant/std::variant/' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ;
sed -i 's/boost::get<\(.*\)>(&/std::get_if<\1>(\&/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.cpp ;
sed -i 's/boost::get</std::get</' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.cpp ;
sed -i 's/boost::apply_visitor(/std::visit(/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ;
sed -i 's/class \(.*\)\b \?: public boost::static_visitor<.*>/class \1/' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include <boost\/variant\(\/.*\)\?.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include "boost\/variant\/.*.hpp"\n//' ./src/*/*.cpp ;
-END VERIFY SCRIPT-
2020-12-16 22:49:53 +00:00
Jack Grigg f68c79554f Add <variant> header to files that will need it 2020-12-16 22:48:21 +00:00
Kris Nuttycombe e9b5d83709 Prefer explicit passing of CChainParams to the Params() global. 2020-12-15 08:23:09 -07:00
furszy ca9fc49fc4
rpc_wallet_tests: changed "Insufficient funds" error message to a proper "Insufficient transparent funds". This is because we are now throwing the insufficient transparent balance rpc error inside load_utxo. 2020-11-13 10:23:59 -03:00
Wladimir J. van der Laan 73bc7a068d Replace uses of boost::filesystem with fs
Step two in abstracting away boost::filesystem.

To repeat this, simply run:
```
git ls-files \*.cpp \*.h | xargs sed -i 's/boost::filesystem/fs/g'
```
2020-10-22 01:11:37 +01:00
Wladimir J. van der Laan 7044e39a57 Replace includes of boost/filesystem.h with fs.h
This is step one in abstracting the use of boost::filesystem.
2020-10-22 01:11:37 +01:00
Homu de5c28b4b7 Auto merge of #4613 - str4d:claaaaaang, r=daira
Pin Clang for all compilation

fixes #2513, fixes #4697, fixes #4698, fixes #4699. refs #4607, #4292
2020-10-20 11:15:47 +00:00
therealyingtong 6f3c29e9b7 Only return address instead of CScript 2020-10-19 10:04:19 +08:00
therealyingtong 4e50b700e9 Minor cleanups 2020-10-17 03:13:19 +08:00
therealyingtong 719c117f1c Handle shielded address case 2020-10-17 03:08:37 +08:00
therealyingtong 6c41d1da05 Fix CScript encoding 2020-10-17 02:35:39 +08:00
therealyingtong cec67e90c5 Add funding stream addresses to getblocksubsidy RPC output 2020-10-16 23:57:04 +08:00
Larry Ruane fbf2743163 performance: auto params = CChainParams::GetConsensus()
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
No functional change.
Assignments from CChainParams::GetConsensus() shouldn't
be auto, or else the copy constructor runs, which is
slow for this structure. Where possible, replace auto
with const Consensus::Params&
2020-10-13 15:49:55 -06:00
Daira Hopwood d3330ab797 Fix warnings surfaced by compiling with clang++.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-12 17:55:12 +01:00
Taylor Hornby 3693b96ed4 Fix undefined behavior in the test_bitcoin tests 2020-10-01 13:59:47 +01:00
Kris Nuttycombe b383d6cada Merge remote-tracking branch 'upstream/master' into bazel-patches 2020-07-31 12:49:40 -06:00
Daira Hopwood 69cf041d5d Change the format of `getblocksubsidy` output to use an array of funding stream objects.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-10 14:10:26 +01:00
Kris Nuttycombe 07ff0d19a0 Make evident the relationship between chainparams and key IO. 2020-07-09 17:48:47 -06:00
Daira Hopwood 6bd85925e7 Tests for changes to getblocksubsidy.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-07-09 23:33:14 +01:00
therealyingtong 119bae082c Remove old SaplingNote() constructor 2020-07-08 12:53:03 +08:00
Sean Bowe 1c2c6be872
Remove bare SaplingNote constructor. 2020-06-17 11:36:35 -06:00
Taylor Hornby e0ab57ee36 Add univalue to updatecheck.py and update univalue, removing calls to deprecated methods 2020-05-14 12:42:19 -06:00
Homu d0b533aacb Auto merge of #4304 - oxarbitrage:issue3893, r=str4d
Add status to transactions in RPC calls

Closes https://github.com/zcash/zcash/issues/3893.
2020-05-12 03:05:37 +00:00
Alfredo Garcia 0636fbabbd
minor comment fix 2020-03-17 17:56:25 -03:00
Homu 6c00a8ccf9 Auto merge of #4280 - oxarbitrage:issue2197, r=daira
Allow negative heights in RPC calls

For issue https://github.com/zcash/zcash/issues/2197

Currently adding the feature to `getblock` and `getblockhash`. There is another candidate: `getblocksubsidy` however i want to have some review about these 2 first before repeating what could be a bad approach.
2020-03-05 16:36:32 +00:00
Alfredo Garcia 445ae593d6 change the cm member of OutputDescription to cmu 2020-02-26 17:43:50 -03:00
Homu 3f270a2afa Auto merge of #4360 - oxarbitrage:issue3235, r=str4d
Add destination wrapper functions

Closes #3235.
2020-02-19 17:53:54 +00:00
Alfredo Garcia d53d4d880a add destination wrappers 2020-02-18 13:20:43 -03:00
Alfredo Garcia a8f6b8c2e5 fix rpx_wallet_tests 2020-02-17 09:52:40 -03:00
Homu 3011702f53 Auto merge of #4302 - oxarbitrage:issue3687, r=str4d
Add z_getnewaddress test

Supercedes #3749. Closes #3687.

It takes the commit from @dagurval where a new test case
`rpc_wallet_z_getnewaddress` is added and it adds a check for too many
arguments.

It uses `CheckRPCThrows()` to test the error message of invalid argument.
However, for too many arguments the full help message is displayed, so I
am just testing there is an runtime exception.
2020-02-11 22:43:44 +00:00
Alfredo Garcia 76a43b6790 Return address and type of imported key in z_importkey
Co-authored-by: Dagur Valberg Johannsson <dagurval@pvv.ntnu.no>
2020-01-22 14:41:02 -03:00
Alfredo Garcia 30ad88cf4c add status to transactions 2020-01-19 14:30:56 -03:00
Alfredo Garcia d8eb0b96bc add additional tests to rpc_wallet_z_getnewaddress 2020-01-17 10:30:14 -03:00
Dagur Valberg Johannsson 61bb241bd3 Improve z_getnewaddress tests 2020-01-17 09:35:11 -03:00