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
c161d73d
Commit
c161d73d
authored
Mar 20, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: drop accessors for Value.Val
I don't see why we would need two different accessors for a public field.
parent
dcb9614d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
11 deletions
+3
-11
rlp.go
common/rlp.go
+1
-1
value.go
common/value.go
+0
-8
value_test.go
common/value_test.go
+1
-1
memory_database.go
ethdb/memory_database.go
+1
-1
No files found.
common/rlp.go
View file @
c161d73d
...
@@ -112,7 +112,7 @@ func Encode(object interface{}) []byte {
...
@@ -112,7 +112,7 @@ func Encode(object interface{}) []byte {
if
object
!=
nil
{
if
object
!=
nil
{
switch
t
:=
object
.
(
type
)
{
switch
t
:=
object
.
(
type
)
{
case
*
Value
:
case
*
Value
:
buff
.
Write
(
Encode
(
t
.
Raw
()
))
buff
.
Write
(
Encode
(
t
.
Val
))
case
RlpEncodable
:
case
RlpEncodable
:
buff
.
Write
(
Encode
(
t
.
RlpData
()))
buff
.
Write
(
Encode
(
t
.
RlpData
()))
// Code dup :-/
// Code dup :-/
...
...
common/value.go
View file @
c161d73d
...
@@ -57,14 +57,6 @@ func (val *Value) Len() int {
...
@@ -57,14 +57,6 @@ func (val *Value) Len() int {
return
len
(
val
.
Bytes
())
return
len
(
val
.
Bytes
())
}
}
func
(
val
*
Value
)
Raw
()
interface
{}
{
return
val
.
Val
}
func
(
val
*
Value
)
Interface
()
interface
{}
{
return
val
.
Val
}
func
(
val
*
Value
)
Uint
()
uint64
{
func
(
val
*
Value
)
Uint
()
uint64
{
if
Val
,
ok
:=
val
.
Val
.
(
uint8
);
ok
{
if
Val
,
ok
:=
val
.
Val
.
(
uint8
);
ok
{
return
uint64
(
Val
)
return
uint64
(
Val
)
...
...
common/value_test.go
View file @
c161d73d
...
@@ -35,7 +35,7 @@ func (s *ValueSuite) TestValueTypes(c *checker.C) {
...
@@ -35,7 +35,7 @@ func (s *ValueSuite) TestValueTypes(c *checker.C) {
c
.
Assert
(
str
.
Str
(),
checker
.
Equals
,
strExp
)
c
.
Assert
(
str
.
Str
(),
checker
.
Equals
,
strExp
)
c
.
Assert
(
num
.
Uint
(),
checker
.
Equals
,
numExp
)
c
.
Assert
(
num
.
Uint
(),
checker
.
Equals
,
numExp
)
c
.
Assert
(
NewValue
(
inter
.
Interface
()
)
.
Cmp
(
NewValue
(
interExp
)),
checker
.
Equals
,
true
)
c
.
Assert
(
NewValue
(
inter
.
Val
)
.
Cmp
(
NewValue
(
interExp
)),
checker
.
Equals
,
true
)
c
.
Assert
(
byt
.
Bytes
(),
checker
.
DeepEquals
,
bytExp
)
c
.
Assert
(
byt
.
Bytes
(),
checker
.
DeepEquals
,
bytExp
)
c
.
Assert
(
bigInt
.
BigInt
(),
checker
.
DeepEquals
,
bigExp
)
c
.
Assert
(
bigInt
.
BigInt
(),
checker
.
DeepEquals
,
bigExp
)
}
}
...
...
ethdb/memory_database.go
View file @
c161d73d
...
@@ -49,7 +49,7 @@ func (db *MemDatabase) Print() {
...
@@ -49,7 +49,7 @@ func (db *MemDatabase) Print() {
for
key
,
val
:=
range
db
.
db
{
for
key
,
val
:=
range
db
.
db
{
fmt
.
Printf
(
"%x(%d): "
,
key
,
len
(
key
))
fmt
.
Printf
(
"%x(%d): "
,
key
,
len
(
key
))
node
:=
common
.
NewValueFromBytes
(
val
)
node
:=
common
.
NewValueFromBytes
(
val
)
fmt
.
Printf
(
"%q
\n
"
,
node
.
Interface
()
)
fmt
.
Printf
(
"%q
\n
"
,
node
.
Val
)
}
}
}
}
...
...
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