near_bindgen
methods with no self
check for attached deposit
#718
Labels
Projects
near_bindgen
methods with no self
check for attached deposit
#718
Methods like this will add the codegen assumed when a contract mutates state. A slightly strange pattern we have that defaults to checking this only when the parameter is
&mut self
even though in any function there can be state changes not tied to the contract state.Tying the check for attached deposit to whether or not contract state changes is a strange pattern IMO but the band-aid fix is to just remove this check when contract state isn't used. This needs to be done so that these methods can be called with a view operation, otherwise, the runtime will fail when trying to call
env::attached_deposit
from within a view call.Test for this looks like:
which is currently failing because it adds the extra check
The text was updated successfully, but these errors were encountered: