Skip to content

Commit 971dcbf

Browse files
authored
refactor: Migrate from ethabi crate to alloy-core crate (#272)
* chore: Adding alloy-json-ab and dyn abi crates * refactor: First attemp migration to alloy json abi * fix: Fixing hex function signature * test: Fixing unit tests for evm filters * chore: Deleting unused file * test: Fixing tests for evm helpers * test: Fixing pbt test format token * chore: Removing ethabi crate * fix: Adding support for parsing tuples * test: Fixing pbt test cases * feat: Adding support for complex tuples * fix: Removing unnecessary function * fix: Improving logic for parsing tuples * fix: Improving logic for parsing events * test: Test coverage for decode events * chore: Removing unecessary crates * chore: Bumping msrv inside cargo file * docs: Adding docs for tuples * fix: Improving logic for parsing events * fix: Improving error handling * fix: Improving parsing function logic * fix: Improving error handling * test: Improving test cases * fix: Moving tuple type inside array kinds * fix: Fixing error handler * fix: Adding parser for tuples * docs: Extending docs for tuples * test: Extending test case * test: Improving load test data and test for tuples * test: Adding data for test and new folders * fix: Fixing array strings content * docs: Extending docs for tuples * chore: Fix format file * fix: Fixing whitespaces issue * fix: Fixing issue when parsing tuples * fix: Updating error message * fix: Case insensitive for compare arrays * chore: Merge main fixes styles * chore: Fix for yaml files * chore: Fixes yaml files * chore: Fixes again yaml files
1 parent 4477469 commit 971dcbf

File tree

31 files changed

+3796
-471
lines changed

31 files changed

+3796
-471
lines changed

Cargo.lock

Lines changed: 0 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ clap = { version = "4.5", features = ["cargo", "derive"] }
2929
cron = "0.15.0"
3030
dotenvy = "0.15.7"
3131
email_address = "0.2.9"
32-
ethabi = "18.0.0"
3332
futures = "0.3"
3433
glob = "0.3"
3534
hex = "0.4"

docs/modules/ROOT/pages/index.adoc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,11 @@ Expressions allow for condition checking of function arguments, event parameters
14141414
| `contains`, `==`, `!=`
14151415
| Behavior of `contains` and `==` differs based on whether the value is CSV or a JSON array string. See "Operations on Complex Types" for details.
14161416

1417+
| `*Tuple (EVM)*`
1418+
| Ordered list represented as a JSON array string (e.g., `'["Alice", 0x1234..., 25, true, [12,34]]'`).
1419+
| `contains`, `==`, `!=`
1420+
| The `contains` operation performs a case-insensitive deep search through all tuple elements. `==` and `!=` perform comparisons against the entire tuple values. See "Operations on Complex Types" for details.
1421+
14171422
|===
14181423

14191424

@@ -1509,6 +1514,28 @@ When an EVM parameter is an array (often represented internally or configured wi
15091514
- `array_param != '["raw_json_array_string"]'` the negation of the above
15101515
- `array_param[0]` indexed access
15111516

1517+
*Tuple Operations (`kind: "tuple"`)*
1518+
1519+
- `tuple_param contains 'value'` checks if the string `'value'` exists within the tuple.
1520+
- `tuple_param == (12, "hello", "testing", 34)` checks if the tuple is equal.
1521+
- `tuple_param != (12, "hello", "testing", 34)` checks if the tuple is not equal.
1522+
1523+
Where `tuple_param` is the name of tuple param (we should have only one param for tuples).
1524+
1525+
*Note on Solidity Structs:* When working with Solidity smart contracts, struct types are automatically converted to tuples during ABI encoding/decoding. For example, a Solidity struct like:
1526+
1527+
[source,solidity]
1528+
----
1529+
struct User {
1530+
uint256 id;
1531+
string name;
1532+
string email;
1533+
uint256 age;
1534+
}
1535+
----
1536+
1537+
Will be represented as a tuple `*(12, "user_name", "user_email", 34)*` where the values correspond to the struct fields in their declaration order. This conversion is handled transparently by the Solidity compiler and Web3 libraries, allowing you to use the tuple operations above to work with struct data returned from smart contract calls.
1538+
15121539
===== Stellar Specifics
15131540

15141541
*Object (`kind: "object"`) / Map (`kind: "Map"`) Operations*

examples/config/networks/avalanche_c_chain.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"confirmation_blocks": 12,
1818
"cron_schedule": "0 */1 * * * *",
1919
"store_blocks": false
20-
}
20+
}

examples/config/networks/avalanche_fuji.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"confirmation_blocks": 12,
1818
"cron_schedule": "0 */1 * * * *",
1919
"store_blocks": false
20-
}
20+
}

examples/config/networks/celo_alfajores.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"confirmation_blocks": 3,
1818
"cron_schedule": "0 */1 * * * *",
1919
"store_blocks": false
20-
}
20+
}

examples/config/networks/celo_mainnet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"confirmation_blocks": 3,
1818
"cron_schedule": "0 */1 * * * *",
1919
"store_blocks": false
20-
}
20+
}

examples/config/networks/linea_mainnet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"confirmation_blocks": 3,
1818
"cron_schedule": "0 */1 * * * *",
1919
"store_blocks": false
20-
}
20+
}

examples/config/networks/linea_testnet.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"network_type": "EVM",
3-
"slug": "linea_testnet",
3+
"slug": "linea_testnet",
44
"name": "Linea Sepolia Testnet",
55
"rpc_urls": [
66
{
@@ -17,4 +17,4 @@
1717
"confirmation_blocks": 3,
1818
"cron_schedule": "0 */1 * * * *",
1919
"store_blocks": false
20-
}
20+
}

examples/config/networks/mantle_mainnet.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"confirmation_blocks": 12,
1818
"cron_schedule": "0 */1 * * * *",
1919
"store_blocks": false
20-
}
20+
}

0 commit comments

Comments
 (0)