Write the function to simulate `TRANSACTION` query between first and last state
Write the function to simulate
TRANSACTIONquery between first and last state