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 @@
def
main
():
pyprotog
=
{}
execfile
(
'../../neo/lib/protocol.py'
,
pyprotog
)
pypacket
=
pyprotog
[
'Packet'
]
pypackets
=
pyprotog
[
'Packets'
]
# dump to go what to expect
...
...
@@ -33,11 +34,31 @@ def main():
emit
(
"package neo"
)
emit
(
"
\
n
var pyMsgRegistry = map[uint16]string{"
)
pycodev
=
pypackets
.
keys
()
pycodev
.
sort
()
for
pycode
in
pycodev
:
pymsg
=
pypackets
[
pycode
]
emit
(
'
\
t
%d:
\
t
"%s",'
%
(
pycode
,
pymsg
.
__name__
))
# access packet structures by names they are defined under Packets
# class and thus in neo/py code which uses them.
#
# ( 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
(
"}"
)
if
__name__
==
'__main__'
:
...
...
go/neo/ztestdata_proto_py_test.go
View file @
368f5366
...
...
@@ -5,71 +5,71 @@ var pyMsgRegistry = map[uint16]string{
1
:
"RequestIdentification"
,
3
:
"Ping"
,
5
:
"CloseClient"
,
6
:
"
PrimaryMaster
"
,
6
:
"
AskPrimary
"
,
8
:
"NotPrimaryMaster"
,
9
:
"NotifyNodeInformation"
,
10
:
"Recovery"
,
12
:
"LastIDs"
,
14
:
"PartitionTable"
,
16
:
"
Notify
PartitionTable"
,
17
:
"PartitionChanges"
,
10
:
"
Ask
Recovery"
,
12
:
"
Ask
LastIDs"
,
14
:
"
Ask
PartitionTable"
,
16
:
"
Send
PartitionTable"
,
17
:
"
Notify
PartitionChanges"
,
18
:
"StartOperation"
,
19
:
"StopOperation"
,
20
:
"UnfinishedTransactions"
,
22
:
"LockedTransactions"
,
24
:
"FinalTID"
,
20
:
"
Ask
UnfinishedTransactions"
,
22
:
"
Ask
LockedTransactions"
,
24
:
"
Ask
FinalTID"
,
26
:
"ValidateTransaction"
,
27
:
"BeginTransaction"
,
27
:
"
Ask
BeginTransaction"
,
29
:
"FailedVote"
,
30
:
"FinishTransaction"
,
32
:
"LockInformation"
,
30
:
"
Ask
FinishTransaction"
,
32
:
"
Ask
LockInformation"
,
34
:
"InvalidateObjects"
,
35
:
"UnlockInformation"
,
36
:
"
Generate
OIDs"
,
38
:
"Deadlock"
,
39
:
"RebaseTransaction"
,
41
:
"RebaseObject"
,
43
:
"StoreObject"
,
35
:
"
Notify
UnlockInformation"
,
36
:
"
AskNew
OIDs"
,
38
:
"
Notify
Deadlock"
,
39
:
"
Ask
RebaseTransaction"
,
41
:
"
Ask
RebaseObject"
,
43
:
"
Ask
StoreObject"
,
45
:
"AbortTransaction"
,
46
:
"StoreTransaction"
,
48
:
"VoteTransaction"
,
50
:
"
Get
Object"
,
52
:
"
TIDList
"
,
54
:
"TransactionInformation"
,
56
:
"ObjectHistory"
,
58
:
"PartitionList"
,
60
:
"NodeList"
,
46
:
"
Ask
StoreTransaction"
,
48
:
"
Ask
VoteTransaction"
,
50
:
"
Ask
Object"
,
52
:
"
AskTIDs
"
,
54
:
"
Ask
TransactionInformation"
,
56
:
"
Ask
ObjectHistory"
,
58
:
"
Ask
PartitionList"
,
60
:
"
Ask
NodeList"
,
62
:
"SetNodeState"
,
63
:
"AddPendingNodes"
,
64
:
"TweakPartitionTable"
,
65
:
"SetClusterState"
,
66
:
"Repair"
,
67
:
"
RepairOne
"
,
68
:
"ClusterInformation"
,
69
:
"ClusterState"
,
71
:
"ObjectUndoSerial"
,
73
:
"
TIDList
From"
,
75
:
"Pack"
,
67
:
"
NotifyRepair
"
,
68
:
"
Notify
ClusterInformation"
,
69
:
"
Ask
ClusterState"
,
71
:
"
Ask
ObjectUndoSerial"
,
73
:
"
AskTIDs
From"
,
75
:
"
Ask
Pack"
,
77
:
"CheckReplicas"
,
78
:
"CheckPartition"
,
79
:
"CheckTIDRange"
,
81
:
"CheckSerialRange"
,
83
:
"PartitionCorrupted"
,
79
:
"
Ask
CheckTIDRange"
,
81
:
"
Ask
CheckSerialRange"
,
83
:
"
Notify
PartitionCorrupted"
,
84
:
"NotifyReady"
,
85
:
"LastTransaction"
,
87
:
"CheckCurrentSerial"
,
85
:
"
Ask
LastTransaction"
,
87
:
"
Ask
CheckCurrentSerial"
,
89
:
"NotifyTransactionFinished"
,
90
:
"Replicate"
,
91
:
"ReplicationDone"
,
92
:
"FetchTransactions"
,
94
:
"FetchObjects"
,
91
:
"
Notify
ReplicationDone"
,
92
:
"
Ask
FetchTransactions"
,
94
:
"
Ask
FetchObjects"
,
96
:
"AddTransaction"
,
97
:
"AddObject"
,
98
:
"Truncate"
,
32768
:
"Error"
,
32769
:
"A
nswerReques
tIdentification"
,
32771
:
"
AnswerPi
ng"
,
32774
:
"AnswerPrimary
Master
"
,
32769
:
"A
ccep
tIdentification"
,
32771
:
"
Po
ng"
,
32774
:
"AnswerPrimary"
,
32778
:
"AnswerRecovery"
,
32780
:
"AnswerLastIDs"
,
32782
:
"AnswerPartitionTable"
,
...
...
@@ -77,23 +77,23 @@ var pyMsgRegistry = map[uint16]string{
32790
:
"AnswerLockedTransactions"
,
32792
:
"AnswerFinalTID"
,
32795
:
"AnswerBeginTransaction"
,
32798
:
"Answer
FinishTransaction
"
,
32800
:
"Answer
LockInformation
"
,
32804
:
"Answer
Generate
OIDs"
,
32798
:
"Answer
TransactionFinished
"
,
32800
:
"Answer
InformationLocked
"
,
32804
:
"Answer
New
OIDs"
,
32807
:
"AnswerRebaseTransaction"
,
32809
:
"AnswerRebaseObject"
,
32811
:
"AnswerStoreObject"
,
32814
:
"AnswerStoreTransaction"
,
32816
:
"AnswerVoteTransaction"
,
32818
:
"Answer
Get
Object"
,
32820
:
"AnswerTID
List
"
,
32818
:
"AnswerObject"
,
32820
:
"AnswerTID
s
"
,
32822
:
"AnswerTransactionInformation"
,
32824
:
"AnswerObjectHistory"
,
32826
:
"AnswerPartitionList"
,
32828
:
"AnswerNodeList"
,
32837
:
"AnswerClusterState"
,
32839
:
"AnswerObjectUndoSerial"
,
32841
:
"AnswerTID
List
From"
,
32841
:
"AnswerTID
s
From"
,
32843
:
"AnswerPack"
,
32847
:
"AnswerCheckTIDRange"
,
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