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
It seems that del keyword doesn't work for a map.
del
E vyper.exceptions.StructureException: line 14: Unsupported statement type E del self.big_storage[key] E ----^
Example test case:
def test_map_delete(get_contract): code = """ big_storage: bytes32[bytes32] @public def set(key: bytes32, value: bytes32): self.big_storage[key] = value @public def get(key: bytes32) -> bytes32: return self.big_storage[key] @public def delete(key: bytes32): del self.big_storage[key] """ c = get_contract(code) assert c.get("test") == b"" assert c.set("test", "value") assert c.get("test") == b"value" c.delete("test") assert c.get("test") == b""
This will be done
Fixed by using SSTORE 0x0on the sha32'ed key value.
SSTORE 0x0
The text was updated successfully, but these errors were encountered:
I think this is actually good syntax for those coming from Python 👍
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
What's your issue about?
It seems that
del
keyword doesn't work for a map.Example test case:
This will be done
How can it be fixed?
Fixed by using
SSTORE 0x0
on the sha32'ed key value.Cute Animal Picture
The text was updated successfully, but these errors were encountered: