Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
392151e2
Commit
392151e2
authored
Aug 05, 2017
by
Egon Elbre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: fix megacheck warnings
parent
b159cdd8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
compress_test.go
common/bitutil/compress_test.go
+4
-4
json.go
common/hexutil/json.go
+4
-5
No files found.
common/bitutil/compress_test.go
View file @
392151e2
...
...
@@ -121,20 +121,20 @@ func TestCompression(t *testing.T) {
in
:=
hexutil
.
MustDecode
(
"0x4912385c0e7b64000000"
)
out
:=
hexutil
.
MustDecode
(
"0x80fe4912385c0e7b64"
)
if
data
:=
CompressBytes
(
in
);
bytes
.
Compare
(
data
,
out
)
!=
0
{
if
data
:=
CompressBytes
(
in
);
!
bytes
.
Equal
(
data
,
out
)
{
t
.
Errorf
(
"encoding mismatch for sparse data: have %x, want %x"
,
data
,
out
)
}
if
data
,
err
:=
DecompressBytes
(
out
,
len
(
in
));
err
!=
nil
||
bytes
.
Compare
(
data
,
in
)
!=
0
{
if
data
,
err
:=
DecompressBytes
(
out
,
len
(
in
));
err
!=
nil
||
!
bytes
.
Equal
(
data
,
in
)
{
t
.
Errorf
(
"decoding mismatch for sparse data: have %x, want %x, error %v"
,
data
,
in
,
err
)
}
// Check the the compression returns the input if the bitset encoding is longer
in
=
hexutil
.
MustDecode
(
"0xdf7070533534333636313639343638373532313536346c1bc33339343837313070706336343035336336346c65fefb3930393233383838ac2f65fefb"
)
out
=
hexutil
.
MustDecode
(
"0xdf7070533534333636313639343638373532313536346c1bc33339343837313070706336343035336336346c65fefb3930393233383838ac2f65fefb"
)
if
data
:=
CompressBytes
(
in
);
bytes
.
Compare
(
data
,
out
)
!=
0
{
if
data
:=
CompressBytes
(
in
);
!
bytes
.
Equal
(
data
,
out
)
{
t
.
Errorf
(
"encoding mismatch for dense data: have %x, want %x"
,
data
,
out
)
}
if
data
,
err
:=
DecompressBytes
(
out
,
len
(
in
));
err
!=
nil
||
bytes
.
Compare
(
data
,
in
)
!=
0
{
if
data
,
err
:=
DecompressBytes
(
out
,
len
(
in
));
err
!=
nil
||
!
bytes
.
Equal
(
data
,
in
)
{
t
.
Errorf
(
"decoding mismatch for dense data: have %x, want %x, error %v"
,
data
,
in
,
err
)
}
// Check that decompressing a longer input than the target fails
...
...
common/hexutil/json.go
View file @
392151e2
...
...
@@ -26,7 +26,6 @@ import (
)
var
(
textZero
=
[]
byte
(
`0x0`
)
bytesT
=
reflect
.
TypeOf
(
Bytes
(
nil
))
bigT
=
reflect
.
TypeOf
((
*
Big
)(
nil
))
uintT
=
reflect
.
TypeOf
(
Uint
(
0
))
...
...
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