Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
DuniterPy
Commits
3dc2576b
Commit
3dc2576b
authored
6 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[mod] tx: Remove test_fromraw_toraw() for v2 transaction document
- Similar to test_fromraw_toraw_v3()
parent
8cdf6588
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!56
Several transaction enhancements, other improvements
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/documents/test_transaction.py
+0
-73
0 additions, 73 deletions
tests/documents/test_transaction.py
with
0 additions
and
73 deletions
tests/documents/test_transaction.py
+
0
−
73
View file @
3dc2576b
...
@@ -307,79 +307,6 @@ class TestTransaction(unittest.TestCase):
...
@@ -307,79 +307,6 @@ class TestTransaction(unittest.TestCase):
self
.
assertEqual
(
tx
.
signatures
[
2
],
self
.
assertEqual
(
tx
.
signatures
[
2
],
"
2XiBDpuUdu6zCPWGzHXXy8c4ATSscfFQG9DjmqMZUxDZVt1Dp4m2N5oHYVUfoPdrU9SLk4qxi65RNrfCVnvQtQJk
"
)
"
2XiBDpuUdu6zCPWGzHXXy8c4ATSscfFQG9DjmqMZUxDZVt1Dp4m2N5oHYVUfoPdrU9SLk4qxi65RNrfCVnvQtQJk
"
)
def
test_fromraw_toraw
(
self
):
tx
=
Transaction
.
from_signed_raw
(
tx_raw
)
rendered_tx
=
tx
.
signed_raw
()
from_rendered_tx
=
Transaction
.
from_signed_raw
(
rendered_tx
)
self
.
assertEqual
(
tx
.
version
,
2
)
self
.
assertEqual
(
tx
.
currency
,
"
beta_brousouf
"
)
self
.
assertEqual
(
len
(
tx
.
issuers
),
3
)
self
.
assertEqual
(
len
(
tx
.
inputs
),
6
)
self
.
assertEqual
(
len
(
tx
.
unlocks
),
6
)
self
.
assertEqual
(
len
(
tx
.
outputs
),
3
)
self
.
assertEqual
(
tx
.
issuers
[
0
],
"
HsLShAtzXTVxeUtQd7yi5Z5Zh4zNvbu8sTEZ53nfKcqY
"
)
self
.
assertEqual
(
tx
.
issuers
[
1
],
"
CYYjHsNyg3HMRMpTHqCJAN9McjH5BwFLmDKGV3PmCuKp
"
)
self
.
assertEqual
(
tx
.
issuers
[
2
],
"
9WYHTavL1pmhunFCzUwiiq4pXwvgGG5ysjZnjz9H8yB
"
)
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
].
source
,
'
T
'
)
self
.
assertEqual
(
tx
.
inputs
[
1
].
origin_id
,
"
3A09A20E9014110FD224889F13357BAB4EC78A72F95CA03394D8CCA2936A7435
"
)
self
.
assertEqual
(
tx
.
inputs
[
1
].
index
,
8
)
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
].
source
,
'
T
'
)
self
.
assertEqual
(
tx
.
inputs
[
3
].
origin_id
,
"
A0D9B4CDC113ECE1145C5525873821398890AE842F4B318BD076095A23E70956
"
)
self
.
assertEqual
(
tx
.
inputs
[
3
].
index
,
3
)
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
].
source
,
'
D
'
)
self
.
assertEqual
(
tx
.
inputs
[
5
].
origin_id
,
"
9WYHTavL1pmhunFCzUwiiq4pXwvgGG5ysjZnjz9H8yB
"
)
self
.
assertEqual
(
tx
.
inputs
[
5
].
index
,
46
)
self
.
assertEqual
(
tx
.
unlocks
[
0
].
index
,
0
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
0
].
parameters
[
0
]),
"
SIG(0)
"
)
self
.
assertEqual
(
tx
.
unlocks
[
1
].
index
,
1
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
1
].
parameters
[
0
]),
"
XHX(7665798292)
"
)
self
.
assertEqual
(
tx
.
unlocks
[
2
].
index
,
2
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
2
].
parameters
[
0
]),
"
SIG(0)
"
)
self
.
assertEqual
(
tx
.
unlocks
[
3
].
index
,
3
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
3
].
parameters
[
0
]),
"
SIG(0)
"
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
3
].
parameters
[
1
]),
"
SIG(2)
"
)
self
.
assertEqual
(
tx
.
unlocks
[
4
].
index
,
4
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
4
].
parameters
[
0
]),
"
SIG(0)
"
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
4
].
parameters
[
1
]),
"
SIG(1)
"
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
4
].
parameters
[
2
]),
"
SIG(2)
"
)
self
.
assertEqual
(
tx
.
unlocks
[
5
].
index
,
5
)
self
.
assertEqual
(
str
(
tx
.
unlocks
[
5
].
parameters
[
0
]),
"
SIG(2)
"
)
self
.
assertEqual
(
tx
.
outputs
[
0
].
amount
,
120
)
self
.
assertEqual
(
tx
.
outputs
[
0
].
base
,
2
)
self
.
assertEqual
(
pypeg2
.
compose
(
tx
.
outputs
[
0
].
condition
,
output
.
Condition
),
"
SIG(BYfWYFrsyjpvpFysgu19rGK3VHBkz4MqmQbNyEuVU64g)
"
)
self
.
assertEqual
(
tx
.
outputs
[
1
].
amount
,
146
)
self
.
assertEqual
(
tx
.
outputs
[
1
].
base
,
2
)
self
.
assertEqual
(
pypeg2
.
compose
(
tx
.
outputs
[
1
].
condition
,
output
.
Condition
),
"
SIG(DSz4rgncXCytsUMW2JU2yhLquZECD2XpEkpP9gG5HyAx)
"
)
self
.
assertEqual
(
tx
.
outputs
[
2
].
amount
,
49
)
self
.
assertEqual
(
tx
.
outputs
[
2
].
base
,
2
)
self
.
assertEqual
(
pypeg2
.
compose
(
tx
.
outputs
[
2
].
condition
,
output
.
Condition
),
"
(SIG(6DyGr5LFtFmbaJYRvcs9WmBsr4cbJbJ1EV9zBbqG7A6i) || XHX(8FAA0ED653CA4D2C1156D511F0D0036F5168ABA4DAC2929676D279C8A2A12E36))
"
)
self
.
assertEqual
(
tx
.
comment
,
"
-----@@@----- (why not this comment?)
"
)
self
.
assertEqual
(
tx
.
signatures
[
0
],
"
42yQm4hGTJYWkPg39hQAUgP6S6EQ4vTfXdJuxKEHL1ih6YHiDL2hcwrFgBHjXLRgxRhj2VNVqqc6b4JayKqTE14r
"
)
self
.
assertEqual
(
tx
.
signatures
[
1
],
"
2D96KZwNUvVtcapQPq2mm7J9isFcDCfykwJpVEZwBc7tCgL4qPyu17BT5ePozAE9HS6Yvj51f62Mp4n9d9dkzJoX
"
)
self
.
assertEqual
(
tx
.
signatures
[
2
],
"
2XiBDpuUdu6zCPWGzHXXy8c4ATSscfFQG9DjmqMZUxDZVt1Dp4m2N5oHYVUfoPdrU9SLk4qxi65RNrfCVnvQtQJk
"
)
def
test_fromraw_toraw_v3
(
self
):
def
test_fromraw_toraw_v3
(
self
):
tx
=
Transaction
.
from_signed_raw
(
tx_raw_v3
)
tx
=
Transaction
.
from_signed_raw
(
tx_raw_v3
)
rendered_tx
=
tx
.
signed_raw
()
rendered_tx
=
tx
.
signed_raw
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment