aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-03-23 13:24:34 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-03-23 13:24:53 +0100
commite2ebd259fbe80c030ddc1caabbcd755b7f5f8f8e (patch)
treeb569906ba76ebe1dc314e203f59af3bdc6ef5362 /qa
parent909b72b10b4dcd8588fed4659595403d34cbebde (diff)
parentd5c5c713e67368802b6a4ab2b6b69962364c251b (diff)
downloadbitcoin-e2ebd259fbe80c030ddc1caabbcd755b7f5f8f8e.tar.xz
Merge #7671: [RPC] Add generatetoaddress rpc to mine to an address
d5c5c71 RPC tests for generatetoaddress (Andrew C) fe00ca7 Create generatetoaddress rpc (Andrew C)
Diffstat (limited to 'qa')
-rwxr-xr-xqa/rpc-tests/disablewallet.py14
-rwxr-xr-xqa/rpc-tests/wallet.py12
2 files changed, 26 insertions, 0 deletions
diff --git a/qa/rpc-tests/disablewallet.py b/qa/rpc-tests/disablewallet.py
index 6964348d55..5af8158467 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 ()
diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py
index f686e6be6c..df176601a5 100755
--- a/qa/rpc-tests/wallet.py
+++ b/qa/rpc-tests/wallet.py
@@ -262,6 +262,18 @@ class WalletTest (BitcoinTestFramework):
assert("not an integer" in errorString)
+ # Mine a block from node0 to an address from node1
+ cbAddr = self.nodes[1].getnewaddress()
+ blkHash = self.nodes[0].generatetoaddress(1, cbAddr)[0]
+ cbTxId = self.nodes[0].getblock(blkHash)['tx'][0]
+ self.sync_all()
+
+ # Check that the txid and balance is found by node1
+ try:
+ self.nodes[1].gettransaction(cbTxId)
+ except JSONRPCException,e:
+ assert("Invalid or non-wallet transaction id" not in e.error['message'])
+
#check if wallet or blochchain maintenance changes the balance
self.sync_all()
blocks = self.nodes[0].generate(2)