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
5883446b
Commit
5883446b
authored
Feb 15, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test
parent
9bcb3d22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
rlp_test.go
ethutil/rlp_test.go
+2
-8
No files found.
ethutil/rlp_test.go
View file @
5883446b
...
@@ -2,8 +2,6 @@ package ethutil
...
@@ -2,8 +2,6 @@ package ethutil
import
(
import
(
"bytes"
"bytes"
"encoding/hex"
"fmt"
"math/big"
"math/big"
"reflect"
"reflect"
"testing"
"testing"
...
@@ -63,7 +61,7 @@ func TestEncode(t *testing.T) {
...
@@ -63,7 +61,7 @@ func TestEncode(t *testing.T) {
str
:=
string
(
bytes
)
str
:=
string
(
bytes
)
if
str
!=
strRes
{
if
str
!=
strRes
{
t
.
Error
(
fmt
.
Sprintf
(
"Expected %q, got %q"
,
strRes
,
str
)
)
t
.
Error
f
(
"Expected %q, got %q"
,
strRes
,
str
)
}
}
sliceRes
:=
"
\xcc\x83
dog
\x83
god
\x83
cat"
sliceRes
:=
"
\xcc\x83
dog
\x83
god
\x83
cat"
...
@@ -71,7 +69,7 @@ func TestEncode(t *testing.T) {
...
@@ -71,7 +69,7 @@ func TestEncode(t *testing.T) {
bytes
=
Encode
(
strs
)
bytes
=
Encode
(
strs
)
slice
:=
string
(
bytes
)
slice
:=
string
(
bytes
)
if
slice
!=
sliceRes
{
if
slice
!=
sliceRes
{
t
.
Error
(
fmt
.
Sprintf
(
"Expected %q, got %q"
,
sliceRes
,
slice
)
)
t
.
Error
(
"Expected %q, got %q"
,
sliceRes
,
slice
)
}
}
intRes
:=
"
\x82\x04\x00
"
intRes
:=
"
\x82\x04\x00
"
...
@@ -108,13 +106,9 @@ func TestEncodeDecodeBigInt(t *testing.T) {
...
@@ -108,13 +106,9 @@ func TestEncodeDecodeBigInt(t *testing.T) {
encoded
:=
Encode
(
bigInt
)
encoded
:=
Encode
(
bigInt
)
value
:=
NewValueFromBytes
(
encoded
)
value
:=
NewValueFromBytes
(
encoded
)
fmt
.
Println
(
value
.
BigInt
(),
bigInt
)
if
value
.
BigInt
()
.
Cmp
(
bigInt
)
!=
0
{
if
value
.
BigInt
()
.
Cmp
(
bigInt
)
!=
0
{
t
.
Errorf
(
"Expected %v, got %v"
,
bigInt
,
value
.
BigInt
())
t
.
Errorf
(
"Expected %v, got %v"
,
bigInt
,
value
.
BigInt
())
}
}
dec
,
_
:=
hex
.
DecodeString
(
"52f4fc1e"
)
fmt
.
Println
(
NewValueFromBytes
(
dec
)
.
BigInt
())
}
}
func
TestEncodeDecodeBytes
(
t
*
testing
.
T
)
{
func
TestEncodeDecodeBytes
(
t
*
testing
.
T
)
{
...
...
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