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
bb67fa9b
Commit
bb67fa9b
authored
Dec 28, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
13fcfefd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
t/neo/marshal.go
t/neo/marshal.go
+9
-9
t/neo/proto.go
t/neo/proto.go
+5
-0
t/neo/protogen.go
t/neo/protogen.go
+1
-1
No files found.
t/neo/marshal.go
View file @
bb67fa9b
...
...
@@ -280,7 +280,7 @@ func (p *PartitionChanges) NEODecode(data []byte) (int, error) {
}
func
(
p
*
StartOperation
)
NEODecode
(
data
[]
byte
)
(
int
,
error
)
{
p
.
Backup
=
bool
((
data
[
0
:
])[
0
])
p
.
Backup
=
b
yte2b
ool
((
data
[
0
:
])[
0
])
return
1
/* + TODO variable part */
,
nil
}
...
...
@@ -442,7 +442,7 @@ func (p *AnswerGenerateOIDs) NEODecode(data []byte) (int, error) {
func
(
p
*
StoreObject
)
NEODecode
(
data
[]
byte
)
(
int
,
error
)
{
p
.
Oid
=
Oid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
Serial
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
Compression
=
bool
((
data
[
16
:
])[
0
])
p
.
Compression
=
b
yte2b
ool
((
data
[
16
:
])[
0
])
p
.
Checksum
[
0
]
=
(
data
[
17
:
])[
0
]
p
.
Checksum
[
1
]
=
(
data
[
18
:
])[
0
]
p
.
Checksum
[
2
]
=
(
data
[
19
:
])[
0
]
...
...
@@ -475,12 +475,12 @@ func (p *StoreObject) NEODecode(data []byte) (int, error) {
}
p
.
DataSerial
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
Tid
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
Unlock
=
bool
((
data
[
16
:
])[
0
])
p
.
Unlock
=
b
yte2b
ool
((
data
[
16
:
])[
0
])
return
17
/* + TODO variable part */
,
nil
}
func
(
p
*
AnswerStoreObject
)
NEODecode
(
data
[]
byte
)
(
int
,
error
)
{
p
.
Conflicting
=
bool
((
data
[
0
:
])[
0
])
p
.
Conflicting
=
b
yte2b
ool
((
data
[
0
:
])[
0
])
p
.
Oid
=
Oid
(
binary
.
BigEndian
.
Uint64
(
data
[
1
:
]))
p
.
Serial
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
9
:
]))
return
17
/* + TODO variable part */
,
nil
...
...
@@ -549,7 +549,7 @@ func (p *AnswerGetObject) NEODecode(data []byte) (int, error) {
p
.
Oid
=
Oid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
p
.
SerialStart
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
p
.
SerialEnd
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
16
:
]))
p
.
Compression
=
bool
((
data
[
24
:
])[
0
])
p
.
Compression
=
b
yte2b
ool
((
data
[
24
:
])[
0
])
p
.
Checksum
[
0
]
=
(
data
[
25
:
])[
0
]
p
.
Checksum
[
1
]
=
(
data
[
26
:
])[
0
]
p
.
Checksum
[
2
]
=
(
data
[
27
:
])[
0
]
...
...
@@ -661,7 +661,7 @@ func (p *AnswerTransactionInformation) NEODecode(data []byte) (int, error) {
p
.
Extension
=
string
(
data
[
:
l
])
data
=
data
[
l
:
]
}
p
.
Packed
=
bool
((
data
[
0
:
])[
0
])
p
.
Packed
=
b
yte2b
ool
((
data
[
0
:
])[
0
])
{
l
:=
binary
.
BigEndian
.
Uint32
(
data
[
1
:
])
data
=
data
[
5
:
]
...
...
@@ -877,7 +877,7 @@ func (p *AnswerObjectUndoSerial) NEODecode(data []byte) (int, error) {
key
=
Oid
(
binary
.
BigEndian
.
Uint64
(
data
[
0
:
]))
m
[
key
]
.
CurrentSerial
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
8
:
]))
m
[
key
]
.
UndoSerial
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
16
:
]))
m
[
key
]
.
IsCurrent
=
bool
((
data
[
24
:
])[
0
])
m
[
key
]
.
IsCurrent
=
b
yte2b
ool
((
data
[
24
:
])[
0
])
data
=
data
[
25
:
]
}
}
...
...
@@ -904,7 +904,7 @@ func (p *CheckCurrentSerial) NEODecode(data []byte) (int, error) {
}
func
(
p
*
AnswerCheckCurrentSerial
)
NEODecode
(
data
[]
byte
)
(
int
,
error
)
{
p
.
Conflicting
=
bool
((
data
[
0
:
])[
0
])
p
.
Conflicting
=
b
yte2b
ool
((
data
[
0
:
])[
0
])
p
.
Oid
=
Oid
(
binary
.
BigEndian
.
Uint64
(
data
[
1
:
]))
p
.
Serial
=
Tid
(
binary
.
BigEndian
.
Uint64
(
data
[
9
:
]))
return
17
/* + TODO variable part */
,
nil
...
...
@@ -916,7 +916,7 @@ func (p *Pack) NEODecode(data []byte) (int, error) {
}
func
(
p
*
AnswerPack
)
NEODecode
(
data
[]
byte
)
(
int
,
error
)
{
p
.
Status
=
bool
((
data
[
0
:
])[
0
])
p
.
Status
=
b
yte2b
ool
((
data
[
0
:
])[
0
])
return
1
/* + TODO variable part */
,
nil
}
...
...
t/neo/proto.go
View file @
bb67fa9b
...
...
@@ -138,6 +138,11 @@ type Checksum [20]byte
type
PTid
uint64
// XXX move to common place ?
// XXX move -> marshalutil.go ?
func
byte2bool
(
b
byte
)
bool
{
return
b
!=
0
}
// NOTE py.None encodes as '\xff' * 8 (-> we use NaN for None)
// NOTE '\xff' * 8 represents FP NaN but many other NaN bits representation exist
func
float64_NEOEncode
(
f
float64
,
b
[]
byte
)
{
...
...
t/neo/protogen.go
View file @
bb67fa9b
...
...
@@ -156,7 +156,7 @@ type basicXXX struct {
var
basicDecode
=
map
[
types
.
BasicKind
]
basicXXX
{
// %v will be `data[n:n+wireSize]` XXX or `data[n:]` ?
types
.
Bool
:
{
1
,
"bool((%v)[0])"
},
types
.
Bool
:
{
1
,
"b
yte2b
ool((%v)[0])"
},
types
.
Int8
:
{
1
,
"int8((%v)[0])"
},
types
.
Int16
:
{
2
,
"int16(binary.BigEndian.Uint16(%v))"
},
types
.
Int32
:
{
4
,
"int32(binary.BigEndian.Uint32(%v))"
},
...
...
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