We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging indexed byte arrays works either if they have runtime length precisely 3! or are literals.
Here is a test that fails:
def test_event_logging_with_multiple_topics(get_contract_with_gas_estimation, chain, utils): loggy_code = """ MyLog: event({arg1: indexed(bytes <= 3), arg2: indexed(bytes <= 4), arg3: indexed(address)}) @public def foo(): a : bytes <= 4 = 'home' log.MyLog('bar', a, self) """ c = get_contract_with_gas_estimation(loggy_code) c.foo() logs = chain.head_state.receipts[-1].logs[-1] event_id = utils.bytes_to_int(utils.sha3(bytes('MyLog(bytes3,bytes4,address)', 'utf-8'))) # Event id is always the first topic assert logs.topics[0] == event_id # Event id is calculated correctly assert c.translator.event_data[event_id] # Event abi is created correctly assert c.translator.event_data[event_id] == ( {'types': ['bytes3', 'bytes4', 'address'], 'name': 'MyLog', 'names': ['arg1', 'arg2', 'arg3'], 'indexed': [True, True, True], 'anonymous': False} ) # Event is decoded correctly assert c.translator.decode_event(logs.topics, logs.data) == {'arg1': b'bar', 'arg2': b'home', 'arg3': '0x' + c.address.hex(), '_event_type': b'MyLog'}
The issue is in the way size is used on these lines:
size
https://github.com/ethereum/vyper/blob/9eebb7c575545fcf880d815b9c888665dccbea51/vyper/parser/parser.py#L725-L726
put a cute animal picture here.
The text was updated successfully, but these errors were encountered:
Starting on this.
Sorry, something went wrong.
No branches or pull requests
What's your issue about?
Logging indexed byte arrays works either if they have runtime length precisely 3! or are literals.
Here is a test that fails:
How can it be fixed?
The issue is in the way
size
is used on these lines:https://github.com/ethereum/vyper/blob/9eebb7c575545fcf880d815b9c888665dccbea51/vyper/parser/parser.py#L725-L726
Cute Animal Picture
The text was updated successfully, but these errors were encountered: