aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBtcDrak <btcdrak@gmail.com>2016-04-03 18:03:53 +0100
committerBtcDrak <btcdrak@gmail.com>2016-04-03 18:06:06 +0100
commit640666b22fdbc6f436fbf701629b04a2367f7317 (patch)
treed6d6a4aa01f417685a69d1a8531bd7ef61c6816a
parentc270b62cc20788bdc59cd648c971523bab7ec8fc (diff)
downloadbitcoin-640666b22fdbc6f436fbf701629b04a2367f7317.tar.xz
[qa] rpc-tests: Properly use integers, floats
partial backport from #7778 using fa2cea1
-rwxr-xr-xqa/rpc-tests/bip68-sequence.py6
-rwxr-xr-xqa/rpc-tests/bip9-softforks.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/qa/rpc-tests/bip68-sequence.py b/qa/rpc-tests/bip68-sequence.py
index bd61282fa1..40c9eff885 100755
--- a/qa/rpc-tests/bip68-sequence.py
+++ b/qa/rpc-tests/bip68-sequence.py
@@ -62,7 +62,7 @@ class BIP68Test(BitcoinTestFramework):
utxo = utxos[0]
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.
# 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))
value += utxos[j]["amount"]*COIN
# 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.vout.append(CTxOut(value-self.relayfee*tx_size*COIN/1000, CScript([b'a'])))
+ tx_size = len(ToHex(tx))//2 + 120*num_inputs + 50
+ tx.vout.append(CTxOut(int(value-self.relayfee*tx_size*COIN/1000), CScript([b'a'])))
rawtx = self.nodes[0].signrawtransaction(ToHex(tx))["hex"]
try:
diff --git a/qa/rpc-tests/bip9-softforks.py b/qa/rpc-tests/bip9-softforks.py
index cbb1b7d4ce..97c6f3f3a7 100755
--- a/qa/rpc-tests/bip9-softforks.py
+++ b/qa/rpc-tests/bip9-softforks.py
@@ -91,7 +91,7 @@ class BIP9SoftForksTest(ComparisonTestFramework):
self.height = 3 # height of the next block to build
self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0)
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')