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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
5ed8dbde
Commit
5ed8dbde
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
74948883
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
118 additions
and
113 deletions
+118
-113
go/neo/protogen.go
go/neo/protogen.go
+15
-10
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+103
-103
No files found.
go/neo/protogen.go
View file @
5ed8dbde
...
@@ -219,10 +219,13 @@ func (c MsgCode) String() string {
...
@@ -219,10 +219,13 @@ func (c MsgCode) String() string {
return
s
return
s
}
}
// sort MsgCode by
serial
// sort MsgCode by
(serial, answer)
type
BySerial
[]
MsgCode
type
BySerial
[]
MsgCode
func
(
v
BySerial
)
Less
(
i
,
j
int
)
bool
{
return
v
[
i
]
.
msgSerial
<
v
[
j
]
.
msgSerial
}
func
(
v
BySerial
)
Less
(
i
,
j
int
)
bool
{
return
(
v
[
i
]
.
msgSerial
<
v
[
j
]
.
msgSerial
)
||
(
v
[
i
]
.
msgSerial
==
v
[
j
]
.
msgSerial
&&
!
v
[
i
]
.
answer
&&
v
[
j
]
.
answer
)
}
func
(
v
BySerial
)
Swap
(
i
,
j
int
)
{
v
[
i
],
v
[
j
]
=
v
[
j
],
v
[
i
]
}
func
(
v
BySerial
)
Swap
(
i
,
j
int
)
{
v
[
i
],
v
[
j
]
=
v
[
j
],
v
[
i
]
}
func
(
v
BySerial
)
Len
()
int
{
return
len
(
v
)
}
func
(
v
BySerial
)
Len
()
int
{
return
len
(
v
)
}
...
@@ -293,16 +296,18 @@ import (
...
@@ -293,16 +296,18 @@ import (
}
}
// generate code for this type to implement neo.Msg
// generate code for this type to implement neo.Msg
msgCode
:=
MsgCode
{
var
msgCode
MsgCode
msgSerial
:
msgSerial
,
msgCode
.
answer
=
specAnnotation
.
answer
||
strings
.
HasPrefix
(
typename
,
"Answer"
)
answer
:
specAnnotation
.
answer
||
strings
.
HasPrefix
(
typename
,
"Answer"
),
switch
{
}
case
!
msgCode
.
answer
||
typename
==
"Error"
:
msgCode
.
msgSerial
=
msgSerial
fmt
.
Fprintf
(
&
buf
,
"// %d. %s"
,
msgSerial
,
typename
)
// answer to something
if
msgCode
.
answer
{
default
:
fmt
.
Fprintf
(
&
buf
,
" (answer)"
)
msgCode
.
msgSerial
=
msgSerial
-
1
}
}
fmt
.
Fprintf
(
&
buf
,
"
\n\n
"
)
fmt
.
Fprintf
(
&
buf
,
"// %s. %s
\n\n
"
,
msgCode
,
typename
)
buf
.
emit
(
"func (*%s) neoMsgCode() uint16 {"
,
typename
)
buf
.
emit
(
"func (*%s) neoMsgCode() uint16 {"
,
typename
)
buf
.
emit
(
"return %s"
,
msgCode
)
buf
.
emit
(
"return %s"
,
msgCode
)
...
...
go/neo/zproto-marshal.go
View file @
5ed8dbde
...
@@ -14,7 +14,7 @@ import (
...
@@ -14,7 +14,7 @@ import (
// messages marshalling
// messages marshalling
// 0
. Error (answer)
// 0
| answerBit. Error
func
(
*
Error
)
neoMsgCode
()
uint16
{
func
(
*
Error
)
neoMsgCode
()
uint16
{
return
0
|
answerBit
return
0
|
answerBit
...
@@ -123,10 +123,10 @@ overflow:
...
@@ -123,10 +123,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
//
2. AcceptIdentification (answer)
//
1 | answerBit. AcceptIdentification
func
(
*
AcceptIdentification
)
neoMsgCode
()
uint16
{
func
(
*
AcceptIdentification
)
neoMsgCode
()
uint16
{
return
2
|
answerBit
return
1
|
answerBit
}
}
func
(
p
*
AcceptIdentification
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AcceptIdentification
)
neoMsgEncodedLen
()
int
{
...
@@ -173,10 +173,10 @@ func (p *Ping) neoMsgDecode(data []byte) (int, error) {
...
@@ -173,10 +173,10 @@ func (p *Ping) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
return
0
,
nil
}
}
//
4. Pong (answer)
//
3 | answerBit. Pong
func
(
*
Pong
)
neoMsgCode
()
uint16
{
func
(
*
Pong
)
neoMsgCode
()
uint16
{
return
4
|
answerBit
return
3
|
answerBit
}
}
func
(
p
*
Pong
)
neoMsgEncodedLen
()
int
{
func
(
p
*
Pong
)
neoMsgEncodedLen
()
int
{
...
@@ -224,10 +224,10 @@ func (p *PrimaryMaster) neoMsgDecode(data []byte) (int, error) {
...
@@ -224,10 +224,10 @@ func (p *PrimaryMaster) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
return
0
,
nil
}
}
//
7. AnswerPrimary (answer)
//
6 | answerBit. AnswerPrimary
func
(
*
AnswerPrimary
)
neoMsgCode
()
uint16
{
func
(
*
AnswerPrimary
)
neoMsgCode
()
uint16
{
return
7
|
answerBit
return
6
|
answerBit
}
}
func
(
p
*
AnswerPrimary
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerPrimary
)
neoMsgEncodedLen
()
int
{
...
@@ -418,10 +418,10 @@ func (p *Recovery) neoMsgDecode(data []byte) (int, error) {
...
@@ -418,10 +418,10 @@ func (p *Recovery) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
return
0
,
nil
}
}
// 1
1. AnswerRecovery (answer)
// 1
0 | answerBit. AnswerRecovery
func
(
*
AnswerRecovery
)
neoMsgCode
()
uint16
{
func
(
*
AnswerRecovery
)
neoMsgCode
()
uint16
{
return
1
1
|
answerBit
return
1
0
|
answerBit
}
}
func
(
p
*
AnswerRecovery
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerRecovery
)
neoMsgEncodedLen
()
int
{
...
@@ -464,10 +464,10 @@ func (p *LastIDs) neoMsgDecode(data []byte) (int, error) {
...
@@ -464,10 +464,10 @@ func (p *LastIDs) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
return
0
,
nil
}
}
// 1
3. AnswerLastIDs (answer)
// 1
2 | answerBit. AnswerLastIDs
func
(
*
AnswerLastIDs
)
neoMsgCode
()
uint16
{
func
(
*
AnswerLastIDs
)
neoMsgCode
()
uint16
{
return
1
3
|
answerBit
return
1
2
|
answerBit
}
}
func
(
p
*
AnswerLastIDs
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerLastIDs
)
neoMsgEncodedLen
()
int
{
...
@@ -508,10 +508,10 @@ func (p *AskPartitionTable) neoMsgDecode(data []byte) (int, error) {
...
@@ -508,10 +508,10 @@ func (p *AskPartitionTable) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
return
0
,
nil
}
}
// 1
5. AnswerPartitionTable (answer)
// 1
4 | answerBit. AnswerPartitionTable
func
(
*
AnswerPartitionTable
)
neoMsgCode
()
uint16
{
func
(
*
AnswerPartitionTable
)
neoMsgCode
()
uint16
{
return
1
5
|
answerBit
return
1
4
|
answerBit
}
}
func
(
p
*
AnswerPartitionTable
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerPartitionTable
)
neoMsgEncodedLen
()
int
{
...
@@ -815,10 +815,10 @@ overflow:
...
@@ -815,10 +815,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 2
1. AnswerUnfinishedTransactions (answer)
// 2
0 | answerBit. AnswerUnfinishedTransactions
func
(
*
AnswerUnfinishedTransactions
)
neoMsgCode
()
uint16
{
func
(
*
AnswerUnfinishedTransactions
)
neoMsgCode
()
uint16
{
return
2
1
|
answerBit
return
2
0
|
answerBit
}
}
func
(
p
*
AnswerUnfinishedTransactions
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerUnfinishedTransactions
)
neoMsgEncodedLen
()
int
{
...
@@ -882,10 +882,10 @@ func (p *LockedTransactions) neoMsgDecode(data []byte) (int, error) {
...
@@ -882,10 +882,10 @@ func (p *LockedTransactions) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
return
0
,
nil
}
}
// 2
3. AnswerLockedTransactions (answer)
// 2
2 | answerBit. AnswerLockedTransactions
func
(
*
AnswerLockedTransactions
)
neoMsgCode
()
uint16
{
func
(
*
AnswerLockedTransactions
)
neoMsgCode
()
uint16
{
return
2
3
|
answerBit
return
2
2
|
answerBit
}
}
func
(
p
*
AnswerLockedTransactions
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerLockedTransactions
)
neoMsgEncodedLen
()
int
{
...
@@ -961,10 +961,10 @@ overflow:
...
@@ -961,10 +961,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 2
5. AnswerFinalTID (answer)
// 2
4 | answerBit. AnswerFinalTID
func
(
*
AnswerFinalTID
)
neoMsgCode
()
uint16
{
func
(
*
AnswerFinalTID
)
neoMsgCode
()
uint16
{
return
2
5
|
answerBit
return
2
4
|
answerBit
}
}
func
(
p
*
AnswerFinalTID
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerFinalTID
)
neoMsgEncodedLen
()
int
{
...
@@ -1038,10 +1038,10 @@ overflow:
...
@@ -1038,10 +1038,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 2
8. AnswerBeginTransaction (answer)
// 2
7 | answerBit. AnswerBeginTransaction
func
(
*
AnswerBeginTransaction
)
neoMsgCode
()
uint16
{
func
(
*
AnswerBeginTransaction
)
neoMsgCode
()
uint16
{
return
2
8
|
answerBit
return
2
7
|
answerBit
}
}
func
(
p
*
AnswerBeginTransaction
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerBeginTransaction
)
neoMsgEncodedLen
()
int
{
...
@@ -1187,10 +1187,10 @@ overflow:
...
@@ -1187,10 +1187,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 3
1. AnswerTransactionFinished (answer)
// 3
0 | answerBit. AnswerTransactionFinished
func
(
*
AnswerTransactionFinished
)
neoMsgCode
()
uint16
{
func
(
*
AnswerTransactionFinished
)
neoMsgCode
()
uint16
{
return
3
1
|
answerBit
return
3
0
|
answerBit
}
}
func
(
p
*
AnswerTransactionFinished
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerTransactionFinished
)
neoMsgEncodedLen
()
int
{
...
@@ -1241,10 +1241,10 @@ overflow:
...
@@ -1241,10 +1241,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 3
3. AnswerInformationLocked (answer)
// 3
2 | answerBit. AnswerInformationLocked
func
(
*
AnswerInformationLocked
)
neoMsgCode
()
uint16
{
func
(
*
AnswerInformationLocked
)
neoMsgCode
()
uint16
{
return
3
3
|
answerBit
return
3
2
|
answerBit
}
}
func
(
p
*
AnswerInformationLocked
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerInformationLocked
)
neoMsgEncodedLen
()
int
{
...
@@ -1366,10 +1366,10 @@ overflow:
...
@@ -1366,10 +1366,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 3
7. AnswerNewOIDs (answer)
// 3
6 | answerBit. AnswerNewOIDs
func
(
*
AnswerNewOIDs
)
neoMsgCode
()
uint16
{
func
(
*
AnswerNewOIDs
)
neoMsgCode
()
uint16
{
return
3
7
|
answerBit
return
3
6
|
answerBit
}
}
func
(
p
*
AnswerNewOIDs
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerNewOIDs
)
neoMsgEncodedLen
()
int
{
...
@@ -1468,10 +1468,10 @@ overflow:
...
@@ -1468,10 +1468,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
//
40. AnswerRebaseTransaction (answer)
//
39 | answerBit. AnswerRebaseTransaction
func
(
*
AnswerRebaseTransaction
)
neoMsgCode
()
uint16
{
func
(
*
AnswerRebaseTransaction
)
neoMsgCode
()
uint16
{
return
40
|
answerBit
return
39
|
answerBit
}
}
func
(
p
*
AnswerRebaseTransaction
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerRebaseTransaction
)
neoMsgEncodedLen
()
int
{
...
@@ -1543,10 +1543,10 @@ overflow:
...
@@ -1543,10 +1543,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 4
2. AnswerRebaseObject (answer)
// 4
1 | answerBit. AnswerRebaseObject
func
(
*
AnswerRebaseObject
)
neoMsgCode
()
uint16
{
func
(
*
AnswerRebaseObject
)
neoMsgCode
()
uint16
{
return
4
2
|
answerBit
return
4
1
|
answerBit
}
}
func
(
p
*
AnswerRebaseObject
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerRebaseObject
)
neoMsgEncodedLen
()
int
{
...
@@ -1647,10 +1647,10 @@ overflow:
...
@@ -1647,10 +1647,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 4
4. AnswerStoreObject (answer)
// 4
3 | answerBit. AnswerStoreObject
func
(
*
AnswerStoreObject
)
neoMsgCode
()
uint16
{
func
(
*
AnswerStoreObject
)
neoMsgCode
()
uint16
{
return
4
4
|
answerBit
return
4
3
|
answerBit
}
}
func
(
p
*
AnswerStoreObject
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerStoreObject
)
neoMsgEncodedLen
()
int
{
...
@@ -1823,10 +1823,10 @@ overflow:
...
@@ -1823,10 +1823,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 4
7. AnswerStoreTransaction (answer)
// 4
6 | answerBit. AnswerStoreTransaction
func
(
*
AnswerStoreTransaction
)
neoMsgCode
()
uint16
{
func
(
*
AnswerStoreTransaction
)
neoMsgCode
()
uint16
{
return
4
7
|
answerBit
return
4
6
|
answerBit
}
}
func
(
p
*
AnswerStoreTransaction
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerStoreTransaction
)
neoMsgEncodedLen
()
int
{
...
@@ -1865,10 +1865,10 @@ overflow:
...
@@ -1865,10 +1865,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 4
9. AnswerVoteTransaction (answer)
// 4
8 | answerBit. AnswerVoteTransaction
func
(
*
AnswerVoteTransaction
)
neoMsgCode
()
uint16
{
func
(
*
AnswerVoteTransaction
)
neoMsgCode
()
uint16
{
return
4
9
|
answerBit
return
4
8
|
answerBit
}
}
func
(
p
*
AnswerVoteTransaction
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerVoteTransaction
)
neoMsgEncodedLen
()
int
{
...
@@ -1911,10 +1911,10 @@ overflow:
...
@@ -1911,10 +1911,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 5
1. AnswerObject (answer)
// 5
0 | answerBit. AnswerObject
func
(
*
AnswerObject
)
neoMsgCode
()
uint16
{
func
(
*
AnswerObject
)
neoMsgCode
()
uint16
{
return
5
1
|
answerBit
return
5
0
|
answerBit
}
}
func
(
p
*
AnswerObject
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerObject
)
neoMsgEncodedLen
()
int
{
...
@@ -1994,10 +1994,10 @@ overflow:
...
@@ -1994,10 +1994,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 5
3. AnswerTIDs (answer)
// 5
2 | answerBit. AnswerTIDs
func
(
*
AnswerTIDs
)
neoMsgCode
()
uint16
{
func
(
*
AnswerTIDs
)
neoMsgCode
()
uint16
{
return
5
3
|
answerBit
return
5
2
|
answerBit
}
}
func
(
p
*
AnswerTIDs
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerTIDs
)
neoMsgEncodedLen
()
int
{
...
@@ -2067,10 +2067,10 @@ overflow:
...
@@ -2067,10 +2067,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 5
5. AnswerTransactionInformation (answer)
// 5
4 | answerBit. AnswerTransactionInformation
func
(
*
AnswerTransactionInformation
)
neoMsgCode
()
uint16
{
func
(
*
AnswerTransactionInformation
)
neoMsgCode
()
uint16
{
return
5
5
|
answerBit
return
5
4
|
answerBit
}
}
func
(
p
*
AnswerTransactionInformation
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerTransactionInformation
)
neoMsgEncodedLen
()
int
{
...
@@ -2199,10 +2199,10 @@ overflow:
...
@@ -2199,10 +2199,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 5
7. AnswerObjectHistory (answer)
// 5
6 | answerBit. AnswerObjectHistory
func
(
*
AnswerObjectHistory
)
neoMsgCode
()
uint16
{
func
(
*
AnswerObjectHistory
)
neoMsgCode
()
uint16
{
return
5
7
|
answerBit
return
5
6
|
answerBit
}
}
func
(
p
*
AnswerObjectHistory
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerObjectHistory
)
neoMsgEncodedLen
()
int
{
...
@@ -2283,10 +2283,10 @@ overflow:
...
@@ -2283,10 +2283,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 5
9. AnswerPartitionList (answer)
// 5
8 | answerBit. AnswerPartitionList
func
(
*
AnswerPartitionList
)
neoMsgCode
()
uint16
{
func
(
*
AnswerPartitionList
)
neoMsgCode
()
uint16
{
return
5
9
|
answerBit
return
5
8
|
answerBit
}
}
func
(
p
*
AnswerPartitionList
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerPartitionList
)
neoMsgEncodedLen
()
int
{
...
@@ -2388,10 +2388,10 @@ overflow:
...
@@ -2388,10 +2388,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 6
1. AnswerNodeList (answer)
// 6
0 | answerBit. AnswerNodeList
func
(
*
AnswerNodeList
)
neoMsgCode
()
uint16
{
func
(
*
AnswerNodeList
)
neoMsgCode
()
uint16
{
return
6
1
|
answerBit
return
6
0
|
answerBit
}
}
func
(
p
*
AnswerNodeList
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerNodeList
)
neoMsgEncodedLen
()
int
{
...
@@ -2731,10 +2731,10 @@ func (p *AskClusterState) neoMsgDecode(data []byte) (int, error) {
...
@@ -2731,10 +2731,10 @@ func (p *AskClusterState) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
return
0
,
nil
}
}
//
70. AnswerClusterState (answer)
//
69 | answerBit. AnswerClusterState
func
(
*
AnswerClusterState
)
neoMsgCode
()
uint16
{
func
(
*
AnswerClusterState
)
neoMsgCode
()
uint16
{
return
70
|
answerBit
return
69
|
answerBit
}
}
func
(
p
*
AnswerClusterState
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerClusterState
)
neoMsgEncodedLen
()
int
{
...
@@ -2810,10 +2810,10 @@ overflow:
...
@@ -2810,10 +2810,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 7
2. AnswerObjectUndoSerial (answer)
// 7
1 | answerBit. AnswerObjectUndoSerial
func
(
*
AnswerObjectUndoSerial
)
neoMsgCode
()
uint16
{
func
(
*
AnswerObjectUndoSerial
)
neoMsgCode
()
uint16
{
return
7
2
|
answerBit
return
7
1
|
answerBit
}
}
func
(
p
*
AnswerObjectUndoSerial
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerObjectUndoSerial
)
neoMsgEncodedLen
()
int
{
...
@@ -2909,10 +2909,10 @@ overflow:
...
@@ -2909,10 +2909,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 7
4. AnswerTIDsFrom (answer)
// 7
3 | answerBit. AnswerTIDsFrom
func
(
*
AnswerTIDsFrom
)
neoMsgCode
()
uint16
{
func
(
*
AnswerTIDsFrom
)
neoMsgCode
()
uint16
{
return
7
4
|
answerBit
return
7
3
|
answerBit
}
}
func
(
p
*
AnswerTIDsFrom
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerTIDsFrom
)
neoMsgEncodedLen
()
int
{
...
@@ -2982,10 +2982,10 @@ overflow:
...
@@ -2982,10 +2982,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 7
6. AnswerPack (answer)
// 7
5 | answerBit. AnswerPack
func
(
*
AnswerPack
)
neoMsgCode
()
uint16
{
func
(
*
AnswerPack
)
neoMsgCode
()
uint16
{
return
7
6
|
answerBit
return
7
5
|
answerBit
}
}
func
(
p
*
AnswerPack
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerPack
)
neoMsgEncodedLen
()
int
{
...
@@ -3162,10 +3162,10 @@ overflow:
...
@@ -3162,10 +3162,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
//
80. AnswerCheckTIDRange (answer)
//
79 | answerBit. AnswerCheckTIDRange
func
(
*
AnswerCheckTIDRange
)
neoMsgCode
()
uint16
{
func
(
*
AnswerCheckTIDRange
)
neoMsgCode
()
uint16
{
return
80
|
answerBit
return
79
|
answerBit
}
}
func
(
p
*
AnswerCheckTIDRange
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerCheckTIDRange
)
neoMsgEncodedLen
()
int
{
...
@@ -3224,10 +3224,10 @@ overflow:
...
@@ -3224,10 +3224,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 8
2. AnswerCheckSerialRange (answer)
// 8
1 | answerBit. AnswerCheckSerialRange
func
(
*
AnswerCheckSerialRange
)
neoMsgCode
()
uint16
{
func
(
*
AnswerCheckSerialRange
)
neoMsgCode
()
uint16
{
return
8
2
|
answerBit
return
8
1
|
answerBit
}
}
func
(
p
*
AnswerCheckSerialRange
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerCheckSerialRange
)
neoMsgEncodedLen
()
int
{
...
@@ -3341,10 +3341,10 @@ func (p *LastTransaction) neoMsgDecode(data []byte) (int, error) {
...
@@ -3341,10 +3341,10 @@ func (p *LastTransaction) neoMsgDecode(data []byte) (int, error) {
return
0
,
nil
return
0
,
nil
}
}
// 8
6. AnswerLastTransaction (answer)
// 8
5 | answerBit. AnswerLastTransaction
func
(
*
AnswerLastTransaction
)
neoMsgCode
()
uint16
{
func
(
*
AnswerLastTransaction
)
neoMsgCode
()
uint16
{
return
8
6
|
answerBit
return
8
5
|
answerBit
}
}
func
(
p
*
AnswerLastTransaction
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerLastTransaction
)
neoMsgEncodedLen
()
int
{
...
@@ -3395,10 +3395,10 @@ overflow:
...
@@ -3395,10 +3395,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 8
8. AnswerCheckCurrentSerial (answer)
// 8
7 | answerBit. AnswerCheckCurrentSerial
func
(
*
AnswerCheckCurrentSerial
)
neoMsgCode
()
uint16
{
func
(
*
AnswerCheckCurrentSerial
)
neoMsgCode
()
uint16
{
return
8
8
|
answerBit
return
8
7
|
answerBit
}
}
func
(
p
*
AnswerCheckCurrentSerial
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerCheckCurrentSerial
)
neoMsgEncodedLen
()
int
{
...
@@ -3621,10 +3621,10 @@ overflow:
...
@@ -3621,10 +3621,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 9
3. AnswerFetchTransactions (answer)
// 9
2 | answerBit. AnswerFetchTransactions
func
(
*
AnswerFetchTransactions
)
neoMsgCode
()
uint16
{
func
(
*
AnswerFetchTransactions
)
neoMsgCode
()
uint16
{
return
9
3
|
answerBit
return
9
2
|
answerBit
}
}
func
(
p
*
AnswerFetchTransactions
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerFetchTransactions
)
neoMsgEncodedLen
()
int
{
...
@@ -3764,10 +3764,10 @@ overflow:
...
@@ -3764,10 +3764,10 @@ overflow:
return
0
,
ErrDecodeOverflow
return
0
,
ErrDecodeOverflow
}
}
// 9
5. AnswerFetchObjects (answer)
// 9
4 | answerBit. AnswerFetchObjects
func
(
*
AnswerFetchObjects
)
neoMsgCode
()
uint16
{
func
(
*
AnswerFetchObjects
)
neoMsgCode
()
uint16
{
return
9
5
|
answerBit
return
9
4
|
answerBit
}
}
func
(
p
*
AnswerFetchObjects
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerFetchObjects
)
neoMsgEncodedLen
()
int
{
...
@@ -4037,66 +4037,66 @@ overflow:
...
@@ -4037,66 +4037,66 @@ overflow:
var
msgTypeRegistry
=
map
[
uint16
]
reflect
.
Type
{
var
msgTypeRegistry
=
map
[
uint16
]
reflect
.
Type
{
0
|
answerBit
:
reflect
.
TypeOf
(
Error
{}),
0
|
answerBit
:
reflect
.
TypeOf
(
Error
{}),
1
:
reflect
.
TypeOf
(
RequestIdentification
{}),
1
:
reflect
.
TypeOf
(
RequestIdentification
{}),
2
|
answerBit
:
reflect
.
TypeOf
(
AcceptIdentification
{}),
1
|
answerBit
:
reflect
.
TypeOf
(
AcceptIdentification
{}),
3
:
reflect
.
TypeOf
(
Ping
{}),
3
:
reflect
.
TypeOf
(
Ping
{}),
4
|
answerBit
:
reflect
.
TypeOf
(
Pong
{}),
3
|
answerBit
:
reflect
.
TypeOf
(
Pong
{}),
5
:
reflect
.
TypeOf
(
CloseClient
{}),
5
:
reflect
.
TypeOf
(
CloseClient
{}),
6
:
reflect
.
TypeOf
(
PrimaryMaster
{}),
6
:
reflect
.
TypeOf
(
PrimaryMaster
{}),
7
|
answerBit
:
reflect
.
TypeOf
(
AnswerPrimary
{}),
6
|
answerBit
:
reflect
.
TypeOf
(
AnswerPrimary
{}),
8
:
reflect
.
TypeOf
(
NotPrimaryMaster
{}),
8
:
reflect
.
TypeOf
(
NotPrimaryMaster
{}),
9
:
reflect
.
TypeOf
(
NotifyNodeInformation
{}),
9
:
reflect
.
TypeOf
(
NotifyNodeInformation
{}),
10
:
reflect
.
TypeOf
(
Recovery
{}),
10
:
reflect
.
TypeOf
(
Recovery
{}),
1
1
|
answerBit
:
reflect
.
TypeOf
(
AnswerRecovery
{}),
1
0
|
answerBit
:
reflect
.
TypeOf
(
AnswerRecovery
{}),
12
:
reflect
.
TypeOf
(
LastIDs
{}),
12
:
reflect
.
TypeOf
(
LastIDs
{}),
1
3
|
answerBit
:
reflect
.
TypeOf
(
AnswerLastIDs
{}),
1
2
|
answerBit
:
reflect
.
TypeOf
(
AnswerLastIDs
{}),
14
:
reflect
.
TypeOf
(
AskPartitionTable
{}),
14
:
reflect
.
TypeOf
(
AskPartitionTable
{}),
1
5
|
answerBit
:
reflect
.
TypeOf
(
AnswerPartitionTable
{}),
1
4
|
answerBit
:
reflect
.
TypeOf
(
AnswerPartitionTable
{}),
16
:
reflect
.
TypeOf
(
SendPartitionTable
{}),
16
:
reflect
.
TypeOf
(
SendPartitionTable
{}),
17
:
reflect
.
TypeOf
(
NotifyPartitionChanges
{}),
17
:
reflect
.
TypeOf
(
NotifyPartitionChanges
{}),
18
:
reflect
.
TypeOf
(
StartOperation
{}),
18
:
reflect
.
TypeOf
(
StartOperation
{}),
19
:
reflect
.
TypeOf
(
StopOperation
{}),
19
:
reflect
.
TypeOf
(
StopOperation
{}),
20
:
reflect
.
TypeOf
(
UnfinishedTransactions
{}),
20
:
reflect
.
TypeOf
(
UnfinishedTransactions
{}),
2
1
|
answerBit
:
reflect
.
TypeOf
(
AnswerUnfinishedTransactions
{}),
2
0
|
answerBit
:
reflect
.
TypeOf
(
AnswerUnfinishedTransactions
{}),
22
:
reflect
.
TypeOf
(
LockedTransactions
{}),
22
:
reflect
.
TypeOf
(
LockedTransactions
{}),
2
3
|
answerBit
:
reflect
.
TypeOf
(
AnswerLockedTransactions
{}),
2
2
|
answerBit
:
reflect
.
TypeOf
(
AnswerLockedTransactions
{}),
24
:
reflect
.
TypeOf
(
FinalTID
{}),
24
:
reflect
.
TypeOf
(
FinalTID
{}),
2
5
|
answerBit
:
reflect
.
TypeOf
(
AnswerFinalTID
{}),
2
4
|
answerBit
:
reflect
.
TypeOf
(
AnswerFinalTID
{}),
26
:
reflect
.
TypeOf
(
ValidateTransaction
{}),
26
:
reflect
.
TypeOf
(
ValidateTransaction
{}),
27
:
reflect
.
TypeOf
(
BeginTransaction
{}),
27
:
reflect
.
TypeOf
(
BeginTransaction
{}),
2
8
|
answerBit
:
reflect
.
TypeOf
(
AnswerBeginTransaction
{}),
2
7
|
answerBit
:
reflect
.
TypeOf
(
AnswerBeginTransaction
{}),
29
:
reflect
.
TypeOf
(
FailedVote
{}),
29
:
reflect
.
TypeOf
(
FailedVote
{}),
30
:
reflect
.
TypeOf
(
FinishTransaction
{}),
30
:
reflect
.
TypeOf
(
FinishTransaction
{}),
3
1
|
answerBit
:
reflect
.
TypeOf
(
AnswerTransactionFinished
{}),
3
0
|
answerBit
:
reflect
.
TypeOf
(
AnswerTransactionFinished
{}),
32
:
reflect
.
TypeOf
(
LockInformation
{}),
32
:
reflect
.
TypeOf
(
LockInformation
{}),
3
3
|
answerBit
:
reflect
.
TypeOf
(
AnswerInformationLocked
{}),
3
2
|
answerBit
:
reflect
.
TypeOf
(
AnswerInformationLocked
{}),
34
:
reflect
.
TypeOf
(
InvalidateObjects
{}),
34
:
reflect
.
TypeOf
(
InvalidateObjects
{}),
35
:
reflect
.
TypeOf
(
NotifyUnlockInformation
{}),
35
:
reflect
.
TypeOf
(
NotifyUnlockInformation
{}),
36
:
reflect
.
TypeOf
(
AskNewOIDs
{}),
36
:
reflect
.
TypeOf
(
AskNewOIDs
{}),
3
7
|
answerBit
:
reflect
.
TypeOf
(
AnswerNewOIDs
{}),
3
6
|
answerBit
:
reflect
.
TypeOf
(
AnswerNewOIDs
{}),
38
:
reflect
.
TypeOf
(
NotifyDeadlock
{}),
38
:
reflect
.
TypeOf
(
NotifyDeadlock
{}),
39
:
reflect
.
TypeOf
(
RebaseTransaction
{}),
39
:
reflect
.
TypeOf
(
RebaseTransaction
{}),
40
|
answerBit
:
reflect
.
TypeOf
(
AnswerRebaseTransaction
{}),
39
|
answerBit
:
reflect
.
TypeOf
(
AnswerRebaseTransaction
{}),
41
:
reflect
.
TypeOf
(
RebaseObject
{}),
41
:
reflect
.
TypeOf
(
RebaseObject
{}),
4
2
|
answerBit
:
reflect
.
TypeOf
(
AnswerRebaseObject
{}),
4
1
|
answerBit
:
reflect
.
TypeOf
(
AnswerRebaseObject
{}),
43
:
reflect
.
TypeOf
(
StoreObject
{}),
43
:
reflect
.
TypeOf
(
StoreObject
{}),
4
4
|
answerBit
:
reflect
.
TypeOf
(
AnswerStoreObject
{}),
4
3
|
answerBit
:
reflect
.
TypeOf
(
AnswerStoreObject
{}),
45
:
reflect
.
TypeOf
(
AbortTransaction
{}),
45
:
reflect
.
TypeOf
(
AbortTransaction
{}),
46
:
reflect
.
TypeOf
(
StoreTransaction
{}),
46
:
reflect
.
TypeOf
(
StoreTransaction
{}),
4
7
|
answerBit
:
reflect
.
TypeOf
(
AnswerStoreTransaction
{}),
4
6
|
answerBit
:
reflect
.
TypeOf
(
AnswerStoreTransaction
{}),
48
:
reflect
.
TypeOf
(
VoteTransaction
{}),
48
:
reflect
.
TypeOf
(
VoteTransaction
{}),
4
9
|
answerBit
:
reflect
.
TypeOf
(
AnswerVoteTransaction
{}),
4
8
|
answerBit
:
reflect
.
TypeOf
(
AnswerVoteTransaction
{}),
50
:
reflect
.
TypeOf
(
GetObject
{}),
50
:
reflect
.
TypeOf
(
GetObject
{}),
5
1
|
answerBit
:
reflect
.
TypeOf
(
AnswerObject
{}),
5
0
|
answerBit
:
reflect
.
TypeOf
(
AnswerObject
{}),
52
:
reflect
.
TypeOf
(
AskTIDs
{}),
52
:
reflect
.
TypeOf
(
AskTIDs
{}),
5
3
|
answerBit
:
reflect
.
TypeOf
(
AnswerTIDs
{}),
5
2
|
answerBit
:
reflect
.
TypeOf
(
AnswerTIDs
{}),
54
:
reflect
.
TypeOf
(
TransactionInformation
{}),
54
:
reflect
.
TypeOf
(
TransactionInformation
{}),
5
5
|
answerBit
:
reflect
.
TypeOf
(
AnswerTransactionInformation
{}),
5
4
|
answerBit
:
reflect
.
TypeOf
(
AnswerTransactionInformation
{}),
56
:
reflect
.
TypeOf
(
ObjectHistory
{}),
56
:
reflect
.
TypeOf
(
ObjectHistory
{}),
5
7
|
answerBit
:
reflect
.
TypeOf
(
AnswerObjectHistory
{}),
5
6
|
answerBit
:
reflect
.
TypeOf
(
AnswerObjectHistory
{}),
58
:
reflect
.
TypeOf
(
PartitionList
{}),
58
:
reflect
.
TypeOf
(
PartitionList
{}),
5
9
|
answerBit
:
reflect
.
TypeOf
(
AnswerPartitionList
{}),
5
8
|
answerBit
:
reflect
.
TypeOf
(
AnswerPartitionList
{}),
60
:
reflect
.
TypeOf
(
NodeList
{}),
60
:
reflect
.
TypeOf
(
NodeList
{}),
6
1
|
answerBit
:
reflect
.
TypeOf
(
AnswerNodeList
{}),
6
0
|
answerBit
:
reflect
.
TypeOf
(
AnswerNodeList
{}),
62
:
reflect
.
TypeOf
(
SetNodeState
{}),
62
:
reflect
.
TypeOf
(
SetNodeState
{}),
63
:
reflect
.
TypeOf
(
AddPendingNodes
{}),
63
:
reflect
.
TypeOf
(
AddPendingNodes
{}),
64
:
reflect
.
TypeOf
(
TweakPartitionTable
{}),
64
:
reflect
.
TypeOf
(
TweakPartitionTable
{}),
...
@@ -4105,32 +4105,32 @@ var msgTypeRegistry = map[uint16]reflect.Type{
...
@@ -4105,32 +4105,32 @@ var msgTypeRegistry = map[uint16]reflect.Type{
67
:
reflect
.
TypeOf
(
RepairOne
{}),
67
:
reflect
.
TypeOf
(
RepairOne
{}),
68
:
reflect
.
TypeOf
(
NotifyClusterState
{}),
68
:
reflect
.
TypeOf
(
NotifyClusterState
{}),
69
:
reflect
.
TypeOf
(
AskClusterState
{}),
69
:
reflect
.
TypeOf
(
AskClusterState
{}),
70
|
answerBit
:
reflect
.
TypeOf
(
AnswerClusterState
{}),
69
|
answerBit
:
reflect
.
TypeOf
(
AnswerClusterState
{}),
71
:
reflect
.
TypeOf
(
ObjectUndoSerial
{}),
71
:
reflect
.
TypeOf
(
ObjectUndoSerial
{}),
7
2
|
answerBit
:
reflect
.
TypeOf
(
AnswerObjectUndoSerial
{}),
7
1
|
answerBit
:
reflect
.
TypeOf
(
AnswerObjectUndoSerial
{}),
73
:
reflect
.
TypeOf
(
AskTIDsFrom
{}),
73
:
reflect
.
TypeOf
(
AskTIDsFrom
{}),
7
4
|
answerBit
:
reflect
.
TypeOf
(
AnswerTIDsFrom
{}),
7
3
|
answerBit
:
reflect
.
TypeOf
(
AnswerTIDsFrom
{}),
75
:
reflect
.
TypeOf
(
Pack
{}),
75
:
reflect
.
TypeOf
(
Pack
{}),
7
6
|
answerBit
:
reflect
.
TypeOf
(
AnswerPack
{}),
7
5
|
answerBit
:
reflect
.
TypeOf
(
AnswerPack
{}),
77
:
reflect
.
TypeOf
(
CheckReplicas
{}),
77
:
reflect
.
TypeOf
(
CheckReplicas
{}),
78
:
reflect
.
TypeOf
(
CheckPartition
{}),
78
:
reflect
.
TypeOf
(
CheckPartition
{}),
79
:
reflect
.
TypeOf
(
CheckTIDRange
{}),
79
:
reflect
.
TypeOf
(
CheckTIDRange
{}),
80
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckTIDRange
{}),
79
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckTIDRange
{}),
81
:
reflect
.
TypeOf
(
CheckSerialRange
{}),
81
:
reflect
.
TypeOf
(
CheckSerialRange
{}),
8
2
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckSerialRange
{}),
8
1
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckSerialRange
{}),
83
:
reflect
.
TypeOf
(
PartitionCorrupted
{}),
83
:
reflect
.
TypeOf
(
PartitionCorrupted
{}),
84
:
reflect
.
TypeOf
(
NotifyReady
{}),
84
:
reflect
.
TypeOf
(
NotifyReady
{}),
85
:
reflect
.
TypeOf
(
LastTransaction
{}),
85
:
reflect
.
TypeOf
(
LastTransaction
{}),
8
6
|
answerBit
:
reflect
.
TypeOf
(
AnswerLastTransaction
{}),
8
5
|
answerBit
:
reflect
.
TypeOf
(
AnswerLastTransaction
{}),
87
:
reflect
.
TypeOf
(
CheckCurrentSerial
{}),
87
:
reflect
.
TypeOf
(
CheckCurrentSerial
{}),
8
8
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckCurrentSerial
{}),
8
7
|
answerBit
:
reflect
.
TypeOf
(
AnswerCheckCurrentSerial
{}),
89
:
reflect
.
TypeOf
(
NotifyTransactionFinished
{}),
89
:
reflect
.
TypeOf
(
NotifyTransactionFinished
{}),
90
:
reflect
.
TypeOf
(
Replicate
{}),
90
:
reflect
.
TypeOf
(
Replicate
{}),
91
:
reflect
.
TypeOf
(
ReplicationDone
{}),
91
:
reflect
.
TypeOf
(
ReplicationDone
{}),
92
:
reflect
.
TypeOf
(
FetchTransactions
{}),
92
:
reflect
.
TypeOf
(
FetchTransactions
{}),
9
3
|
answerBit
:
reflect
.
TypeOf
(
AnswerFetchTransactions
{}),
9
2
|
answerBit
:
reflect
.
TypeOf
(
AnswerFetchTransactions
{}),
94
:
reflect
.
TypeOf
(
FetchObjects
{}),
94
:
reflect
.
TypeOf
(
FetchObjects
{}),
9
5
|
answerBit
:
reflect
.
TypeOf
(
AnswerFetchObjects
{}),
9
4
|
answerBit
:
reflect
.
TypeOf
(
AnswerFetchObjects
{}),
96
:
reflect
.
TypeOf
(
AddTransaction
{}),
96
:
reflect
.
TypeOf
(
AddTransaction
{}),
97
:
reflect
.
TypeOf
(
AddObject
{}),
97
:
reflect
.
TypeOf
(
AddObject
{}),
98
:
reflect
.
TypeOf
(
Truncate
{}),
98
:
reflect
.
TypeOf
(
Truncate
{}),
...
...
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