added .new_script back to Share
[p2pool.git] / p2pool / test / test_skiplists.py
1 import random
2 import unittest
3
4 from p2pool import skiplists
5 from p2pool.util import forest
6 from p2pool.test.util import test_forest
7
8 class Test(unittest.TestCase):
9     def test_all(self):
10         t = forest.Tracker()
11         d = skiplists.WeightsSkipList(t)
12         for i in xrange(200):
13             t.add(test_forest.FakeShare(hash=i, previous_hash=i - 1 if i > 0 else None, new_script=i, share_data=dict(donation=1234), target=2**249))
14         for i in xrange(200):
15             a = random.randrange(200)
16             d(a, random.randrange(a + 1), 1000000*65535)[1]