Since owner_is takes &self, it might be assumed it’s eligible for view. I couldn’t find a precise definition of when a function is eligible for view, hence I’m not sure how to handle this. Is it ok to simply mention in docs that owner_is cannot be called via view?
I think it is fine to document that owner_is does not work as a view call. If a user wants to check the owner in a view call then they should use owner_get instead (assuming that works).
The error is:
Since
owner_is
takes&self
, it might be assumed it’s eligible forview
. I couldn’t find a precise definition of when a function is eligible forview
, hence I’m not sure how to handle this. Is it ok to simply mention in docs thatowner_is
cannot be called viaview
?The method’s default implementation is here:
https://github.com/aurora-is-near/near-plugins/blob/df8473232c76d6b75cfcb255e55975d8a5d9c7ff/near-plugins-derive/src/ownable.rs#L76-L80
Another option could be changing the signature:
It would remove the problem and make the method more general, though it would also be a breaking change.