ape: Make RemoveChainLocalOverride set correct removed flag #1006

Merged
fyrchik merged 1 commit from aarifullin/frostfs-node:fix/898_removed-true into master 2024-02-28 19:07:10 +00:00
5 changed files with 3 additions and 14 deletions

View file

@ -57,11 +57,7 @@ func removeRule(cmd *cobra.Command, _ []string) {
verifyResponse(cmd, resp.GetSignature(), resp.GetBody())
if resp.GetBody().GetRemoved() {
cmd.Println("Rule has been removed.")
} else {
cmd.Println("Rule has not been removed.")
}
cmd.Println("Rule has been removed.")
}
func initControlRemoveRuleCmd() {

View file

@ -159,19 +159,13 @@ func (s *Server) RemoveChainLocalOverride(_ context.Context, req *control.Remove
return nil, err
}
removed := true
if err = s.localOverrideStorage.LocalStorage().RemoveOverride(apechain.Ingress, target, apechain.ID(req.GetBody().GetChainId())); err != nil {
code := getCodeByLocalStorageErr(err)
if code == codes.NotFound {
removed = false
} else {
if code := getCodeByLocalStorageErr(err); code != codes.NotFound {
return nil, status.Error(code, err.Error())
}
}
resp := &control.RemoveChainLocalOverrideResponse{
Body: &control.RemoveChainLocalOverrideResponse_Body{
Removed: removed,
},
Body: &control.RemoveChainLocalOverrideResponse_Body{},
}
err = SignMessage(s.key, resp)
if err != nil {

Binary file not shown.

View file

@ -566,7 +566,6 @@ message RemoveChainLocalOverrideRequest {
message RemoveChainLocalOverrideResponse {
message Body {
bool removed = 1;
}
Body body = 1;

Binary file not shown.