aboutsummaryrefslogtreecommitdiff
path: root/test/functional/interface_rest.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-08-19 17:10:24 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-09-02 10:34:35 +0200
commitfa0b916971e5bc23ad6396831940a2899ca05402 (patch)
tree45514e79001bb9e1a3d4f05bdc822e8d18d4012d /test/functional/interface_rest.py
parent245462b66ce35dfc5b191d245b3b18b7d035dc92 (diff)
downloadbitcoin-fa0b916971e5bc23ad6396831940a2899ca05402.tar.xz
scripted-diff: Use generate* from TestFramework
-BEGIN VERIFY SCRIPT- sed --regexp-extended -i \ 's/((self\.)?(nodes\[[^]]+\]|[a-z_]*(wallet|node)[0-9a-z_]*))\.(generate(|toaddress|block|todescriptor)(\(|, ))/self.\5\1, /g' \ $(git grep -l generate ./test | grep -v 'test_framework/' | grep -v 'feature_rbf') -END VERIFY SCRIPT-
Diffstat (limited to 'test/functional/interface_rest.py')
-rwxr-xr-xtest/functional/interface_rest.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py
index 47c95f5673..e0716fc54a 100755
--- a/test/functional/interface_rest.py
+++ b/test/functional/interface_rest.py
@@ -80,9 +80,9 @@ class RESTTest (BitcoinTestFramework):
# Random address so node1's balance doesn't increase
not_related_address = "2MxqoHEdNQTyYeX1mHcbrrpzgojbosTpCvJ"
- self.nodes[0].generate(1)
+ self.generate(self.nodes[0], 1)
self.sync_all()
- self.nodes[1].generatetoaddress(100, not_related_address)
+ self.generatetoaddress(self.nodes[1], 100, not_related_address)
self.sync_all()
assert_equal(self.nodes[0].getbalance(), 50)
@@ -107,7 +107,7 @@ class RESTTest (BitcoinTestFramework):
self.log.info("Query an unspent TXO using the /getutxos URI")
- self.nodes[1].generatetoaddress(1, not_related_address)
+ self.generatetoaddress(self.nodes[1], 1, not_related_address)
self.sync_all()
bb_hash = self.nodes[0].getbestblockhash()
@@ -182,7 +182,7 @@ class RESTTest (BitcoinTestFramework):
json_obj = self.test_rest_request(f"/getutxos/checkmempool/{spent[0]}-{spent[1]}")
assert_equal(len(json_obj['utxos']), 0)
- self.nodes[0].generate(1)
+ self.generate(self.nodes[0], 1)
self.sync_all()
json_obj = self.test_rest_request(f"/getutxos/{spending[0]}-{spending[1]}")
@@ -203,7 +203,7 @@ class RESTTest (BitcoinTestFramework):
long_uri = '/'.join([f'{txid}-{n_}' for n_ in range(15)])
self.test_rest_request(f"/getutxos/checkmempool/{long_uri}", http_method='POST', status=200)
- self.nodes[0].generate(1) # generate block to not affect upcoming tests
+ self.generate(self.nodes[0], 1) # generate block to not affect upcoming tests
self.sync_all()
self.log.info("Test the /block, /blockhashbyheight and /headers URIs")
@@ -274,7 +274,7 @@ class RESTTest (BitcoinTestFramework):
assert_equal(json_obj[0][key], rpc_block_json[key])
# See if we can get 5 headers in one response
- self.nodes[1].generate(5)
+ self.generate(self.nodes[1], 5)
self.sync_all()
json_obj = self.test_rest_request(f"/headers/5/{bb_hash}")
assert_equal(len(json_obj), 5) # now we should have 5 header objects
@@ -302,7 +302,7 @@ class RESTTest (BitcoinTestFramework):
assert_equal(json_obj[tx]['depends'], txs[i - 1:i])
# Now mine the transactions
- newblockhash = self.nodes[1].generate(1)
+ newblockhash = self.generate(self.nodes[1], 1)
self.sync_all()
# Check if the 3 tx show up in the new block