-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
abi2: expose array index when decoding abi arrays (#191)
E2PG copies N rows where N is equal to the number of elements in an abi encoded array(s). For example, if you have the following type: X(uint8,uint8[2]) then, assuming no filters, 2 rows will be inserted into the table. Each row will have the first uint8 and the 1 and 2nd row will have the 0th and 1st element of the abi encoded array respectively. This change allows the integration to request the array index be copied into the row. Continuing the example, given the following bytes: 000000000000000000000000000000000000000000000000000000000000002a 0000000000000000000000000000000000000000000000000000000000000040 0000000000000000000000000000000000000000000000000000000000000002 000000000000000000000000000000000000000000000000000000000000002b 000000000000000000000000000000000000000000000000000000000000002c the following rows will be inserted: abi_idx | a | b ---------+----+---- 0 | 42 | 43 1 | 42 | 44 E2PG decodes a log which contains an abi array, (eg an array of structs or an array of uint256s)
- Loading branch information
1 parent
cdfc6a1
commit 6346b75
Showing
3 changed files
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters