Commit 7e4e3213 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 27a72fd2
...@@ -20,6 +20,20 @@ ...@@ -20,6 +20,20 @@
# See https://www.nexedi.com/licensing for rationale and options. # See https://www.nexedi.com/licensing for rationale and options.
"""generate registry of neo/py packet codes for tests""" """generate registry of neo/py packet codes for tests"""
# things that are renamed a bit
# pyname -> goname
renames = {}
def noask(name):
renames['Ask'+name] = name
noask('Recovery')
noask('LastIDs')
noask('UnfinishedTransactions')
noask('LockedTransactions')
noask('FinalTID')
def main(): def main():
pyprotog = {} pyprotog = {}
execfile('../../neo/lib/protocol.py', pyprotog) execfile('../../neo/lib/protocol.py', pyprotog)
...@@ -51,7 +65,9 @@ def main(): ...@@ -51,7 +65,9 @@ def main():
pypktv.sort(key=lambda pkt: pkt._code) pypktv.sort(key=lambda pkt: pkt._code)
for pypkt in pypktv: for pypkt in pypktv:
emit('\t%d:\t"%s",' % (pypkt._code, pypkt._x_use_name)) name = pypkt._x_use_name
name = renames.get(name, name)
emit('\t%d:\t"%s",' % (pypkt._code, name))
#pycodev = pypackets.keys() #pycodev = pypackets.keys()
#pycodev.sort() #pycodev.sort()
......
...@@ -8,16 +8,16 @@ var pyMsgRegistry = map[uint16]string{ ...@@ -8,16 +8,16 @@ var pyMsgRegistry = map[uint16]string{
6: "AskPrimary", 6: "AskPrimary",
8: "NotPrimaryMaster", 8: "NotPrimaryMaster",
9: "NotifyNodeInformation", 9: "NotifyNodeInformation",
10: "AskRecovery", 10: "Recovery",
12: "AskLastIDs", 12: "LastIDs",
14: "AskPartitionTable", 14: "AskPartitionTable",
16: "SendPartitionTable", 16: "SendPartitionTable",
17: "NotifyPartitionChanges", 17: "NotifyPartitionChanges",
18: "StartOperation", 18: "StartOperation",
19: "StopOperation", 19: "StopOperation",
20: "AskUnfinishedTransactions", 20: "UnfinishedTransactions",
22: "AskLockedTransactions", 22: "LockedTransactions",
24: "AskFinalTID", 24: "FinalTID",
26: "ValidateTransaction", 26: "ValidateTransaction",
27: "AskBeginTransaction", 27: "AskBeginTransaction",
29: "FailedVote", 29: "FailedVote",
......
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