setupStateMachine creates and returns a read-only state machine
(height uint64, w http.ResponseWriter)
| 231 | |
| 232 | // setupStateMachine creates and returns a read-only state machine |
| 233 | func (s *Server) getStateMachineWithHeight(height uint64, w http.ResponseWriter) (*fsm.StateMachine, bool) { |
| 234 | |
| 235 | // Investigate memory use of state. State.Discard needs to be called |
| 236 | state, err := s.controller.FSM.TimeMachine(height) |
| 237 | if err != nil { |
| 238 | write(w, lib.ErrTimeMachine(err), http.StatusInternalServerError) |
| 239 | return nil, false |
| 240 | } |
| 241 | return state, true |
| 242 | } |
| 243 | |
| 244 | // getFeeFromState populates txRequest with the fee for the transaction type specified in messageName |
| 245 | func (s *Server) getFeeFromState(ptr *txRequest, messageName string, lockorder ...bool) lib.ErrorI { |
no test coverage detected