Browse Source

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

pull/4/head
Simon 7 years ago
parent
commit
85c9ecb846
  1. 2
      qa/rpc-tests/mempool_resurrect_test.py
  2. 4
      qa/rpc-tests/rawtransactions.py
  3. 4
      qa/rpc-tests/zcjoinsplit.py
  4. 18
      qa/rpc-tests/zcjoinsplitdoublespend.py

2
qa/rpc-tests/mempool_resurrect_test.py

@ -51,7 +51,7 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
blocks = []
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 ]
blocks.extend(self.nodes[0].generate(1))

4
qa/rpc-tests/rawtransactions.py

@ -127,7 +127,7 @@ class RawTransactionsTest(BitcoinTestFramework):
bal = self.nodes[0].getbalance()
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)
rawTxPartialSigned = self.nodes[1].signrawtransaction(rawTx, inputs)
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.nodes[0].generate(1)
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__':
RawTransactionsTest().main()

4
qa/rpc-tests/zcjoinsplit.py

@ -24,7 +24,7 @@ class JoinSplitTest(BitcoinTestFramework):
(total_in, inputs) = gather_inputs(self.nodes[0], 40)
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"])
assert_equal(receive_result["exists"], False)
@ -45,7 +45,7 @@ class JoinSplitTest(BitcoinTestFramework):
self.nodes[0].sendtoaddress(addrtest, 0.01);
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].generate(1)

18
qa/rpc-tests/zcjoinsplitdoublespend.py

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

Loading…
Cancel
Save