baking-bad / pytezos

🐍 Python SDK for Tezos | Michelson VM in Python
https://pytezos.org
MIT License
111 stars 37 forks source link

View name collision token_metadata #314

Open WalterProof opened 2 years ago

WalterProof commented 2 years ago

This is really an edge case, but

having a view named "token_metadata" make a contract unreadable, crashing with a View name collision token_metadata error

made a simple reproduction there: https://github.com/der-alter/exp-collision

aguillon commented 1 year ago

I'm running into this issue as well with https://packages.ligolang.org/package/ligo-generic-fa2.1 where the collision happens on balance_of, with latest release of PyTezos.

I think a fix would be to not make views accessible from the ContractInterface itself, since they're already available from the .views dict. I can give it a try if that works for you?

aguillon commented 1 year ago

My bad, .views has objects of the ViewSection class. I'll change the name in the Ligo library, but changing the behaviour from PyTezos might be nice as well.