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
c085bf5b
Commit
c085bf5b
authored
Feb 22, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e8a471f2
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
181 additions
and
61 deletions
+181
-61
t/neo/storage/fs1/py/gen-testdata
t/neo/storage/fs1/py/gen-testdata
+9
-6
t/neo/storage/fs1/testdata_expect_test.go
t/neo/storage/fs1/testdata_expect_test.go
+172
-55
No files found.
t/neo/storage/fs1/py/gen-testdata
View file @
c085bf5b
...
...
@@ -109,23 +109,26 @@ def main():
emit
(
"
\
n
var _1fs_dbEntryv = [...]dbEntry{"
)
for
txn
in
stor
.
iterator
():
# txn is TransactionRecord
# txn.extension is already depickled dict - we want to put raw data from file
# also we need to access txn record legth which is not provided by higher-level iterator
# do deep-dive into FileStorage
h
=
stor
.
_read_txn_header
(
txn
.
_tpos
)
assert
h
.
tid
==
txn
.
tid
# -> TxnHeader
emit
(
"
\
t
TxnHeader{"
)
emit
(
"
\
t
\
t
Tid:
\
t
%s,"
%
hex64
(
txn
.
tid
))
# TODO reclenm8 ?
emit
(
"
\
t
\
t
RecLenm8:
\
t
%i,"
%
h
.
tlen
)
emit
(
"
\
t
\
t
Status:
\
t
'%s',"
%
txn
.
status
)
emit
(
"
\
t
\
t
User:
\
t
[]byte(
\
"
%s
\
"
),"
%
txn
.
user
.
encode
(
'string_escape'
))
emit
(
"
\
t
\
t
User:
\
t
\
t
[]byte(
\
"
%s
\
"
),"
%
txn
.
user
.
encode
(
'string_escape'
))
emit
(
"
\
t
\
t
Description:
\
t
[]byte(
\
"
%s
\
"
),"
%
txn
.
description
.
encode
(
'string_escape'
))
# txn.extension is already depickled dict - we want to put raw data from file
h
=
stor
.
_read_txn_header
(
txn
.
_tpos
)
assert
h
.
tid
==
txn
.
tid
emit
(
"
\
t
\
t
Extension:
\
t
[]byte(
\
"
%s
\
"
),"
%
h
.
ext
.
encode
(
'string_escape'
))
# txn: ._pos ._tend ._tpos
# -> DataHeader + payload
for
drec
in
txn
:
# drec is itemof(TransactionRecordIterator) = Record
emit
(
"
\
t
\
t
DataHeader{"
)
emit
(
"
\
n
\
t
\
t
DataHeader{"
)
emit
(
"
\
t
\
t
\
t
Oid:
\
t
%i,"
%
unpack64
(
drec
.
oid
))
emit
(
"
\
t
\
t
\
t
Tid:
\
t
%s,"
%
hex64
(
drec
.
tid
))
# drec: .data .prev (=prev_txn) .pos
...
...
t/neo/storage/fs1/testdata_expect_test.go
View file @
c085bf5b
This diff is collapsed.
Click to expand it.
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