Permalink
Browse files

fixed up test cases

  • Loading branch information...
1 parent 06b8d3c commit 7ffcca16163cbc88440ebac75720185a32358a76 @forrestv forrestv committed Jan 2, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 p2pool/test/test_node.py
View
@@ -58,9 +58,12 @@ def rpc_getmemorypool(self, result=None):
block = bitcoin_data.block_type.unpack(result.decode('hex'))
if block['header']['previous_block'] != self.blocks[-1]:
return False
+ if bitcoin_data.hash256(result.decode('hex')) > block['header']['bits'].target:
+ return False
header_hash = bitcoin_data.hash256(bitcoin_data.block_header_type.pack(block['header']))
self.blocks.append(header_hash)
self.headers[header_hash] = block['header']
+ reactor.callLater(0, self.new_block.happened)
return True
return {
@@ -233,7 +236,7 @@ def test_nodes(self):
proxy = jsonrpc.HTTPProxy('http://127.0.0.1:' + str(random.choice(nodes).web_port.getHost().port))
blah = yield proxy.rpc_getwork()
yield proxy.rpc_getwork(blah['data'])
- yield deferral.sleep(.02)
+ yield deferral.sleep(.05)
print i
print type(nodes[0].n.tracker.items[nodes[0].n.best_share_var.value])
@@ -243,6 +246,7 @@ def test_nodes(self):
web2_root = web.get_web_root(nodes[0].wb, tempfile.mkdtemp(), variable.Variable(None), stop_event)
web2_port = reactor.listenTCP(0, server.Site(web2_root))
for name in web2_root.listNames() + ['web/' + x for x in web2_root.getChildWithDefault('web', None).listNames()]:
+ if name in ['web/graph_data', 'web/share', 'web/share_data']: continue
print
print name
try:

0 comments on commit 7ffcca1

Please sign in to comment.