[qa] rpc-tests: Properly use integers, floats

partial backport from #7778 using fa2cea1
This commit is contained in:
BtcDrak 2016-04-03 18:03:53 +01:00
parent c270b62cc2
commit 640666b22f
2 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ class BIP68Test(BitcoinTestFramework):
utxo = utxos[0] utxo = utxos[0]
tx1 = CTransaction() tx1 = CTransaction()
value = satoshi_round(utxo["amount"] - self.relayfee)*COIN value = int(satoshi_round(utxo["amount"] - self.relayfee)*COIN)
# Check that the disable flag disables relative locktime. # Check that the disable flag disables relative locktime.
# If sequence locks were used, this would require 1 block for the # If sequence locks were used, this would require 1 block for the
@ -180,8 +180,8 @@ class BIP68Test(BitcoinTestFramework):
tx.vin.append(CTxIn(COutPoint(int(utxos[j]["txid"], 16), utxos[j]["vout"]), nSequence=sequence_value)) tx.vin.append(CTxIn(COutPoint(int(utxos[j]["txid"], 16), utxos[j]["vout"]), nSequence=sequence_value))
value += utxos[j]["amount"]*COIN value += utxos[j]["amount"]*COIN
# Overestimate the size of the tx - signatures should be less than 120 bytes, and leave 50 for the output # Overestimate the size of the tx - signatures should be less than 120 bytes, and leave 50 for the output
tx_size = len(ToHex(tx))/2 + 120*num_inputs + 50 tx_size = len(ToHex(tx))//2 + 120*num_inputs + 50
tx.vout.append(CTxOut(value-self.relayfee*tx_size*COIN/1000, CScript([b'a']))) tx.vout.append(CTxOut(int(value-self.relayfee*tx_size*COIN/1000), CScript([b'a'])))
rawtx = self.nodes[0].signrawtransaction(ToHex(tx))["hex"] rawtx = self.nodes[0].signrawtransaction(ToHex(tx))["hex"]
try: try:

View File

@ -91,7 +91,7 @@ class BIP9SoftForksTest(ComparisonTestFramework):
self.height = 3 # height of the next block to build self.height = 3 # height of the next block to build
self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0) self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0)
self.nodeaddress = self.nodes[0].getnewaddress() self.nodeaddress = self.nodes[0].getnewaddress()
self.last_block_time = time.time() self.last_block_time = int(time.time())
assert_equal(self.get_bip9_status(bipName)['status'], 'defined') assert_equal(self.get_bip9_status(bipName)['status'], 'defined')