[#898] control: Remove removed flag from RemoveChainLocalOverrideResponse

* Remove removed flag in service.proto for RemoveChainLocalOverrideResponse.
* Regenerate control API.
* Return error only if RemoveOverride returns non-NotFound code.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2024-02-27 12:27:09 +03:00 committed by Evgenii Stratonikov
parent 75a1a95c2c
commit 93bf9acbc2
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.