Part of #1969. Update tests to avoid error 'absurdly high fee' from change in min fee calc.

This commit is contained in:
Simon 2017-02-28 11:44:51 -08:00
parent ebe750a882
commit 85c9ecb846
4 changed files with 14 additions and 14 deletions

View File

@ -51,7 +51,7 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
blocks = [] blocks = []
blocks.extend(self.nodes[0].generate(1)) blocks.extend(self.nodes[0].generate(1))
spends2_raw = [ self.create_tx(txid, node0_address, 9.99) for txid in spends1_id ] spends2_raw = [ self.create_tx(txid, node0_address, 9.999) for txid in spends1_id ]
spends2_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends2_raw ] spends2_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends2_raw ]
blocks.extend(self.nodes[0].generate(1)) blocks.extend(self.nodes[0].generate(1))

View File

@ -127,7 +127,7 @@ class RawTransactionsTest(BitcoinTestFramework):
bal = self.nodes[0].getbalance() bal = self.nodes[0].getbalance()
inputs = [{ "txid" : txId, "vout" : vout['n'], "scriptPubKey" : vout['scriptPubKey']['hex']}] inputs = [{ "txid" : txId, "vout" : vout['n'], "scriptPubKey" : vout['scriptPubKey']['hex']}]
outputs = { self.nodes[0].getnewaddress() : 2.19 } outputs = { self.nodes[0].getnewaddress() : 2.199 }
rawTx = self.nodes[2].createrawtransaction(inputs, outputs) rawTx = self.nodes[2].createrawtransaction(inputs, outputs)
rawTxPartialSigned = self.nodes[1].signrawtransaction(rawTx, inputs) rawTxPartialSigned = self.nodes[1].signrawtransaction(rawTx, inputs)
assert_equal(rawTxPartialSigned['complete'], False) #node1 only has one key, can't comp. sign the tx assert_equal(rawTxPartialSigned['complete'], False) #node1 only has one key, can't comp. sign the tx
@ -139,7 +139,7 @@ class RawTransactionsTest(BitcoinTestFramework):
self.sync_all() self.sync_all()
self.nodes[0].generate(1) self.nodes[0].generate(1)
self.sync_all() self.sync_all()
assert_equal(self.nodes[0].getbalance(), bal+Decimal('10.00000000')+Decimal('2.19000000')) #block reward + tx assert_equal(self.nodes[0].getbalance(), bal+Decimal('10.00000000')+Decimal('2.19900000')) #block reward + tx
if __name__ == '__main__': if __name__ == '__main__':
RawTransactionsTest().main() RawTransactionsTest().main()

View File

@ -24,7 +24,7 @@ class JoinSplitTest(BitcoinTestFramework):
(total_in, inputs) = gather_inputs(self.nodes[0], 40) (total_in, inputs) = gather_inputs(self.nodes[0], 40)
protect_tx = self.nodes[0].createrawtransaction(inputs, {}) protect_tx = self.nodes[0].createrawtransaction(inputs, {})
joinsplit_result = self.nodes[0].zcrawjoinsplit(protect_tx, {}, {zcaddress:39.9}, 39.9, 0) joinsplit_result = self.nodes[0].zcrawjoinsplit(protect_tx, {}, {zcaddress:39.99}, 39.99, 0)
receive_result = self.nodes[0].zcrawreceive(zcsecretkey, joinsplit_result["encryptednote1"]) receive_result = self.nodes[0].zcrawreceive(zcsecretkey, joinsplit_result["encryptednote1"])
assert_equal(receive_result["exists"], False) assert_equal(receive_result["exists"], False)
@ -45,7 +45,7 @@ class JoinSplitTest(BitcoinTestFramework):
self.nodes[0].sendtoaddress(addrtest, 0.01); self.nodes[0].sendtoaddress(addrtest, 0.01);
joinsplit_tx = self.nodes[0].createrawtransaction([], {}) joinsplit_tx = self.nodes[0].createrawtransaction([], {})
joinsplit_result = self.nodes[0].zcrawjoinsplit(joinsplit_tx, {receive_result["note"] : zcsecretkey}, {zcaddress: 39.8}, 0, 0.1) joinsplit_result = self.nodes[0].zcrawjoinsplit(joinsplit_tx, {receive_result["note"] : zcsecretkey}, {zcaddress: 39.98}, 0, 0.01)
self.nodes[0].sendrawtransaction(joinsplit_result["rawtxn"]) self.nodes[0].sendrawtransaction(joinsplit_result["rawtxn"])
self.nodes[0].generate(1) self.nodes[0].generate(1)

View File

@ -56,7 +56,7 @@ class JoinSplitTest(BitcoinTestFramework):
for i in range(4): for i in range(4):
(total_in, inputs) = gather_inputs(self.nodes[i], 40) (total_in, inputs) = gather_inputs(self.nodes[i], 40)
pool[i] = self.nodes[i].createrawtransaction(inputs, {}) pool[i] = self.nodes[i].createrawtransaction(inputs, {})
pool[i] = self.nodes[i].zcrawjoinsplit(pool[i], {}, {zcaddress:39.9}, 39.9, 0) pool[i] = self.nodes[i].zcrawjoinsplit(pool[i], {}, {zcaddress:39.99}, 39.99, 0)
signed = self.nodes[i].signrawtransaction(pool[i]["rawtxn"]) signed = self.nodes[i].signrawtransaction(pool[i]["rawtxn"])
# send the tx to both halves of the network # send the tx to both halves of the network
@ -90,26 +90,26 @@ class JoinSplitTest(BitcoinTestFramework):
# Create joinsplit {A, B}->{*} # Create joinsplit {A, B}->{*}
joinsplit_AB = self.nodes[0].zcrawjoinsplit(blank_tx, joinsplit_AB = self.nodes[0].zcrawjoinsplit(blank_tx,
{pool[0] : zcsecretkey, pool[1] : zcsecretkey}, {pool[0] : zcsecretkey, pool[1] : zcsecretkey},
{zcaddress:(39.9*2)-0.1}, {zcaddress:(39.99*2)-0.01},
0, 0.1) 0, 0.01)
# Create joinsplit {B, C}->{*} # Create joinsplit {B, C}->{*}
joinsplit_BC = self.nodes[0].zcrawjoinsplit(blank_tx, joinsplit_BC = self.nodes[0].zcrawjoinsplit(blank_tx,
{pool[1] : zcsecretkey, pool[2] : zcsecretkey}, {pool[1] : zcsecretkey, pool[2] : zcsecretkey},
{zcaddress:(39.9*2)-0.1}, {zcaddress:(39.99*2)-0.01},
0, 0.1) 0, 0.01)
# Create joinsplit {C, D}->{*} # Create joinsplit {C, D}->{*}
joinsplit_CD = self.nodes[0].zcrawjoinsplit(blank_tx, joinsplit_CD = self.nodes[0].zcrawjoinsplit(blank_tx,
{pool[2] : zcsecretkey, pool[3] : zcsecretkey}, {pool[2] : zcsecretkey, pool[3] : zcsecretkey},
{zcaddress:(39.9*2)-0.1}, {zcaddress:(39.99*2)-0.01},
0, 0.1) 0, 0.01)
# Create joinsplit {A, D}->{*} # Create joinsplit {A, D}->{*}
joinsplit_AD = self.nodes[0].zcrawjoinsplit(blank_tx, joinsplit_AD = self.nodes[0].zcrawjoinsplit(blank_tx,
{pool[0] : zcsecretkey, pool[3] : zcsecretkey}, {pool[0] : zcsecretkey, pool[3] : zcsecretkey},
{zcaddress:(39.9*2)-0.1}, {zcaddress:(39.99*2)-0.01},
0, 0.1) 0, 0.01)
# (a) Node 0 will spend joinsplit AB, then attempt to # (a) Node 0 will spend joinsplit AB, then attempt to
# double-spend it with BC. It should fail before and # double-spend it with BC. It should fail before and