Commit f12a2397 authored by Moul's avatar Moul

[test] tx: Upgrade test_from_compact() to v10 tx

parent eb585054
......@@ -35,16 +35,17 @@ Comment: XHX for pubkey DCYELkvV1aAsxFv58SbfRerHy5giJwKA1i4ZKTTcVGZe
GXGephqTSJfb+8xsG/UMKRW0y+edL4RoMHM+OlgFq1aYOuaQ3/CtBKVSA01n2mkI7zwepeIABSjS94iVH4vZDg==
"""
tx_compact = """TX:2:3:6:6:3:1:0
tx_compact = """TX:10:3:6:6:3:1:0
13410-000041DF0CCA173F09B5FBA48F619D4BC934F12ADF1D0B798639EB2149C4A8CC
HsLShAtzXTVxeUtQd7yi5Z5Zh4zNvbu8sTEZ53nfKcqY
CYYjHsNyg3HMRMpTHqCJAN9McjH5BwFLmDKGV3PmCuKp
9WYHTavL1pmhunFCzUwiiq4pXwvgGG5ysjZnjz9H8yB
T:6991C993631BED4733972ED7538E41CCC33660F554E3C51963E2A0AC4D6453D3:2
T:3A09A20E9014110FD224889F13357BAB4EC78A72F95CA03394D8CCA2936A7435:8
D:HsLShAtzXTVxeUtQd7yi5Z5Zh4zNvbu8sTEZ53nfKcqY:46
T:A0D9B4CDC113ECE1145C5525873821398890AE842F4B318BD076095A23E70956:3
T:67F2045B5318777CC52CD38B424F3E40DDA823FA0364625F124BABE0030E7B5B:5
D:9WYHTavL1pmhunFCzUwiiq4pXwvgGG5ysjZnjz9H8yB:46
230:2:T:6991C993631BED4733972ED7538E41CCC33660F554E3C51963E2A0AC4D6453D3:2
2230:2:T:3A09A20E9014110FD224889F13357BAB4EC78A72F95CA03394D8CCA2936A7435:8
2430:2:D:HsLShAtzXTVxeUtQd7yi5Z5Zh4zNvbu8sTEZ53nfKcqY:46
2310:2:T:A0D9B4CDC113ECE1145C5525873821398890AE842F4B318BD076095A23E70956:3
30:2:T:67F2045B5318777CC52CD38B424F3E40DDA823FA0364625F124BABE0030E7B5B:5
2330:2:D:9WYHTavL1pmhunFCzUwiiq4pXwvgGG5ysjZnjz9H8yB:46
0:SIG(0)
1:XHX(7665798292)
2:SIG(0)
......@@ -107,7 +108,7 @@ Comment: -----@@@----- (why not this comment?)
class TestTransaction(unittest.TestCase):
def test_fromcompact(self):
tx = Transaction.from_compact("zeta_brousouf", tx_compact)
self.assertEqual(tx.version, 2)
self.assertEqual(tx.version, 10)
self.assertEqual(tx.currency, "zeta_brousouf")
self.assertEqual(len(tx.issuers), 3)
self.assertEqual(len(tx.inputs), 6)
......@@ -118,21 +119,33 @@ class TestTransaction(unittest.TestCase):
self.assertEqual(tx.issuers[1], "CYYjHsNyg3HMRMpTHqCJAN9McjH5BwFLmDKGV3PmCuKp")
self.assertEqual(tx.issuers[2], "9WYHTavL1pmhunFCzUwiiq4pXwvgGG5ysjZnjz9H8yB")
self.assertEqual(tx.inputs[0].amount, 230)
self.assertEqual(tx.inputs[0].base, 2)
self.assertEqual(tx.inputs[0].source, 'T')
self.assertEqual(tx.inputs[0].origin_id, "6991C993631BED4733972ED7538E41CCC33660F554E3C51963E2A0AC4D6453D3")
self.assertEqual(tx.inputs[0].index, 2)
self.assertEqual(tx.inputs[1].amount, 2230)
self.assertEqual(tx.inputs[1].base, 2)
self.assertEqual(tx.inputs[1].source, 'T')
self.assertEqual(tx.inputs[1].origin_id, "3A09A20E9014110FD224889F13357BAB4EC78A72F95CA03394D8CCA2936A7435")
self.assertEqual(tx.inputs[1].index, 8)
self.assertEqual(tx.inputs[2].amount, 2430)
self.assertEqual(tx.inputs[2].base, 2)
self.assertEqual(tx.inputs[2].source, 'D')
self.assertEqual(tx.inputs[2].origin_id, "HsLShAtzXTVxeUtQd7yi5Z5Zh4zNvbu8sTEZ53nfKcqY")
self.assertEqual(tx.inputs[2].index, 46)
self.assertEqual(tx.inputs[3].amount, 2310)
self.assertEqual(tx.inputs[3].base, 2)
self.assertEqual(tx.inputs[3].source, 'T')
self.assertEqual(tx.inputs[3].origin_id, "A0D9B4CDC113ECE1145C5525873821398890AE842F4B318BD076095A23E70956")
self.assertEqual(tx.inputs[3].index, 3)
self.assertEqual(tx.inputs[4].amount, 30)
self.assertEqual(tx.inputs[4].base, 2)
self.assertEqual(tx.inputs[4].source, 'T')
self.assertEqual(tx.inputs[4].origin_id, "67F2045B5318777CC52CD38B424F3E40DDA823FA0364625F124BABE0030E7B5B")
self.assertEqual(tx.inputs[4].index, 5)
self.assertEqual(tx.inputs[5].amount, 2330)
self.assertEqual(tx.inputs[5].base, 2)
self.assertEqual(tx.inputs[5].source, 'D')
self.assertEqual(tx.inputs[5].origin_id, "9WYHTavL1pmhunFCzUwiiq4pXwvgGG5ysjZnjz9H8yB")
self.assertEqual(tx.inputs[5].index, 46)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment