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
dffd804c
Unverified
Commit
dffd804c
authored
May 11, 2023
by
makcandrov
Committed by
GitHub
May 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal/ethapi: remove unused err-return (#27240)
parent
0b66d474
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
17 deletions
+12
-17
api_backend.go
eth/api_backend.go
+2
-2
api.go
internal/ethapi/api.go
+3
-8
api_test.go
internal/ethapi/api_test.go
+2
-2
backend.go
internal/ethapi/backend.go
+1
-1
transaction_args_test.go
internal/ethapi/transaction_args_test.go
+2
-2
api_backend.go
les/api_backend.go
+2
-2
No files found.
eth/api_backend.go
View file @
dffd804c
...
...
@@ -246,7 +246,7 @@ func (b *EthAPIBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int {
return
nil
}
func
(
b
*
EthAPIBackend
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockCtx
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
,
error
)
{
func
(
b
*
EthAPIBackend
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockCtx
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
)
{
if
vmConfig
==
nil
{
vmConfig
=
b
.
eth
.
blockchain
.
GetVMConfig
()
}
...
...
@@ -257,7 +257,7 @@ func (b *EthAPIBackend) GetEVM(ctx context.Context, msg *core.Message, state *st
}
else
{
context
=
core
.
NewEVMBlockContext
(
header
,
b
.
eth
.
BlockChain
(),
nil
)
}
return
vm
.
NewEVM
(
context
,
txContext
,
state
,
b
.
eth
.
blockchain
.
Config
(),
*
vmConfig
),
state
.
Error
,
nil
return
vm
.
NewEVM
(
context
,
txContext
,
state
,
b
.
eth
.
blockchain
.
Config
(),
*
vmConfig
),
state
.
Error
}
func
(
b
*
EthAPIBackend
)
SubscribeRemovedLogsEvent
(
ch
chan
<-
core
.
RemovedLogsEvent
)
event
.
Subscription
{
...
...
internal/ethapi/api.go
View file @
dffd804c
...
...
@@ -1018,10 +1018,8 @@ func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash
if
blockOverrides
!=
nil
{
blockOverrides
.
Apply
(
&
blockCtx
)
}
evm
,
vmError
,
err
:=
b
.
GetEVM
(
ctx
,
msg
,
state
,
header
,
&
vm
.
Config
{
NoBaseFee
:
true
},
&
blockCtx
)
if
err
!=
nil
{
return
nil
,
err
}
evm
,
vmError
:=
b
.
GetEVM
(
ctx
,
msg
,
state
,
header
,
&
vm
.
Config
{
NoBaseFee
:
true
},
&
blockCtx
)
// Wait for the context to be done and cancel the evm. Even if the
// EVM has finished, cancelling may be done (repeatedly)
go
func
()
{
...
...
@@ -1514,10 +1512,7 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
// Apply the transaction with the access list tracer
tracer
:=
logger
.
NewAccessListTracer
(
accessList
,
args
.
from
(),
to
,
precompiles
)
config
:=
vm
.
Config
{
Tracer
:
tracer
,
NoBaseFee
:
true
}
vmenv
,
_
,
err
:=
b
.
GetEVM
(
ctx
,
msg
,
statedb
,
header
,
&
config
,
nil
)
if
err
!=
nil
{
return
nil
,
0
,
nil
,
err
}
vmenv
,
_
:=
b
.
GetEVM
(
ctx
,
msg
,
statedb
,
header
,
&
config
,
nil
)
res
,
err
:=
core
.
ApplyMessage
(
vmenv
,
msg
,
new
(
core
.
GasPool
)
.
AddGas
(
msg
.
GasLimit
))
if
err
!=
nil
{
return
nil
,
0
,
nil
,
fmt
.
Errorf
(
"failed to apply transaction: %v err: %v"
,
args
.
toTransaction
()
.
Hash
(),
err
)
...
...
internal/ethapi/api_test.go
View file @
dffd804c
...
...
@@ -283,7 +283,7 @@ func (b testBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.R
panic
(
"implement me"
)
}
func
(
b
testBackend
)
GetTd
(
ctx
context
.
Context
,
hash
common
.
Hash
)
*
big
.
Int
{
panic
(
"implement me"
)
}
func
(
b
testBackend
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockContext
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
,
error
)
{
func
(
b
testBackend
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockContext
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
)
{
vmError
:=
func
()
error
{
return
nil
}
if
vmConfig
==
nil
{
vmConfig
=
b
.
chain
.
GetVMConfig
()
...
...
@@ -293,7 +293,7 @@ func (b testBackend) GetEVM(ctx context.Context, msg *core.Message, state *state
if
blockContext
!=
nil
{
context
=
*
blockContext
}
return
vm
.
NewEVM
(
context
,
txContext
,
state
,
b
.
chain
.
Config
(),
*
vmConfig
),
vmError
,
nil
return
vm
.
NewEVM
(
context
,
txContext
,
state
,
b
.
chain
.
Config
(),
*
vmConfig
),
vmError
}
func
(
b
testBackend
)
SubscribeChainEvent
(
ch
chan
<-
core
.
ChainEvent
)
event
.
Subscription
{
panic
(
"implement me"
)
...
...
internal/ethapi/backend.go
View file @
dffd804c
...
...
@@ -68,7 +68,7 @@ type Backend interface {
PendingBlockAndReceipts
()
(
*
types
.
Block
,
types
.
Receipts
)
GetReceipts
(
ctx
context
.
Context
,
hash
common
.
Hash
)
(
types
.
Receipts
,
error
)
GetTd
(
ctx
context
.
Context
,
hash
common
.
Hash
)
*
big
.
Int
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockCtx
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
,
error
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockCtx
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
)
SubscribeChainEvent
(
ch
chan
<-
core
.
ChainEvent
)
event
.
Subscription
SubscribeChainHeadEvent
(
ch
chan
<-
core
.
ChainHeadEvent
)
event
.
Subscription
SubscribeChainSideEvent
(
ch
chan
<-
core
.
ChainSideEvent
)
event
.
Subscription
...
...
internal/ethapi/transaction_args_test.go
View file @
dffd804c
...
...
@@ -305,8 +305,8 @@ func (b *backendMock) GetLogs(ctx context.Context, blockHash common.Hash, number
return
nil
,
nil
}
func
(
b
*
backendMock
)
GetTd
(
ctx
context
.
Context
,
hash
common
.
Hash
)
*
big
.
Int
{
return
nil
}
func
(
b
*
backendMock
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockCtx
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
,
error
)
{
return
nil
,
nil
,
nil
func
(
b
*
backendMock
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockCtx
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
)
{
return
nil
,
nil
}
func
(
b
*
backendMock
)
SubscribeChainEvent
(
ch
chan
<-
core
.
ChainEvent
)
event
.
Subscription
{
return
nil
}
func
(
b
*
backendMock
)
SubscribeChainHeadEvent
(
ch
chan
<-
core
.
ChainHeadEvent
)
event
.
Subscription
{
...
...
les/api_backend.go
View file @
dffd804c
...
...
@@ -184,7 +184,7 @@ func (b *LesApiBackend) GetTd(ctx context.Context, hash common.Hash) *big.Int {
return
nil
}
func
(
b
*
LesApiBackend
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockCtx
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
,
error
)
{
func
(
b
*
LesApiBackend
)
GetEVM
(
ctx
context
.
Context
,
msg
*
core
.
Message
,
state
*
state
.
StateDB
,
header
*
types
.
Header
,
vmConfig
*
vm
.
Config
,
blockCtx
*
vm
.
BlockContext
)
(
*
vm
.
EVM
,
func
()
error
)
{
if
vmConfig
==
nil
{
vmConfig
=
new
(
vm
.
Config
)
}
...
...
@@ -193,7 +193,7 @@ func (b *LesApiBackend) GetEVM(ctx context.Context, msg *core.Message, state *st
if
blockCtx
!=
nil
{
context
=
*
blockCtx
}
return
vm
.
NewEVM
(
context
,
txContext
,
state
,
b
.
eth
.
chainConfig
,
*
vmConfig
),
state
.
Error
,
nil
return
vm
.
NewEVM
(
context
,
txContext
,
state
,
b
.
eth
.
chainConfig
,
*
vmConfig
),
state
.
Error
}
func
(
b
*
LesApiBackend
)
SendTx
(
ctx
context
.
Context
,
signedTx
*
types
.
Transaction
)
error
{
...
...
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