Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
368f5366
Commit
368f5366
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cd63c735
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
54 deletions
+75
-54
go/neo/py/pyneo-gen-testdata
go/neo/py/pyneo-gen-testdata
+26
-5
go/neo/ztestdata_proto_py_test.go
go/neo/ztestdata_proto_py_test.go
+49
-49
No files found.
go/neo/py/pyneo-gen-testdata
View file @
368f5366
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
def
main
():
def
main
():
pyprotog
=
{}
pyprotog
=
{}
execfile
(
'../../neo/lib/protocol.py'
,
pyprotog
)
execfile
(
'../../neo/lib/protocol.py'
,
pyprotog
)
pypacket
=
pyprotog
[
'Packet'
]
pypackets
=
pyprotog
[
'Packets'
]
pypackets
=
pyprotog
[
'Packets'
]
# dump to go what to expect
# dump to go what to expect
...
@@ -33,11 +34,31 @@ def main():
...
@@ -33,11 +34,31 @@ def main():
emit
(
"package neo"
)
emit
(
"package neo"
)
emit
(
"
\
n
var pyMsgRegistry = map[uint16]string{"
)
emit
(
"
\
n
var pyMsgRegistry = map[uint16]string{"
)
pycodev
=
pypackets
.
keys
()
pycodev
.
sort
()
# access packet structures by names they are defined under Packets
for
pycode
in
pycodev
:
# class and thus in neo/py code which uses them.
pymsg
=
pypackets
[
pycode
]
#
emit
(
'
\
t
%d:
\
t
"%s",'
%
(
pycode
,
pymsg
.
__name__
))
# ( this is not the same as packet class name as e.g. currently
# AcceptIdentification has class name AnswerRequestIdentification )
pypktv
=
[]
for
k
in
dir
(
pypackets
):
v
=
getattr
(
pypackets
,
k
)
if
isinstance
(
v
,
type
)
and
issubclass
(
v
,
pypacket
):
v
.
_x_use_name
=
k
pypktv
.
append
(
v
)
# order by message code
pypktv
.
sort
(
key
=
lambda
pkt
:
pkt
.
_code
)
for
pypkt
in
pypktv
:
emit
(
'
\
t
%d:
\
t
"%s",'
%
(
pypkt
.
_code
,
pypkt
.
_x_use_name
))
#pycodev = pypackets.keys()
#pycodev.sort()
#for pycode in pycodev:
# pymsg = pypackets[pycode]
# emit('\t%d:\t"%s",' % (pycode, pymsg.__name__))
emit
(
"}"
)
emit
(
"}"
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
go/neo/ztestdata_proto_py_test.go
View file @
368f5366
...
@@ -5,71 +5,71 @@ var pyMsgRegistry = map[uint16]string{
...
@@ -5,71 +5,71 @@ var pyMsgRegistry = map[uint16]string{
1
:
"RequestIdentification"
,
1
:
"RequestIdentification"
,
3
:
"Ping"
,
3
:
"Ping"
,
5
:
"CloseClient"
,
5
:
"CloseClient"
,
6
:
"
PrimaryMaster
"
,
6
:
"
AskPrimary
"
,
8
:
"NotPrimaryMaster"
,
8
:
"NotPrimaryMaster"
,
9
:
"NotifyNodeInformation"
,
9
:
"NotifyNodeInformation"
,
10
:
"Recovery"
,
10
:
"
Ask
Recovery"
,
12
:
"LastIDs"
,
12
:
"
Ask
LastIDs"
,
14
:
"PartitionTable"
,
14
:
"
Ask
PartitionTable"
,
16
:
"
Notify
PartitionTable"
,
16
:
"
Send
PartitionTable"
,
17
:
"PartitionChanges"
,
17
:
"
Notify
PartitionChanges"
,
18
:
"StartOperation"
,
18
:
"StartOperation"
,
19
:
"StopOperation"
,
19
:
"StopOperation"
,
20
:
"UnfinishedTransactions"
,
20
:
"
Ask
UnfinishedTransactions"
,
22
:
"LockedTransactions"
,
22
:
"
Ask
LockedTransactions"
,
24
:
"FinalTID"
,
24
:
"
Ask
FinalTID"
,
26
:
"ValidateTransaction"
,
26
:
"ValidateTransaction"
,
27
:
"BeginTransaction"
,
27
:
"
Ask
BeginTransaction"
,
29
:
"FailedVote"
,
29
:
"FailedVote"
,
30
:
"FinishTransaction"
,
30
:
"
Ask
FinishTransaction"
,
32
:
"LockInformation"
,
32
:
"
Ask
LockInformation"
,
34
:
"InvalidateObjects"
,
34
:
"InvalidateObjects"
,
35
:
"UnlockInformation"
,
35
:
"
Notify
UnlockInformation"
,
36
:
"
Generate
OIDs"
,
36
:
"
AskNew
OIDs"
,
38
:
"Deadlock"
,
38
:
"
Notify
Deadlock"
,
39
:
"RebaseTransaction"
,
39
:
"
Ask
RebaseTransaction"
,
41
:
"RebaseObject"
,
41
:
"
Ask
RebaseObject"
,
43
:
"StoreObject"
,
43
:
"
Ask
StoreObject"
,
45
:
"AbortTransaction"
,
45
:
"AbortTransaction"
,
46
:
"StoreTransaction"
,
46
:
"
Ask
StoreTransaction"
,
48
:
"VoteTransaction"
,
48
:
"
Ask
VoteTransaction"
,
50
:
"
Get
Object"
,
50
:
"
Ask
Object"
,
52
:
"
TIDList
"
,
52
:
"
AskTIDs
"
,
54
:
"TransactionInformation"
,
54
:
"
Ask
TransactionInformation"
,
56
:
"ObjectHistory"
,
56
:
"
Ask
ObjectHistory"
,
58
:
"PartitionList"
,
58
:
"
Ask
PartitionList"
,
60
:
"NodeList"
,
60
:
"
Ask
NodeList"
,
62
:
"SetNodeState"
,
62
:
"SetNodeState"
,
63
:
"AddPendingNodes"
,
63
:
"AddPendingNodes"
,
64
:
"TweakPartitionTable"
,
64
:
"TweakPartitionTable"
,
65
:
"SetClusterState"
,
65
:
"SetClusterState"
,
66
:
"Repair"
,
66
:
"Repair"
,
67
:
"
RepairOne
"
,
67
:
"
NotifyRepair
"
,
68
:
"ClusterInformation"
,
68
:
"
Notify
ClusterInformation"
,
69
:
"ClusterState"
,
69
:
"
Ask
ClusterState"
,
71
:
"ObjectUndoSerial"
,
71
:
"
Ask
ObjectUndoSerial"
,
73
:
"
TIDList
From"
,
73
:
"
AskTIDs
From"
,
75
:
"Pack"
,
75
:
"
Ask
Pack"
,
77
:
"CheckReplicas"
,
77
:
"CheckReplicas"
,
78
:
"CheckPartition"
,
78
:
"CheckPartition"
,
79
:
"CheckTIDRange"
,
79
:
"
Ask
CheckTIDRange"
,
81
:
"CheckSerialRange"
,
81
:
"
Ask
CheckSerialRange"
,
83
:
"PartitionCorrupted"
,
83
:
"
Notify
PartitionCorrupted"
,
84
:
"NotifyReady"
,
84
:
"NotifyReady"
,
85
:
"LastTransaction"
,
85
:
"
Ask
LastTransaction"
,
87
:
"CheckCurrentSerial"
,
87
:
"
Ask
CheckCurrentSerial"
,
89
:
"NotifyTransactionFinished"
,
89
:
"NotifyTransactionFinished"
,
90
:
"Replicate"
,
90
:
"Replicate"
,
91
:
"ReplicationDone"
,
91
:
"
Notify
ReplicationDone"
,
92
:
"FetchTransactions"
,
92
:
"
Ask
FetchTransactions"
,
94
:
"FetchObjects"
,
94
:
"
Ask
FetchObjects"
,
96
:
"AddTransaction"
,
96
:
"AddTransaction"
,
97
:
"AddObject"
,
97
:
"AddObject"
,
98
:
"Truncate"
,
98
:
"Truncate"
,
32768
:
"Error"
,
32768
:
"Error"
,
32769
:
"A
nswerReques
tIdentification"
,
32769
:
"A
ccep
tIdentification"
,
32771
:
"
AnswerPi
ng"
,
32771
:
"
Po
ng"
,
32774
:
"AnswerPrimary
Master
"
,
32774
:
"AnswerPrimary"
,
32778
:
"AnswerRecovery"
,
32778
:
"AnswerRecovery"
,
32780
:
"AnswerLastIDs"
,
32780
:
"AnswerLastIDs"
,
32782
:
"AnswerPartitionTable"
,
32782
:
"AnswerPartitionTable"
,
...
@@ -77,23 +77,23 @@ var pyMsgRegistry = map[uint16]string{
...
@@ -77,23 +77,23 @@ var pyMsgRegistry = map[uint16]string{
32790
:
"AnswerLockedTransactions"
,
32790
:
"AnswerLockedTransactions"
,
32792
:
"AnswerFinalTID"
,
32792
:
"AnswerFinalTID"
,
32795
:
"AnswerBeginTransaction"
,
32795
:
"AnswerBeginTransaction"
,
32798
:
"Answer
FinishTransaction
"
,
32798
:
"Answer
TransactionFinished
"
,
32800
:
"Answer
LockInformation
"
,
32800
:
"Answer
InformationLocked
"
,
32804
:
"Answer
Generate
OIDs"
,
32804
:
"Answer
New
OIDs"
,
32807
:
"AnswerRebaseTransaction"
,
32807
:
"AnswerRebaseTransaction"
,
32809
:
"AnswerRebaseObject"
,
32809
:
"AnswerRebaseObject"
,
32811
:
"AnswerStoreObject"
,
32811
:
"AnswerStoreObject"
,
32814
:
"AnswerStoreTransaction"
,
32814
:
"AnswerStoreTransaction"
,
32816
:
"AnswerVoteTransaction"
,
32816
:
"AnswerVoteTransaction"
,
32818
:
"Answer
Get
Object"
,
32818
:
"AnswerObject"
,
32820
:
"AnswerTID
List
"
,
32820
:
"AnswerTID
s
"
,
32822
:
"AnswerTransactionInformation"
,
32822
:
"AnswerTransactionInformation"
,
32824
:
"AnswerObjectHistory"
,
32824
:
"AnswerObjectHistory"
,
32826
:
"AnswerPartitionList"
,
32826
:
"AnswerPartitionList"
,
32828
:
"AnswerNodeList"
,
32828
:
"AnswerNodeList"
,
32837
:
"AnswerClusterState"
,
32837
:
"AnswerClusterState"
,
32839
:
"AnswerObjectUndoSerial"
,
32839
:
"AnswerObjectUndoSerial"
,
32841
:
"AnswerTID
List
From"
,
32841
:
"AnswerTID
s
From"
,
32843
:
"AnswerPack"
,
32843
:
"AnswerPack"
,
32847
:
"AnswerCheckTIDRange"
,
32847
:
"AnswerCheckTIDRange"
,
32849
:
"AnswerCheckSerialRange"
,
32849
:
"AnswerCheckSerialRange"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment