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
810f9e05
Unverified
Commit
810f9e05
authored
Nov 25, 2020
by
Alex Prut
Committed by
GitHub
Nov 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: remove redundant conversions and import names (#21903)
parent
f59ed356
Changes
44
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
66 additions
and
67 deletions
+66
-67
reflect_test.go
accounts/abi/reflect_test.go
+2
-2
type_test.go
accounts/abi/type_test.go
+1
-1
accounts.go
accounts/accounts.go
+1
-1
passphrase.go
accounts/keystore/passphrase.go
+1
-1
wallet.go
accounts/keystore/wallet.go
+1
-1
wallet.go
accounts/scwallet/wallet.go
+1
-1
wallet.go
accounts/usbwallet/wallet.go
+1
-1
main.go
cmd/clef/main.go
+1
-1
dnscmd.go
cmd/devp2p/dnscmd.go
+1
-1
compiler.go
cmd/evm/compiler.go
+1
-1
disasm.go
cmd/evm/disasm.go
+1
-1
runner.go
cmd/evm/runner.go
+1
-1
staterunner.go
cmd/evm/staterunner.go
+1
-1
config.go
cmd/geth/config.go
+1
-1
main.go
cmd/geth/main.go
+1
-1
usage.go
cmd/geth/usage.go
+1
-1
genesis.go
cmd/puppeth/genesis.go
+2
-2
flags.go
cmd/utils/flags.go
+1
-1
json_test.go
common/hexutil/json_test.go
+1
-1
ethash.go
consensus/ethash/ethash.go
+1
-1
oracle.go
contracts/checkpointoracle/oracle.go
+1
-1
statedb.go
core/state/statedb.go
+2
-2
tx_pool_test.go
core/tx_pool_test.go
+1
-1
evm.go
core/vm/evm.go
+1
-1
gas_table.go
core/vm/gas_table.go
+4
-4
instructions.go
core/vm/instructions.go
+4
-4
operations_acl.go
core/vm/operations_acl.go
+1
-1
api.go
eth/downloader/api.go
+1
-1
api.go
eth/filters/api.go
+2
-2
filter_system.go
eth/filters/filter_system.go
+1
-1
filter_system_test.go
eth/filters/filter_system_test.go
+1
-1
tracer.go
eth/tracers/tracer.go
+1
-1
event_test.go
event/event_test.go
+1
-1
feed_test.go
event/feed_test.go
+5
-5
graphql.go
graphql/graphql.go
+8
-8
flags.go
internal/debug/flags.go
+1
-1
api.go
internal/ethapi/api.go
+1
-1
helpers.go
internal/flags/helpers.go
+1
-1
unconfirmed_test.go
miner/unconfirmed_test.go
+2
-3
ethereum.go
mobile/ethereum.go
+1
-1
nodedb.go
p2p/enode/nodedb.go
+1
-1
signed_data.go
signer/core/signed_data.go
+1
-1
database.go
trie/database.go
+1
-1
iterator.go
trie/iterator.go
+1
-1
No files found.
accounts/abi/reflect_test.go
View file @
810f9e05
...
...
@@ -202,12 +202,12 @@ func TestConvertType(t *testing.T) {
fields
=
append
(
fields
,
reflect
.
StructField
{
Name
:
"X"
,
Type
:
reflect
.
TypeOf
(
new
(
big
.
Int
)),
Tag
:
reflect
.
StructTag
(
"json:
\"
"
+
"x"
+
"
\"
"
)
,
Tag
:
"json:
\"
"
+
"x"
+
"
\"
"
,
})
fields
=
append
(
fields
,
reflect
.
StructField
{
Name
:
"Y"
,
Type
:
reflect
.
TypeOf
(
new
(
big
.
Int
)),
Tag
:
reflect
.
StructTag
(
"json:
\"
"
+
"y"
+
"
\"
"
)
,
Tag
:
"json:
\"
"
+
"y"
+
"
\"
"
,
})
val
:=
reflect
.
New
(
reflect
.
StructOf
(
fields
))
val
.
Elem
()
.
Field
(
0
)
.
Set
(
reflect
.
ValueOf
(
big
.
NewInt
(
1
)))
...
...
accounts/abi/type_test.go
View file @
810f9e05
...
...
@@ -255,7 +255,7 @@ func TestTypeCheck(t *testing.T) {
{
"bytes"
,
nil
,
[
2
]
byte
{
0
,
1
},
"abi: cannot use array as type slice as argument"
},
{
"bytes"
,
nil
,
common
.
Hash
{
1
},
"abi: cannot use array as type slice as argument"
},
{
"string"
,
nil
,
"hello world"
,
""
},
{
"string"
,
nil
,
string
(
""
)
,
""
},
{
"string"
,
nil
,
""
,
""
},
{
"string"
,
nil
,
[]
byte
{},
"abi: cannot use slice as type string as argument"
},
{
"bytes32[]"
,
nil
,
[][
32
]
byte
{{}},
""
},
{
"function"
,
nil
,
[
24
]
byte
{},
""
},
...
...
accounts/accounts.go
View file @
810f9e05
...
...
@@ -21,7 +21,7 @@ import (
"fmt"
"math/big"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
...
...
accounts/keystore/passphrase.go
View file @
810f9e05
...
...
@@ -230,7 +230,7 @@ func DecryptKey(keyjson []byte, auth string) (*Key, error) {
key
:=
crypto
.
ToECDSAUnsafe
(
keyBytes
)
return
&
Key
{
Id
:
uuid
.
UUID
(
keyId
)
,
Id
:
keyId
,
Address
:
crypto
.
PubkeyToAddress
(
key
.
PublicKey
),
PrivateKey
:
key
,
},
nil
...
...
accounts/keystore/wallet.go
View file @
810f9e05
...
...
@@ -19,7 +19,7 @@ package keystore
import
(
"math/big"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
...
...
accounts/scwallet/wallet.go
View file @
810f9e05
...
...
@@ -33,7 +33,7 @@ import (
"sync"
"time"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
...
...
accounts/usbwallet/wallet.go
View file @
810f9e05
...
...
@@ -25,7 +25,7 @@ import (
"sync"
"time"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
...
...
cmd/clef/main.go
View file @
810f9e05
...
...
@@ -54,7 +54,7 @@ import (
"github.com/ethereum/go-ethereum/signer/rules"
"github.com/ethereum/go-ethereum/signer/storage"
colorable
"github.com/mattn/go-colorable"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"gopkg.in/urfave/cli.v1"
)
...
...
cmd/devp2p/dnscmd.go
View file @
810f9e05
...
...
@@ -30,7 +30,7 @@ import (
"github.com/ethereum/go-ethereum/console/prompt"
"github.com/ethereum/go-ethereum/p2p/dnsdisc"
"github.com/ethereum/go-ethereum/p2p/enode"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
var
(
...
...
cmd/evm/compiler.go
View file @
810f9e05
...
...
@@ -23,7 +23,7 @@ import (
"github.com/ethereum/go-ethereum/cmd/evm/internal/compiler"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
var
compileCommand
=
cli
.
Command
{
...
...
cmd/evm/disasm.go
View file @
810f9e05
...
...
@@ -23,7 +23,7 @@ import (
"strings"
"github.com/ethereum/go-ethereum/core/asm"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
var
disasmCommand
=
cli
.
Command
{
...
...
cmd/evm/runner.go
View file @
810f9e05
...
...
@@ -38,7 +38,7 @@ import (
"github.com/ethereum/go-ethereum/core/vm/runtime"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
var
runCommand
=
cli
.
Command
{
...
...
cmd/evm/staterunner.go
View file @
810f9e05
...
...
@@ -28,7 +28,7 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/tests"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
var
stateTestCommand
=
cli
.
Command
{
...
...
cmd/geth/config.go
View file @
810f9e05
...
...
@@ -24,7 +24,7 @@ import (
"reflect"
"unicode"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/eth"
...
...
cmd/geth/main.go
View file @
810f9e05
...
...
@@ -42,7 +42,7 @@ import (
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/node"
gopsutil
"github.com/shirou/gopsutil/mem"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
const
(
...
...
cmd/geth/usage.go
View file @
810f9e05
...
...
@@ -25,7 +25,7 @@ import (
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/internal/flags"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
// AppHelpFlagGroups is the application flags, grouped by functionality.
...
...
cmd/puppeth/genesis.go
View file @
810f9e05
...
...
@@ -152,7 +152,7 @@ func newAlethGenesisSpec(network string, genesis *core.Genesis) (*alethGenesisSp
spec
.
Genesis
.
Author
=
genesis
.
Coinbase
spec
.
Genesis
.
Timestamp
=
(
hexutil
.
Uint64
)(
genesis
.
Timestamp
)
spec
.
Genesis
.
ParentHash
=
genesis
.
ParentHash
spec
.
Genesis
.
ExtraData
=
(
hexutil
.
Bytes
)(
genesis
.
ExtraData
)
spec
.
Genesis
.
ExtraData
=
genesis
.
ExtraData
spec
.
Genesis
.
GasLimit
=
(
hexutil
.
Uint64
)(
genesis
.
GasLimit
)
for
address
,
account
:=
range
genesis
.
Alloc
{
...
...
@@ -430,7 +430,7 @@ func newParityChainSpec(network string, genesis *core.Genesis, bootnodes []strin
spec
.
Genesis
.
Author
=
genesis
.
Coinbase
spec
.
Genesis
.
Timestamp
=
(
hexutil
.
Uint64
)(
genesis
.
Timestamp
)
spec
.
Genesis
.
ParentHash
=
genesis
.
ParentHash
spec
.
Genesis
.
ExtraData
=
(
hexutil
.
Bytes
)(
genesis
.
ExtraData
)
spec
.
Genesis
.
ExtraData
=
genesis
.
ExtraData
spec
.
Genesis
.
GasLimit
=
(
hexutil
.
Uint64
)(
genesis
.
GasLimit
)
spec
.
Accounts
=
make
(
map
[
common
.
UnprefixedAddress
]
*
parityChainSpecAccount
)
...
...
cmd/utils/flags.go
View file @
810f9e05
...
...
@@ -64,7 +64,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/netutil"
"github.com/ethereum/go-ethereum/params"
pcsclite
"github.com/gballet/go-libpcsclite"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
func
init
()
{
...
...
common/hexutil/json_test.go
View file @
810f9e05
...
...
@@ -88,7 +88,7 @@ func TestUnmarshalBytes(t *testing.T) {
if
!
checkError
(
t
,
test
.
input
,
err
,
test
.
wantErr
)
{
continue
}
if
!
bytes
.
Equal
(
test
.
want
.
([]
byte
),
[]
byte
(
v
)
)
{
if
!
bytes
.
Equal
(
test
.
want
.
([]
byte
),
v
)
{
t
.
Errorf
(
"input %s: value mismatch: got %x, want %x"
,
test
.
input
,
&
v
,
test
.
want
)
continue
}
...
...
consensus/ethash/ethash.go
View file @
810f9e05
...
...
@@ -33,7 +33,7 @@ import (
"time"
"unsafe"
mmap
"github.com/edsrzf/mmap-go"
"github.com/edsrzf/mmap-go"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
...
...
contracts/checkpointoracle/oracle.go
View file @
810f9e05
...
...
@@ -65,7 +65,7 @@ func (oracle *CheckpointOracle) LookupCheckpointEvents(blockLogs [][]*types.Log,
if
err
!=
nil
{
continue
}
if
event
.
Index
==
section
&&
common
.
Hash
(
event
.
CheckpointHash
)
==
hash
{
if
event
.
Index
==
section
&&
event
.
CheckpointHash
==
hash
{
votes
=
append
(
votes
,
event
)
}
}
...
...
core/state/statedb.go
View file @
810f9e05
...
...
@@ -318,7 +318,7 @@ func (s *StateDB) GetState(addr common.Address, hash common.Hash) common.Hash {
func
(
s
*
StateDB
)
GetProof
(
a
common
.
Address
)
([][]
byte
,
error
)
{
var
proof
proofList
err
:=
s
.
trie
.
Prove
(
crypto
.
Keccak256
(
a
.
Bytes
()),
0
,
&
proof
)
return
[][]
byte
(
proof
)
,
err
return
proof
,
err
}
// GetStorageProof returns the StorageProof for given key
...
...
@@ -329,7 +329,7 @@ func (s *StateDB) GetStorageProof(a common.Address, key common.Hash) ([][]byte,
return
proof
,
errors
.
New
(
"storage trie for requested address does not exist"
)
}
err
:=
trie
.
Prove
(
crypto
.
Keccak256
(
key
.
Bytes
()),
0
,
&
proof
)
return
[][]
byte
(
proof
)
,
err
return
proof
,
err
}
// GetCommittedState retrieves a value from the given account's committed storage trie.
...
...
core/tx_pool_test.go
View file @
810f9e05
...
...
@@ -1139,7 +1139,7 @@ func TestTransactionAllowedTxSize(t *testing.T) {
t
.
Fatalf
(
"expected rejection on slightly oversize transaction"
)
}
// Try adding a transaction of random not allowed size
if
err
:=
pool
.
addRemoteSync
(
pricedDataTransaction
(
2
,
pool
.
currentMaxGas
,
big
.
NewInt
(
1
),
key
,
dataSize
+
1
+
uint64
(
rand
.
Intn
(
int
(
10
*
txMaxSize
)
))));
err
==
nil
{
if
err
:=
pool
.
addRemoteSync
(
pricedDataTransaction
(
2
,
pool
.
currentMaxGas
,
big
.
NewInt
(
1
),
key
,
dataSize
+
1
+
uint64
(
rand
.
Intn
(
10
*
txMaxSize
))));
err
==
nil
{
t
.
Fatalf
(
"expected rejection on oversize transaction"
)
}
// Run some sanity checks on the pool internals
...
...
core/vm/evm.go
View file @
810f9e05
...
...
@@ -525,7 +525,7 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I
// instead of the usual sender-and-nonce-hash as the address where the contract is initialized at.
func
(
evm
*
EVM
)
Create2
(
caller
ContractRef
,
code
[]
byte
,
gas
uint64
,
endowment
*
big
.
Int
,
salt
*
uint256
.
Int
)
(
ret
[]
byte
,
contractAddr
common
.
Address
,
leftOverGas
uint64
,
err
error
)
{
codeAndHash
:=
&
codeAndHash
{
code
:
code
}
contractAddr
=
crypto
.
CreateAddress2
(
caller
.
Address
(),
common
.
Hash
(
salt
.
Bytes32
()
),
codeAndHash
.
Hash
()
.
Bytes
())
contractAddr
=
crypto
.
CreateAddress2
(
caller
.
Address
(),
salt
.
Bytes32
(
),
codeAndHash
.
Hash
()
.
Bytes
())
return
evm
.
create
(
caller
,
codeAndHash
,
gas
,
endowment
,
contractAddr
)
}
...
...
core/vm/gas_table.go
View file @
810f9e05
...
...
@@ -96,7 +96,7 @@ var (
func
gasSStore
(
evm
*
EVM
,
contract
*
Contract
,
stack
*
Stack
,
mem
*
Memory
,
memorySize
uint64
)
(
uint64
,
error
)
{
var
(
y
,
x
=
stack
.
Back
(
1
),
stack
.
Back
(
0
)
current
=
evm
.
StateDB
.
GetState
(
contract
.
Address
(),
common
.
Hash
(
x
.
Bytes32
()
))
current
=
evm
.
StateDB
.
GetState
(
contract
.
Address
(),
x
.
Bytes32
(
))
)
// The legacy gas metering only takes into consideration the current state
// Legacy rules should be applied if we are in Petersburg (removal of EIP-1283)
...
...
@@ -135,7 +135,7 @@ func gasSStore(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySi
if
current
==
value
{
// noop (1)
return
params
.
NetSstoreNoopGas
,
nil
}
original
:=
evm
.
StateDB
.
GetCommittedState
(
contract
.
Address
(),
common
.
Hash
(
x
.
Bytes32
()
))
original
:=
evm
.
StateDB
.
GetCommittedState
(
contract
.
Address
(),
x
.
Bytes32
(
))
if
original
==
current
{
if
original
==
(
common
.
Hash
{})
{
// create slot (2.1.1)
return
params
.
NetSstoreInitGas
,
nil
...
...
@@ -183,14 +183,14 @@ func gasSStoreEIP2200(evm *EVM, contract *Contract, stack *Stack, mem *Memory, m
// Gas sentry honoured, do the actual gas calculation based on the stored value
var
(
y
,
x
=
stack
.
Back
(
1
),
stack
.
Back
(
0
)
current
=
evm
.
StateDB
.
GetState
(
contract
.
Address
(),
common
.
Hash
(
x
.
Bytes32
()
))
current
=
evm
.
StateDB
.
GetState
(
contract
.
Address
(),
x
.
Bytes32
(
))
)
value
:=
common
.
Hash
(
y
.
Bytes32
())
if
current
==
value
{
// noop (1)
return
params
.
SloadGasEIP2200
,
nil
}
original
:=
evm
.
StateDB
.
GetCommittedState
(
contract
.
Address
(),
common
.
Hash
(
x
.
Bytes32
()
))
original
:=
evm
.
StateDB
.
GetCommittedState
(
contract
.
Address
(),
x
.
Bytes32
(
))
if
original
==
current
{
if
original
==
(
common
.
Hash
{})
{
// create slot (2.1.1)
return
params
.
SstoreSetGasEIP2200
,
nil
...
...
core/vm/instructions.go
View file @
810f9e05
...
...
@@ -341,7 +341,7 @@ func opReturnDataCopy(pc *uint64, interpreter *EVMInterpreter, callContext *call
func
opExtCodeSize
(
pc
*
uint64
,
interpreter
*
EVMInterpreter
,
callContext
*
callCtx
)
([]
byte
,
error
)
{
slot
:=
callContext
.
stack
.
peek
()
slot
.
SetUint64
(
uint64
(
interpreter
.
evm
.
StateDB
.
GetCodeSize
(
common
.
Address
(
slot
.
Bytes20
()
))))
slot
.
SetUint64
(
uint64
(
interpreter
.
evm
.
StateDB
.
GetCodeSize
(
slot
.
Bytes20
(
))))
return
nil
,
nil
}
...
...
@@ -517,7 +517,7 @@ func opSstore(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([]
loc
:=
callContext
.
stack
.
pop
()
val
:=
callContext
.
stack
.
pop
()
interpreter
.
evm
.
StateDB
.
SetState
(
callContext
.
contract
.
Address
(),
common
.
Hash
(
loc
.
Bytes32
()),
common
.
Hash
(
val
.
Bytes32
()
))
loc
.
Bytes32
(),
val
.
Bytes32
(
))
return
nil
,
nil
}
...
...
@@ -817,7 +817,7 @@ func opStop(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([]by
func
opSuicide
(
pc
*
uint64
,
interpreter
*
EVMInterpreter
,
callContext
*
callCtx
)
([]
byte
,
error
)
{
beneficiary
:=
callContext
.
stack
.
pop
()
balance
:=
interpreter
.
evm
.
StateDB
.
GetBalance
(
callContext
.
contract
.
Address
())
interpreter
.
evm
.
StateDB
.
AddBalance
(
common
.
Address
(
beneficiary
.
Bytes20
()
),
balance
)
interpreter
.
evm
.
StateDB
.
AddBalance
(
beneficiary
.
Bytes20
(
),
balance
)
interpreter
.
evm
.
StateDB
.
Suicide
(
callContext
.
contract
.
Address
())
return
nil
,
nil
}
...
...
@@ -832,7 +832,7 @@ func makeLog(size int) executionFunc {
mStart
,
mSize
:=
stack
.
pop
(),
stack
.
pop
()
for
i
:=
0
;
i
<
size
;
i
++
{
addr
:=
stack
.
pop
()
topics
[
i
]
=
common
.
Hash
(
addr
.
Bytes32
()
)
topics
[
i
]
=
addr
.
Bytes32
(
)
}
d
:=
callContext
.
memory
.
GetCopy
(
int64
(
mStart
.
Uint64
()),
int64
(
mSize
.
Uint64
()))
...
...
core/vm/operations_acl.go
View file @
810f9e05
...
...
@@ -73,7 +73,7 @@ func gasSStoreEIP2929(evm *EVM, contract *Contract, stack *Stack, mem *Memory, m
// return params.SloadGasEIP2200, nil
return
cost
+
WarmStorageReadCostEIP2929
,
nil
// SLOAD_GAS
}
original
:=
evm
.
StateDB
.
GetCommittedState
(
contract
.
Address
(),
common
.
Hash
(
x
.
Bytes32
()
))
original
:=
evm
.
StateDB
.
GetCommittedState
(
contract
.
Address
(),
x
.
Bytes32
(
))
if
original
==
current
{
if
original
==
(
common
.
Hash
{})
{
// create slot (2.1.1)
return
cost
+
params
.
SstoreSetGasEIP2200
,
nil
...
...
eth/downloader/api.go
View file @
810f9e05
...
...
@@ -20,7 +20,7 @@ import (
"context"
"sync"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/rpc"
)
...
...
eth/filters/api.go
View file @
810f9e05
...
...
@@ -25,7 +25,7 @@ import (
"sync"
"time"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
...
...
@@ -292,7 +292,7 @@ func (api *PublicFilterAPI) NewFilter(crit FilterCriteria) (rpc.ID, error) {
logs
:=
make
(
chan
[]
*
types
.
Log
)
logsSub
,
err
:=
api
.
events
.
SubscribeLogs
(
ethereum
.
FilterQuery
(
crit
),
logs
)
if
err
!=
nil
{
return
rpc
.
ID
(
""
)
,
err
return
""
,
err
}
api
.
filtersMu
.
Lock
()
...
...
eth/filters/filter_system.go
View file @
810f9e05
...
...
@@ -24,7 +24,7 @@ import (
"sync"
"time"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/rawdb"
...
...
eth/filters/filter_system_test.go
View file @
810f9e05
...
...
@@ -25,7 +25,7 @@ import (
"testing"
"time"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
...
...
eth/tracers/tracer.go
View file @
810f9e05
...
...
@@ -30,7 +30,7 @@ import (
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
duktape
"gopkg.in/olebedev/go-duktape.v3"
"gopkg.in/olebedev/go-duktape.v3"
)
// bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js.
...
...
event/event_test.go
View file @
810f9e05
...
...
@@ -29,7 +29,7 @@ func TestSubCloseUnsub(t *testing.T) {
// the point of this test is **not** to panic
var
mux
TypeMux
mux
.
Stop
()
sub
:=
mux
.
Subscribe
(
int
(
0
)
)
sub
:=
mux
.
Subscribe
(
0
)
sub
.
Unsubscribe
()
}
...
...
event/feed_test.go
View file @
810f9e05
...
...
@@ -27,8 +27,8 @@ import (
func
TestFeedPanics
(
t
*
testing
.
T
)
{
{
var
f
Feed
f
.
Send
(
int
(
2
)
)
want
:=
feedTypeError
{
op
:
"Send"
,
got
:
reflect
.
TypeOf
(
uint64
(
0
)),
want
:
reflect
.
TypeOf
(
int
(
0
)
)}
f
.
Send
(
2
)
want
:=
feedTypeError
{
op
:
"Send"
,
got
:
reflect
.
TypeOf
(
uint64
(
0
)),
want
:
reflect
.
TypeOf
(
0
)}
if
err
:=
checkPanic
(
want
,
func
()
{
f
.
Send
(
uint64
(
2
))
});
err
!=
nil
{
t
.
Error
(
err
)
}
...
...
@@ -37,14 +37,14 @@ func TestFeedPanics(t *testing.T) {
var
f
Feed
ch
:=
make
(
chan
int
)
f
.
Subscribe
(
ch
)
want
:=
feedTypeError
{
op
:
"Send"
,
got
:
reflect
.
TypeOf
(
uint64
(
0
)),
want
:
reflect
.
TypeOf
(
int
(
0
)
)}
want
:=
feedTypeError
{
op
:
"Send"
,
got
:
reflect
.
TypeOf
(
uint64
(
0
)),
want
:
reflect
.
TypeOf
(
0
)}
if
err
:=
checkPanic
(
want
,
func
()
{
f
.
Send
(
uint64
(
2
))
});
err
!=
nil
{
t
.
Error
(
err
)
}
}
{
var
f
Feed
f
.
Send
(
int
(
2
)
)
f
.
Send
(
2
)
want
:=
feedTypeError
{
op
:
"Subscribe"
,
got
:
reflect
.
TypeOf
(
make
(
chan
uint64
)),
want
:
reflect
.
TypeOf
(
make
(
chan
<-
int
))}
if
err
:=
checkPanic
(
want
,
func
()
{
f
.
Subscribe
(
make
(
chan
uint64
))
});
err
!=
nil
{
t
.
Error
(
err
)
...
...
@@ -58,7 +58,7 @@ func TestFeedPanics(t *testing.T) {
}
{
var
f
Feed
if
err
:=
checkPanic
(
errBadChannel
,
func
()
{
f
.
Subscribe
(
int
(
0
)
)
});
err
!=
nil
{
if
err
:=
checkPanic
(
errBadChannel
,
func
()
{
f
.
Subscribe
(
0
)
});
err
!=
nil
{
t
.
Error
(
err
)
}
}
...
...
graphql/graphql.go
View file @
810f9e05
...
...
@@ -77,7 +77,7 @@ func (a *Account) Code(ctx context.Context) (hexutil.Bytes, error) {
if
err
!=
nil
{
return
hexutil
.
Bytes
{},
err
}
return
hexutil
.
Bytes
(
state
.
GetCode
(
a
.
address
)
),
nil
return
state
.
GetCode
(
a
.
address
),
nil
}
func
(
a
*
Account
)
Storage
(
ctx
context
.
Context
,
args
struct
{
Slot
common
.
Hash
})
(
common
.
Hash
,
error
)
{
...
...
@@ -116,7 +116,7 @@ func (l *Log) Topics(ctx context.Context) []common.Hash {
}
func
(
l
*
Log
)
Data
(
ctx
context
.
Context
)
hexutil
.
Bytes
{
return
hexutil
.
Bytes
(
l
.
log
.
Data
)
return
l
.
log
.
Data
}
// Transaction represents an Ethereum transaction.
...
...
@@ -157,7 +157,7 @@ func (t *Transaction) InputData(ctx context.Context) (hexutil.Bytes, error) {
if
err
!=
nil
||
tx
==
nil
{
return
hexutil
.
Bytes
{},
err
}
return
hexutil
.
Bytes
(
tx
.
Data
()
),
nil
return
tx
.
Data
(
),
nil
}
func
(
t
*
Transaction
)
Gas
(
ctx
context
.
Context
)
(
hexutil
.
Uint64
,
error
)
{
...
...
@@ -410,7 +410,7 @@ func (b *Block) resolveReceipts(ctx context.Context) ([]*types.Receipt, error) {
if
err
!=
nil
{
return
nil
,
err
}
b
.
receipts
=
[]
*
types
.
Receipt
(
receipts
)
b
.
receipts
=
receipts
}
return
b
.
receipts
,
nil
}
...
...
@@ -490,7 +490,7 @@ func (b *Block) Nonce(ctx context.Context) (hexutil.Bytes, error) {
if
err
!=
nil
{
return
hexutil
.
Bytes
{},
err
}
return
he
xutil
.
Bytes
(
header
.
Nonce
[
:
])
,
nil
return
he
ader
.
Nonce
[
:
]
,
nil
}
func
(
b
*
Block
)
MixHash
(
ctx
context
.
Context
)
(
common
.
Hash
,
error
)
{
...
...
@@ -564,7 +564,7 @@ func (b *Block) ExtraData(ctx context.Context) (hexutil.Bytes, error) {
if
err
!=
nil
{
return
hexutil
.
Bytes
{},
err
}
return
he
xutil
.
Bytes
(
header
.
Extra
)
,
nil
return
he
ader
.
Extra
,
nil
}
func
(
b
*
Block
)
LogsBloom
(
ctx
context
.
Context
)
(
hexutil
.
Bytes
,
error
)
{
...
...
@@ -572,7 +572,7 @@ func (b *Block) LogsBloom(ctx context.Context) (hexutil.Bytes, error) {
if
err
!=
nil
{
return
hexutil
.
Bytes
{},
err
}
return
he
xutil
.
Bytes
(
header
.
Bloom
.
Bytes
()
),
nil
return
he
ader
.
Bloom
.
Bytes
(
),
nil
}
func
(
b
*
Block
)
TotalDifficulty
(
ctx
context
.
Context
)
(
hexutil
.
Big
,
error
)
{
...
...
@@ -907,7 +907,7 @@ func (r *Resolver) Block(ctx context.Context, args struct {
})
(
*
Block
,
error
)
{
var
block
*
Block
if
args
.
Number
!=
nil
{
number
:=
rpc
.
BlockNumber
(
uint64
(
*
args
.
Number
)
)
number
:=
rpc
.
BlockNumber
(
*
args
.
Number
)
numberOrHash
:=
rpc
.
BlockNumberOrHashWithNumber
(
number
)
block
=
&
Block
{
backend
:
r
.
backend
,
...
...
internal/debug/flags.go
View file @
810f9e05
...
...
@@ -28,7 +28,7 @@ import (
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/metrics/exp"
"github.com/fjl/memsize/memsizeui"
colorable
"github.com/mattn/go-colorable"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"gopkg.in/urfave/cli.v1"
)
...
...
internal/ethapi/api.go
View file @
810f9e05
...
...
@@ -793,7 +793,7 @@ func (args *CallArgs) ToMessage(globalGasCap uint64) types.Message {
var
data
[]
byte
if
args
.
Data
!=
nil
{
data
=
[]
byte
(
*
args
.
Data
)
data
=
*
args
.
Data
}
msg
:=
types
.
NewMessage
(
addr
,
args
.
To
,
0
,
value
,
gas
,
gasPrice
,
data
,
false
)
...
...
internal/flags/helpers.go
View file @
810f9e05
...
...
@@ -21,7 +21,7 @@ import (
"path/filepath"
"github.com/ethereum/go-ethereum/params"
cli
"gopkg.in/urfave/cli.v1"
"gopkg.in/urfave/cli.v1"
)
var
(
...
...
miner/unconfirmed_test.go
View file @
810f9e05
...
...
@@ -19,7 +19,6 @@ package miner
import
(
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
...
...
@@ -43,7 +42,7 @@ func TestUnconfirmedInsertBounds(t *testing.T) {
for
depth
:=
uint64
(
0
);
depth
<
2
*
uint64
(
limit
);
depth
++
{
// Insert multiple blocks for the same level just to stress it
for
i
:=
0
;
i
<
int
(
depth
);
i
++
{
pool
.
Insert
(
depth
,
common
.
Hash
([
32
]
byte
{
byte
(
depth
),
byte
(
i
)})
)
pool
.
Insert
(
depth
,
[
32
]
byte
{
byte
(
depth
),
byte
(
i
)}
)
}
// Validate that no blocks below the depth allowance are left in
pool
.
blocks
.
Do
(
func
(
block
interface
{})
{
...
...
@@ -63,7 +62,7 @@ func TestUnconfirmedShifts(t *testing.T) {
pool
:=
newUnconfirmedBlocks
(
new
(
noopChainRetriever
),
limit
)
for
depth
:=
start
;
depth
<
start
+
uint64
(
limit
);
depth
++
{
pool
.
Insert
(
depth
,
common
.
Hash
([
32
]
byte
{
byte
(
depth
)})
)
pool
.
Insert
(
depth
,
[
32
]
byte
{
byte
(
depth
)}
)
}
// Try to shift below the limit and ensure no blocks are dropped
pool
.
Shift
(
start
+
uint64
(
limit
)
-
1
)
...
...
mobile/ethereum.go
View file @
810f9e05
...
...
@@ -21,7 +21,7 @@ package geth
import
(
"errors"
ethereum
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
)
...
...
p2p/enode/nodedb.go
View file @
810f9e05
...
...
@@ -163,7 +163,7 @@ func splitNodeItemKey(key []byte) (id ID, ip net.IP, field string) {
}
key
=
key
[
len
(
dbDiscoverRoot
)
+
1
:
]
// Split out the IP.
ip
=
net
.
IP
(
key
[
:
16
])
ip
=
key
[
:
16
]
if
ip4
:=
ip
.
To4
();
ip4
!=
nil
{
ip
=
ip4
}
...
...
signer/core/signed_data.go
View file @
810f9e05
...
...
@@ -506,7 +506,7 @@ func parseBytes(encType interface{}) ([]byte, bool) {
case
[]
byte
:
return
v
,
true
case
hexutil
.
Bytes
:
return
[]
byte
(
v
)
,
true
return
v
,
true
case
string
:
bytes
,
err
:=
hexutil
.
Decode
(
v
)
if
err
!=
nil
{
...
...
trie/database.go
View file @
810f9e05
...
...
@@ -100,7 +100,7 @@ func (n rawNode) cache() (hashNode, bool) { panic("this should never end up in
func
(
n
rawNode
)
fstring
(
ind
string
)
string
{
panic
(
"this should never end up in a live trie"
)
}
func
(
n
rawNode
)
EncodeRLP
(
w
io
.
Writer
)
error
{
_
,
err
:=
w
.
Write
(
[]
byte
(
n
)
)
_
,
err
:=
w
.
Write
(
n
)
return
err
}
...
...
trie/iterator.go
View file @
810f9e05
...
...
@@ -173,7 +173,7 @@ func (it *nodeIterator) LeafKey() []byte {
func
(
it
*
nodeIterator
)
LeafBlob
()
[]
byte
{
if
len
(
it
.
stack
)
>
0
{
if
node
,
ok
:=
it
.
stack
[
len
(
it
.
stack
)
-
1
]
.
node
.
(
valueNode
);
ok
{
return
[]
byte
(
node
)
return
node
}
}
panic
(
"not at leaf"
)
...
...
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