Fix (most) rpc tests by updating balances. zcpour, zcpourdoublespend, and txn_doublespend currently fail.

This commit is contained in:
Nathan Wilcox
2016-04-08 18:05:51 -07:00
parent 349a7b3714
commit ad56edf7d4
14 changed files with 59 additions and 72 deletions

View File

@@ -21,9 +21,9 @@ class PourTxTest(BitcoinTestFramework):
zcsecretkey = zckeypair["zcsecretkey"]
zcaddress = zckeypair["zcaddress"]
(total_in, inputs) = gather_inputs(self.nodes[1], 50)
(total_in, inputs) = gather_inputs(self.nodes[1], 40)
protect_tx = self.nodes[1].createrawtransaction(inputs, {})
pour_result = self.nodes[1].zcrawpour(protect_tx, {}, {zcaddress:49.9}, 50, 0.1)
pour_result = self.nodes[1].zcrawpour(protect_tx, {}, {zcaddress:49.9}, 40, 0.1)
receive_result = self.nodes[1].zcrawreceive(zcsecretkey, pour_result["encryptedbucket1"])
assert_equal(receive_result["exists"], False)
@@ -50,12 +50,11 @@ class PourTxTest(BitcoinTestFramework):
assert_equal(receive_result["exists"], True)
def run_test(self):
# All nodes should start with 1,250 BTC:
starting_balance = 1250
starting_balance = 1000
for i in range(4):
assert_equal(self.nodes[i].getbalance(), starting_balance)
self.nodes[i].getnewaddress("") # bug workaround, coins generated assigned to first getnewaddress!
# Generate zcaddress keypairs
zckeypair1 = self.nodes[0].zcrawkeygen()
zcsecretkey1 = zckeypair1["zcsecretkey"]
@@ -65,14 +64,14 @@ class PourTxTest(BitcoinTestFramework):
zcsecretkey2 = zckeypair2["zcsecretkey"]
zcaddress2 = zckeypair2["zcaddress"]
self.nodes[0].move("", "foo", 1220)
self.nodes[0].move("", "foo", 970)
self.nodes[0].move("", "bar", 30)
assert_equal(self.nodes[0].getbalance(""), 0)
change_address = self.nodes[0].getnewaddress("foo")
# Pour some of our money into this address
(total_in, inputs) = gather_inputs(self.nodes[0], 1210)
(total_in, inputs) = gather_inputs(self.nodes[0], 960)
outputs = {}
outputs[change_address] = 78
rawtx = self.nodes[0].createrawtransaction(inputs, outputs)