v31.1-roots.1 · Commit 7: [PATCH 07/17] feat(rpc): preserve Roots operator interfaces on v31
test/functional/wallet_sweepprivkeys.py
Before: test/functional/wallet_sweepprivkeys.py · After: test/functional/wallet_sweepprivkeys.py
File metadata
index ea319bb3e407131f63ff45ea7d4fc7b6a87a7cbc..56ccd072f77c076cc6caa6a5c5ae74c78a99b007 100644
Download original patch · Release notes
Diff rows 1–30 of 30. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
test/functional/wallet_sweepprivkeys.py
CHANGED
|
@@ -166,6 +166,30 @@ class SweepPrivKeysTest(BitcoinTestFramework):
|
|
| 166 |
miner.sendtoaddress(key_to_p2pkh(small_pubkey), Decimal('0.00010000'))
|
| 167 |
self.generate(miner, 1)
|
| 168 |
self.sync_blocks()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
wallet_name = wallet.getwalletinfo()['walletname']
|
| 170 |
dust_destination = wallet.getnewaddress(address_type='legacy')
|
| 171 |
self.restart_node(0, extra_args=['-fallbackfee=0.00052000'])
|
|
|
|
| 166 |
miner.sendtoaddress(key_to_p2pkh(small_pubkey), Decimal('0.00010000'))
|
| 167 |
self.generate(miner, 1)
|
| 168 |
self.sync_blocks()
|
| 169 |
+
# Integrated runtime configuration must feed the same initialized
|
| 170 |
+
# relay fee used by reporting and sweep's required-fee calculation.
|
| 171 |
+
wallet_name = wallet.getwalletinfo()['walletname']
|
| 172 |
+
rw_path = node.chain_path / 'bitcoin_rw.conf'
|
| 173 |
+
self.stop_node(0)
|
| 174 |
+
rw_path.write_text('minrelaytxfee=0.00100000\n', encoding='utf-8')
|
| 175 |
+
self.start_node(0)
|
| 176 |
+
self.connect_nodes(0, 1)
|
| 177 |
+
wallet = node.get_wallet_rpc(wallet_name)
|
| 178 |
+
wallet.walletpassphrase('pass', 60)
|
| 179 |
+
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00100000'))
|
| 180 |
+
assert_raises_rpc_error(-6, 'Fee exceeds swept value', wallet.sweepprivkeys, [small_wif], destination)
|
| 181 |
+
self.restart_node(0, extra_args=['-minrelaytxfee=0.00001000'])
|
| 182 |
+
self.connect_nodes(0, 1)
|
| 183 |
+
wallet = node.get_wallet_rpc(wallet_name)
|
| 184 |
+
wallet.walletpassphrase('pass', 60)
|
| 185 |
+
assert_equal(node.getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
|
| 186 |
+
assert_equal(wallet.sweepprivkeys([small_wif], destination)['broadcast'], False)
|
| 187 |
+
self.stop_node(0)
|
| 188 |
+
rw_path.unlink()
|
| 189 |
+
self.start_node(0)
|
| 190 |
+
self.connect_nodes(0, 1)
|
| 191 |
+
wallet = node.get_wallet_rpc(wallet_name)
|
| 192 |
+
wallet.walletpassphrase('pass', 60)
|
| 193 |
wallet_name = wallet.getwalletinfo()['walletname']
|
| 194 |
dust_destination = wallet.getnewaddress(address_type='legacy')
|
| 195 |
self.restart_node(0, extra_args=['-fallbackfee=0.00052000'])
|