Ejemplo n.º 1
0
    def test_format_satoshis_whitespaces_negative(self):
        result = format_satoshis(-12340, whitespaces=True)
        expected = "    -0.0001234 "
        self.assertEqual(expected, result)

        result = format_satoshis(-1234, whitespaces=True)
        expected = "    -0.00001234"
        self.assertEqual(expected, result)
Ejemplo n.º 2
0
    def test_format_fee_precision(self):
        result = format_satoshis(1666/1000, 0, 0, precision=6)
        expected = "1.666"
        self.assertEqual(expected, result)

        result = format_satoshis(1666/1000, 0, 0, precision=1)
        expected = "1.7"
        self.assertEqual(expected, result)
Ejemplo n.º 3
0
 def test_format_satoshis(self):
     result = format_satoshis(1234)
     expected = "0.00001234"
     self.assertEqual(expected, result)
Ejemplo n.º 4
0
 def test_format_satoshis_diff_negative(self):
     result = format_satoshis(-1234, is_diff=True)
     expected = "-0.00001234"
     self.assertEqual(expected, result)
Ejemplo n.º 5
0
 def test_format_fee(self):
     result = format_satoshis(1700/1000, 0, 0)
     expected = "1.7"
     self.assertEqual(expected, result)
Ejemplo n.º 6
0
 def test_format_satoshis(self):
     result = format_satoshis(1234)
     expected = "0.00001234"
     self.assertEqual(expected, result)
Ejemplo n.º 7
0
 def test_format_satoshis_diff_negative(self):
     result = format_satoshis(-1234, is_diff=True)
     expected = "-0.00001234"
     self.assertEqual(expected, result)
Ejemplo n.º 8
0
 def test_format_fee(self):
     result = format_satoshis(1700 / 1000, 0, 0)
     expected = "1.7"
     self.assertEqual(expected, result)