From 44030cddc872f32c6d6e857510b511f2c64034ca Mon Sep 17 00:00:00 2001 From: Elnaril Date: Sat, 26 Oct 2024 14:23:24 +0200 Subject: [PATCH] add support for python 3.12 & 3.13, and for web3 7 --- coverage.json | 2 +- pyproject.toml | 10 ++++---- requirements_install.txt | 2 +- tox.ini | 23 +++++++++++++++---- .../_abi_builder.py | 10 ++++---- 5 files changed, 33 insertions(+), 14 deletions(-) diff --git a/coverage.json b/coverage.json index b90c04a..8baf9d2 100644 --- a/coverage.json +++ b/coverage.json @@ -1 +1 @@ -{"meta": {"format": 2, "version": "7.4.1", "timestamp": "2024-06-17T16:41:04.912513", "branch_coverage": false, "show_contexts": false}, "files": {"uniswap_universal_router_decoder/__init__.py": {"executed_lines": [1, 5, 8], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "uniswap_universal_router_decoder/_abi_builder.py": {"executed_lines": [1, 8, 10, 14, 21, 23, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 38, 39, 42, 43, 44, 45, 48, 51, 52, 53, 55, 56, 57, 59, 60, 61, 63, 65, 66, 67, 69, 70, 71, 73, 74, 75, 77, 78, 79, 81, 82, 84, 85, 86, 88, 89, 90, 92, 93, 94, 97, 98, 99, 112, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 140, 141, 142, 143, 144, 146, 147, 148, 149, 151, 152, 153, 154, 155, 157, 158, 159, 160, 161, 163, 164, 165, 166, 168, 169, 170, 171, 173, 174, 175, 176], "summary": {"covered_lines": 112, "num_statements": 112, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "uniswap_universal_router_decoder/_constants.py": {"executed_lines": [1, 8, 9, 12, 13, 14, 15, 16, 17, 20, 21, 23, 24], "summary": {"covered_lines": 12, "num_statements": 12, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "uniswap_universal_router_decoder/_decoder.py": {"executed_lines": [1, 8, 9, 17, 18, 19, 26, 27, 28, 34, 35, 36, 37, 38, 40, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 67, 76, 77, 78, 79, 80, 82, 83, 85, 86, 95, 96, 97, 98, 99, 100, 101, 108, 110, 111, 113], "summary": {"covered_lines": 51, "num_statements": 51, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "uniswap_universal_router_decoder/_encoder.py": {"executed_lines": [1, 8, 10, 21, 22, 23, 24, 25, 26, 27, 36, 37, 45, 51, 54, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79, 81, 85, 88, 89, 90, 91, 92, 93, 94, 96, 97, 100, 105, 106, 107, 109, 114, 115, 116, 118, 119, 120, 121, 123, 124, 125, 126, 128, 129, 130, 131, 132, 134, 148, 149, 150, 151, 153, 154, 155, 156, 157, 159, 173, 174, 175, 176, 178, 185, 186, 187, 188, 189, 191, 212, 213, 214, 225, 227, 246, 255, 262, 263, 264, 265, 266, 268, 289, 290, 291, 302, 304, 311, 312, 313, 314, 315, 316, 318, 340, 341, 342, 353, 355, 375, 384, 391, 392, 393, 394, 395, 396, 398, 420, 421, 422, 433, 435, 439, 444, 445, 446, 447, 448, 450, 463, 464, 472, 474, 475, 476, 477, 478, 480, 496, 497, 498, 507, 509, 510, 511, 512, 513, 515, 532, 537, 539, 540, 541, 550, 552, 553, 554, 555, 556, 558, 576, 577, 578, 587, 589, 596, 597, 598, 600, 601, 603, 646, 648, 649, 651, 652, 654, 655, 656, 658, 659, 661, 662, 664, 665, 666, 672, 684, 685, 686, 688, 690], "summary": {"covered_lines": 203, "num_statements": 203, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "uniswap_universal_router_decoder/_enums.py": {"executed_lines": [1, 10, 12, 13, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 38, 39, 40, 43, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56], "summary": {"covered_lines": 29, "num_statements": 29, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "uniswap_universal_router_decoder/router_codec.py": {"executed_lines": [1, 8, 9, 16, 20, 21, 28, 29, 36, 37, 40, 41, 42, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 57, 58, 62, 64, 65, 69, 71, 72, 76, 78, 79, 111, 117, 122, 123, 124, 125, 130, 132, 153, 154, 155, 156], "summary": {"covered_lines": 45, "num_statements": 45, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "uniswap_universal_router_decoder/utils.py": {"executed_lines": [1, 2, 8, 9, 15, 18, 26, 43, 44, 45, 51, 52, 54, 55, 57, 58, 60], "summary": {"covered_lines": 17, "num_statements": 17, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "totals": {"covered_lines": 472, "num_statements": 472, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}} \ No newline at end of file +{"meta": {"format": 3, "version": "7.6.4", "timestamp": "2024-10-26T14:11:27.206052", "branch_coverage": false, "show_contexts": false}, "files": {"uniswap_universal_router_decoder/__init__.py": {"executed_lines": [1, 5, 8], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": [], "functions": {"": {"executed_lines": [1, 5, 8], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "classes": {"": {"executed_lines": [1, 5, 8], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}}, "uniswap_universal_router_decoder/_abi_builder.py": {"executed_lines": [1, 8, 10, 14, 21, 23, 26, 27, 28, 29, 30, 32, 33, 35, 36, 37, 38, 40, 41, 44, 45, 46, 47, 50, 53, 54, 55, 57, 58, 59, 61, 62, 63, 65, 67, 68, 69, 71, 72, 73, 75, 76, 77, 79, 80, 81, 83, 84, 86, 87, 88, 90, 91, 92, 94, 95, 96, 99, 100, 101, 114, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 142, 143, 144, 145, 146, 148, 149, 150, 151, 153, 154, 155, 156, 157, 159, 160, 161, 162, 163, 165, 166, 167, 168, 170, 171, 172, 173, 175, 176, 177, 178], "summary": {"covered_lines": 113, "num_statements": 113, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": [], "functions": {"_FunctionABI.get_abi": {"executed_lines": [33], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABI.get_struct_abi": {"executed_lines": [36, 37, 38], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABI.get_full_abi": {"executed_lines": [41], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.__init__": {"executed_lines": [55], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.add_address": {"executed_lines": [58, 59], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.add_uint256": {"executed_lines": [62, 63], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.add_uint160": {"executed_lines": [68, 69], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.add_uint48": {"executed_lines": [72, 73], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.add_address_array": {"executed_lines": [76, 77], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.add_bool": {"executed_lines": [80, 81], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.build": {"executed_lines": [84], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.create_struct": {"executed_lines": [88], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.add_struct": {"executed_lines": [91, 92], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder.add_bytes": {"executed_lines": [95, 96], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder.build_abi_map": {"executed_lines": [101, 114], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._add_mapping": {"executed_lines": [118, 119, 120], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_v2_swap_exact_in": {"executed_lines": [124, 125, 126], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_permit2_permit": {"executed_lines": [130, 131, 132, 133, 134, 135], "summary": {"covered_lines": 6, "num_statements": 6, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_unwrap_weth": {"executed_lines": [139, 140], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_v3_swap_exact_in": {"executed_lines": [144, 145, 146], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_wrap_eth": {"executed_lines": [150, 151], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_v2_swap_exact_out": {"executed_lines": [155, 156, 157], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_v3_swap_exact_out": {"executed_lines": [161, 162, 163], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_sweep": {"executed_lines": [167, 168], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_pay_portion": {"executed_lines": [172, 173], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder._build_transfer": {"executed_lines": [177, 178], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 8, 10, 14, 21, 23, 26, 27, 28, 29, 30, 32, 35, 40, 44, 45, 46, 47, 50, 53, 54, 57, 61, 65, 67, 71, 75, 79, 83, 86, 87, 90, 94, 99, 100, 116, 117, 122, 123, 128, 129, 137, 138, 142, 143, 148, 149, 153, 154, 159, 160, 165, 166, 170, 171, 175, 176], "summary": {"covered_lines": 56, "num_statements": 56, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "classes": {"_FunctionABI": {"executed_lines": [33, 36, 37, 38, 41], "summary": {"covered_lines": 5, "num_statements": 5, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionDesc": {"executed_lines": [], "summary": {"covered_lines": 0, "num_statements": 0, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_FunctionABIBuilder": {"executed_lines": [55, 58, 59, 62, 63, 68, 69, 72, 73, 76, 77, 80, 81, 84, 88, 91, 92, 95, 96], "summary": {"covered_lines": 19, "num_statements": 19, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ABIBuilder": {"executed_lines": [101, 114, 118, 119, 120, 124, 125, 126, 130, 131, 132, 133, 134, 135, 139, 140, 144, 145, 146, 150, 151, 155, 156, 157, 161, 162, 163, 167, 168, 172, 173, 177, 178], "summary": {"covered_lines": 33, "num_statements": 33, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 8, 10, 14, 21, 23, 26, 27, 28, 29, 30, 32, 35, 40, 44, 45, 46, 47, 50, 53, 54, 57, 61, 65, 67, 71, 75, 79, 83, 86, 87, 90, 94, 99, 100, 116, 117, 122, 123, 128, 129, 137, 138, 142, 143, 148, 149, 153, 154, 159, 160, 165, 166, 170, 171, 175, 176], "summary": {"covered_lines": 56, "num_statements": 56, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}}, "uniswap_universal_router_decoder/_constants.py": {"executed_lines": [1, 8, 9, 12, 13, 14, 15, 16, 17, 20, 21, 23, 24], "summary": {"covered_lines": 12, "num_statements": 12, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": [], "functions": {"": {"executed_lines": [1, 8, 9, 12, 13, 14, 15, 16, 17, 20, 21, 23, 24], "summary": {"covered_lines": 12, "num_statements": 12, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "classes": {"": {"executed_lines": [1, 8, 9, 12, 13, 14, 15, 16, 17, 20, 21, 23, 24], "summary": {"covered_lines": 12, "num_statements": 12, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}}, "uniswap_universal_router_decoder/_decoder.py": {"executed_lines": [1, 8, 9, 17, 18, 19, 26, 27, 28, 34, 35, 36, 37, 38, 40, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 67, 76, 77, 78, 79, 80, 82, 83, 85, 86, 95, 96, 97, 98, 99, 100, 101, 108, 110, 111, 113], "summary": {"covered_lines": 51, "num_statements": 51, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": [], "functions": {"_Decoder.__init__": {"executed_lines": [36, 37, 38], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_Decoder.function_input": {"executed_lines": [47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65], "summary": {"covered_lines": 16, "num_statements": 16, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_Decoder.transaction": {"executed_lines": [76, 77, 78, 79, 80], "summary": {"covered_lines": 5, "num_statements": 5, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_Decoder._get_transaction": {"executed_lines": [83], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_Decoder.v3_path": {"executed_lines": [95, 96, 97, 98, 99, 100, 101, 108, 110, 111, 113], "summary": {"covered_lines": 11, "num_statements": 11, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 8, 9, 17, 18, 19, 26, 27, 28, 34, 35, 40, 67, 82, 85, 86], "summary": {"covered_lines": 15, "num_statements": 15, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "classes": {"_Decoder": {"executed_lines": [36, 37, 38, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 59, 62, 63, 64, 65, 76, 77, 78, 79, 80, 83, 95, 96, 97, 98, 99, 100, 101, 108, 110, 111, 113], "summary": {"covered_lines": 36, "num_statements": 36, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 8, 9, 17, 18, 19, 26, 27, 28, 34, 35, 40, 67, 82, 85, 86], "summary": {"covered_lines": 15, "num_statements": 15, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}}, "uniswap_universal_router_decoder/_encoder.py": {"executed_lines": [1, 8, 10, 21, 22, 23, 24, 25, 26, 27, 36, 37, 45, 51, 54, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79, 81, 85, 88, 89, 90, 91, 92, 93, 94, 96, 97, 100, 105, 106, 107, 109, 114, 115, 116, 118, 119, 120, 121, 123, 124, 125, 126, 128, 129, 130, 131, 132, 134, 148, 149, 150, 151, 153, 154, 155, 156, 157, 159, 173, 174, 175, 176, 178, 185, 186, 187, 188, 189, 191, 212, 213, 214, 225, 227, 246, 255, 262, 263, 264, 265, 266, 268, 289, 290, 291, 302, 304, 311, 312, 313, 314, 315, 316, 318, 340, 341, 342, 353, 355, 375, 384, 391, 392, 393, 394, 395, 396, 398, 420, 421, 422, 433, 435, 439, 444, 445, 446, 447, 448, 450, 463, 464, 472, 474, 475, 476, 477, 478, 480, 496, 497, 498, 507, 509, 510, 511, 512, 513, 515, 532, 537, 539, 540, 541, 550, 552, 553, 554, 555, 556, 558, 576, 577, 578, 587, 589, 596, 597, 598, 600, 601, 603, 646, 648, 649, 651, 652, 654, 655, 656, 658, 659, 661, 662, 664, 665, 666, 672, 684, 685, 686, 688, 690], "summary": {"covered_lines": 203, "num_statements": 203, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": [], "functions": {"_Encoder.__init__": {"executed_lines": [59, 60, 61], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_Encoder.v3_path": {"executed_lines": [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79], "summary": {"covered_lines": 14, "num_statements": 14, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_Encoder.chain": {"executed_lines": [85], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.__init__": {"executed_lines": [90, 91, 92, 93, 94], "summary": {"covered_lines": 5, "num_statements": 5, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._get_recipient": {"executed_lines": [100, 105, 106, 107, 109], "summary": {"covered_lines": 5, "num_statements": 5, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._get_command": {"executed_lines": [116], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_execution_function": {"executed_lines": [120, 121], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_execution_without_deadline_function": {"executed_lines": [125, 126], "summary": {"covered_lines": 2, "num_statements": 2, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_wrap_eth_sub_contract": {"executed_lines": [129, 130, 131, 132], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.wrap_eth": {"executed_lines": [148, 149, 150, 151], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_unwrap_weth_sub_contract": {"executed_lines": [154, 155, 156, 157], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.unwrap_weth": {"executed_lines": [173, 174, 175, 176], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_v2_swap_exact_in_sub_contract": {"executed_lines": [185, 186, 187, 188, 189], "summary": {"covered_lines": 5, "num_statements": 5, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.v2_swap_exact_in": {"executed_lines": [212, 213, 214, 225], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.v2_swap_exact_in_from_balance": {"executed_lines": [246], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_v2_swap_exact_out_sub_contract": {"executed_lines": [262, 263, 264, 265, 266], "summary": {"covered_lines": 5, "num_statements": 5, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.v2_swap_exact_out": {"executed_lines": [289, 290, 291, 302], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_v3_swap_exact_in_sub_contract": {"executed_lines": [311, 312, 313, 314, 315, 316], "summary": {"covered_lines": 6, "num_statements": 6, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.v3_swap_exact_in": {"executed_lines": [340, 341, 342, 353], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.v3_swap_exact_in_from_balance": {"executed_lines": [375], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_v3_swap_exact_out_sub_contract": {"executed_lines": [391, 392, 393, 394, 395, 396], "summary": {"covered_lines": 6, "num_statements": 6, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.v3_swap_exact_out": {"executed_lines": [420, 421, 422, 433], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_permit2_permit_sub_contract": {"executed_lines": [439, 444, 445, 446, 447, 448], "summary": {"covered_lines": 6, "num_statements": 6, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.permit2_permit": {"executed_lines": [463, 464, 472], "summary": {"covered_lines": 3, "num_statements": 3, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_sweep_sub_contract": {"executed_lines": [475, 476, 477, 478], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.sweep": {"executed_lines": [496, 497, 498, 507], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_pay_portion_sub_contract": {"executed_lines": [510, 511, 512, 513], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.pay_portion": {"executed_lines": [532, 537, 539, 540, 541, 550], "summary": {"covered_lines": 6, "num_statements": 6, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder._encode_transfer_sub_contract": {"executed_lines": [553, 554, 555, 556], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.transfer": {"executed_lines": [576, 577, 578, 587], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.build": {"executed_lines": [596, 597, 598, 600, 601], "summary": {"covered_lines": 5, "num_statements": 5, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder.build_transaction": {"executed_lines": [646, 648, 649, 651, 652, 654, 655, 656, 658, 659, 661, 662, 664, 665, 666, 672, 684, 685, 686, 688, 690], "summary": {"covered_lines": 21, "num_statements": 21, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 8, 10, 21, 22, 23, 24, 25, 26, 27, 36, 37, 45, 51, 54, 57, 58, 63, 64, 81, 88, 89, 96, 97, 114, 115, 118, 119, 123, 124, 128, 134, 153, 159, 178, 191, 227, 255, 268, 304, 318, 355, 384, 398, 435, 450, 474, 480, 509, 515, 552, 558, 589, 603], "summary": {"covered_lines": 53, "num_statements": 53, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "classes": {"_Encoder": {"executed_lines": [59, 60, 61, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79, 85], "summary": {"covered_lines": 18, "num_statements": 18, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_ChainedFunctionBuilder": {"executed_lines": [90, 91, 92, 93, 94, 100, 105, 106, 107, 109, 116, 120, 121, 125, 126, 129, 130, 131, 132, 148, 149, 150, 151, 154, 155, 156, 157, 173, 174, 175, 176, 185, 186, 187, 188, 189, 212, 213, 214, 225, 246, 262, 263, 264, 265, 266, 289, 290, 291, 302, 311, 312, 313, 314, 315, 316, 340, 341, 342, 353, 375, 391, 392, 393, 394, 395, 396, 420, 421, 422, 433, 439, 444, 445, 446, 447, 448, 463, 464, 472, 475, 476, 477, 478, 496, 497, 498, 507, 510, 511, 512, 513, 532, 537, 539, 540, 541, 550, 553, 554, 555, 556, 576, 577, 578, 587, 596, 597, 598, 600, 601, 646, 648, 649, 651, 652, 654, 655, 656, 658, 659, 661, 662, 664, 665, 666, 672, 684, 685, 686, 688, 690], "summary": {"covered_lines": 132, "num_statements": 132, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 8, 10, 21, 22, 23, 24, 25, 26, 27, 36, 37, 45, 51, 54, 57, 58, 63, 64, 81, 88, 89, 96, 97, 114, 115, 118, 119, 123, 124, 128, 134, 153, 159, 178, 191, 227, 255, 268, 304, 318, 355, 384, 398, 435, 450, 474, 480, 509, 515, 552, 558, 589, 603], "summary": {"covered_lines": 53, "num_statements": 53, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}}, "uniswap_universal_router_decoder/_enums.py": {"executed_lines": [1, 10, 12, 13, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 38, 39, 40, 43, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56], "summary": {"covered_lines": 29, "num_statements": 29, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": [], "functions": {"": {"executed_lines": [1, 10, 12, 13, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 38, 39, 40, 43, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56], "summary": {"covered_lines": 29, "num_statements": 29, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "classes": {"_RouterFunction": {"executed_lines": [], "summary": {"covered_lines": 0, "num_statements": 0, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "FunctionRecipient": {"executed_lines": [], "summary": {"covered_lines": 0, "num_statements": 0, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "_RouterConstant": {"executed_lines": [], "summary": {"covered_lines": 0, "num_statements": 0, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "TransactionSpeed": {"executed_lines": [], "summary": {"covered_lines": 0, "num_statements": 0, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 10, 12, 13, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 38, 39, 40, 43, 45, 46, 47, 48, 49, 52, 53, 54, 55, 56], "summary": {"covered_lines": 29, "num_statements": 29, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}}, "uniswap_universal_router_decoder/router_codec.py": {"executed_lines": [1, 8, 9, 16, 20, 21, 28, 29, 36, 37, 40, 41, 42, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 57, 58, 62, 64, 65, 69, 71, 72, 76, 78, 79, 111, 117, 122, 123, 124, 125, 130, 132, 153, 154, 155, 156], "summary": {"covered_lines": 45, "num_statements": 45, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": [], "functions": {"RouterCodec.__init__": {"executed_lines": [47, 48, 49, 50, 51, 53, 54, 55], "summary": {"covered_lines": 8, "num_statements": 8, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "RouterCodec.get_default_deadline": {"executed_lines": [62], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "RouterCodec.get_default_expiration": {"executed_lines": [69], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "RouterCodec.get_max_expiration": {"executed_lines": [76], "summary": {"covered_lines": 1, "num_statements": 1, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "RouterCodec.create_permit2_signable_message": {"executed_lines": [111, 117, 122, 123, 124, 125, 130], "summary": {"covered_lines": 7, "num_statements": 7, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "RouterCodec.fetch_permit2_allowance": {"executed_lines": [153, 154, 155, 156], "summary": {"covered_lines": 4, "num_statements": 4, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 8, 9, 16, 20, 21, 28, 29, 36, 37, 40, 41, 42, 45, 46, 57, 58, 64, 65, 71, 72, 78, 79, 132], "summary": {"covered_lines": 23, "num_statements": 23, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "classes": {"RouterCodec": {"executed_lines": [47, 48, 49, 50, 51, 53, 54, 55, 62, 69, 76, 111, 117, 122, 123, 124, 125, 130, 153, 154, 155, 156], "summary": {"covered_lines": 22, "num_statements": 22, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 8, 9, 16, 20, 21, 28, 29, 36, 37, 40, 41, 42, 45, 46, 57, 58, 64, 65, 71, 72, 78, 79, 132], "summary": {"covered_lines": 23, "num_statements": 23, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}}, "uniswap_universal_router_decoder/utils.py": {"executed_lines": [1, 2, 8, 9, 15, 18, 26, 43, 44, 45, 51, 52, 54, 55, 57, 58, 60], "summary": {"covered_lines": 17, "num_statements": 17, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": [], "functions": {"compute_gas_fees": {"executed_lines": [43, 44, 45, 51, 52, 54, 55, 57, 58, 60], "summary": {"covered_lines": 10, "num_statements": 10, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}, "": {"executed_lines": [1, 2, 8, 9, 15, 18, 26], "summary": {"covered_lines": 7, "num_statements": 7, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}, "classes": {"": {"executed_lines": [1, 2, 8, 9, 15, 18, 26, 43, 44, 45, 51, 52, 54, 55, 57, 58, 60], "summary": {"covered_lines": 17, "num_statements": 17, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}, "missing_lines": [], "excluded_lines": []}}}}, "totals": {"covered_lines": 473, "num_statements": 473, "percent_covered": 100.0, "percent_covered_display": "100", "missing_lines": 0, "excluded_lines": 0}} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 968ebdb..2c75f73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta" [project] name = "uniswap-universal-router-decoder" -version = "1.2.0" +version = "1.2.1.dev0" authors = [ { name="Elnaril", email="elnaril_dev@caramail.com" }, ] -description = "Decode & Encode transaction data sent to Uniswap Universal Router" +description = "Decode & Encode transactions sent to the Uniswap Universal Router" readme = "README.md" requires-python = ">=3.8" classifiers = [ @@ -21,13 +21,15 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", ] license = {text = "MIT License"} dependencies = [ - "web3>=6.0.0,<7.0.0", + "web3>=6.0.0,<8.0.0", ] -keywords = ["blockchain", "ethereum", "uniswap", "universal router", "decoder", "encoder", "codec", "wrapper", "SDK"] +keywords = ["blockchain", "ethereum", "uniswap", "exchange", "dex", "universal router", "swap", "decoder", "encoder", "codec", "wrapper", "SDK"] [tool.setuptools] packages = ["uniswap_universal_router_decoder"] diff --git a/requirements_install.txt b/requirements_install.txt index 1a5c445..ac889e0 100644 --- a/requirements_install.txt +++ b/requirements_install.txt @@ -1 +1 @@ -web3>=6.0.0,<7.0.0 +web3>=6.0.0,<8.0.0 diff --git a/tox.ini b/tox.ini index 51366de..f231bd6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,9 @@ [tox] skipsdist = True -envlist = py38,py39,lint,py310,coverage,py311 +envlist = + py{38,39,310,311,312,313}-web3{6,7} + lint-web3{6,7} + coverage [flake8] max-line-length = 120 @@ -19,16 +22,27 @@ use_parentheses = True [testenv] description = run tests -deps = -rrequirements.txt +deps = + web36: web3>=6.0.0,<7.0.0 + web37: web3>=7.0.0,<8.0.0 + pytest commands = python --version + pip freeze pytest tests -[testenv:lint] +[testenv:lint-web3{6,7}] description = run lint, type and format checks -deps = -rrequirements.txt +deps = + web36: web3>=6.0.0,<7.0.0 + web37: web3>=7.0.0,<8.0.0 + coverage + flake8 + isort + mypy commands = python --version + pip freeze mypy uniswap_universal_router_decoder flake8 uniswap_universal_router_decoder flake8 tests @@ -42,6 +56,7 @@ description = run coverage and output json result deps = -rrequirements.txt commands = python --version + pip freeze coverage run -m pytest tests coverage report -m coverage json diff --git a/uniswap_universal_router_decoder/_abi_builder.py b/uniswap_universal_router_decoder/_abi_builder.py index dc5bce6..217f7e5 100644 --- a/uniswap_universal_router_decoder/_abi_builder.py +++ b/uniswap_universal_router_decoder/_abi_builder.py @@ -30,9 +30,11 @@ class _FunctionABI: type: str def get_abi(self) -> Dict[str, Any]: + return asdict(self) + + def get_struct_abi(self) -> Dict[str, Any]: result = asdict(self) - if self.type == "tuple": - result["components"] = result.pop("inputs") + result["components"] = result.pop("inputs") return result def get_full_abi(self) -> List[Dict[str, Any]]: @@ -86,7 +88,7 @@ def create_struct(arg_name: str) -> _FunctionABIBuilder: return _FunctionABIBuilder(arg_name, "tuple") def add_struct(self, struct: _FunctionABIBuilder) -> _FunctionABIBuilder: - self.abi.inputs.append(struct.abi.get_abi()) + self.abi.inputs.append(struct.abi.get_struct_abi()) return self def add_bytes(self, arg_name: str) -> _FunctionABIBuilder: @@ -114,7 +116,7 @@ def build_abi_map(self) -> _ABIMap: @staticmethod def _add_mapping(build_abi_method: Callable[[], _FunctionABI]) -> _FunctionDesc: fct_abi = build_abi_method() - selector = function_abi_to_4byte_selector(fct_abi.get_abi()) + selector = function_abi_to_4byte_selector(fct_abi.get_abi()) # type: ignore[arg-type, unused-ignore] return _FunctionDesc(fct_abi=fct_abi, selector=selector) @staticmethod