Daniel Liu
ccda15ef5d
accounts, cmd: fix typos ( #28526 )
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
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
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
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
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
cab293859a
eth/filters: update Backend interface ( #26126 )
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
c241fc3574
eth/filters: fix for eth_getLogs failing with tag ( #25922 )
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
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
b6be9c181c
accounts/abi/bind/backends: typo fix ( #25549 )
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
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
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
4f7123c3c0
accounts/abi/bind/backends: return errors instead of panic ( #24242 )
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
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
Daniel Liu
36d3e7dcc2
accounts/abi/bind: set Context in TransactOpts ( #23188 )
2025-01-24 16:18:30 +08:00
Daniel Liu
92d9f7e13a
accounts/abi/bind: parse ABI only once, create metadata struct ( #22583 )
2025-01-24 16:18:30 +08:00
Daniel Liu
74ec7022c2
accounts/abi/bind: replace context.TODO with context.Background ( #23088 )
2025-01-24 16:18:30 +08:00
Daniel Liu
e26b70e5cc
accounts/abi/bind: fix sim backend test for 1559 ( #23038 )
2025-01-24 16:18:30 +08:00
Daniel Liu
c2e71efd65
accounts/abi/bind/backends: add simulated reorgs ( #22624 )
2025-01-24 16:18:30 +08:00
Daniel Liu
146ea8ba78
accounts: EIP-2718: Typed Transaction Envelope + EIP-2930 ( #21502 )
2025-01-24 16:18:30 +08:00
Daniel Liu
01d3be7eb8
accounts/abi/bind: fixed unpacking error ( #22230 )
...
There was a dormant error with structured inputs that failed unpacking.
This commit fixes the error by switching casting to the better abi.ConvertType function.
It also adds a test for calling a view function that returns a struct
2025-01-24 16:18:30 +08:00
Daniel Liu
cebdb44051
accounts/abi/bind: fix erroneous test ( #22053 )
...
closes #22049
2025-01-24 16:18:30 +08:00
Daniel Liu
54e0d6c093
abi/bind: fix error-handling in generated wrappers for functions returning structs ( #22005 )
...
Fixes the template used when generating code, which in some scenarios would lead to panic instead of returning an error.
2025-01-24 16:18:30 +08:00
Daniel Liu
fb85aca8d8
accounts/abi/bind: allow specifying signer on transactOpts ( #21356 )
2025-01-24 16:18:30 +08:00
Daniel Liu
7f2ae32933
accounts/abi: template: set events Raw field in Parse methods ( #21807 )
2025-01-24 16:18:30 +08:00
Daniel Liu
c7efbcd9fd
accounts/abi/bind: restore error functionality ( #21743 )
2025-01-24 16:18:30 +08:00
Daniel Liu
b0063d39b9
accounts/abi: ABI explicit difference between Unpack and UnpackIntoInterface ( #21091 )
...
* accounts/abi: refactored abi.Unpack
* accounts/abi/bind: fixed error
* accounts/abi/bind: modified template
* accounts/abi/bind: added ToStruct for conversion
* accounts/abi: reenabled tests
* accounts/abi: fixed tests
* accounts/abi: fixed tests for packing/unpacking
* accounts/abi: fixed tests
* accounts/abi: added more logic to ToStruct
* accounts/abi/bind: fixed template
* accounts/abi/bind: fixed ToStruct conversion
* accounts/abi/: removed unused code
* accounts/abi: updated template
* accounts/abi: refactored unused code
* contracts/checkpointoracle: updated contracts to sol ^0.6.0
* accounts/abi: refactored reflection logic
* accounts/abi: less code duplication in Unpack*
* accounts/abi: fixed rebasing bug
* fix a few typos in comments
* rebase on master
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
2025-01-24 16:18:30 +08:00
Daniel Liu
22df50c77a
accounts/abi: improve documentation and names ( #21540 )
...
* accounts: abi/bid/backends; cleaned doc errors, camelCase refactors and anonymous variable assignments
* acounts/abi/bind: doc errors, anonymous parameter assignments
* accounts/abi: doc edits, camelCase refactors
* accounts/abi/bind: review fix
* reverted name changes
* name revert
Co-authored-by: Osoro Bironga <osoro@doctaroo.com>
2025-01-24 16:18:29 +08:00
Daniel Liu
c9643e9c90
accounts/abi/bind/backends: clean doc errors ( #21514 )
2025-01-24 16:18:29 +08:00