use typechain::{chainlink, chain}; chainlink!(State => { mut value: T; }); chain!(BasicState => { @State mut value: T; }); impl BasicState { pub fn new(value: T) -> Self { Self { value } } } #[test] fn test_state() { let mut state = BasicState::new(0); assert_eq!(state.value(), &0); *state.value() = 1; assert_eq!(state.value(), &1); }