Ejemplo n.º 1
0
    def test_from_trytes(self):
        """
    Converting a sequence of tryte values into a TryteString.
    """
        trytes = [
            [0, 0, -1],
            [-1, 1, 0],
            [-1, 1, -1],
            [0, 1, 0],
            [0, 0, 0],
            [1, 1, 0],
            [0, 0, 0],
            [1, 1, 0],
            [0, 1, 0],
            [1, 1, 0],
            [-1, 0, -1],
            [1, 0, 0],
            [-1, -1, 1],
            [1, 0, 0],
            [1, 0, -1],
            [-1, 1, 0],
            [1, -1, 0],
            [-1, 1, 0],
            [0, 1, 0],
            [0, 1, 0],
            [-1, 1, 1],
            [-1, 1, 0],
            [0, -1, 1],
            [1, 0, 0],
        ]

        self.assertEqual(
            binary_type(TryteString.from_trytes(trytes)),
            b'RBTC9D9DCDQAEASBYBCCKBFA',
        )
Ejemplo n.º 2
0
  def test_from_trytes(self):
    """
    Converting a sequence of tryte values into a TryteString.
    """
    trytes = [
      [0, 0, -1],
      [-1, 1, 0],
      [-1, 1, -1],
      [0, 1, 0],
      [0, 0, 0],
      [1, 1, 0],
      [0, 0, 0],
      [1, 1, 0],
      [0, 1, 0],
      [1, 1, 0],
      [-1, 0, -1],
      [1, 0, 0],
      [-1, -1, 1],
      [1, 0, 0],
      [1, 0, -1],
      [-1, 1, 0],
      [1, -1, 0],
      [-1, 1, 0],
      [0, 1, 0],
      [0, 1, 0],
      [-1, 1, 1],
      [-1, 1, 0],
      [0, -1, 1],
      [1, 0, 0],
    ]

    self.assertEqual(
      binary_type(TryteString.from_trytes(trytes)),
      b'RBTC9D9DCDQAEASBYBCCKBFA',
    )