Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleaned up test.test_p2p.Test.test_sharereq

  • Loading branch information...
commit 11c160ff3319a91a7f6494e699a33622d6f8e85e 1 parent 309110c
@forrestv authored
Showing with 13 additions and 13 deletions.
  1. +13 −13 p2pool/test/test_p2p.py
View
26 p2pool/test/test_p2p.py
@@ -5,23 +5,23 @@
from p2pool import networks, p2p
-class MyNode(p2p.Node):
- def __init__(self, df):
- p2p.Node.__init__(self, lambda: None, 29333, networks.nets['bitcoin'], {}, set([('127.0.0.1', 9333)]), 0, 0, 0, 0)
-
- self.id_to_use = random.randrange(2**256)
- self.df = df
-
- def handle_share_hashes(self, hashes, peer):
- peer.get_shares(
- hashes=[hashes[0]],
- parents=5,
- stops=[],
- ).chainDeferred(self.df)
class Test(unittest.TestCase):
@defer.inlineCallbacks
def test_sharereq(self):
+ class MyNode(p2p.Node):
+ def __init__(self, df):
+ p2p.Node.__init__(self, lambda: None, 29333, networks.nets['bitcoin'], {}, set([('127.0.0.1', 9333)]), 0, 0, 0, 0)
+
+ self.df = df
+
+ def handle_share_hashes(self, hashes, peer):
+ peer.get_shares(
+ hashes=[hashes[0]],
+ parents=5,
+ stops=[],
+ ).chainDeferred(self.df)
+
df = defer.Deferred()
n = MyNode(df)
n.start()
Please sign in to comment.
Something went wrong with that request. Please try again.