Skip to content

Commit

Permalink
feat: add failing test for missing event data
Browse files Browse the repository at this point in the history
  • Loading branch information
z80dev committed Nov 2, 2023
1 parent cab828b commit 3b842ae
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions tests/functional/data/sources/TestContractSol.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ contract TestContractSol {
address[1] agents
);

event EventWithUintArray(
uint256[1] agents
);

struct MyStruct {
address a;
bytes32 b;
Expand Down Expand Up @@ -302,4 +306,9 @@ contract TestContractSol {
address[1] memory agts = [msg.sender];
emit EventWithAddressArray(1001, msg.sender, ppl, agts);
}

function logUintArray() public {
uint256[1] memory agts = [uint256(1)];
emit EventWithUintArray(agts);
}
}
8 changes: 8 additions & 0 deletions tests/functional/data/sources/TestContractVy.vy
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ event EventWithAddressArray:
participants: DynArray[address, 1024]
agents: address[1]

event EventWithUintArray:
agents: uint256[1]

struct MyStruct:
a: address
b: bytes32
Expand Down Expand Up @@ -295,3 +298,8 @@ def logAddressArray():
ppl.append(msg.sender)
agts: address[1] = [msg.sender]
log EventWithAddressArray(1001, msg.sender, ppl, agts)

@external
def logUintArray():
agts: uint256[1] = [1]
log EventWithUintArray(agts)
7 changes: 7 additions & 0 deletions tests/functional/test_contract_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,10 @@ def test_address_arrays_in_events(contract_instance, owner):
some_id=1001, some_address=owner, participants=[owner], agents=[owner]
)
assert tx.events == [expected]

def test_uint_arrays_in_events(contract_instance, owner):
tx = contract_instance.logUintArray(sender=owner)
expected = contract_instance.EventWithUintArray(
agents=[1]
)
assert tx.events == [expected]

0 comments on commit 3b842ae

Please sign in to comment.