-
Notifications
You must be signed in to change notification settings - Fork 391
wallet: allow mintxfee=0 #1333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
delta1
wants to merge
4
commits into
ElementsProject:master
Choose a base branch
from
delta1:mintxfee
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+74
−8
Open
wallet: allow mintxfee=0 #1333
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2017-2020 The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
from decimal import Decimal | ||
|
||
from test_framework.blocktools import COINBASE_MATURITY | ||
from test_framework.test_framework import BitcoinTestFramework | ||
from test_framework.util import ( | ||
assert_equal, | ||
) | ||
|
||
class WalletTest(BitcoinTestFramework): | ||
def set_test_params(self): | ||
self.setup_clean_chain = True | ||
self.num_nodes = 3 | ||
self.extra_args = [[ | ||
"-blindedaddresses=1", | ||
"-initialfreecoins=2100000000000000", | ||
"-con_blocksubsidy=0", | ||
"-con_connect_genesis_outputs=1", | ||
"-txindex=1", | ||
"-minrelaytxfee=0", | ||
"-blockmintxfee=0", | ||
"-mintxfee=0", | ||
]] * self.num_nodes | ||
self.extra_args[0].append("-anyonecanspendaremine=1") | ||
|
||
def skip_test_if_missing_module(self): | ||
self.skip_if_no_wallet() | ||
|
||
def run_test(self): | ||
self.generate(self.nodes[0], COINBASE_MATURITY + 1) | ||
self.sync_all() | ||
|
||
new_addr = self.nodes[1].getnewaddress() | ||
self.nodes[0].sendtoaddress(new_addr, 10) | ||
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 20) | ||
self.generate(self.nodes[0], 1) | ||
assert_equal(self.nodes[0].getblockchaininfo()["blocks"], 102) | ||
assert_equal(self.nodes[0].getbalance(), {'bitcoin': Decimal('20999969.99900900')}) | ||
assert_equal(self.nodes[1].getbalance(), {'bitcoin': Decimal('10.00000000')}) | ||
assert_equal(self.nodes[2].getbalance(), {'bitcoin': Decimal('20.00000000')}) | ||
|
||
addr = self.nodes[1].getnewaddress() | ||
txid = self.nodes[0].sendtoaddress(addr, 1, None, None, None, None, None, None, None, None, None, 0, False) | ||
tx = self.nodes[0].gettransaction(txid) | ||
assert_equal(tx["fee"]["bitcoin"], 0) | ||
hex = self.nodes[0].getrawtransaction(txid) | ||
self.generate(self.nodes[0], 1) | ||
assert_equal(self.nodes[0].getblockchaininfo()["blocks"], 103) | ||
|
||
decoded = self.nodes[0].decoderawtransaction(hex) | ||
# there should be no fee output | ||
assert_equal(decoded["fee"], {}) | ||
assert_equal(len(decoded["vout"]),2) | ||
assert_equal(self.nodes[0].getbalance(), {'bitcoin': Decimal('20999968.99900900')}) | ||
assert_equal(self.nodes[1].getbalance(), {'bitcoin': Decimal('11.00000000')}) | ||
assert_equal(self.nodes[2].getbalance(), {'bitcoin': Decimal('20.00000000')}) | ||
|
||
if __name__ == '__main__': | ||
WalletTest().main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.