From 6b713958d1876c73e1463d9b427bbc432cfcb7de Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 26 Jul 2022 17:27:19 +0200 Subject: [PATCH] feat: bump abi/token tuple limit (#1506) --- ethers-contract/tests/it/abigen.rs | 5 ++ .../tests/solidity-contracts/sale.json | 81 +++++++++++++++++++ ethers-core/src/abi/codec.rs | 6 +- ethers-core/src/abi/mod.rs | 5 ++ ethers-core/src/abi/tokens.rs | 10 +++ 5 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 ethers-contract/tests/solidity-contracts/sale.json diff --git a/ethers-contract/tests/it/abigen.rs b/ethers-contract/tests/it/abigen.rs index 8256dc3a..fd661ad0 100644 --- a/ethers-contract/tests/it/abigen.rs +++ b/ethers-contract/tests/it/abigen.rs @@ -654,3 +654,8 @@ fn can_generate_to_string_overload() { ToStringCalls::ToString5(_) => {} }; } + +#[test] +fn can_generate_large_event() { + abigen!(NewSale, "ethers-contract/tests/solidity-contracts/sale.json"); +} diff --git a/ethers-contract/tests/solidity-contracts/sale.json b/ethers-contract/tests/solidity-contracts/sale.json new file mode 100644 index 00000000..d1192e30 --- /dev/null +++ b/ethers-contract/tests/solidity-contracts/sale.json @@ -0,0 +1,81 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "marketplaceId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "nfts", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "amountBatches", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint128", + "name": "price", + "type": "uint128" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isAuction", + "type": "bool" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isNSFW", + "type": "bool" + }, + { + "indexed": false, + "internalType": "string", + "name": "marketplaceURI", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "searchKeywords", + "type": "string" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + } + ], + "name": "NewSale", + "type": "event" + } +] \ No newline at end of file diff --git a/ethers-core/src/abi/codec.rs b/ethers-core/src/abi/codec.rs index 6a888aa0..a953eef0 100644 --- a/ethers-core/src/abi/codec.rs +++ b/ethers-core/src/abi/codec.rs @@ -167,7 +167,11 @@ impl_abi_codec_tuple!(12, A, B, C, D, E, F, G, H, I, J, K, L); impl_abi_codec_tuple!(13, A, B, C, D, E, F, G, H, I, J, K, L, M); impl_abi_codec_tuple!(14, A, B, C, D, E, F, G, H, I, J, K, L, M, N); impl_abi_codec_tuple!(15, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); -impl_abi_codec_tuple!(16, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P); +impl_abi_codec_tuple!(16, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q); +impl_abi_codec_tuple!(17, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R); +impl_abi_codec_tuple!(18, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S); +impl_abi_codec_tuple!(19, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T); +impl_abi_codec_tuple!(20, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U); #[cfg(test)] mod tests { diff --git a/ethers-core/src/abi/mod.rs b/ethers-core/src/abi/mod.rs index 4a332e6d..88c57f88 100644 --- a/ethers-core/src/abi/mod.rs +++ b/ethers-core/src/abi/mod.rs @@ -188,6 +188,11 @@ impl_abi_type_tuple!(13, A, B, C, D, E, F, G, H, I, J, K, L, M); impl_abi_type_tuple!(14, A, B, C, D, E, F, G, H, I, J, K, L, M, N); impl_abi_type_tuple!(15, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); impl_abi_type_tuple!(16, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P); +impl_abi_type_tuple!(17, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q); +impl_abi_type_tuple!(18, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R); +impl_abi_type_tuple!(19, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S); +impl_abi_type_tuple!(20, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T); +impl_abi_type_tuple!(21, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U); #[cfg(test)] mod tests { diff --git a/ethers-core/src/abi/tokens.rs b/ethers-core/src/abi/tokens.rs index e0684bb0..8839d14d 100644 --- a/ethers-core/src/abi/tokens.rs +++ b/ethers-core/src/abi/tokens.rs @@ -123,6 +123,11 @@ impl_tuples!(13, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M impl_tuples!(14, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, ); impl_tuples!(15, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, ); impl_tuples!(16, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, P:15, ); +impl_tuples!(17, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, P:15, Q:16,); +impl_tuples!(18, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, P:15, Q:16, R:17,); +impl_tuples!(19, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, P:15, Q:16, R:17, S:18,); +impl_tuples!(20, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, P:15, Q:16, R:17, S:18, T:19,); +impl_tuples!(21, A:0, B:1, C:2, D:3, E:4, F:5, G:6, H:7, I:8, J:9, K:10, L:11, M:12, N:13, O:14, P:15, Q:16, R:17, S:18, T:19, U:20,); impl Tokenizable for Token { fn from_token(token: Token) -> Result { @@ -329,6 +334,11 @@ impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M,); impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N,); impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,); impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,); +impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,); +impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,); +impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S,); +impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,); +impl_tokenizable_item_tuple!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U,); impl Tokenizable for Vec { fn from_token(token: Token) -> Result {