Commit Graph

6560 Commits

Author SHA1 Message Date
Daira Hopwood
8a7d37befd Move the increment of nWitnessCacheSize to make the later assertions correct.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-17 05:09:27 +01:00
Jack Grigg
83d7b5b67b Add more asserts to track down the bug 2016-10-17 05:09:27 +01:00
zkbot
ec8dc3a88a Auto merge of #1431 - bitcartel:master_1373_taddr_coinbase_error, r=bitcartel
Return a more informative error message when trying to spend coinbase; select non-coinbase inputs when sending to a transparent output if needed

For #1373 and #1519

Code change:
- Extra parameter added to AvailableCoins to include or exclude Coinbase coins.  Default value of parameter is 'true' as current behaviour is to include Coinbase coins.
- SelectCoins, used for sending taddr->taddr, will now exclude Coinbase coins.

Unit test:
Tried to write a test to focus on the extra parameter added to AvailableCoins but could not.

Empirical testing on Testnet:
Current behaviour is that upstream RPC commands sendfrom and sendtoaddress try to spend coinbase coins returned by AvailableCoins.  So the user will see:

```
./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."}

./zcash-cli sendfrom "" mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."}
```

After fix is applied:

```
./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
error: {"code":-4,"message":"Coinbase funds can only be sent to a zaddr"}
```

When non-coinbase UTXOs exist, they will now be selected and used:

