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
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
Stefane Fermigier
neo
Commits
9206bfb6
Commit
9206bfb6
authored
Feb 15, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
686b8976
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
5 deletions
+20
-5
go/neo/storage/sqlite/sqlite.go
go/neo/storage/sqlite/sqlite.go
+16
-1
go/neo/t/zhash.go
go/neo/t/zhash.go
+1
-1
go/neo/t/zhash.py
go/neo/t/zhash.py
+3
-3
No files found.
go/neo/storage/sqlite/sqlite.go
View file @
9206bfb6
...
...
@@ -344,7 +344,6 @@ func openURL(ctx context.Context, u *url.URL) (_ storage.Backend, err error) {
return
nil
,
fmt
.
Errorf
(
"NEO/go POC: not ready to handle: %s"
,
err
)
}
// config("version")
// config("nid")
// config("partitions")
...
...
@@ -355,6 +354,22 @@ func openURL(ctx context.Context, u *url.URL) (_ storage.Backend, err error) {
// config("truncate_tid")
// config("_pack_tid")
// check ttrans/tobj to be empty - else there are some unfinished, or
// not-yet-moved to trans/tobj transactions.
nttrans
,
ntobj
:=
0
,
0
errv
=
xerr
.
Errorv
{}
errv
.
Appendif
(
b
.
query1
(
ctx
,
"SELECT COUNT(*) FROM ttrans"
)
.
Scan
(
&
nttrans
)
)
errv
.
Appendif
(
b
.
query1
(
ctx
,
"SELECT COUNT(*) FROM tobj"
)
.
Scan
(
&
ntobj
)
)
err
=
errv
.
Err
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"NEO/go POC: checking ttrans/tobj: %s"
,
err
)
}
if
!
(
nttrans
==
0
&&
ntobj
==
0
)
{
return
nil
,
fmt
.
Errorf
(
"NEO/go POC: not ready to handle: !empty ttrans/tobj"
)
}
return
b
,
nil
}
...
...
go/neo/t/zhash.go
View file @
9206bfb6
...
...
@@ -185,7 +185,7 @@ loop:
h
.
Write
(
buf
.
Data
)
//fmt.Fprintf(os.Stderr, "%d @%s\t
sha1: %x\n", uint(oid), serial
, h.Sum(nil))
//fmt.Fprintf(os.Stderr, "%d @%s\t
%s: %x\n", uint(oid), serial, h.name
, h.Sum(nil))
//fmt.Fprintf(os.Stderr, "\tdata: %x\n", buf.Data)
nread
+=
len
(
buf
.
Data
)
...
...
go/neo/t/zhash.py
View file @
9206bfb6
...
...
@@ -54,7 +54,7 @@ class Adler32Hasher:
self
.
h
=
adler32
(
data
,
self
.
h
)
def
hexdigest
(
self
):
return
'%x'
%
(
self
.
h
&
0xffffffff
)
return
'%
08
x'
%
(
self
.
h
&
0xffffffff
)
# crc32 in hashlib interface
class
CRC32Hasher
:
...
...
@@ -67,7 +67,7 @@ class CRC32Hasher:
self
.
h
=
crc32
(
data
,
self
.
h
)
def
hexdigest
(
self
):
return
'%x'
%
(
self
.
h
&
0xffffffff
)
return
'%
08
x'
%
(
self
.
h
&
0xffffffff
)
# {} name -> hasher
hashRegistry
=
{
...
...
@@ -152,7 +152,7 @@ def main():
h
.
update
(
data
)
#print('%s @%s\t
sha1: %s' % (oid, u64(serial)
, h.hexdigest()), file=sys.stderr)
#print('%s @%s\t
%s: %s' % (oid, u64(serial), h.name
, h.hexdigest()), file=sys.stderr)
#print('\tdata: %s' % (data.encode('hex'),), file=sys.stderr)
nread
+=
len
(
data
)
...
...
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