Commit Graph

652 Commits

Author SHA1 Message Date
Jordan Krage 3c754e2a09
accounts/abi: fix MakeTopics mutation of big.Int inputs (#30785)
#28764 updated `func MakeTopics` to support negative `*big.Int`s.
However, it also changed the behavior of the function from just
_reading_ the input `*big.Int` via `Bytes()`, to leveraging
`big.U256Bytes` which is documented as being _destructive_:

This change updates `MakeTopics` to not mutate the original, and 
also applies the same change in signer/core/apitypes.
2024-11-25 13:34:50 +01:00
Martin HS a5f0001845
cmd/geth: remove unlock commandline flag (#30737)
This is one further step towards removing account management from
`geth`. This PR deprecates the flag `unlock`, and makes the flag moot:
unlock via geth is no longer possible.
2024-11-15 10:15:15 +01:00
Madhur Shrimal a6037d027f
accounts/usbwallet: support dynamic tx (#30180)
Adds support non-legacy transaction-signing using ledger

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-11-08 14:57:29 +01:00
Martin HS 5adc314817
build: update to golangci-lint 1.61.0 (#30587)
Changelog: https://golangci-lint.run/product/changelog/#1610 

Removes `exportloopref` (no longer needed), replaces it with
`copyloopvar` which is basically the opposite.

Also adds: 
- `durationcheck`
- `gocheckcompilerdirectives`
- `reassign`
- `mirror`
- `tenv`

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2024-10-14 19:25:22 +02:00
Ceyhun Onur 9eb91542de
accounts/abi/bind, ethclient/simulated: check SendTransaction error in tests (#30349)
In few tests the returned error from `SendTransaction` is not being
checked. This PR checks the returned err in tests.

Returning errors also revealed tx in `TestCommitReturnValue` is not
actually being sent, and returns err ` only replay-protected (EIP-155)
transactions allowed over RPC`. Fixed the transaction by using the
`testTx` function.
2024-08-27 17:11:50 +02:00
chen4903 65aaf52f4c
accounts/abi: handle ABIs with contract type parameter (#30315)
convert parameter of type contract to the basic `address` type
---------

Co-authored-by: Martin HS <martin@swende.se>
2024-08-20 12:26:35 +02:00
ysh0566 67b8137100
accounts/abi/bind: add accessList support to base bond contract (#30195)
Adding the correct accessList parameter when calling a contract can
reduce gas consumption. However, the current version only allows adding
the accessList manually when constructing the transaction. This PR can
provide convenience for saving gas.
2024-08-01 12:09:04 -06:00
Icarus Wu b635089c7c
all: remove deprecated protobuf dependencies (#30232)
The package `github.com/golang/protobuf/proto` is deprecated in favor
`google.golang.org/protobuf/proto`. We should update the codes to
recommended package.

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
2024-08-01 16:25:55 +02:00
zhiqiangxu 71210b0630
all: simplify tests using t.TempDir() (#30150) 2024-07-15 15:26:58 +02:00
winniehere de366fd2e2
accounts/abi: embed Go template instead of string literal (#30098)
refactor(accounts/abi): use embed pkg to split default template to file
2024-07-02 15:58:15 +03:00
jwasinger 41abab9e39
build: add check for stale generated files (#30037)
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-07-01 17:16:15 +02:00
jwasinger a4e338f05e
accounts/usbwallet/trezor: upgrade to generate with protoc 27.1 (#30058) 2024-07-01 16:18:38 +02:00
Halimao fe0c0b04fe
accounts/keystore: use t.TempDir in test (#30052) 2024-06-25 11:24:33 +02:00
jackyin 3687c34cfc
accounts: avoid duplicate regex compilation (#29943)
* fix: Optimize regular initialization

* modify var name

* variable change to private types
2024-06-12 10:46:36 +03:00
Steven Wang b8cf1636d4
accounts: fix TestUpdateKeyfileContents (#29867)
Create the directory before NewKeyStore. This ensures the watcher successfully starts on
the first attempt, and waitWatcherStart functions as intended.
2024-05-29 12:12:57 +02:00
Bin f8820f170c
accounts, cmd/geth, core: close opened files (#29598)
* fix: open file used up but not closed

* feat: more same case

* feat: accept conversation
2024-04-30 15:47:21 +02:00
haoran b2b0e1da8c
all: fix various typos (#29600)
* core: fix typo

* rpc: fix typo

* snap: fix typo

* trie: fix typo

* main: fix typo

* abi: fix typo

* main: fix field comment for basicOp
2024-04-23 13:09:42 +03:00
persmor 0a51028819
all: fix various typos (#29542)
* core/rawdb: fix typos

* accounts/abi: fix typos

* metrics: fix typo

* beacon: fix typo

* crypto: fix typo

* rpc: fix typo

* rpc: fix typo
2024-04-16 15:44:00 +03:00
Aaron Chen ed4bc7f27b
all: replace fmt.Errorf() with errors.New() if no param required (#29472) 2024-04-08 12:59:17 +02:00
Martin HS 7ee9a6e89f
signer: implement blob txs sendtxargs, enable blobtx-signing (#28976)
This change makes it possible to sign blob transactions
2024-04-05 19:29:44 +02:00
crazeteam fa5019de19
accounts/keystore: fix typos in comments (#29336) 2024-03-27 13:16:29 +01:00
Aaron Chen 723b1e36ad
all: fix mismatched names in comments (#29348)
* all: fix mismatched names in comments

* metrics: fix mismatched name in UpdateIfGt
2024-03-26 21:01:28 +01:00
Martin HS 14cc967d19
all: remove dependency on golang.org/exp (#29314)
This change includes a leftovers from https://github.com/ethereum/go-ethereum/pull/29307
- using the [new `slices` package](https://go.dev/doc/go1.21#slices) and
- using the [new `cmp.Ordered`](https://go.dev/doc/go1.21#cmp) instead of exp `constraints.Ordered`
2024-03-25 07:50:18 +01:00
Martin HS 14eb8967be
all: use min/max/clear from go1.21 (#29307) 2024-03-21 13:50:13 +01:00
Tien Nguyen eda9c7e36f
accounts/abi/bind: check invalid chainID first (#29275) 2024-03-19 14:05:31 +01:00
Martin HS ab49f228ad
all: update to go version 1.22.1 (#28946)
Since Go 1.22 has deprecated certain elliptic curve operations, this PR removes 
references to the affected functions and replaces them with a custom implementation
in package crypto. This causes backwards-incompatible changes in some places.

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-03-18 17:36:50 +01:00
SanYe ba2dd9385c
accounts/abi/bind: remove unused err set and check (#29269)
accounts/abi: remove unused err set and check
2024-03-15 10:46:22 +01:00
Justin Dhillon b80643b737
accounts/usbwallet, common/bitutil: fix broken links in docs (#29078)
fixes some links in documentation
2024-03-13 07:54:40 +01:00
cuinix 3bebabbd03
accounts: remove redundant string conversion (#29184) 2024-03-07 22:25:08 +01:00
Undefinedor a90fe84971
accounts: remove deprecated function NewPlaintextKeyStore (#29171) 2024-03-06 11:55:44 +01:00
Martin HS e73f55365c
accounts/usbwallet: update hid library (#29176) 2024-03-06 12:31:50 +02:00
Martin HS 899bb88a4b
accounts/usbwallet: revert #28945 (#29175) 2024-03-06 11:32:17 +02:00
Martin HS 96bf23f1ea
accounts/usbwallet: use updated hid (only) library (#28945)
* accounts/usbwallet: use updated hid (only) library

* deps: update karalabe/hid
2024-03-05 14:32:47 +01:00
yzb b408b3e5fe
accounts/abi: delete duplicate error check (#29136) 2024-03-04 10:24:24 +01:00
Sina Mahmoodi 95741b1844
core: move genesis alloc types to core/types (#29003)
We want to use these types in public user-facing APIs, so they shouldn't be in core.

Co-authored-by: Felix Lange <fjl@twurst.com>
2024-02-16 19:05:33 +01:00
Peter Straus 1a79089193
fix: update outdated link to trezor docs (#28966)
fix: update link to trezor
2024-02-09 19:30:56 +01:00
Péter Szilágyi 16ce7bf50f
eth, miner: fix enforcing the minimum miner tip (#28933)
* eth, miner: fix enforcing the minimum miner tip

* ethclient/simulated: fix failing test due the min tip change

* accounts/abi/bind: fix simulater gas tip issue
2024-02-06 10:59:24 +02:00
Dimitris Apostolou 8fd43c8013
all: fix typos in comments (#28881) 2024-02-05 22:16:32 +01:00
alex 566754c74a
acounts/usbwallet: fix typo (#28815)
acounts:fix typo
2024-01-15 21:45:50 +02:00
Péter Szilágyi 065f82a8cc
accounts, ethclient: minor tweaks on the new simulated backend (#28799)
* accounts, ethclient: minor tweaks on the new simulated backend

* ethclient/simulated: add an initial batch of gas options

* accounts, ethclient: remove mandatory gasLimit constructor param

* accounts, ethclient: minor option naming tweaks
2024-01-12 15:58:49 +02:00
Marius van der Wijden 2d08c99009
ethclient/simulated: implement new sim backend (#28202)
This is a rewrite of the 'simulated backend', an implementation of the ethclient interfaces
which is backed by a simulated blockchain. It was getting annoying to maintain the old
version of the simulated backend feature because there was a lot of code duplication with
the main client. 

The new version is built using parts that we already have: an in-memory geth node instance
running in developer mode provides the chain, while the Go API is provided by ethclient.
A backwards-compatibility wrapper is provided, but the simulated backend has also moved to
a more sensible import path: github.com/ethereum/go-ethereum/ethclient/simulated

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-01-10 16:45:08 +01:00
rjl493456442 d0edc5af4a
accounts/abi: fix bigInt topic encoding (#28764) 2024-01-09 14:55:09 +01:00
Taeguk Kwon 09e0208029
accounts,signer: fix typos in comments (#28730) 2023-12-28 11:46:51 +01:00
Martin HS d3452a22cc
accounts: properly close managed wallets when closing manager (#28710) 2023-12-20 13:41:40 +01:00
Elias Rad 0f74aad641
all: fix typos in comments (#28662)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-12-13 23:33:46 +01:00
Håvard Anda Estensen 2e13b01046
accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
BorkBorked f04e5bde74
accounts/abi/bind: fixed typos (#28634)
* Update auth.go

* Update backend.go

* Update bind.go

* Update bind_test.go
2023-12-04 11:53:42 +02:00
BorkBorked f2b509d8a1
accounts/abi/bind: fix typo (#28630) 2023-12-01 09:51:50 +01:00
Marius van der Wijden 146e8d999c
core, trie, rpc: speed up tests (#28461)
* rpc: make subscription test faster

reduces time for TestClientSubscriptionChannelClose
from 25 sec to < 1 sec.

* trie: cache trie nodes for faster sanity check

This reduces the time spent on TestIncompleteSyncHash
from ~25s to ~16s.

* core/forkid: speed up validation test

This takes the validation test from > 5s to sub 1 sec

* core/state: improve snapshot test run
brings the time for TestSnapshotRandom from 13s down to 6s

* accounts/keystore: improve keyfile test

This removes some unnecessary waits and reduces the
runtime of TestUpdatedKeyfileContents from 5 to 3 seconds

* trie: remove resolver
* trie: only check ~5% of all trie nodes
2023-11-21 12:19:28 +01:00
levisyin 525db7b2c5
accounts/abi: context info on unpack-errors (#28529)
adds contextual information to errors returned by unpack
2023-11-21 09:16:57 +01:00