Skip to content

Commit f42bd73

Browse files
egonelbrefjl
authored andcommitted
internal: fix megacheck warnings (#14919)
1 parent f5925b0 commit f42bd73

2 files changed

Lines changed: 3 additions & 34 deletions

File tree

‎internal/ethapi/api.go‎

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import (
4646
const (
4747
defaultGas = 90000
4848
defaultGasPrice = 50 * params.Shannon
49-
emptyHex = "0x"
5049
)
5150

5251
// PublicEthereumAPI provides an API to access Ethereum related information.
@@ -548,26 +547,6 @@ func (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.A
548547
return res[:], state.Error()
549548
}
550549

551-
// callmsg is the message type used for call transitions.
552-
type callmsg struct {
553-
addr common.Address
554-
to *common.Address
555-
gas, gasPrice *big.Int
556-
value *big.Int
557-
data []byte
558-
}
559-
560-
// accessor boilerplate to implement core.Message
561-
func (m callmsg) From() (common.Address, error) { return m.addr, nil }
562-
func (m callmsg) FromFrontier() (common.Address, error) { return m.addr, nil }
563-
func (m callmsg) Nonce() uint64 { return 0 }
564-
func (m callmsg) CheckNonce() bool { return false }
565-
func (m callmsg) To() *common.Address { return m.to }
566-
func (m callmsg) GasPrice() *big.Int { return m.gasPrice }
567-
func (m callmsg) Gas() *big.Int { return m.gas }
568-
func (m callmsg) Value() *big.Int { return m.value }
569-
func (m callmsg) Data() []byte { return m.data }
570-
571550
// CallArgs represents the arguments for a call.
572551
type CallArgs struct {
573552
From common.Address `json:"from"`
@@ -626,10 +605,8 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
626605
// Wait for the context to be done and cancel the evm. Even if the
627606
// EVM has finished, cancelling may be done (repeatedly)
628607
go func() {
629-
select {
630-
case <-ctx.Done():
631-
evm.Cancel()
632-
}
608+
<-ctx.Done()
609+
evm.Cancel()
633610
}()
634611

635612
// Setup the gas pool (also for unmetered requests)
@@ -1306,7 +1283,7 @@ func (api *PublicDebugAPI) PrintBlock(ctx context.Context, number uint64) (strin
13061283
if block == nil {
13071284
return "", fmt.Errorf("block #%d not found", number)
13081285
}
1309-
return fmt.Sprintf("%s", block), nil
1286+
return block.String(), nil
13101287
}
13111288

13121289
// SeedHash retrieves the seed hash of a block.

‎internal/jsre/pretty.go‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ func prettyError(vm *otto.Otto, err error, w io.Writer) {
6565
fmt.Fprint(w, ErrorColor("%s", failure))
6666
}
6767

68-
// jsErrorString adds a backtrace to errors generated by otto.
69-
func jsErrorString(err error) string {
70-
if ottoErr, ok := err.(*otto.Error); ok {
71-
return ottoErr.String()
72-
}
73-
return err.Error()
74-
}
75-
7668
func (re *JSRE) prettyPrintJS(call otto.FunctionCall) otto.Value {
7769
for _, v := range call.ArgumentList {
7870
prettyPrint(call.Otto, v, re.output)

0 commit comments

Comments
 (0)