Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
7fc32050
Commit
7fc32050
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
7e4e3213
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
34 deletions
+35
-34
go/neo/proto.go
go/neo/proto.go
+5
-7
go/neo/py/pyneo-gen-testdata
go/neo/py/pyneo-gen-testdata
+3
-0
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+24
-24
go/neo/ztestdata_proto_py_test.go
go/neo/ztestdata_proto_py_test.go
+3
-3
No files found.
go/neo/proto.go
View file @
7fc32050
...
...
@@ -478,30 +478,28 @@ type FinishTransaction struct {
CheckedList
[]
zodb
.
Oid
}
type
Answer
FinishTransaction
struct
{
TT
ID
zodb
.
Tid
type
Answer
TransactionFinished
struct
{
TT
id
zodb
.
Tid
Tid
zodb
.
Tid
}
/* XXX move vvv
// Notify that a transaction blocking a replication is now finished
// M -> S
type NotifyTransactionFinished struct {
TTID zodb.Tid
MaxTID zodb.Tid
}
*/
// XXX move vvv
/*
// Lock information on a transaction. PM -> S.
// Notify information on a transaction locked. S -> PM.
type
LockInformation
struct
{
Ttid
zodb
.
Tid
Tid
zodb
.
Tid
}
*/
// XXX AnswerInformationLocked ?
type
AnswerLockInformation
struct
{
type
AnswerInformationLocked
struct
{
Ttid
zodb
.
Tid
}
...
...
go/neo/py/pyneo-gen-testdata
View file @
7fc32050
...
...
@@ -32,6 +32,9 @@ noask('LastIDs')
noask
(
'UnfinishedTransactions'
)
noask
(
'LockedTransactions'
)
noask
(
'FinalTID'
)
noask
(
'BeginTransaction'
)
noask
(
'FinishTransaction'
)
noask
(
'LockInformation'
)
def
main
():
...
...
go/neo/zproto-marshal.go
View file @
7fc32050
...
...
@@ -1187,26 +1187,26 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 31. Answer
FinishTransaction
// 31. Answer
TransactionFinished
func
(
*
Answer
FinishTransaction
)
neoMsgCode
()
uint16
{
func
(
*
Answer
TransactionFinished
)
neoMsgCode
()
uint16
{
return
31
|
answerBit
}
func
(
p
*
Answer
FinishTransaction
)
neoMsgEncodedLen
()
int
{
func
(
p
*
Answer
TransactionFinished
)
neoMsgEncodedLen
()
int
{
return
16
}
func
(
p
*
Answer
FinishTransaction
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
TT
ID
))
func
(
p
*
Answer
TransactionFinished
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
TT
id
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
Tid
))
}
func
(
p
*
Answer
FinishTransaction
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
Answer
TransactionFinished
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
16
{
goto
overflow
}
p
.
TT
ID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
TT
id
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
Tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
return
16
,
nil
...
...
@@ -1214,48 +1214,48 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 32.
NotifyTransactionFinished
// 32.
LockInformation
func
(
*
NotifyTransactionFinished
)
neoMsgCode
()
uint16
{
func
(
*
LockInformation
)
neoMsgCode
()
uint16
{
return
32
}
func
(
p
*
NotifyTransactionFinished
)
neoMsgEncodedLen
()
int
{
func
(
p
*
LockInformation
)
neoMsgEncodedLen
()
int
{
return
16
}
func
(
p
*
NotifyTransactionFinished
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
T
TID
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
MaxTID
))
func
(
p
*
LockInformation
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
T
tid
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
Tid
))
}
func
(
p
*
NotifyTransactionFinished
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
LockInformation
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
16
{
goto
overflow
}
p
.
T
TID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
MaxTID
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
T
tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
Tid
=
zodb
.
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
return
16
,
nil
overflow
:
return
0
,
ErrDecodeOverflow
}
// 33. Answer
LockInformation
// 33. Answer
InformationLocked
func
(
*
Answer
LockInformation
)
neoMsgCode
()
uint16
{
func
(
*
Answer
InformationLocked
)
neoMsgCode
()
uint16
{
return
33
|
answerBit
}
func
(
p
*
Answer
LockInformation
)
neoMsgEncodedLen
()
int
{
func
(
p
*
Answer
InformationLocked
)
neoMsgEncodedLen
()
int
{
return
8
}
func
(
p
*
Answer
LockInformation
)
neoMsgEncode
(
data
[]
byte
)
{
func
(
p
*
Answer
InformationLocked
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
Ttid
))
}
func
(
p
*
Answer
LockInformation
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
Answer
InformationLocked
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
8
{
goto
overflow
}
...
...
@@ -3470,9 +3470,9 @@ var msgTypeRegistry = map[uint16]reflect.Type{
28
|
answerBit
:
reflect
.
TypeOf
(
AnswerBeginTransaction
{}),
29
:
reflect
.
TypeOf
(
FailedVote
{}),
30
:
reflect
.
TypeOf
(
FinishTransaction
{}),
31
|
answerBit
:
reflect
.
TypeOf
(
Answer
FinishTransaction
{}),
32
:
reflect
.
TypeOf
(
NotifyTransactionFinished
{}),
33
|
answerBit
:
reflect
.
TypeOf
(
Answer
LockInformation
{}),
31
|
answerBit
:
reflect
.
TypeOf
(
Answer
TransactionFinished
{}),
32
:
reflect
.
TypeOf
(
LockInformation
{}),
33
|
answerBit
:
reflect
.
TypeOf
(
Answer
InformationLocked
{}),
34
:
reflect
.
TypeOf
(
InvalidateObjects
{}),
35
:
reflect
.
TypeOf
(
UnlockInformation
{}),
36
:
reflect
.
TypeOf
(
AskNewOIDs
{}),
...
...
go/neo/ztestdata_proto_py_test.go
View file @
7fc32050
...
...
@@ -19,10 +19,10 @@ var pyMsgRegistry = map[uint16]string{
22
:
"LockedTransactions"
,
24
:
"FinalTID"
,
26
:
"ValidateTransaction"
,
27
:
"
Ask
BeginTransaction"
,
27
:
"BeginTransaction"
,
29
:
"FailedVote"
,
30
:
"
Ask
FinishTransaction"
,
32
:
"
Ask
LockInformation"
,
30
:
"FinishTransaction"
,
32
:
"LockInformation"
,
34
:
"InvalidateObjects"
,
35
:
"NotifyUnlockInformation"
,
36
:
"AskNewOIDs"
,
...
...
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