Daniel Liu
733a5fc193
accounts: fix mismatched names in comments ( #29348 )
2025-01-24 16:54:12 +08:00
Daniel Liu
dfc0f112b8
accounts/keystore: use min/max/clear from go1.21 ( #29307 )
2025-01-24 16:54:12 +08:00
Daniel Liu
30dc0f47c9
accounts/abi/bind: check invalid chainID first ( #29275 )
2025-01-24 16:54:12 +08:00
Daniel Liu
2b60816af1
accounts/scwallet: remove references to deprecated elliptic package ( #28946 )
2025-01-24 16:54:12 +08:00
Daniel Liu
a9ca99dc6a
accounts: remove redundant string conversion ( #29184 )
2025-01-24 16:54:12 +08:00
Daniel Liu
888963c6ff
accounts: remove deprecated function NewPlaintextKeyStore ( #29171 )
2025-01-24 16:54:12 +08:00
Daniel Liu
13d39173b3
accounts/usbwallet: update hid library ( #29176 )
2025-01-24 16:54:12 +08:00
Daniel Liu
85059ed0d7
accounts/abi: delete duplicate error check ( #29136 )
2025-01-24 16:54:12 +08:00
Daniel Liu
b6f3007af1
core: move genesis alloc types to core/types ( #29003 )
2025-01-24 16:54:12 +08:00
Daniel Liu
745c276ed3
fix: update outdated link to trezor docs ( #28966 )
...
fix: update link to trezor
2025-01-24 16:54:12 +08:00
Daniel Liu
2dfb1cf7d3
accounts: fix typos ( #28881 )
2025-01-24 16:54:12 +08:00
Daniel Liu
0a0784d324
acounts/usbwallet: fix typo ( #28815 )
...
acounts:fix typo
2025-01-24 16:54:12 +08:00
Daniel Liu
c1913bb22a
accounts/abi/bind/backends: replace NewSimulatedBackend with NewXDCSimulatedBackend
2025-01-24 16:54:12 +08:00
Daniel Liu
b5f6104d5d
accounts/abi: fix bigInt topic encoding ( #28764 )
2025-01-24 16:54:12 +08:00
Daniel Liu
0e7679dc6a
accounts,signer: fix typos in comments ( #28730 )
2025-01-24 16:54:12 +08:00
Daniel Liu
36bf7311cd
accounts: properly close managed wallets when closing manager ( #28710 )
2025-01-24 16:54:12 +08:00
Daniel Liu
8133f96d5f
all: fix typos in comments ( #28662 )
...
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
4a54407eb9
accounts: run tests in parallel ( #28544 )
2025-01-24 16:54:12 +08:00
Daniel Liu
c032eed8f8
accounts/abi/bind: fixed typos ( #28634 )
...
* Update auth.go
* Update backend.go
* Update bind.go
* Update bind_test.go
2025-01-24 16:54:12 +08:00
Daniel Liu
0b30a3de38
accounts/abi/bind: fix typo ( #28630 )
2025-01-24 16:54:12 +08:00
Daniel Liu
f804203609
accounts/keystore: speed up tests ( #28461 )
2025-01-24 16:54:12 +08:00
Daniel Liu
ea6606ad1c
accounts/abi: context info on unpack-errors ( #28529 )
...
adds contextual information to errors returned by unpack
2025-01-24 16:54:12 +08:00
Daniel Liu
ccda15ef5d
accounts, cmd: fix typos ( #28526 )
2025-01-24 16:54:12 +08:00
Daniel Liu
e78abe0e44
accounts/scwallet: replace strings.SplitN(arg, sep, 2) with strings.Cut(arg, sep) ( #28446 )
2025-01-24 16:54:12 +08:00
Daniel Liu
919cbf6032
accounts/abi: improve readability of method-to-string conversion ( #28530 )
...
refactor: improve readability of NewMethod print
2025-01-24 16:54:12 +08:00
Daniel Liu
390daf98e4
accounts: fix errors checked by go-staticcheck ST1005 ( #28532 )
2025-01-24 16:54:12 +08:00
Daniel Liu
5081ad72f5
accounts: move fuzzers into native packages ( #28467 )
2025-01-24 16:54:12 +08:00
Daniel Liu
df87605355
api/bind: add CallOpts.BlockHash to allow calling contracts at a specific block hash ( #28084 )
...
* api/bind: Add CallOpts.BlockHash to allow calling contracts at a specific block hash.
* ethclient: Add BalanceAtHash, NonceAtHash and StorageAtHash functions
2025-01-24 16:54:12 +08:00
Daniel Liu
b6c33b9a14
internal/ethapi, accounts/abi/bind: use errors.Is for error comparison ( #28348 )
...
Co-authored-by: lightclient <lightclient@protonmail.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
382855b191
accounts, cmd: fix typos ( #28300 )
2025-01-24 16:54:12 +08:00
Daniel Liu
57598e1825
accounts/abi/bind/backend: use requested header for gas prices and gas limits ( #28280 )
2025-01-24 16:54:12 +08:00
Daniel Liu
0efc73d664
accounts: handle genesis state missing ( #28171 )
2025-01-24 16:54:12 +08:00
Daniel Liu
3e880ef27d
cmd/clef: suppress fsnotify error if keydir not exists ( #28160 )
...
As the keydir will be automatically created after an account is created, no error message if the watcher is failed.
2025-01-24 16:54:12 +08:00
Daniel Liu
4c7507af85
account/abi: handle solidity panic revert ( #27868 )
...
See https://docs.soliditylang.org/en/v0.8.21/control-structures.html#panic-via-assert-and-error-via-require
2025-01-24 16:54:12 +08:00
Daniel Liu
d2cfa789da
account/abi: convert if-else-if chain to tagged switch ( #27869 )
...
account/abi: conver if-else-if chain to tagged switch
2025-01-24 16:54:12 +08:00
Daniel Liu
3bce105c95
accounts: use atomic type ( #27857 )
2025-01-24 16:54:12 +08:00
Daniel Liu
e1c7317374
all: remove trailing whitespace ( #27741 )
2025-01-24 16:54:12 +08:00
Daniel Liu
0f737b4725
core: replace suicide with selfdestruct to improve code consistency ( #27716 )
2025-01-24 16:54:12 +08:00
Daniel Liu
80967d52f6
accounts: fix docstrings ( #27703 )
...
fix function name in comment
Signed-off-by: cui fliter <imcusg@gmail.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
f365434a0c
accounts/keystore: use slices package for sorting ( #27485 )
...
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
a57f3583fc
accounts/keystore: handle error for invalid key in DecryptKey ( #27432 )
...
Co-authored-by: KAI <kaili@coinsummer.io>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
d4bf06d689
accounts: replace noarg fmt.Errorf with errors.New ( #27331 )
...
* accounts: replace noarg fmt.Errorf with errors.New
Signed-off-by: jsvisa <delweng@gmail.com>
* accounts: go autoimport
Signed-off-by: jsvisa <delweng@gmail.com>
---------
Signed-off-by: jsvisa <delweng@gmail.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
013c90a4e8
accounts/abi: add ErrorById ( #27277 )
...
Adds `ErrorById` lookup
2025-01-24 16:54:12 +08:00
Daniel Liu
d9ec687a2c
accounts/abi: resolve name conflict for methods starting with a number ( #26999 )
...
This adds logic to prepend 'M' or 'E' to Solidity identifiers when they would
otherwise violate Go identifier naming rules.
Closes #26972
---------
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
5de961552e
accounts/abi/bind: handle UnpackLog with zero topics ( #26920 )
...
Adds error handling for the case that UnpackLog or UnpackLogIntoMap is called with a log that has zero topics.
---------
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2025-01-24 16:54:12 +08:00
Daniel Liu
1a07b9bb49
accounts/abi: add error-checks ( #26914 )
2025-01-24 16:54:12 +08:00
Daniel Liu
ba053a5468
accounts/usbwallet: mitigate ledger app chunking issue ( #26773 )
...
This PR mitigates an issue with Ledger's on-device RLP deserialization, see
https://github.com/LedgerHQ/app-ethereum/issues/409
Ledger's RLP deserialization code does not validate the length of the RLP list received,
and it may prematurely enter the signing flow when a APDU chunk boundary falls immediately
before the EIP-155 chain_id when deserializing a transaction. Since the chain_id is
uninitialized, it is 0 during this signing flow. This may cause the user to accidentally
sign the transaction with chain_id = 0. That signature would be returned from the device 1
packet earlier than expected by the communication loop. The device blocks the
second-to-last packet waiting for the signer flow, and then errors on the successive
packet (which contains the chain_id, zeroed r, and zeroed s)
Since the signature's early arrival causes successive errors during the communication
process, geth does not parse the improper signature produced by the device, and therefore
no improperly-signed transaction can be created. User funds are not at risk.
We mitigate by selecting the highest chunk size that leaves at least 4 bytes in the
final chunk.
2025-01-24 16:54:11 +08:00
Daniel Liu
3d90cf7de2
accounts/keystore: remove deprecated uses of math.rand ( #26710 )
2025-01-24 16:54:11 +08:00
Daniel Liu
b18e0e45b7
accounts/abi: fix integer encoding/decoding ( #26568 )
...
This PR fixes this abi encoder/decoder to be more stringent.
2025-01-24 16:54:11 +08:00
Daniel Liu
4e951ed8fe
all: use github.com/deckarep/golang-set/v2 (generic set) ( #26159 )
2025-01-24 16:54:11 +08:00
Daniel Liu
cab293859a
eth/filters: update Backend interface ( #26126 )
2025-01-24 16:54:11 +08:00
Daniel Liu
4081ed926a
accounts/keystore: replace inotify with fsnotify ( #26176 )
2025-01-24 16:54:11 +08:00
Daniel Liu
e88251d63a
accounts/abi: properly quote untrusted data in error message ( #26110 )
...
* abi: Format data as hex-string instead of string(data)
* Update accounts/abi/abi.go
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-01-24 16:54:11 +08:00
Daniel Liu
cd9c09f384
accounts/abi.bind: don't fetch head in transact unless required ( #25988 )
...
If GasFeeCap and GasTipCap are specified, we don't need to retrieve the head block for constructing a transaction
2025-01-24 16:54:11 +08:00
Daniel Liu
19085392a2
accounts/abi: return error on fixed bytes with size larger than 32 bytes ( #26075 )
...
* fixed bytes with size larger than 32 bytes is not allowed
* add testcase
2025-01-24 16:54:11 +08:00
Daniel Liu
4292979685
accounts/scwallet: fix keycard data signing error ( #25331 )
...
accounts/scwallet: fix keycard data signing
2025-01-24 16:54:11 +08:00
Daniel Liu
a79d2a2ed3
accounts/keystore: faster tests ( #25827 )
...
This PR removes some optimistic tests -- a'la "do something,
wait a while, and hope it has trickled through and continue" -- and
instead uses some introspection to ensure that prerequisites are met.
2025-01-24 16:54:11 +08:00
Daniel Liu
669b5e081d
accounts: fix spelling mistakes ( #25961 )
2025-01-24 16:54:11 +08:00
Daniel Liu
80f3eaac01
accounts/usbwallet: support Ledger Nano S Plus and FTS ( #25933 )
...
* usbwallet support Ledger Nano S Plus
* accounts/usbwallet: add definitions + ref to ledger docs
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-01-24 16:54:11 +08:00
Daniel Liu
c241fc3574
eth/filters: fix for eth_getLogs failing with tag ( #25922 )
2025-01-24 16:54:11 +08:00
Daniel Liu
98c67ab2d9
accounts/abi: return toGoType error immediately ( #25565 )
2025-01-24 16:54:11 +08:00
Daniel Liu
73947f03b7
accounts/abi/bind/backends: fix AdjustTime to respect Fork ( #25225 )
2025-01-24 16:54:11 +08:00
Daniel Liu
0389524da8
accounts/abi: fix typo in error message ( #25742 )
2025-01-24 16:54:11 +08:00
Daniel Liu
e2b5a03ce8
accounts: lint comments ( #25726 )
2025-01-24 16:54:11 +08:00
Daniel Liu
bdf80d77e4
accounts/abi/bind: add const for tx fee elasticity multiplier ( #25504 )
...
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-01-24 16:54:11 +08:00
Daniel Liu
aec9d767cc
accounts/abi: fix set function ( #25477 )
...
* accounts/abi: fix set function
* don't break things
* update test
2025-01-24 16:54:11 +08:00
Daniel Liu
b6be9c181c
accounts/abi/bind/backends: typo fix ( #25549 )
2025-01-24 16:54:11 +08:00
Daniel Liu
c046f36afd
accounts: fix some typos ( #25551 )
2025-01-24 16:54:11 +08:00
Daniel Liu
08fedbb503
accounts/abi: display name in "method/event not found" error ( #25512 )
2025-01-24 16:54:11 +08:00
Daniel Liu
78a35f1dc3
accounts: lint whitespace ( #25312 )
2025-01-24 16:54:11 +08:00
Daniel Liu
b3d89c0d84
accounts/abi: substitude arg%d to the range keyword ( #25307 )
...
* accounts/abi: substitude arg%d to the range keyword
* support more keywords
* review feedback
2025-01-24 16:54:11 +08:00
Daniel Liu
c5eecc5522
accounts/abi/bind/backends: return hash of new blocks ( #25163 )
...
Co-authored-by: Jens <jmw.1906@gmx.de>
2025-01-24 16:54:11 +08:00
Daniel Liu
b62913b54f
accounts/scwallet: change format 0x%x to %#x ( #25221 )
2025-01-24 16:54:11 +08:00
Daniel Liu
53ea297d6a
accounts/abi: replace fmt.Errorf with errors.New in abi argument ( #25181 )
...
Replace unnecessary fmt.Errorf with errors.New in accounts/abi/argument.go
2025-01-24 16:54:11 +08:00
Daniel Liu
d9b4f0f2c3
accounts/abi: prefer new(big.Int) over big.NewInt(0) ( #25087 )
2025-01-24 16:54:11 +08:00
Daniel Liu
9dda5b9819
accounts: more linters ( #24783 )
2025-01-24 16:54:11 +08:00
Daniel Liu
13eef32998
accounts/abi/bind: fix duplicate field names in the generated go struct ( #24924 )
...
* accounts/abi/bind: fix duplicate field names in the generated go struct #24627
* accounts, cmd/abigen: resolve name conflicts
* ci lint, accounts/abi: remove unused function overloadedArgName
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-01-24 16:54:11 +08:00
Daniel Liu
04fabd63a4
accounts/abi: validate fieldnames, fixes #24930 ( #24932 )
2025-01-24 16:54:11 +08:00
Daniel Liu
16cdf8f4ec
accounts/abi: eplace strings.Replace with string.ReplaceAll ( #24835 )
2025-01-24 16:54:11 +08:00
Daniel Liu
a09fd97b11
abi: fix checks when all fields are indexed ( #24792 )
...
This PR fixes abi checks in the edge case where all arguments are indexed
2025-01-24 16:54:11 +08:00
Daniel Liu
98629d0c4b
accounts: fix typo in comments ( #24805 )
2025-01-24 16:54:11 +08:00
Daniel Liu
206b61420f
abi/base: return error for pending call error ( #24649 )
...
If a pending contract call errors, return that error right away rather
than ignoring it to allow an error somewhere else. This is helpful for
callers to know if perhaps a call failed because of the context deadline
being expired. This change mirrors the behavior of non-pending contract
calls.
2025-01-24 16:54:11 +08:00
Daniel Liu
5b10b2441c
all: use T.TempDir to create temporary test directories ( #24633 )
2025-01-24 16:54:08 +08:00
Daniel Liu
8b9138521e
accounts/abi/bind: improve WaitMined error handling ( #24321 )
...
This change makes it so WaitMined no longer logs an error when the receipt
is unavailable. It also changes the simulated backend to return NotFound for
unavailable receipts, just like ethclient does.
2025-01-24 16:18:30 +08:00
Daniel Liu
f22046701f
accounts: correct spelling mistake ( #24323 )
...
I believe the sentence is attempting to explain that the URL is "[used] by upper layers to define a sorting order over all wallets from multiple backends."
2025-01-24 16:18:30 +08:00
Daniel Liu
c78cc1e8f8
accounts/abi: simplify Arguments.Unpack ( #24277 )
...
Since len(nonIndexedArgs) is definitely 0 in this context, the code can be simplified.
2025-01-24 16:18:30 +08:00
Daniel Liu
c55d8c8bab
accounts: fix typo in errors.go ( #24270 )
2025-01-24 16:18:30 +08:00
Daniel Liu
4f7123c3c0
accounts/abi/bind/backends: return errors instead of panic ( #24242 )
2025-01-24 16:18:30 +08:00
Daniel Liu
9e82b201c7
accouts/scwallet: typo fix ( #24207 )
2025-01-24 16:18:30 +08:00
Daniel Liu
78fd3b44d7
accounts: corrected spelling mistakes ( #24194 )
...
Co-authored-by: sanskar khare <sanskarkhare@sanskars-MacBook-Air.local>
2025-01-24 16:18:30 +08:00
Daniel Liu
d89e2d6734
accounts: fix comments ( #24186 )
2025-01-24 16:18:30 +08:00
Daniel Liu
c5acd6822d
accounts/abi: avoid unnecessary alloc ( #24128 )
2025-01-24 16:18:30 +08:00
Daniel Liu
b33307eaea
accounts/abi/bind: correctly handle structs used only as constructor params ( #23940 )
...
The `structs` map is populated by iterating over all methods except the constructor, which results in a nil-pointer dereference.
I've first reproduced the problem with a new test and then implemented the fix.
Co-authored-by: Arran Schlosberg <me@arranschlosberg.com>
2025-01-24 16:18:30 +08:00
Daniel Liu
bdf9d80b56
accounts/abi/bind/backends: fix race condition in simulated backend ( #23898 )
...
Now that `SimulatedBackend.SuggestGasPrice` inspects member values, a lock needs to be added to prevent a race condition.
2025-01-24 16:18:30 +08:00
Daniel Liu
65c3ad5cba
accounts/abi/bin/backends: return basefee in suggestGasPrice ( #23838 )
...
Co-authored-by: mrx <mrx@mrx.com>
2025-01-24 16:18:30 +08:00
Daniel Liu
7fb05b7c16
accounts/abi: add basic support for error types ( #23161 )
...
This is the initial step for support of Solidity errors in contract bindings.
As of this change, errors can be decoded, but are not supported in
bindings yet.
Closes #23157
2025-01-24 16:18:30 +08:00
Daniel Liu
0c9babc95c
accounts/abi/bind: refactor transact method ( #23719 )
2025-01-24 16:18:30 +08:00
Daniel Liu
46a16f9149
accounts/abi: fix some go-critic linter warnings ( #23709 )
2025-01-24 16:18:30 +08:00
Daniel Liu
2af78feca0
accounts/abi/bind: check event signature before parsing ( #23230 )
...
* accounts/abi/bind: check event signature before parsing
* remove redundant break line
2025-01-24 16:18:30 +08:00
Daniel Liu
2b396f29ad
accounts/abi: fix resolving single struct argument ( #23573 )
2025-01-24 16:18:30 +08:00