```
./zcash-cli z_sendmany tnPJZHeVxegCg91utaquBRPEDBGjozfz9iLDHt7zvphFbZdspNgkTVLCGjDcadQBKNyUwKs8pNjDXuEZKrE1aNLpFwHgz4t '[{"address":"mx5fTRhLZwbYE7ZqhAPueZgQGSnwTbdvKU", "amount":0.01}]'

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 1000.0
error: {"code":-6,"message":"Insufficient funds"}

./zcash-cli sendtoaddress mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
9818e543ac2f689d4ce8b52087607d73fecd771d45d316a1d9db092f0485aff2

./zcash-cli sendfrom "" mrEGRmGJhmwAa4MQjzGd86ry63vrvovu9b 0.00003000
899f2894823f51f15fc73b5e0871ac943edbe0ff88e1635f86906087b72caf30
```
2016-10-16 22:08:07 -04:00
Simon
2b1cda3b6a Return improved error message when trying to spend Coinbase coins (#1373).
Extra parameter added to AvailableCoins to include or exclude Coinbase coins.
SelectCoins, used for sending taddr->taddr, will exclude Coinbase coins.

Added qa rpc test and a runtime parameter -regtestprotectcoinbase to enforce
the coinbase->zaddr consensus rule in regtest mode.
2016-10-16 19:05:56 -07:00
Jack Grigg
6e263a5fd3 Address review comments 2016-10-16 16:26:51 -05:00
Jack Grigg
a581fe2aae Only ignore runtime errors caused by failed note decryption 2016-10-14 17:16:09 -05:00
Jack Grigg
ddea44a27e Update comments 2016-10-14 17:16:09 -05:00
Jack Grigg
1a62587e9a Delay caching of nullifiers when wallet is locked
Closes #1502
2016-10-14 17:16:09 -05:00
Jack Grigg
fb2653ed0e Add unit test that fails when calling FindMyNotes on a locked wallet 2016-10-14 17:14:13 -05:00
zkbot
cc10005247 Auto merge of #1486 - str4d:1456-writewitnesscache-exception-safety, r=bitcartel
WriteWitnessCache: Catch errors and abort transaction

Closes #1452
2016-10-14 17:37:53 -04:00
zkbot
3fceaca3a1 Auto merge of #1506 - bitcartel:master_1478_fix_testnet3_test_issue, r=bitcartel
Stop some wallet tests creating ~/.zcash/testnet3 folder by setting -datadir environment

Closes #1478
2016-10-14 17:03:11 -04:00
Simon
b13a87c6d7 Reorder gtests in zcash-gtest.
There is an issue where checktransaction_tests will output errors to ~/.zcash/testnet3/debug.log
because other tests which run before it select the testnet chain parameters.
2016-10-14 13:36:53 -07:00
Simon
6be367ea6d Fix test so that the encrypted wallet is output to the test_bitcoin -datadir folder. 2016-10-14 12:44:22 -07:00
4ZEC
cc6c9ec05e Correct line swap
Pretty clear the author wanted these two lines in other order.
2016-10-14 13:35:22 -04:00
zkbot
27bc01a05b Auto merge of #1523 - bitcartel:master_1504_z_logging, r=bitcartel
Refine LogPrint debugging for z_* rpc calls

For #1504 ZCA011
2016-10-14 11:11:26 -04:00
Jack Grigg
6da46b692a Refactor test to clarify expectations 2016-10-14 09:31:26 -05:00
zkbot
bb25bd4bc1 Auto merge of #1533 - bitcartel:master_1447_document_getfilterednotes, r=bitcartel
Document CWallet::GetFilteredNotes

Also fixes return type of method which should be void.

Part of #1447
2016-10-13 20:25:19 -04:00
Simon
cb0d208f6b Document CWallet::GetFilteredNotes and fix return type which should be
void.
2016-10-13 17:01:54 -07:00
zkbot
2b29970e28 Auto merge of #1531 - str4d:1447-document-findmynotes, r=bitcartel
Document CWalletTx::FindMyNotes

Part of #1447
2016-10-13 19:51:06 -04:00
Jack Grigg
e492d98632 Document CWalletTx::FindMyNotes
Part of #1447
2016-10-13 18:27:58 -05:00
zkbot
8eb672251b Auto merge of #1513 - bitcartel:master_1491_fix_help_message_rpc_z_importkey, r=daira
Fixes #1491 by updating help message for rpc call z_importkey
2016-10-13 19:05:08 -04:00
Simon
438d1e45be Use -debug=zrpc for z_* rpc calls (#1504) 2016-10-12 15:46:24 -07:00
Simon
5bd677f5c6 Rename client identifier from Satoshi to MagicBean (closes #1481) 2016-10-12 10:50:05 -07:00
Simon
e346a0b3f8 Add tests to verify that all z_* rpc calls return an error if there are too many input parameters. 2016-10-12 10:15:12 -07:00
Simon
49e591eb89 Fix incorrect check of number of parameters for z_getnewaddress. 2016-10-12 10:14:32 -07:00
Simon
950f8ffdb6 Fixes #1491 by updating help message for rpc call z_importkey 2016-10-11 16:52:38 -07:00
Jack Grigg
82c2d97c60 Add unit tests for WriteWitnessCache
Requires moving implementation into header
2016-10-11 09:33:47 -05:00
zkbot
7dc49cbc6a Auto merge of #1490 - str4d:1454-deprecate-accounts, r=bitcartel
Throw an RPC error for all accounts except the default

Closes #1454
2016-10-10 23:55:02 -04:00
Simon
32bf097f90 Fixes #1478 by ensuring wallet tests have the -datadir environment set appropriately. 2016-10-10 20:23:24 -07:00
zkbot
4210e20c9c Auto merge of #1501 - ebfull:100kb-max-tx, r=ebfull
Make 100KB transaction size limit a consensus rule, rather than a standard rule

Closes #1475
2016-10-10 15:39:42 -04:00
Jack Grigg
715e5bbefd Correct docstring 2016-10-10 10:47:38 -05:00
Jack Grigg
7b3351ff0e Deprecated -> Unsupported in RPC error 2016-10-10 10:47:36 -05:00
Jack Grigg
b6f100cf86 Update tests for account deprecation 2016-10-10 10:47:30 -05:00
Sean Bowe
74f15a73a1 Make 100KB transaction size limit a consensus rule, rather than a standard rule. 2016-10-08 00:00:23 -06:00
Simon
f7cfb52d3c Add vjoinsplit to JSON output of RPC call gettransaction 2016-10-06 19:53:46 -07:00
Jack Grigg
3c31eb24d3 Throw an RPC error for all accounts except the default 2016-10-05 15:16:47 -05:00
Jack Grigg
6216b4b2dc WriteWitnessCache: Catch errors and abort transaction
Closes #1456
2016-10-05 09:49:43 -05:00
Jack Grigg
17b23ffe20 v1.0.0-beta2 2016-10-04 21:55:26 -05:00
zkbot
b4526f4d22 Auto merge of #1458 - str4d:1386-remove-findanddelete-and-codeseparator, r=ageis
Remove FindAndDelete and disable OP_CODESEPARATOR

Closes #1386
2016-10-04 21:51:29 -04:00
zkbot
1f4515a8c0 Auto merge of #1477 - zcash:812.change-address-prefixes.0, r=str4d
Update address prefixes

Closes #812 and #1450
2016-10-04 18:59:20 -04:00
Daira Hopwood
9418345fe6 Repair bitcoin-util-test.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-04 22:56:33 +01:00
Jack Grigg
9cf182d451 Update address in Founders' Reward gtest 2016-10-04 11:55:40 -07:00
Jack Grigg
f92f004714 Fix zkey test 2016-10-04 11:05:57 -07:00
zkbot
d86218a52f Auto merge of #1476 - ebfull:update-parameters, r=str4d
Update to beta2 public parameters

Also gets rid of the `testnet3`/`regtest` subdirectories/symlinks and other such things.
2016-10-04 04:54:02 -04:00
zkbot
4cfbe798bf Auto merge of #1429 - str4d:867-update-dependencies, r=str4d
Update all dependencies

Also re-enables disabled compiler warnings.

Closes #867, #944, #1241, #1255, #1348.
2016-10-04 03:48:42 -04:00
Jack Grigg
87da7b4ea0 Fix secp256k1 test compilation 2016-10-04 00:45:56 -07:00
Jack Grigg
1fc7e92ea0 Re-encode Founders' Reward keys
Closes #1450
2016-10-03 23:59:59 -07:00
Jack Grigg
ee64b5e726 Re-encode hard-coded addresses in tests 2016-10-03 23:53:14 -07:00
Daira Hopwood
00e56272e8 CBitcoinAddress should use nVersionBytes == 2.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-03 23:53:14 -07:00
Daira Hopwood
fbad4cac24 Reencode keys in JSON test data. refs #812
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-03 23:53:14 -07:00