@@ -806,7 +806,7 @@ func (ft *FFTokens) CreateTokenPool(ctx context.Context, nsOpID string, pool *co
806806 if err != nil || ! res .IsSuccess () {
807807 return core .OpPhaseInitializing , wrapError (ctx , & errRes , res , err )
808808 }
809- if res .StatusCode () == 200 {
809+ if res .StatusCode () == http . StatusOK {
810810 // HTTP 200: Creation was successful, and pool details are in response body
811811 var obj fftypes.JSONObject
812812 if err := json .Unmarshal (res .Body (), & obj ); err != nil {
@@ -841,7 +841,7 @@ func (ft *FFTokens) ActivateTokenPool(ctx context.Context, pool *core.TokenPool)
841841 if err != nil || ! res .IsSuccess () {
842842 return core .OpPhaseInitializing , err
843843 }
844- if res .StatusCode () == 200 {
844+ if res .StatusCode () == http . StatusOK {
845845 // HTTP 200: Activation was successful, and pool details are in response body
846846 var obj fftypes.JSONObject
847847 if err := json .Unmarshal (res .Body (), & obj ); err != nil {
@@ -851,7 +851,7 @@ func (ft *FFTokens) ActivateTokenPool(ctx context.Context, pool *core.TokenPool)
851851 TX : pool .TX .ID ,
852852 TXType : pool .TX .Type ,
853853 })
854- } else if res .StatusCode () == 204 {
854+ } else if res .StatusCode () == http . StatusNoContent {
855855 // HTTP 204: Activation was successful, but pool details are not available
856856 // This will resolve the operation, but connector is responsible for re-delivering pool details on the websocket.
857857 return core .OpPhaseComplete , nil
@@ -871,7 +871,7 @@ func (ft *FFTokens) DeactivateTokenPool(ctx context.Context, pool *core.TokenPoo
871871 }).
872872 SetError (& errRes ).
873873 Post ("/api/v1/deactivatepool" )
874- if err == nil && (res .IsSuccess () || res .StatusCode () == 404 ) {
874+ if err == nil && (res .IsSuccess () || res .StatusCode () == http . StatusNotFound ) {
875875 return nil
876876 }
877877 return wrapError (ctx , & errRes , res , err )
0 commit comments