Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
67454df
params: begin v1.10.20 release cycle
karalabe Jun 15, 2022
ba99e19
internal/ethapi: add comment explaining return of nil instead of erro…
kosuke-taniguchi Jun 16, 2022
01e5e9c
tests/fuzzers/rlp: avoid very large input (#25109)
holiman Jun 16, 2022
21129ec
node: make jwt tests less time-dependent (#25120)
holiman Jun 20, 2022
c776029
cmd/faucet: more verbose message about private posts (#25129)
Jun 20, 2022
d39f0cc
internal/ethapi: remove SignAndSendTransaction (#25111)
s1na Jun 20, 2022
ad15050
cmd/faucet: add sepolia network support (#25128)
Jun 20, 2022
241dd27
trie: fix size accounting in cleaner (#25007)
aaronbuchwald Jun 21, 2022
10dc5dc
all: remove concept of public/private API definitions (#25053)
lightclient Jun 21, 2022
f20a569
cmd/geth: drop geth js command (#25000)
s1na Jun 21, 2022
f49e298
README,rpc: remove mention of "shh" RPC API (#25137)
Jun 21, 2022
7c7cd41
eth, miner: retrieve mining state from live database (#25139)
rjl493456442 Jun 22, 2022
68420e1
core: fix typo in txpool (#25149)
aaronbuchwald Jun 22, 2022
0f044f3
go.mod: upgrade to latest goleveldb (#25067)
ucwong Jun 23, 2022
6135c68
eth/tracers: optimize goja buffer conversion (#25156)
s1na Jun 23, 2022
e620fa3
eth: fix typo (#25161)
int88 Jun 24, 2022
647c6f2
internal/ethapi: always return chain id (#25166)
lightclient Jun 24, 2022
c7f485d
internal/ethapi: add note about eth_chainId compatibility with EIP-69…
lightclient Jun 25, 2022
119f955
all: remove `public` field from `rpc.API` (#25059)
lightclient Jun 27, 2022
0c6f81f
all: remove version field from rpc.API
lightclient Jun 15, 2022
52ed357
cmd: migrate to urfave/cli/v2 (#24751)
willianpaixao Jun 27, 2022
1438e7c
params: set TTD for sepolia testnet (#25179)
MariusVanDerWijden Jun 28, 2022
9a5c100
cmd/geth, p2p: add support for custom discovery UDP port (#24979)
zeim839 Jun 28, 2022
d1890aa
fix: linter warning (#25192)
gballet Jun 29, 2022
3f712e7
core/rawdb: fix typo in comment (#25191)
noirgif Jun 29, 2022
300f612
core/rawdb: simplify TestDiskSeek to use memorydb (#25182)
aaronbuchwald Jun 29, 2022
9ecf8a9
cmd/utils: fix applying bootstrap nodes from config file (#25174)
andrepatta Jun 29, 2022
3e693e1
internal/ethapi: return chain id for EIP-155 legacy txs (#25155)
lightclient Jun 29, 2022
c2070f8
common: increase StorageSize test coverage (#25188)
dbadoy Jun 29, 2022
d12b1a9
consensus/beacon: check that only the latest pow block is valid ttd b…
MariusVanDerWijden Jun 29, 2022
ea0bf08
build: fix auto-completion scripts and include them in .deb package (…
willianpaixao Jun 29, 2022
63b2d49
build: upgrade to golangci-lint v1.46.2 (#25202)
fjl Jun 29, 2022
75ebeb7
build/deb: fix auto-completion install paths (#25204)
fjl Jun 29, 2022
8f2416a
params: go-ethereum v1.10.20 stable
fjl Jun 29, 2022
5e25228
params: begin v1.10.21 release cycle
fjl Jun 29, 2022
a1cb728
common/prque: fix typo
dbadoy Jun 30, 2022
692bfd1
Merge pull request #25206 from dbadoy/master
karalabe Jun 30, 2022
de1cecb
eth/catalyst: disallow importing blocks via newPayload during snap sy…
karalabe Jul 1, 2022
953a29f
Replace fmt.Errorf with errors.New in abi argument (#25181)
aaronbuchwald Jul 4, 2022
2697e44
all: change format `0x%x` to `%#x` (#25221)
dbadoy Jul 4, 2022
62470ee
consensus/beacon: copy td value so we can modify it (#25230)
MariusVanDerWijden Jul 4, 2022
e537193
core: allow external code to set the block validator for malicious te…
MariusVanDerWijden Jul 4, 2022
5f6e870
core: apply ttd override to uninitialized db (#25136)
MariusVanDerWijden Jul 4, 2022
55f914a
signer/core/apitypes: support primitive types int96/uint96 (#25105)
spkjp Jul 4, 2022
f6ac80c
cmd/geth, cmd/devp2p: fix some cli parsing issues (#25234)
fjl Jul 4, 2022
87bb5db
core: allow external processor (#25233)
MariusVanDerWijden Jul 5, 2022
7217ef4
consensus/beacon: verify timestamp is greater than parent timestamp (…
MariusVanDerWijden Jul 5, 2022
e3c1a7c
go.mod: updated logfmt dependency (#25231)
MariusVanDerWijden Jul 5, 2022
cb7f359
internal/ethapi: add basefee to block overrides (#25219)
s1na Jul 5, 2022
ed7a80f
build: upgrade -dlgo version to Go 1.18.3
sandakersmann Jul 5, 2022
926b3e0
trie: fix typo in comment (#25241)
aaronbuchwald Jul 6, 2022
e394d01
core/types: fix typo in comment (#25249)
dbadoy Jul 6, 2022
ae8ce72
internal/ethapi: fix chain ID check to return all non-zero IDs (#25244)
lightclient Jul 7, 2022
842ec7c
Merge remote-tracking branch 'foundation/release/1.10' into merge/fou…
meowsbits Jul 8, 2022
76d1670
go.mod,go.sum: go get -d ./... && go mod tidy
meowsbits Jul 8, 2022
f2da77e
cmd/puppeth: rm -rf ./cmd/puppeth
meowsbits Jul 8, 2022
e736df3
cmd/evm: cli.Flag to pointer, add statetest and flags to Dev category
meowsbits Jul 8, 2022
d839515
rpc: add graceful shutdown timeout for HTTP server (#25258)
cifer76 Jul 8, 2022
4e29dab
cmd/evm: [cli] v2 lib adaption: pointerize flag
meowsbits Jul 8, 2022
bc6e594
cmd/evm: [cli] v2 lib adaption: s/GlobalXXX/XXX/g
meowsbits Jul 8, 2022
187bf65
cmd/geth: [cli] rm usage.go per upstream
meowsbits Jul 8, 2022
6fb4bb9
cmd/utils: [cli] v2 lib adaption: s/GlobalXXX/XXX/g
meowsbits Jul 8, 2022
1b280d8
cmd/utils: [cli] v2 lib adaption: s/GlobalXXX/XXX/g
meowsbits Jul 8, 2022
476bbdf
cmd/utils: [cli] v2 lib adaption: s/GlobalXXX/XXX/g
meowsbits Jul 8, 2022
539959b
cmd/utils: [cli] v2 lib adaption: s/GlobalXXX/XXX/g
meowsbits Jul 8, 2022
b281e18
cmd/utils: [cli] v2 lib adaption: s/GlobalXXX/XXX/g
meowsbits Jul 8, 2022
d547ce9
cmd/utils: [cli] v2 lib adaption: s/GlobalXXX/XXX/g
meowsbits Jul 8, 2022
b7bb880
cmd/utils: export SetDataDir per upstream
meowsbits Jul 8, 2022
6faedb7
cmd/utils: implemented upstream-moved homeDir helper function
meowsbits Jul 8, 2022
bd05ab0
consensus/beacon: use Configurator getter/setter methods
meowsbits Jul 8, 2022
69184d6
eth: use renamed struct type
meowsbits Jul 8, 2022
6bbf33d
eth/filters: use renamed struct type
meowsbits Jul 8, 2022
a19491f
eth/filters: use renamed struct type
meowsbits Jul 8, 2022
423244d
params: use Configurator engine Ethash type
meowsbits Jul 8, 2022
948e766
cmd/geth: [cli] adapt core-geth specific flags to v2 lib
meowsbits Jul 8, 2022
a61afc0
consensus/beacon: use Configurator getter/setter methods
meowsbits Jul 8, 2022
37fb55d
node: use renamed struct type
meowsbits Jul 8, 2022
ebac56c
cmd/geth,cmd/utils: [cli] adapt to new v2 lib
meowsbits Jul 8, 2022
3db0905
cmd/faucet: sepolia flag unused; implement in parsing logic
meowsbits Jul 8, 2022
f8a0935
eth/tracers,ethclient: add (parity) TraceAPI receiver to registered
meowsbits Jul 8, 2022
9852957
ethclient: remove removed personal_signAndSendTransaction
meowsbits Jul 8, 2022
b3fc957
p2p/discover: fix typos in comments (#25272)
dbadoy Jul 10, 2022
714fb30
Merge pull request #25247 from sandakersmann/master
karalabe Jul 11, 2022
44893be
core, eth: pre-allocate map in storage copy (#25279)
dbadoy Jul 12, 2022
3e759e2
eth/tracers: add initial revertReasonTracer tracer (#25265)
fanbsb Jul 12, 2022
e66a538
params: enable DNS discovery on Sepolia too
karalabe Jul 12, 2022
48da9d5
Merge pull request #25288 from karalabe/enable-sepolia-dnsdisc
karalabe Jul 12, 2022
68cd0cd
internal/build: add a timestamp to the tar archive folder
karalabe Jul 12, 2022
d740d6e
Merge pull request #25290 from karalabe/tar-archive-folder-time
karalabe Jul 12, 2022
852ced2
cmd/utils: remove TODO, completed
meowsbits Jul 12, 2022
d10c0ab
cmd/utils: do TODO: review networkid initialization
meowsbits Jul 12, 2022
9f96578
build: upgrade -dlgo version to Go 1.18.4
sandakersmann Jul 12, 2022
6a17566
docs/JSON-RPC-API/modules: make docs-generate
meowsbits Jul 13, 2022
f9a5825
cmd/echainspec: add sepolia and kiln nets to defaults list
meowsbits Jul 13, 2022
e108d36
Merge pull request #25293 from sandakersmann/master
karalabe Jul 14, 2022
93f981b
accounts/abi: fix typo in comment (#25271)
eltociear Jul 14, 2022
5b5dfba
accounts/abi/bind/backends: return hash of new blocks (#25163)
DragonDev1906 Jul 14, 2022
b53d382
Merge pull request #25096 from lightclient/remove-version-field
karalabe Jul 14, 2022
434ca02
internal/ethapi: error if tx args includes chain id that doesn't matc…
lightclient Jul 14, 2022
4766b11
core: remove lock in BlockChain.ExportN (#25254)
henridf Jul 14, 2022
1c9afc5
core: prevent negative fee during RPC calls (#25214)
PlasmaPower Jul 15, 2022
1657e43
core, les, eth: port snap sync changes (#24898)
rjl493456442 Jul 15, 2022
a54a230
tests: only activate merge on london rules (#25239)
MariusVanDerWijden Jul 15, 2022
e3df3d3
trie: fix 'gosimple' lint issue (#25309)
fjl Jul 15, 2022
a9ef135
p2p/discover: apply netrestrict in discv5 response handler (#25304)
hadv Jul 15, 2022
a7d47ee
cmd/geth: remove redundant 0x in dbGet/dbDelete (#25315)
gballet Jul 18, 2022
e73e8bc
accounts/abi: substitude arg%d to the range keyword (#25307)
gballet Jul 19, 2022
89b138c
params: Add Shanghai and Cancun blocks (#25305)
gballet Jul 19, 2022
a22fb93
params: change Merge config to print simpler message
Jul 21, 2022
b214c49
cmd/puppeth: remove support for exporting non-Geth genesis configurat…
jwasinger Jul 22, 2022
1764f8f
params: set goerli TTD to 10_790_000 (#25324)
MariusVanDerWijden Jul 22, 2022
ba3919c
signer/core: add canonical TypedData hashing methods (#25283)
nik-suri Jul 22, 2022
62306a5
deps: update goleveldb
holiman Jul 23, 2022
22d71af
params: set sepolia mergeNetsplitBlock to 1735371 (#25372)
MariusVanDerWijden Jul 23, 2022
3b2a6b3
cmd/geth: eth/catalyst: enable authrpc by default (#25152)
MariusVanDerWijden Jul 23, 2022
6da1fce
Merge pull request #25379 from holiman/leveldb_update
karalabe Jul 25, 2022
b2be5f9
eth/catalyst: better warning for ttd not configured (#25394)
MariusVanDerWijden Jul 25, 2022
1ed8b7d
cmd: use flags.Merge for grouping flags (#25392)
rjl493456442 Jul 25, 2022
ff22594
consensus/beacon: fix typo in comment (#25391)
gballet Jul 25, 2022
39900be
p2p/netutil: minor code cosmetic
Abirdcfly Jul 25, 2022
d2247d9
eth, internal, light: fix error string capitalization (#25364)
dbadoy Jul 25, 2022
6c4e5d0
light: fix differTries err message in tests (#25358)
eval-exec Jul 25, 2022
b196ad1
all: add whitespace linter (#25312)
jsvisa Jul 25, 2022
eb2b8cb
eth/tracers/js: fix capitalization in tests
karalabe Jul 25, 2022
2b6a761
Merge pull request #25397 from karalabe/fix-tracer-capitalization
karalabe Jul 25, 2022
f3af3fd
eth: support bubbling up bad blocks from sync to the engine API (#25190)
karalabe Jul 25, 2022
f543e6b
Merge pull request #25371 from Zachinquarantine/mergeconfig-message
karalabe Jul 25, 2022
c6dcd01
core: eth: rpc: implement safe rpc block (#25165)
MariusVanDerWijden Jul 25, 2022
14b0eed
go.mod: downgrade leveldb (#25413)
rjl493456442 Jul 27, 2022
6710942
params: go-ethereum v1.10.21 stable
fjl Jul 27, 2022
9e9fcb8
Merge remote-tracking branch 'foundation/release/1.10' into merge/fou…
meowsbits Aug 1, 2022
2b02646
cmd/puppeth: rm -rf ./cmd/puppeth
meowsbits Aug 1, 2022
5f1b116
go.mod,go.sum: go mod tidy
meowsbits Aug 1, 2022
6d7b27b
params/types/goethereum: add Shanghai, Cancun fields to go-ethereum c…
meowsbits Aug 1, 2022
c1d8db3
accounts/abi/bind/backends: TxGas not declared by package params
meowsbits Aug 1, 2022
8f8bc28
cmd/devp2p: undeclared name: `treeNodeTTLCloudflare`
meowsbits Aug 1, 2022
f348660
params: File is not `goimports`-ed, add trusted checkpoint configs
meowsbits Aug 1, 2022
0e5c118
tests: config.IsLondon undefined (type ctypes.ChainConfigurator has n…
meowsbits Aug 1, 2022
39bca6a
params/confp,params/confp/tconvert,params/mutations,params/types/alet…
meowsbits Aug 1, 2022
348a8bd
cmd/faucet,cmd/geth,cmd/utils,consensus/ethash,core,core/forkid,eth/t…
meowsbits Aug 1, 2022
df653c6
accounts/abi/bind: s/core.GenesisAlloc/genesisT.GenesisAlloc/g
meowsbits Aug 1, 2022
a915381
params/types/coregeth,params/types/ctypes,params/types/genesisT,param…
meowsbits Aug 1, 2022
5bcbb9d
core/forkid: add missing TheMerge test cases
meowsbits Aug 1, 2022
35052a8
Merge branch 'master' into merge/foundation-release/1.10.21
meowsbits Aug 15, 2022
ffb1ea3
accounts,cmd/utils: fixup merge issues; lint and cli lib v2 syntax
meowsbits Aug 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ linters:
- durationcheck
- exportloopref
- gosec
- whitespace

#- structcheck # lots of false positives
#- errcheck #lot of false positives
# - contextcheck
# - errchkjson # lots of false positives
# - errorlint # this check crashes
# - exhaustive # silly check
# - makezero # false positives
# - nilerr # several intentional
# - structcheck # lots of false positives
# - errcheck #lot of false positives
# - contextcheck
# - errchkjson # lots of false positives
# - errorlint # this check crashes
# - exhaustive # silly check
# - makezero # false positives
# - nilerr # several intentional

linters-settings:
gofmt:
Expand All @@ -49,9 +50,9 @@ linters-settings:
min-occurrences: 6 # minimum number of occurrences
gosec:
excludes:
- G404 # Use of weak random number generator - lots of FP
- G107 # Potential http request -- those are intentional
- G306 # G306: Expect WriteFile permissions to be 0600 or less
- G404 # Use of weak random number generator - lots of FP
- G107 # Potential http request -- those are intentional
- G306 # G306: Expect WriteFile permissions to be 0600 or less

issues:
exclude-rules:
Expand All @@ -78,5 +79,6 @@ issues:
exclude:
- 'SA1019: event.TypeMux is deprecated: use Feed'
- 'SA1019: strings.Title is deprecated'
- 'SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.'
- 'SA1029: should not use built-in type string as key for value'
- 'G306: Expect WriteFile permissions to be 0600 or less'
9 changes: 5 additions & 4 deletions accounts/abi/argument.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package abi

import (
"encoding/json"
"errors"
"fmt"
"reflect"
"strings"
Expand Down Expand Up @@ -79,7 +80,7 @@ func (arguments Arguments) isTuple() bool {
func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
if len(data) == 0 {
if len(arguments.NonIndexed()) != 0 {
return nil, fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
return nil, errors.New("abi: attempting to unmarshall an empty string while arguments are expected")
}
return make([]interface{}, 0), nil
}
Expand All @@ -90,11 +91,11 @@ func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte) error {
// Make sure map is not nil
if v == nil {
return fmt.Errorf("abi: cannot unpack into a nil map")
return errors.New("abi: cannot unpack into a nil map")
}
if len(data) == 0 {
if len(arguments.NonIndexed()) != 0 {
return fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
return errors.New("abi: attempting to unmarshall an empty string while arguments are expected")
}
return nil // Nothing to unmarshal, return
}
Expand All @@ -116,7 +117,7 @@ func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
}
if len(values) == 0 {
if len(arguments.NonIndexed()) != 0 {
return fmt.Errorf("abi: attempting to copy no values while arguments are expected")
return errors.New("abi: attempting to copy no values while arguments are expected")
}
return nil // Nothing to copy, return
}
Expand Down
6 changes: 5 additions & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,20 @@ func (b *SimulatedBackend) Close() error {

// Commit imports all the pending transactions as a single block and starts a
// fresh new state.
func (b *SimulatedBackend) Commit() {
func (b *SimulatedBackend) Commit() common.Hash {
b.mu.Lock()
defer b.mu.Unlock()

if _, err := b.blockchain.InsertChain([]*types.Block{b.pendingBlock}); err != nil {
panic(err) // This cannot happen unless the simulator is wrong, fail in that case
}
blockHash := b.pendingBlock.Hash()

// Using the last inserted block here makes it possible to build on a side
// chain after a fork.
b.rollback(b.pendingBlock)

return blockHash
}

// Rollback aborts all pending transactions, reverting to the last committed state.
Expand Down
39 changes: 39 additions & 0 deletions accounts/abi/bind/backends/simulated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1336,3 +1336,42 @@ func TestForkResendTx(t *testing.T) {
t.Errorf("TX included in wrong block: %d", h)
}
}

func TestCommitReturnValue(t *testing.T) {
testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
sim := simTestBackend(testAddr)
defer sim.Close()

startBlockHeight := sim.blockchain.CurrentBlock().NumberU64()

// Test if Commit returns the correct block hash
h1 := sim.Commit()
if h1 != sim.blockchain.CurrentBlock().Hash() {
t.Error("Commit did not return the hash of the last block.")
}

// Create a block in the original chain (containing a transaction to force different block hashes)
head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
gasPrice := new(big.Int).Add(head.BaseFee, big.NewInt(1))
_tx := types.NewTransaction(0, testAddr, big.NewInt(1000), vars.TxGas, gasPrice, nil)
tx, _ := types.SignTx(_tx, types.HomesteadSigner{}, testKey)
sim.SendTransaction(context.Background(), tx)
h2 := sim.Commit()

// Create another block in the original chain
sim.Commit()

// Fork at the first bock
if err := sim.Fork(context.Background(), h1); err != nil {
t.Errorf("forking: %v", err)
}

// Test if Commit returns the correct block hash after the reorg
h2fork := sim.Commit()
if h2 == h2fork {
t.Error("The block in the fork and the original block are the same block!")
}
if sim.blockchain.GetHeader(h2fork, startBlockHeight+2) == nil {
t.Error("Could not retrieve the just created block (side-chain)")
}
}
1 change: 0 additions & 1 deletion accounts/abi/bind/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func (mc *mockPendingCaller) PendingCallContract(ctx context.Context, call ether
}

func TestPassingBlockNumber(t *testing.T) {

mc := &mockPendingCaller{
mockCaller: &mockCaller{
codeAtBytes: []byte{1, 2, 3},
Expand Down
41 changes: 39 additions & 2 deletions accounts/abi/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,43 @@ const (
LangObjC
)

func isKeyWord(arg string) bool {
switch arg {
case "break":
case "case":
case "chan":
case "const":
case "continue":
case "default":
case "defer":
case "else":
case "fallthrough":
case "for":
case "func":
case "go":
case "goto":
case "if":
case "import":
case "interface":
case "iota":
case "map":
case "make":
case "new":
case "package":
case "range":
case "return":
case "select":
case "struct":
case "switch":
case "type":
case "var":
default:
return false
}

return true
}

// Bind generates a Go wrapper around a contract ABI. This wrapper isn't meant
// to be used as is in client code, but rather as an intermediate struct which
// enforces compile time type safety and naming convention opposed to having to
Expand Down Expand Up @@ -114,7 +151,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
normalized.Inputs = make([]abi.Argument, len(original.Inputs))
copy(normalized.Inputs, original.Inputs)
for j, input := range normalized.Inputs {
if input.Name == "" {
if input.Name == "" || isKeyWord(input.Name) {
normalized.Inputs[j].Name = fmt.Sprintf("arg%d", j)
}
if hasStruct(input.Type) {
Expand Down Expand Up @@ -158,7 +195,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
normalized.Inputs = make([]abi.Argument, len(original.Inputs))
copy(normalized.Inputs, original.Inputs)
for j, input := range normalized.Inputs {
if input.Name == "" {
if input.Name == "" || isKeyWord(input.Name) {
normalized.Inputs[j].Name = fmt.Sprintf("arg%d", j)
}
// Event is a bit special, we need to define event struct in binding,
Expand Down
39 changes: 38 additions & 1 deletion accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ var bindTests = []struct {
}
}
`,
bytecode: []string{`0x608060405234801561001057600080fd5b5061042b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063c2bb515f1461003b578063cce7b04814610059575b600080fd5b610043610075565b60405161005091906101af565b60405180910390f35b610073600480360381019061006e91906103ac565b6100b5565b005b61007d6100b8565b604051806040016040528060405180602001604052806000815250815260200160405180602001604052806000815250815250905090565b50565b604051806040016040528060608152602001606081525090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561010c5780820151818401526020810190506100f1565b8381111561011b576000848401525b50505050565b6000601f19601f8301169050919050565b600061013d826100d2565b61014781856100dd565b93506101578185602086016100ee565b61016081610121565b840191505092915050565b600060408301600083015184820360008601526101888282610132565b915050602083015184820360208601526101a28282610132565b9150508091505092915050565b600060208201905081810360008301526101c9818461016b565b905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61022282610121565b810181811067ffffffffffffffff82111715610241576102406101ea565b5b80604052505050565b60006102546101d1565b90506102608282610219565b919050565b600080fd5b600080fd5b600080fd5b600067ffffffffffffffff82111561028f5761028e6101ea565b5b61029882610121565b9050602081019050919050565b82818337600083830152505050565b60006102c76102c284610274565b61024a565b9050828152602081018484840111156102e3576102e261026f565b5b6102ee8482856102a5565b509392505050565b600082601f83011261030b5761030a61026a565b5b813561031b8482602086016102b4565b91505092915050565b60006040828403121561033a576103396101e5565b5b610344604061024a565b9050600082013567ffffffffffffffff81111561036457610363610265565b5b610370848285016102f6565b600083015250602082013567ffffffffffffffff81111561039457610393610265565b5b6103a0848285016102f6565b60208301525092915050565b6000602082840312156103c2576103c16101db565b5b600082013567ffffffffffffffff8111156103e0576103df6101e0565b5b6103ec84828501610324565b9150509291505056fea264697066735822122033bca1606af9b6aeba1673f98c52003cec19338539fb44b86690ce82c51483b564736f6c634300080e0033`},
bytecode: []string{"0x608060405234801561001057600080fd5b5061042b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063c2bb515f1461003b578063cce7b04814610059575b600080fd5b610043610075565b60405161005091906101af565b60405180910390f35b610073600480360381019061006e91906103ac565b6100b5565b005b61007d6100b8565b604051806040016040528060405180602001604052806000815250815260200160405180602001604052806000815250815250905090565b50565b604051806040016040528060608152602001606081525090565b600081519050919050565b600082825260208201905092915050565b60005b8381101561010c5780820151818401526020810190506100f1565b8381111561011b576000848401525b50505050565b6000601f19601f8301169050919050565b600061013d826100d2565b61014781856100dd565b93506101578185602086016100ee565b61016081610121565b840191505092915050565b600060408301600083015184820360008601526101888282610132565b915050602083015184820360208601526101a28282610132565b9150508091505092915050565b600060208201905081810360008301526101c9818461016b565b905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61022282610121565b810181811067ffffffffffffffff82111715610241576102406101ea565b5b80604052505050565b60006102546101d1565b90506102608282610219565b919050565b600080fd5b600080fd5b600080fd5b600067ffffffffffffffff82111561028f5761028e6101ea565b5b61029882610121565b9050602081019050919050565b82818337600083830152505050565b60006102c76102c284610274565b61024a565b9050828152602081018484840111156102e3576102e261026f565b5b6102ee8482856102a5565b509392505050565b600082601f83011261030b5761030a61026a565b5b813561031b8482602086016102b4565b91505092915050565b60006040828403121561033a576103396101e5565b5b610344604061024a565b9050600082013567ffffffffffffffff81111561036457610363610265565b5b610370848285016102f6565b600083015250602082013567ffffffffffffffff81111561039457610393610265565b5b6103a0848285016102f6565b60208301525092915050565b6000602082840312156103c2576103c16101db565b5b600082013567ffffffffffffffff8111156103e0576103df6101e0565b5b6103ec84828501610324565b9150509291505056fea264697066735822122033bca1606af9b6aeba1673f98c52003cec19338539fb44b86690ce82c51483b564736f6c634300080e0033"},
abi: []string{`[ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "int256", "name": "msg", "type": "int256" }, { "indexed": false, "internalType": "int256", "name": "_msg", "type": "int256" } ], "name": "log", "type": "event" }, { "inputs": [ { "components": [ { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "internalType": "struct oracle.request", "name": "req", "type": "tuple" } ], "name": "addRequest", "outputs": [], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "getRequest", "outputs": [ { "components": [ { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "internalType": "struct oracle.request", "name": "", "type": "tuple" } ], "stateMutability": "pure", "type": "function" } ]`},
imports: `
"math/big"
Expand Down Expand Up @@ -2002,6 +2002,43 @@ var bindTests = []struct {
}
`,
},
{
name: "RangeKeyword",
contract: `
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
contract keywordcontract {
function functionWithKeywordParameter(range uint256) public pure {}
}
`,
bytecode: []string{"0x608060405234801561001057600080fd5b5060dc8061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063527a119f14602d575b600080fd5b60436004803603810190603f9190605b565b6045565b005b50565b6000813590506055816092565b92915050565b600060208284031215606e57606d608d565b5b6000607a848285016048565b91505092915050565b6000819050919050565b600080fd5b6099816083565b811460a357600080fd5b5056fea2646970667358221220d4f4525e2615516394055d369fb17df41c359e5e962734f27fd683ea81fd9db164736f6c63430008070033"},
abi: []string{`[{"inputs":[{"internalType":"uint256","name":"range","type":"uint256"}],"name":"functionWithKeywordParameter","outputs":[],"stateMutability":"pure","type":"function"}]`},
imports: `
"math/big"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/params/types/genesisT"
`,
tester: `
var (
key, _ = crypto.GenerateKey()
user, _ = bind.NewKeyedTransactorWithChainID(key, big.NewInt(1337))
sim = backends.NewSimulatedBackend(genesisT.GenesisAlloc{user.From: {Balance: big.NewInt(1000000000000000000)}}, ethconfig.Defaults.Miner.GasCeil)
)
_, tx, _, err := DeployRangeKeyword(user, sim)
if err != nil {
t.Fatalf("error deploying contract: %v", err)
}
sim.Commit()

if _, err = bind.WaitDeployed(nil, sim, tx); err != nil {
t.Errorf("error deploying the contract: %v", err)
}
`,
},
}

// Tests that packages generated by the binder can be successfully compiled and
Expand Down
1 change: 0 additions & 1 deletion accounts/abi/error_handling.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func typeCheck(t Type, value reflect.Value) error {
} else {
return nil
}

}

// typeErr returns a formatted type casting error.
Expand Down
1 change: 0 additions & 1 deletion accounts/abi/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ func TestEventMultiValueWithArrayUnpack(t *testing.T) {
}

func TestEventTupleUnpack(t *testing.T) {

type EventTransfer struct {
Value *big.Int
}
Expand Down
1 change: 0 additions & 1 deletion accounts/abi/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ func mapArgNamesToStructFields(argNames []string, value reflect.Value) (map[stri

// second round ~~~
for _, argName := range argNames {

structFieldName := ToCamelCase(argName)

if structFieldName == "" {
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/selector_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func ParseSelector(unescapedSelector string) (SelectorMarshaling, error) {
return SelectorMarshaling{}, fmt.Errorf("failed to parse selector '%s': unexpected string '%s'", unescapedSelector, rest)
}

// Reassemble the fake ABI and constuct the JSON
// Reassemble the fake ABI and construct the JSON
fakeArgs, err := assembleArgs(args)
if err != nil {
return SelectorMarshaling{}, fmt.Errorf("failed to parse selector: %v", err)
Expand Down
1 change: 0 additions & 1 deletion accounts/abi/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func ReadFixedBytes(t Type, word []byte) (interface{}, error) {

reflect.Copy(array, reflect.ValueOf(word[0:t.Size]))
return array.Interface(), nil

}

// forEachUnpack iteratively unpack elements.
Expand Down
1 change: 0 additions & 1 deletion accounts/hd_cg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func TestHDPathParsing_CG(t *testing.T) {

func testHDPathParsing(coinType uint32) func(t *testing.T) {
return func(t *testing.T) {

// Set the coin type to the one we're testing.
// This assigns the default derivations and iterator to the coin type.
SetCoinTypeConfiguration(coinType)
Expand Down
2 changes: 0 additions & 2 deletions accounts/keystore/keystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ func TestImportExport(t *testing.T) {
if _, err = ks2.Import(json, "new", "new"); err == nil {
t.Errorf("importing a key twice succeeded")
}

}

// TestImportRace tests the keystore on races.
Expand All @@ -402,7 +401,6 @@ func TestImportRace(t *testing.T) {
if _, err := ks2.Import(json, "new", "new"); err != nil {
atomic.AddUint32(&atom, 1)
}

}()
}
wg.Wait()
Expand Down
2 changes: 0 additions & 2 deletions accounts/keystore/passphrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ func (ks keyStorePassphrase) JoinPath(filename string) string {

// Encryptdata encrypts the data given as 'data' with the password 'auth'.
func EncryptDataV3(data, auth []byte, scryptN, scryptP int) (CryptoJSON, error) {

salt := make([]byte, 32)
if _, err := io.ReadFull(rand.Reader, salt); err != nil {
panic("reading from crypto/rand failed: " + err.Error())
Expand Down Expand Up @@ -341,7 +340,6 @@ func getKDFKey(cryptoJSON CryptoJSON, auth string) ([]byte, error) {
r := ensureInt(cryptoJSON.KDFParams["r"])
p := ensureInt(cryptoJSON.KDFParams["p"])
return scrypt.Key(authArray, salt, n, r, p, dkLen)

} else if cryptoJSON.KDF == "pbkdf2" {
c := ensureInt(cryptoJSON.KDFParams["c"])
prf := cryptoJSON.KDFParams["prf"].(string)
Expand Down
4 changes: 2 additions & 2 deletions accounts/scwallet/securechannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (s *SecureChannelSession) mutuallyAuthenticate() error {
return err
}
if response.Sw1 != 0x90 || response.Sw2 != 0x00 {
return fmt.Errorf("got unexpected response from MUTUALLY_AUTHENTICATE: 0x%x%x", response.Sw1, response.Sw2)
return fmt.Errorf("got unexpected response from MUTUALLY_AUTHENTICATE: %#x%x", response.Sw1, response.Sw2)
}

if len(response.Data) != scSecretLength {
Expand Down Expand Up @@ -261,7 +261,7 @@ func (s *SecureChannelSession) transmitEncrypted(cla, ins, p1, p2 byte, data []b
rapdu.deserialize(plainData)

if rapdu.Sw1 != sw1Ok {
return nil, fmt.Errorf("unexpected response status Cla=0x%x, Ins=0x%x, Sw=0x%x%x", cla, ins, rapdu.Sw1, rapdu.Sw2)
return nil, fmt.Errorf("unexpected response status Cla=%#x, Ins=%#x, Sw=%#x%x", cla, ins, rapdu.Sw1, rapdu.Sw2)
}

return rapdu, nil
Expand Down
2 changes: 1 addition & 1 deletion accounts/scwallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func transmit(card *pcsc.Card, command *commandAPDU) (*responseAPDU, error) {
}

if response.Sw1 != sw1Ok {
return nil, fmt.Errorf("unexpected insecure response status Cla=0x%x, Ins=0x%x, Sw=0x%x%x", command.Cla, command.Ins, response.Sw1, response.Sw2)
return nil, fmt.Errorf("unexpected insecure response status Cla=%#x, Ins=%#x, Sw=%#x%x", command.Cla, command.Ins, response.Sw1, response.Sw2)
}

return response, nil
Expand Down
1 change: 0 additions & 1 deletion accounts/usbwallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ func (w *wallet) signHash(account accounts.Account, hash []byte) ([]byte, error)

// SignData signs keccak256(data). The mimetype parameter describes the type of data being signed
func (w *wallet) SignData(account accounts.Account, mimeType string, data []byte) ([]byte, error) {

// Unless we are doing 712 signing, simply dispatch to signHash
if !(mimeType == accounts.MimetypeTypedData && len(data) == 66 && data[0] == 0x19 && data[1] == 0x01) {
return w.signHash(account, crypto.Keccak256(data))
Expand Down
Loading