Exemplo n.º 1
0
    def test_chain(self):
        tree = self.tree

        chain0 = BlockchainSpider.chain(tree, 0)
        self.assertEqual(len(chain0), 2)

        chain1 = BlockchainSpider.chain(tree, 1)
        self.assertEqual(len(chain1), 5)
Exemplo n.º 2
0
    def test_chain(self):
        tree = self.tree

        chain0 = BlockchainSpider.chain(tree, 0)
        self.assertEqual(len(chain0), 2)

        chain1 = BlockchainSpider.chain(tree, 1)
        self.assertEqual(len(chain1), 5)
Exemplo n.º 3
0
    def test_strip_loan(self):
        chain = BlockchainSpider.chain(self.tree, 1)
        self.assertEqual(chain[-1]['action'], 'LOAN')

        chain = BlockchainSpider.strip_loan(chain)
        self.assertEqual(len(chain), 4)
        self.assertEqual(chain[-1]['action'], 'UNCONSIGN')
Exemplo n.º 4
0
    def test_strip_loan(self):
        chain = BlockchainSpider.chain(self.tree, 1)
        self.assertEqual(chain[-1]['action'], 'LOAN')

        chain = BlockchainSpider.strip_loan(chain)
        self.assertEqual(len(chain), 4)
        self.assertEqual(chain[-1]['action'], 'UNCONSIGN')
Exemplo n.º 5
0
 def test_data(self):
     tree = self.tree
     data = {0: BlockchainSpider.chain(tree, 0)}
     self.assertDictEqual(data, {0: [{'action': 'EDITIONS',
                                      'edition_number': 0,
                                      'from_address': u'mqXz83H4LCxjf2ie8hYNsTRByvtfV43Pa7',
                                      'number_editions': 10,
                                      'piece_address': u'myr2VcDnPKf997sjXx6rUFc4CtFH9sxNVS',
                                      'timestamp_utc': 1432649855,
                                      'to_address': u'n2sQHoUghWUgSM8msqdmCim8pZ635YjoCD',
                                      'txid': u'fb22bbb83161f6904f1803ee1cdbed1b5836eb9ac51b102564400989780b48ea',
                                      'verb': 'ASCRIBESPOOL01EDITIONS10'},
                                    {'action': 'REGISTER',
                                     'edition_number': 0,
                                     'from_address': u'mqXz83H4LCxjf2ie8hYNsTRByvtfV43Pa7',
                                     'number_editions': 10,
                                     'piece_address': u'myr2VcDnPKf997sjXx6rUFc4CtFH9sxNVS',
                                     'timestamp_utc': 1432651005,
                                     'to_address': u'n2sQHoUghWUgSM8msqdmCim8pZ635YjoCD',
                                     'txid': u'02994a3ceee87be2210fa6e4a649bc0626e791f590bd8db22e7e1fd9fc66d038',
                                     'verb': 'ASCRIBESPOOL01REGISTER0'}]})
Exemplo n.º 6
0
 def test_data(self):
     tree = self.tree
     data = {0: BlockchainSpider.chain(tree, 0)}
     self.assertDictEqual(data, {0: [{'action': 'EDITIONS',
                                      'edition_number': 0,
                                      'from_address': u'mqXz83H4LCxjf2ie8hYNsTRByvtfV43Pa7',
                                      'number_editions': 10,
                                      'piece_address': u'myr2VcDnPKf997sjXx6rUFc4CtFH9sxNVS',
                                      'timestamp_utc': 1432649855,
                                      'to_address': u'n2sQHoUghWUgSM8msqdmCim8pZ635YjoCD',
                                      'txid': u'fb22bbb83161f6904f1803ee1cdbed1b5836eb9ac51b102564400989780b48ea',
                                      'verb': 'ASCRIBESPOOL01EDITIONS10'},
                                    {'action': 'REGISTER',
                                     'edition_number': 0,
                                     'from_address': u'mqXz83H4LCxjf2ie8hYNsTRByvtfV43Pa7',
                                     'number_editions': 10,
                                     'piece_address': u'myr2VcDnPKf997sjXx6rUFc4CtFH9sxNVS',
                                     'timestamp_utc': 1432651005,
                                     'to_address': u'n2sQHoUghWUgSM8msqdmCim8pZ635YjoCD',
                                     'txid': u'02994a3ceee87be2210fa6e4a649bc0626e791f590bd8db22e7e1fd9fc66d038',
                                     'verb': 'ASCRIBESPOOL01REGISTER0'}]})