diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-12-29 09:52:45 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-12-29 09:53:01 +0100 |
commit | 565b3008ecdf98daacd9a085908b32e7fcc96ed6 (patch) | |
tree | 5179bf69054983f84b016eeda6c12b23f779c9b2 | |
parent | 5f5f14e9f28362cb5aff56a31969c7cbb0526e72 (diff) | |
parent | 7c5dd603065ec8a568bedde4d7cf311a6dc9ff2e (diff) |
Merge pull request #5530
7c5dd60 Adding RPC tests for the following wallet related calls: getbalance, listsinceblock, listtransactions, listlockunspent, listaccounts listaddressgroupings (Everett Forth)
-rw-r--r-- | src/test/rpc_wallet_tests.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index a83bd120ca..57c49c2dfc 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -93,6 +93,13 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) /* 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X (33 chars) is an illegal address (should be 34 chars) */ BOOST_CHECK_THROW(CallRPC("setaccount 1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4X nullaccount"), runtime_error); + + /********************************* + * getbalance + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("getbalance")); + BOOST_CHECK_NO_THROW(CallRPC("getbalance " + demoAddress.ToString())); + /********************************* * listunspent *********************************/ @@ -125,6 +132,35 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) BOOST_CHECK_THROW(CallRPC("listreceivedbyaccount 0 true extra"), runtime_error); /********************************* + * listsinceblock + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("listsinceblock")); + + /********************************* + * listtransactions + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("listtransactions")); + BOOST_CHECK_NO_THROW(CallRPC("listtransactions " + demoAddress.ToString())); + BOOST_CHECK_NO_THROW(CallRPC("listtransactions " + demoAddress.ToString() + " 20")); + BOOST_CHECK_NO_THROW(CallRPC("listtransactions " + demoAddress.ToString() + " 20 0")); + BOOST_CHECK_THROW(CallRPC("listtransactions " + demoAddress.ToString() + " not_int"), runtime_error); + + /********************************* + * listlockunspent + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("listlockunspent")); + + /********************************* + * listaccounts + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("listaccounts")); + + /********************************* + * listaddressgroupings + *********************************/ + BOOST_CHECK_NO_THROW(CallRPC("listaddressgroupings")); + + /********************************* * getrawchangeaddress *********************************/ BOOST_CHECK_NO_THROW(CallRPC("getrawchangeaddress")); @@ -179,5 +215,4 @@ BOOST_AUTO_TEST_CASE(rpc_wallet) BOOST_CHECK(CBitcoinAddress(arr[0].get_str()).Get() == demoAddress.Get()); } - BOOST_AUTO_TEST_SUITE_END() |