Jared Wasinger
484c723a0c
move BindV2 and methods it depends on into their own file.
2025-01-22 13:54:57 +01:00
Jared Wasinger
26d0d787dc
add docs
2025-01-22 13:54:57 +01:00
Jared Wasinger
adc4ab6e79
remove unecessarily-added method
2025-01-22 13:54:57 +01:00
Jared Wasinger
b1f3970c57
tests pass
2025-01-22 13:54:57 +01:00
Jared Wasinger
b6d6ba92de
refactor builds
2025-01-22 13:54:57 +01:00
Jared Wasinger
5da8d5a086
wip...
2025-01-22 13:54:57 +01:00
Jared Wasinger
bbddf0d0be
remove field that I added to abi.Error and never used
2025-01-22 13:54:57 +01:00
Jared Wasinger
02ff41a738
add comment for tmplError struct and remove unused v2 backend interface
2025-01-22 13:54:57 +01:00
Jared Wasinger
2c9c9cf4bd
regenerate bindings
2025-01-22 13:54:57 +01:00
Jared Wasinger
fce1885317
remove TODO comment about adding a test case that I have added
2025-01-22 13:54:57 +01:00
Jared Wasinger
d93a152298
update dep tree
2025-01-22 13:54:57 +01:00
Jared Wasinger
3129593b3f
export event names in bindings. remove added APIs Filter/Watch-Logs which take event ids.
2025-01-22 13:54:57 +01:00
Jared Wasinger
89fcfac1cf
move abigen2 specific bind code into BindV2. fix broken v1 tests
2025-01-22 13:54:57 +01:00
Jared Wasinger
780dd76746
add some docs
2025-01-22 13:54:57 +01:00
Jared Wasinger
2421cc3ed5
move contract dep tree, link-and-deploy to bind package. This is so that bind can build the dependency tree for each library to populate their exported deps.
2025-01-22 13:54:57 +01:00
Jared Wasinger
7000583654
fix regex for solc pattern matching
2025-01-22 13:54:57 +01:00
Jared Wasinger
709ff38bc1
gofmt files. add a TODO comment and remove another useless comment
2025-01-22 13:54:57 +01:00
Jared Wasinger
645c844f4b
clean up link/deploy code. add docs
2025-01-22 13:54:57 +01:00
Jared Wasinger
47192a758c
change semantics of contract overrides again: any direct/indirect dependencies of contracts/libraries specified with override addresses should not be deployed if they are not elsewhere referenced as direct/indirect deps of non-override contracts.
2025-01-22 13:54:57 +01:00
Jared Wasinger
736d587990
full support for errors with working test
2025-01-22 13:54:57 +01:00
Jared Wasinger
9552b30263
wip (just committing so that I can rebase off master to use ethclient.RevertErrorData)
2025-01-22 13:54:57 +01:00
Jared Wasinger
9a59bdb239
generation of custom error unpacking builds (not tested yet)
2025-01-22 13:54:57 +01:00
Jared Wasinger
e7e1426d89
remove debug prints. fix contract linking test condition
2025-01-22 13:54:57 +01:00
Jared Wasinger
c293caade9
tests working now
2025-01-22 13:54:57 +01:00
Jared Wasinger
5cc853d807
fix linking tests
2025-01-22 13:54:57 +01:00
Jared Wasinger
60fc16dea8
rewrite contract link/deploy again
2025-01-22 13:54:57 +01:00
Jared Wasinger
e4c01633a4
make link test case input be its own struct
2025-01-22 13:54:57 +01:00
Jared Wasinger
f9186b712e
one more test
2025-01-22 13:54:57 +01:00
Jared Wasinger
463c3b6dd4
fix test cases
2025-01-22 13:54:57 +01:00
Jared Wasinger
81289d7e26
wip: update
2025-01-22 13:54:57 +01:00
Jared Wasinger
4821fbae99
add test cases for contract linking that I forgot to push earlier. Fix deployment logic (apparently modifying a map in-place during iteration is not safe????
2025-01-22 13:54:57 +01:00
Jared Wasinger
44420cbb36
basic linking test working
2025-01-22 13:54:57 +01:00
Jared Wasinger
b06406a8b2
wip
2025-01-22 13:54:57 +01:00
Jared Wasinger
c8b17ca9c4
staging changes for linking tests. rework LinkAndDeploy to decouple logic of contract deployment, by passing a callback that does it.
2025-01-22 13:54:57 +01:00
Jared Wasinger
ba68e747b5
mv test contracts to internal directory under v2
2025-01-22 13:54:57 +01:00
Jared Wasinger
4872d7fde5
remove unecessary abi parameter from WatchEvents. simplify event tests
2025-01-22 13:54:57 +01:00
Jared Wasinger
b50593e702
add db example from sina
2025-01-22 13:54:57 +01:00
Jared Wasinger
a0485167d5
add generic call/transact
2025-01-22 13:54:57 +01:00
Jared Wasinger
28d57002ff
add generic log watching/filtering. skip adding generic call/transact (issue with interface regarding contract methods that don't take arguments)
2025-01-22 13:54:57 +01:00
Jared Wasinger
69e6f2932d
add binding generation test
2025-01-22 13:54:57 +01:00
Jared Wasinger
57e13591cc
small cleanups
2025-01-22 13:54:57 +01:00
Jared Wasinger
2df68eb106
remove unused error test, other unused code in tests
2025-01-22 13:54:57 +01:00
Jared Wasinger
6b5967afd8
delete unused test data. remove useless v2 helper methods. update tests
2025-01-22 13:54:57 +01:00
Jared Wasinger
d3d6926683
fix contract filter test. rename *Logs methods to *Events, to reflect the fact that these are specific to solidity events.
2025-01-22 13:54:57 +01:00
Jared Wasinger
1f25c68ec4
add error unpacking. simplify WatchLogs api.
2025-01-22 13:54:57 +01:00
Jared Wasinger
4fc62e94b3
add errors to emitted code.
2025-01-22 13:54:57 +01:00
Jared Wasinger
f2d78fcfaf
return multiple results in exported struct (instead of anonymous one). add return_structs contract example to have an example of it.
2025-01-22 13:54:57 +01:00
Jared Wasinger
51207183cd
add coverage for event filtering
2025-01-22 13:54:57 +01:00
Jared Wasinger
cd18d99180
add test coverage for events watching
2025-01-22 13:54:57 +01:00
Jared Wasinger
1e8aca95e9
add test for overrides
2025-01-22 13:54:57 +01:00
Jared Wasinger
77158e5bf0
various small fixes: better error message, remove unecessary comments. address review about missing word in function documentation.
2025-01-22 13:54:57 +01:00
Jared Wasinger
d0a8ead758
add copyright notices. move v2 template to its own file. Rename V2Backend->BackendV2
2025-01-22 13:54:57 +01:00
Jared Wasinger
26641a190a
make tests run again
2025-01-22 13:54:57 +01:00
Jared Wasinger
afe887fcc3
remove old half-written test case with events (I will add it back in when I complete it).
2025-01-22 13:54:57 +01:00
Jared Wasinger
b612cab7f1
simplify generated code for list of library dependencies
2025-01-22 13:54:57 +01:00
Jared Wasinger
0bdf69cbc6
some more docs
2025-01-22 13:54:57 +01:00
Jared Wasinger
0cff488b04
fix v2 test
2025-01-22 13:54:57 +01:00
Jared Wasinger
ab97d38da5
more docs. fix nested library contract. fix associated test case.
2025-01-22 13:54:57 +01:00
Jared Wasinger
b2aec5af41
add missing files from testdata. refactor contract deployment API to be cleaner
2025-01-22 13:54:57 +01:00
Jared Wasinger
03a6ade16b
format improvements
2025-01-22 13:54:57 +01:00
Jared Wasinger
41b77f9d9c
update library test contract to have constructor with inputs. remove some debug print statements
2025-01-22 13:54:57 +01:00
Jared Wasinger
42d159fb9a
fix contract
2025-01-22 13:54:57 +01:00
Jared Wasinger
7c95aa1411
closer to test passing now...
2025-01-22 13:54:57 +01:00
Jared Wasinger
5ba939f50c
rework contract deployment API
2025-01-22 13:54:57 +01:00
Jared Wasinger
cc04aa4e9e
commit of wip-code: rework the contract deployment code to be cleaner
2025-01-22 13:54:57 +01:00
Jared Wasinger
6d9104e706
dependency graph calculation working
2025-01-22 13:54:57 +01:00
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
georgehao
1843f27766
all: fix some typos in comments and names ( #31023 )
2025-01-14 14:16:15 +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
lightclient
f808d7357e
all: implement eip-7702 set code tx ( #30078 )
...
This PR implements EIP-7702: "Set EOA account code".
Specification: https://eips.ethereum.org/EIPS/eip-7702
> Add a new transaction type that adds a list of `[chain_id, address,
nonce, y_parity, r, s]` authorization tuples. For each tuple, write a
delegation designator `(0xef0100 ++ address)` to the signing account’s
code. All code reading operations must load the code pointed to by the
designator.
---------
Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
2024-12-16 11:29:37 +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
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