I am trying to use the following code but it isn't working:
require_eq!(self.state,TokenState::Initial,TokenError::NotAtInitialState);
This is error I see when anchor build
is run:
require_eq!(game_data.state,TokenState::Initial,TokenError::NotAtInitialState);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `game::TokenState` cannot be formatted with the default formatter
However, the same code works if I use require! macro:
require!(self.state == TokenState::Initial,TokenError::NotAtInitialState);
Is it because I am not using a particular trait required for the custom type? If yes then what is this trait?