go-ethereum/accounts/abi
Arran Schlosberg 865e03ca6a
feat(abi): pack event and output + unpack input (#249)
## Why this should be merged

Allows ICM code to use the `abi` package from `libevm` instead of
`subnet-evm`, as part of a broader transition.

## How this works

Port and refactor of the following `abi.ABI` methods (with differences
described) from `subnet-evm`:

1. `PackEvent()` returns topics and packed data for events. Unlike
`subnet-evm`, the returned `[]common.Hash` topic slice MAY be nil
instead of the non-nil but empty equivalent. This is in keeping with the
upstream `abi.MakeTopics()`.
2. `PackOutput()` returns packed output for methods.
3. `UnpackInputIntoInterface()` unpacks method inputs or event arguments
into an arbitrary interface. Unlike the `subnet-evm` implementation, it
doesn't perform any checks on the length of the input buffer as these
are an Avalanche-specific feature that can be performed by the consumer.

## How this was tested

Unit tests from `subnet-evm`, refactored for clarity.
2025-12-15 15:46:36 +00:00
..
bind [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
abi.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
abi.libevm.go feat(abi): pack event and output + unpack input (#249) 2025-12-15 15:46:36 +00:00
abi.libevm_test.go feat(abi): pack event and output + unpack input (#249) 2025-12-15 15:46:36 +00:00
abi_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
abifuzzer_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
argument.go accounts, cmd: fix typos (#28526) 2023-11-20 08:44:05 +01:00
doc.go all: fix license headers one more time 2015-07-23 18:35:11 +02:00
error.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
error_handling.go accounts/abi: fix integer encoding/decoding (#26568) 2023-02-07 08:32:27 -05:00
event.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
event_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
method.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
method_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
pack.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
pack_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
packing_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
reflect.go accounts,cmd,console,les,metrics: refactor some errors checked by (ST1005) go-staticcheck (#28532) 2023-11-15 14:36:57 +02:00
reflect_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
selector_parser.go accounts: replace noarg fmt.Errorf with errors.New (#27331) 2023-05-25 08:25:58 -04:00
selector_parser_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
topics.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
topics_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
type.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
type_test.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
unpack.go [AUTO] rename Go module + update internal import paths 2024-10-17 01:49:47 +00:00
unpack_test.go chore: Go 1.24 (#232) 2025-10-13 14:07:33 -04:00
utils.go build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00