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
17fc7c92
Commit
17fc7c92
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
77a69df1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
24 deletions
+25
-24
go/neo/proto.go
go/neo/proto.go
+3
-5
go/neo/py/pyneo-gen-testdata
go/neo/py/pyneo-gen-testdata
+3
-0
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+18
-18
go/neo/ztestdata_proto_py_test.go
go/neo/ztestdata_proto_py_test.go
+1
-1
No files found.
go/neo/proto.go
View file @
17fc7c92
...
...
@@ -615,8 +615,7 @@ type GetObject struct {
Tid
zodb
.
Tid
}
// XXX answer_object ?
type
AnswerGetObject
struct
{
type
AnswerObject
struct
{
Oid
zodb
.
Oid
Serial
zodb
.
Tid
// XXX strictly is SerialStart/SerialEnd in proto.py
NextSerial
zodb
.
Tid
// XXX but there it is out of sync
...
...
@@ -629,14 +628,13 @@ type AnswerGetObject struct {
// Ask for TIDs between a range of offsets. The order of TIDs is descending,
// and the range is [first, last). C -> S.
// Answer the requested TIDs. S -> C.
type
TIDList
struct
{
type
AskTIDs
struct
{
First
uint64
// PIndex XXX this is TID actually ? -> no it is offset in list
Last
uint64
// PIndex ----//----
Partition
uint32
// PNumber
}
// XXX answer_tids ?
type
AnswerTIDList
struct
{
type
AnswerTIDs
struct
{
TIDList
[]
zodb
.
Tid
}
...
...
go/neo/py/pyneo-gen-testdata
View file @
17fc7c92
...
...
@@ -42,6 +42,9 @@ noask('StoreObject')
noask
(
'StoreTransaction'
)
noask
(
'VoteTransaction'
)
_
=
renames
_
[
'AskObject'
]
=
'GetObject'
def
main
():
pyprotog
=
{}
...
...
go/neo/zproto-marshal.go
View file @
17fc7c92
...
...
@@ -1911,17 +1911,17 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 51. Answer
Get
Object
// 51. AnswerObject
func
(
*
Answer
Get
Object
)
neoMsgCode
()
uint16
{
func
(
*
AnswerObject
)
neoMsgCode
()
uint16
{
return
51
|
answerBit
}
func
(
p
*
Answer
Get
Object
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerObject
)
neoMsgEncodedLen
()
int
{
return
57
+
len
(
p
.
Data
)
}
func
(
p
*
Answer
Get
Object
)
neoMsgEncode
(
data
[]
byte
)
{
func
(
p
*
AnswerObject
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
Oid
))
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
uint64
(
p
.
Serial
))
binary
.
BigEndian
.
PutUint64
(
data
[
16
:
],
uint64
(
p
.
NextSerial
))
...
...
@@ -1937,7 +1937,7 @@ func (p *AnswerGetObject) neoMsgEncode(data []byte) {
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
uint64
(
p
.
DataSerial
))
}
func
(
p
*
Answer
Get
Object
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
AnswerObject
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
var
nread
uint32
if
uint32
(
len
(
data
))
<
49
{
goto
overflow
...
...
@@ -1965,23 +1965,23 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 52.
TIDList
// 52.
AskTIDs
func
(
*
TIDList
)
neoMsgCode
()
uint16
{
func
(
*
AskTIDs
)
neoMsgCode
()
uint16
{
return
52
}
func
(
p
*
TIDList
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AskTIDs
)
neoMsgEncodedLen
()
int
{
return
20
}
func
(
p
*
TIDList
)
neoMsgEncode
(
data
[]
byte
)
{
func
(
p
*
AskTIDs
)
neoMsgEncode
(
data
[]
byte
)
{
binary
.
BigEndian
.
PutUint64
(
data
[
0
:
],
p
.
First
)
binary
.
BigEndian
.
PutUint64
(
data
[
8
:
],
p
.
Last
)
binary
.
BigEndian
.
PutUint32
(
data
[
16
:
],
p
.
Partition
)
}
func
(
p
*
TIDList
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
AskTIDs
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
if
uint32
(
len
(
data
))
<
20
{
goto
overflow
}
...
...
@@ -1994,17 +1994,17 @@ overflow:
return
0
,
ErrDecodeOverflow
}
// 53. AnswerTID
List
// 53. AnswerTID
s
func
(
*
AnswerTID
List
)
neoMsgCode
()
uint16
{
func
(
*
AnswerTID
s
)
neoMsgCode
()
uint16
{
return
53
|
answerBit
}
func
(
p
*
AnswerTID
List
)
neoMsgEncodedLen
()
int
{
func
(
p
*
AnswerTID
s
)
neoMsgEncodedLen
()
int
{
return
4
+
len
(
p
.
TIDList
)
*
8
}
func
(
p
*
AnswerTID
List
)
neoMsgEncode
(
data
[]
byte
)
{
func
(
p
*
AnswerTID
s
)
neoMsgEncode
(
data
[]
byte
)
{
{
l
:=
uint32
(
len
(
p
.
TIDList
))
binary
.
BigEndian
.
PutUint32
(
data
[
0
:
],
l
)
...
...
@@ -2017,7 +2017,7 @@ func (p *AnswerTIDList) neoMsgEncode(data []byte) {
}
}
func
(
p
*
AnswerTID
List
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
func
(
p
*
AnswerTID
s
)
neoMsgDecode
(
data
[]
byte
)
(
int
,
error
)
{
var
nread
uint32
if
uint32
(
len
(
data
))
<
4
{
goto
overflow
...
...
@@ -3490,9 +3490,9 @@ var msgTypeRegistry = map[uint16]reflect.Type{
48
:
reflect
.
TypeOf
(
VoteTransaction
{}),
49
|
answerBit
:
reflect
.
TypeOf
(
AnswerVoteTransaction
{}),
50
:
reflect
.
TypeOf
(
GetObject
{}),
51
|
answerBit
:
reflect
.
TypeOf
(
Answer
Get
Object
{}),
52
:
reflect
.
TypeOf
(
TIDList
{}),
53
|
answerBit
:
reflect
.
TypeOf
(
AnswerTID
List
{}),
51
|
answerBit
:
reflect
.
TypeOf
(
AnswerObject
{}),
52
:
reflect
.
TypeOf
(
AskTIDs
{}),
53
|
answerBit
:
reflect
.
TypeOf
(
AnswerTID
s
{}),
54
:
reflect
.
TypeOf
(
TIDListFrom
{}),
55
|
answerBit
:
reflect
.
TypeOf
(
AnswerTIDListFrom
{}),
56
:
reflect
.
TypeOf
(
TransactionInformation
{}),
...
...
go/neo/ztestdata_proto_py_test.go
View file @
17fc7c92
...
...
@@ -33,7 +33,7 @@ var pyMsgRegistry = map[uint16]string{
45
:
"AbortTransaction"
,
46
:
"StoreTransaction"
,
48
:
"VoteTransaction"
,
50
:
"
Ask
Object"
,
50
:
"
Get
Object"
,
52
:
"AskTIDs"
,
54
:
"AskTransactionInformation"
,
56
:
"AskObjectHistory"
,
...
...
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