forked from gakonst/ethers-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(abigen): ensure structs in events work (gakonst#1235)
* test(abigen): ensure structs in events work * chore: rename vars * chore: use ganache chain id * chore: disable ganache test on celo
- Loading branch information
Showing
3 changed files
with
94 additions
and
0 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
55 changes: 55 additions & 0 deletions
55
ethers-contract/tests/solidity-contracts/StructContract.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"abi": [ | ||
{ | ||
"anonymous": false, | ||
"inputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "x", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "y", | ||
"type": "uint256" | ||
} | ||
], | ||
"indexed": false, | ||
"internalType": "struct MyContract.Point", | ||
"name": "x", | ||
"type": "tuple" | ||
} | ||
], | ||
"name": "NewPoint", | ||
"type": "event" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"components": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "x", | ||
"type": "uint256" | ||
}, | ||
{ | ||
"internalType": "uint256", | ||
"name": "y", | ||
"type": "uint256" | ||
} | ||
], | ||
"internalType": "struct MyContract.Point", | ||
"name": "_point", | ||
"type": "tuple" | ||
} | ||
], | ||
"name": "submitPoint", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
], | ||
"bin": "608060405234801561001057600080fd5b50610268806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063b3c67bb814610030575b600080fd5b61004a600480360381019061004591906101ac565b61004c565b005b7f0a10caaea7ac3c68834bca5fb5f42a10cb68bc3866ed86e6379d62bea6d591668160405161007b9190610217565b60405180910390a150565b6000604051905090565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6100e38261009a565b810181811067ffffffffffffffff82111715610102576101016100ab565b5b80604052505050565b6000610115610086565b905061012182826100da565b919050565b6000819050919050565b61013981610126565b811461014457600080fd5b50565b60008135905061015681610130565b92915050565b60006040828403121561017257610171610095565b5b61017c604061010b565b9050600061018c84828501610147565b60008301525060206101a084828501610147565b60208301525092915050565b6000604082840312156101c2576101c1610090565b5b60006101d08482850161015c565b91505092915050565b6101e281610126565b82525050565b6040820160008201516101fe60008501826101d9565b50602082015161021160208501826101d9565b50505050565b600060408201905061022c60008301846101e8565b9291505056fea2646970667358221220ca9c95aa57bcabfe8405dcd5d993ab0920ed1e768884cae607c1b47d5c127f9564736f6c634300080a0033" | ||
} |
15 changes: 15 additions & 0 deletions
15
ethers-contract/tests/solidity-contracts/StructContract.sol
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.10; | ||
|
||
contract MyContract { | ||
struct Point { | ||
uint256 x; | ||
uint256 y; | ||
} | ||
|
||
event NewPoint(Point x); | ||
|
||
function submitPoint(Point memory _point) public { | ||
emit NewPoint(_point); | ||
} | ||
} |