Skip to content
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

wallet test fee rate fix. #12

Merged
merged 2 commits into from
Apr 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/functional/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

def assert_fee_amount(fee, tx_size, fee_per_kB):
"""Assert the fee was in range"""
# dogecoin: tx_size <1000 is rounded up to 1000
tx_size = tx_size if tx_size >= 1000 else 1000
target_fee = tx_size * fee_per_kB / 1000
if fee < target_fee:
raise AssertionError("Fee of %s BTC too low! (Should be %s BTC)" % (str(fee), str(target_fee)))
Expand Down
8 changes: 5 additions & 3 deletions test/functional/wallet-hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ def run_test (self):
assert_equal(self.nodes[1].getbalance(), num_hd_adds + 1)

# send a tx and make sure its using the internal chain for the changeoutput
txid = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
signal_amount = 1.5
txid = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), signal_amount)
outs = self.nodes[1].decoderawtransaction(self.nodes[1].gettransaction(txid)['hex'])['vout']
assert_equal(len(outs), 2) # one payment and one change tx
keypath = ""
for out in outs:
if out['value'] != 1:
if out['value'] != signal_amount:
keypath = self.nodes[1].validateaddress(out['scriptPubKey']['addresses'][0])['hdkeypath']

assert_equal(keypath[0:7], "m/0'/1'")

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion test/functional/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def run_test(self):

# Send 100000 DOGE normal
address = self.nodes[0].getnewaddress("test")
fee_per_byte = Decimal('1')
fee_per_byte = Decimal('0.001')
self.nodes[2].settxfee(fee_per_byte * 1000)
txid = self.nodes[2].sendtoaddress(address, 100000, "", "", False)
self.nodes[2].generate(1)
Expand Down