Ejemplo n.º 1
0
    def test_random(self):
        """
    Generating a random sequence of trytes.
    """
        trytes = TryteString.random(Hash.LEN)

        # It is (hopefully!) impossible to predict what the actual trytes
        # will be, but at least we can verify that the correct number were
        # generated!
        self.assertEqual(len(trytes), Hash.LEN)
Ejemplo n.º 2
0
  def test_random(self):
    """
    Generating a random sequence of trytes.
    """
    trytes = TryteString.random(Hash.LEN)

    # It is (hopefully!) impossible to predict what the actual trytes
    # will be, but at least we can verify that the correct number were
    # generated!
    self.assertEqual(len(trytes), Hash.LEN)
Ejemplo n.º 3
0
from iota.multisig.types import MultisigAddress
import time
"""
step1
"""
bundle_trans = Transaction(
    hash_=
    "AVPVVUUNZDTOHNZWIJVNSVQVOWXFGM9SKJSWAPGWNJCNDFPKSTQETASWTROWCSSTFLRFVRYFTYBD99999",  # type: Optional[TransactionHash]
    signature_message_fragment="",  # type: Optional[Fragment]
    address=
    "FJKKSHBZTAKQNDTIKJYCZBOZDGSZANCZSWCNWUOCZXFADNOQSYAHEJPXRLOVPNOQFQXXGEGVDGICLMOXX",  # type: Address
    value=5,  # type: int
    timestamp=1574903736,  # type: int
    current_index=0,  # type: Optional[int]
    last_index=3,  # type: Optional[int]
    bundle_hash=TryteString.random(81),
    trunk_transaction_hash=
    "ZQLLKWWTPNXXKYHWXRIQZKRG9MLW9DHFVXHPGFYACGOUGPWENMEC9ZOWRUORUWEFBEREGNVPNRHXZ9999",  # type: Optional[TransactionHash]
    branch_transaction_hash=
    "DQEUSNVVGKZUMYXKDUIEDYHCDVVAXGWU9RZUGOGFCFSTDVJEIWIETEGLKUIEKMKKFOKHVGUAELCMWE999",  # type: Optional[TransactionHash]
    tag="QA9999999999999999999999999",  # type: Optional[Tag]
    attachment_timestamp=1574903776620,  # type: Optional[int]
    attachment_timestamp_lower_bound=0,  # type: Optional[int]
    attachment_timestamp_upper_bound=3812798742493,  # type: Optional[int]
    nonce="LSJDSJRHNOHMWNRNJFHEORVHMXY",  # type: Optional[Nonce]
    legacy_tag=None  # type: Optional[Tag]
)
bundle_trans_2 = Transaction(
    hash_=
    "ZQLLKWWTPNXXKYHWXRIQZKRG9MLW9DHFVXHPGFYACGOUGPWENMEC9ZOWRUORUWEFBEREGNVPNRHXZ9999",  # type: Optional[TransactionHash]
    signature_message_fragment="",  # type: Optional[Fragment]
Ejemplo n.º 4
0
 def test_random_wrong_length(self):
     """
 Generating random Trytestring with negative length.
 """
     with self.assertRaises(TypeError):
         trytes = TryteString.random(length=-5)
Ejemplo n.º 5
0
 def test_random_no_length(self):
     """
 Trying to create a random TryteString without specifying length.
 """
     with self.assertRaises(TypeError):
         trytes = TryteString.random()