You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having these would be useful in the context of standards, since a contract could
implement an ink! trait which already has the correct behaviour implemented.
This would also bring traits closer to "normal" Rust traits.
This issue requires the refactoring of the trait system first. The main reason is associated output types, mentioned here. Because the default implementation may return something, the output type should be known in the trait definition in the default implementation. So first, to be able to solve this issue, we need to solve the #631 properly. After we have pure Rust traits we can have default methods in the trait definition, but we will face another problem on the #[ink::contract] side, because we will not know the full list of implemented messages(some of them can come from default implementation). But it is possible to solve via introductions of the real and fake messages and the assumption that each trait can't have more than 256 messages.
There are several limitations which exist around ink!'s traits infrastructure.
One of those is the inability to have default trait method implementations.
Having these would be useful in the context of standards, since a contract could
implement an ink! trait which already has the correct behaviour implemented.
This would also bring traits closer to "normal" Rust traits.
cc @xgreenx
The text was updated successfully, but these errors were encountered: