@@ -806,7 +806,7 @@ func (ft *FFTokens) CreateTokenPool(ctx context.Context, nsOpID string, pool *co
806
806
if err != nil || ! res .IsSuccess () {
807
807
return core .OpPhaseInitializing , wrapError (ctx , & errRes , res , err )
808
808
}
809
- if res .StatusCode () == 200 {
809
+ if res .StatusCode () == http . StatusOK {
810
810
// HTTP 200: Creation was successful, and pool details are in response body
811
811
var obj fftypes.JSONObject
812
812
if err := json .Unmarshal (res .Body (), & obj ); err != nil {
@@ -841,7 +841,7 @@ func (ft *FFTokens) ActivateTokenPool(ctx context.Context, pool *core.TokenPool)
841
841
if err != nil || ! res .IsSuccess () {
842
842
return core .OpPhaseInitializing , err
843
843
}
844
- if res .StatusCode () == 200 {
844
+ if res .StatusCode () == http . StatusOK {
845
845
// HTTP 200: Activation was successful, and pool details are in response body
846
846
var obj fftypes.JSONObject
847
847
if err := json .Unmarshal (res .Body (), & obj ); err != nil {
@@ -851,7 +851,7 @@ func (ft *FFTokens) ActivateTokenPool(ctx context.Context, pool *core.TokenPool)
851
851
TX : pool .TX .ID ,
852
852
TXType : pool .TX .Type ,
853
853
})
854
- } else if res .StatusCode () == 204 {
854
+ } else if res .StatusCode () == http . StatusNoContent {
855
855
// HTTP 204: Activation was successful, but pool details are not available
856
856
// This will resolve the operation, but connector is responsible for re-delivering pool details on the websocket.
857
857
return core .OpPhaseComplete , nil
@@ -871,7 +871,7 @@ func (ft *FFTokens) DeactivateTokenPool(ctx context.Context, pool *core.TokenPoo
871
871
}).
872
872
SetError (& errRes ).
873
873
Post ("/api/v1/deactivatepool" )
874
- if err == nil && (res .IsSuccess () || res .StatusCode () == 404 ) {
874
+ if err == nil && (res .IsSuccess () || res .StatusCode () == http . StatusNotFound ) {
875
875
return nil
876
876
}
877
877
return wrapError (ctx , & errRes , res , err )
0 commit comments