Fix wallet.py iand util.py after merging bitcoin 0.12
This commit is contained in:
parent
6af7a58d92
commit
790607b060
@ -38,9 +38,9 @@ MOCKTIME = 0
|
||||
def enable_mocktime():
|
||||
#For backwared compatibility of the python scripts
|
||||
#with previous versions of the cache, set MOCKTIME
|
||||
#to Jan 1, 2014 + (201 * 10 * 60)
|
||||
#to regtest genesis time + (201 * 156)
|
||||
global MOCKTIME
|
||||
MOCKTIME = 1388534400 + (201 * 10 * 60)
|
||||
MOCKTIME = 1417713337 + (201 * 156)
|
||||
|
||||
def disable_mocktime():
|
||||
global MOCKTIME
|
||||
@ -220,16 +220,16 @@ def initialize_chain(test_dir):
|
||||
|
||||
# Create a 200-block-long chain; each of the 4 nodes
|
||||
# gets 25 mature blocks and 25 immature.
|
||||
# blocks are created with timestamps 2.5 minutes apart
|
||||
# starting from 2010 minutes in the past
|
||||
# blocks are created with timestamps 156 seconds apart
|
||||
# starting from 31356 seconds in the past
|
||||
enable_mocktime()
|
||||
block_time = get_mocktime() - (201 * 2.5 * 60)
|
||||
block_time = get_mocktime() - (201 * 156)
|
||||
for i in range(2):
|
||||
for peer in range(4):
|
||||
for j in range(25):
|
||||
set_node_times(rpcs, block_time)
|
||||
rpcs[peer].generate(1)
|
||||
block_time += 2.5*60
|
||||
block_time += 156
|
||||
# Must sync before next peer starts generating blocks
|
||||
sync_blocks(rpcs)
|
||||
|
||||
|
@ -77,7 +77,7 @@ class WalletTest (BitcoinTestFramework):
|
||||
unspent_0 = self.nodes[2].listunspent()[0]
|
||||
unspent_0 = {"txid": unspent_0["txid"], "vout": unspent_0["vout"]}
|
||||
self.nodes[2].lockunspent(False, [unspent_0])
|
||||
assert_raises(JSONRPCException, self.nodes[2].sendtoaddress, self.nodes[2].getnewaddress(), 20)
|
||||
assert_raises(JSONRPCException, self.nodes[2].sendtoaddress, self.nodes[2].getnewaddress(), 200)
|
||||
assert_equal([unspent_0], self.nodes[2].listlockunspent())
|
||||
self.nodes[2].lockunspent(True, [unspent_0])
|
||||
assert_equal(len(self.nodes[2].listlockunspent()), 0)
|
||||
|
Loading…
Reference in New Issue
Block a user