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
a7720b59
Commit
a7720b59
authored
May 02, 2018
by
kiel barry
Committed by
Péter Szilágyi
May 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: golint updates for this or self warning (#16633)
parent
670bae4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
contract.go
core/vm/contract.go
+7
-7
logger.go
core/vm/logger.go
+2
-2
memory.go
core/vm/memory.go
+6
-6
opcodes.go
core/vm/opcodes.go
+3
-3
No files found.
core/vm/contract.go
View file @
a7720b59
...
...
@@ -139,15 +139,15 @@ func (c *Contract) Value() *big.Int {
}
// SetCode sets the code to the contract
func
(
self
*
Contract
)
SetCode
(
hash
common
.
Hash
,
code
[]
byte
)
{
self
.
Code
=
code
self
.
CodeHash
=
hash
func
(
c
*
Contract
)
SetCode
(
hash
common
.
Hash
,
code
[]
byte
)
{
c
.
Code
=
code
c
.
CodeHash
=
hash
}
// SetCallCode sets the code of the contract and address of the backing data
// object
func
(
self
*
Contract
)
SetCallCode
(
addr
*
common
.
Address
,
hash
common
.
Hash
,
code
[]
byte
)
{
self
.
Code
=
code
self
.
CodeHash
=
hash
self
.
CodeAddr
=
addr
func
(
c
*
Contract
)
SetCallCode
(
addr
*
common
.
Address
,
hash
common
.
Hash
,
code
[]
byte
)
{
c
.
Code
=
code
c
.
CodeHash
=
hash
c
.
CodeAddr
=
addr
}
core/vm/logger.go
View file @
a7720b59
...
...
@@ -31,9 +31,9 @@ import (
type
Storage
map
[
common
.
Hash
]
common
.
Hash
func
(
s
elf
Storage
)
Copy
()
Storage
{
func
(
s
Storage
)
Copy
()
Storage
{
cpy
:=
make
(
Storage
)
for
key
,
value
:=
range
s
elf
{
for
key
,
value
:=
range
s
{
cpy
[
key
]
=
value
}
...
...
core/vm/memory.go
View file @
a7720b59
...
...
@@ -51,14 +51,14 @@ func (m *Memory) Resize(size uint64) {
}
// Get returns offset + size as a new slice
func
(
self
*
Memory
)
Get
(
offset
,
size
int64
)
(
cpy
[]
byte
)
{
func
(
m
*
Memory
)
Get
(
offset
,
size
int64
)
(
cpy
[]
byte
)
{
if
size
==
0
{
return
nil
}
if
len
(
self
.
store
)
>
int
(
offset
)
{
if
len
(
m
.
store
)
>
int
(
offset
)
{
cpy
=
make
([]
byte
,
size
)
copy
(
cpy
,
self
.
store
[
offset
:
offset
+
size
])
copy
(
cpy
,
m
.
store
[
offset
:
offset
+
size
])
return
}
...
...
@@ -67,13 +67,13 @@ func (self *Memory) Get(offset, size int64) (cpy []byte) {
}
// GetPtr returns the offset + size
func
(
self
*
Memory
)
GetPtr
(
offset
,
size
int64
)
[]
byte
{
func
(
m
*
Memory
)
GetPtr
(
offset
,
size
int64
)
[]
byte
{
if
size
==
0
{
return
nil
}
if
len
(
self
.
store
)
>
int
(
offset
)
{
return
self
.
store
[
offset
:
offset
+
size
]
if
len
(
m
.
store
)
>
int
(
offset
)
{
return
m
.
store
[
offset
:
offset
+
size
]
}
return
nil
...
...
core/vm/opcodes.go
View file @
a7720b59
...
...
@@ -375,10 +375,10 @@ var opCodeToString = map[OpCode]string{
SWAP
:
"SWAP"
,
}
func
(
o
OpCode
)
String
()
string
{
str
:=
opCodeToString
[
o
]
func
(
o
p
OpCode
)
String
()
string
{
str
:=
opCodeToString
[
o
p
]
if
len
(
str
)
==
0
{
return
fmt
.
Sprintf
(
"Missing opcode 0x%x"
,
int
(
o
))
return
fmt
.
Sprintf
(
"Missing opcode 0x%x"
,
int
(
o
p
))
}
return
str
...
...
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