aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/disablewallet.py
diff options
context:
space:
mode:
authorAndrew C <[email protected]>2016-03-14 17:54:34 -0400
committerAndrew C <[email protected]>2016-03-21 10:22:29 -0400
commitd5c5c713e67368802b6a4ab2b6b69962364c251b (patch)
tree7583238d6eb662ce60ae6ef6280f4b0526c8e3cc /qa/rpc-tests/disablewallet.py
parentCreate generatetoaddress rpc (diff)
downloaddiscoin-d5c5c713e67368802b6a4ab2b6b69962364c251b.tar.xz
discoin-d5c5c713e67368802b6a4ab2b6b69962364c251b.zip
RPC tests for generatetoaddress
Adds two RPC tests for the generatetoaddress RPC, one in the wallet, and one when the wallet is disabled. The wallet RPC Test mines Bitcoin to another node's address and checks that that node has received the Bitcoin. The RPC test without the wallet mines Bitcoin to an arbitrary address and checks that it works. It then mines to an arbitrary invalid address and checks that that fails.
Diffstat (limited to 'qa/rpc-tests/disablewallet.py')
-rwxr-xr-xqa/rpc-tests/disablewallet.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/qa/rpc-tests/disablewallet.py b/qa/rpc-tests/disablewallet.py
index 6964348d5..5af815846 100755
--- a/qa/rpc-tests/disablewallet.py
+++ b/qa/rpc-tests/disablewallet.py
@@ -29,5 +29,19 @@ class DisableWalletTest (BitcoinTestFramework):
x = self.nodes[0].validateaddress('mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ')
assert(x['isvalid'] == True)
+ # Checking mining to an address without a wallet
+ try:
+ self.nodes[0].generatetoaddress(1, 'mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ')
+ except JSONRPCException,e:
+ assert("Invalid address" not in e.error['message'])
+ assert("ProcessNewBlock, block not accepted" not in e.error['message'])
+ assert("Couldn't create new block" not in e.error['message'])
+
+ try:
+ self.nodes[0].generatetoaddress(1, '3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy')
+ raise AssertionError("Must not mine to invalid address!")
+ except JSONRPCException,e:
+ assert("Invalid address" in e.error['message'])
+
if __name__ == '__main__':
DisableWalletTest ().main ()