Commit Graph

401 Commits

Author SHA1 Message Date
Jared Wasinger 26491ae5cd still in a wip state 2025-01-22 13:54:57 +01:00
Jared Wasinger 61263dcd68 stage point before I try to dedup contract interaction api 2025-01-22 13:54:57 +01:00
Jared Wasinger 0aac1981f5 move v2 contract interaction methods into v2 package. add test 2025-01-22 13:54:57 +01:00
Jared Wasinger 9c086811ae isolate V2 contract interaction API into its own package 2025-01-22 13:54:57 +01:00
Jared Wasinger cb0d1ea3ba fix last rebase regression 2025-01-22 13:54:56 +01:00
Jared Wasinger f7fa3fe037 add back code that got mistakenly removed in the rebase 2025-01-22 13:54:56 +01:00
Sina Mahmoodi 135ef69b9b fix test 2025-01-22 13:54:56 +01:00
Sina Mahmoodi c14bd3d6e7 clean lang selection leftovers 2025-01-22 13:54:55 +01:00
Sina Mahmoodi b504552373 Pass pointer to log for unpack 2025-01-22 13:53:59 +01:00
Sina Mahmoodi f7084f4723 Add deploy code to contract struct 2025-01-22 13:53:59 +01:00
Sina Mahmoodi e2746e7f54 define contract instance type 2025-01-22 13:53:59 +01:00
Sina Mahmoodi 040f808742 skip unpack method when no return args 2025-01-22 13:53:59 +01:00
Sina Mahmoodi ee1263a78c drop fmt 2025-01-22 13:53:59 +01:00
Sina Mahmoodi 7b6f0eadd7 replace fmt with errors
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2025-01-22 13:53:59 +01:00
Sina Mahmoodi 6b69f4c90c drop unnecessary imports 2025-01-22 13:53:59 +01:00
Sina Mahmoodi d4ccdc30c2 add copyright header to lib.go 2025-01-22 13:53:59 +01:00
Sina Mahmoodi ed627ccf8b accounts/abi: abigen v2 2025-01-22 13:53:59 +01:00
maskpp 3c208cdea8
accounts/abi/bind: make it possible to wait for tx hash (#30079)
This change adds methods which makes it possible for to wait for a transaction with a specific hash when deploying contracts during abi bind interaction.

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2024-12-17 09:12:10 +01:00
Darren Kelly 330190e476
accounts/abi: support unpacking solidity errors (#30738)
This PR adds the error fragments to `func (abi ABI) getArguments` which
allows typed decoding of errors.
2024-12-10 14:30:24 +01:00
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 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
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
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
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 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
Tien Nguyen eda9c7e36f
accounts/abi/bind: check invalid chainID first (#29275) 2024-03-19 14:05:31 +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
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
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
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
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
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
levisyin a73748258f
accounts, cmd: fix typos (#28526) 2023-11-20 08:44:05 +01:00
Halimao db7895d3b6
accounts/abi: improve readability of method-to-string conversion (#28530)
refactor: improve readability of NewMethod print
2023-11-15 14:30:35 +01:00
Zoro 2814ee0547
accounts,cmd,console,les,metrics: refactor some errors checked by (ST1005) go-staticcheck (#28532)
fix: fix some (ST1005)go-staticcheck
2023-11-15 14:36:57 +02:00
Martin Holst Swende 2391fbc676
tests/fuzzers: move fuzzers into native packages (#28467)
This PR moves our fuzzers from tests/fuzzers into whatever their respective 'native' package is.

The historical reason why they were placed in an external location, is that when they were based on go-fuzz, they could not be "hidden" via the _test.go prefix. So in order to shove them away from the go-ethereum "production code", they were put aside.

But now we've rewritten them to be based on golang testing, and thus can be brought back. I've left (in tests/) the ones that are not production (bls128381), require non-standard imports (secp requires btcec, bn256 requires gnark/google/cloudflare deps).

This PR also adds a fuzzer for precompiled contracts, because why not.

This PR utilizes a newly rewritten replacement for go-118-fuzz-build, namely gofuzz-shim, which utilises the inputs from the fuzzing engine better.
2023-11-14 14:34:29 +01:00
Adrian Sutton b85c86022e
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
2023-10-17 15:34:01 +03:00
Brandon Liu f62502e123
internal/ethapi, accounts/abi/bind: use `errors.Is` for error comparison (#28348)
Co-authored-by: lightclient <lightclient@protonmail.com>
2023-10-17 14:11:04 +02:00
Péter Szilágyi 2c007cfed7
accounts/abi/bind/backend: use requested header for gas prices and gas limits (#28280) 2023-10-10 15:53:01 +03:00