[wallet] rpc: Drop misleading option in importprunedfunds

This commit is contained in:
MarcoFalke
2016-08-24 19:21:27 +02:00
committed by lateminer
parent 8bca020397
commit 2b9c31046b
2 changed files with 13 additions and 21 deletions

View File

@@ -26,7 +26,6 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
print "Mining blocks..."
self.nodes[0].generate(101)
# sync
self.sync_all()
# address
@@ -71,7 +70,6 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
rawtxn2 = self.nodes[0].gettransaction(txnid2)['hex']
proof2 = self.nodes[0].gettxoutproof([txnid2])
txnid3 = self.nodes[0].sendtoaddress(address3, 0.025)
self.nodes[0].generate(1)
rawtxn3 = self.nodes[0].gettransaction(txnid3)['hex']
@@ -81,7 +79,7 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
#Import with no affiliated address
try:
result1 = self.nodes[1].importprunedfunds(rawtxn1, proof1, "")
self.nodes[1].importprunedfunds(rawtxn1, proof1)
except JSONRPCException,e:
errorString = e.error['message']
@@ -91,17 +89,17 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
assert_equal(balance1, Decimal(0))
#Import with affiliated address with no rescan
self.nodes[1].importaddress(address2, "", False)
result2 = self.nodes[1].importprunedfunds(rawtxn2, proof2, "")
balance2 = Decimal(self.nodes[1].getbalance("", 0, True))
self.nodes[1].importaddress(address2, "add2", False)
result2 = self.nodes[1].importprunedfunds(rawtxn2, proof2)
balance2 = self.nodes[1].getbalance("add2", 0, True)
assert_equal(balance2, Decimal('0.05'))
#Import with private key with no rescan
self.nodes[1].importprivkey(address3_privkey, "", False)
result3 = self.nodes[1].importprunedfunds(rawtxn3, proof3, "")
balance3 = Decimal(self.nodes[1].getbalance("", 0, False))
self.nodes[1].importprivkey(address3_privkey, "add3", False)
result3 = self.nodes[1].importprunedfunds(rawtxn3, proof3)
balance3 = self.nodes[1].getbalance("add3", 0, False)
assert_equal(balance3, Decimal('0.025'))
balance3 = Decimal(self.nodes[1].getbalance("", 0, True))
balance3 = self.nodes[1].getbalance("*", 0, True)
assert_equal(balance3, Decimal('0.075'))
#Addresses Test - after import
@@ -116,7 +114,6 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
assert_equal(address_info['ismine'], True)
#Remove transactions
try:
self.nodes[1].removeprunedfunds(txnid1)
except JSONRPCException,e:
@@ -124,17 +121,17 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
assert('does not exist' in errorString)
balance1 = Decimal(self.nodes[1].getbalance("", 0, True))
balance1 = self.nodes[1].getbalance("*", 0, True)
assert_equal(balance1, Decimal('0.075'))
self.nodes[1].removeprunedfunds(txnid2)
balance2 = Decimal(self.nodes[1].getbalance("", 0, True))
balance2 = self.nodes[1].getbalance("*", 0, True)
assert_equal(balance2, Decimal('0.025'))
self.nodes[1].removeprunedfunds(txnid3)
balance3 = Decimal(self.nodes[1].getbalance("", 0, True))
balance3 = self.nodes[1].getbalance("*", 0, True)
assert_equal(balance3, Decimal('0.0'))
if __name__ == '__main__':
ImportPrunedFundsTest ().main ()
ImportPrunedFundsTest().main()