Esempio n. 1
0
    def test_remove_checksum_second_time(self):
        """
    `remove_checksum` is called on an Address that does not have a checksum.
    """
        addy = Address(trytes=b'ZKIUDZXQYQAWSHPKSAATJXPAQZPGYCDCQDRSMWWCGQJNI'
                       b'PCOORMDRNREDUDKBMUYENYTFVUNEWDBAKXMV')

        self.assertFalse(addy.is_checksum_valid())
        self.assertTrue(len(addy) == Address.LEN)

        addy.remove_checksum()

        self.assertFalse(addy.is_checksum_valid())
        self.assertTrue(len(addy) == Address.LEN)
Esempio n. 2
0
    def test_remove_checksum(self):
        """
    Checksum is removed from an address.
    """
        addy = Address(trytes=b'ZKIUDZXQYQAWSHPKSAATJXPAQZPGYCDCQDRSMWWCGQJNI'
                       b'PCOORMDRNREDUDKBMUYENYTFVUNEWDBAKXMVJJJGBARPB')

        self.assertTrue(addy.is_checksum_valid())
        self.assertTrue(len(addy) == Address.LEN + AddressChecksum.LEN)

        addy.remove_checksum()

        self.assertFalse(addy.is_checksum_valid())
        self.assertTrue(len(addy) == Address.LEN)