From 3b3247f27572b2e49f30316f78c5643e0959b384 Mon Sep 17 00:00:00 2001 From: miiu Date: Thu, 25 Apr 2024 14:55:57 +0300 Subject: [PATCH] fixes after second review --- pkg/facade/simulatorFacade.go | 2 +- pkg/proxy/api/endpoints.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/facade/simulatorFacade.go b/pkg/facade/simulatorFacade.go index 20f73290..1b7b32f0 100644 --- a/pkg/facade/simulatorFacade.go +++ b/pkg/facade/simulatorFacade.go @@ -50,7 +50,7 @@ func (sf *simulatorFacade) SetStateMultiple(stateSlice []*dtos.AddressState) err // SetStateMultipleOverwrite will set the entire state for the provided address and cleanup the old state of the provided addresses func (sf *simulatorFacade) SetStateMultipleOverwrite(stateSlice []*dtos.AddressState) error { - accounts := make([]string, 0) + accounts := make([]string, 0, len(stateSlice)) for _, state := range stateSlice { accounts = append(accounts, state.Address) } diff --git a/pkg/proxy/api/endpoints.go b/pkg/proxy/api/endpoints.go index 18b8f847..41331ba3 100644 --- a/pkg/proxy/api/endpoints.go +++ b/pkg/proxy/api/endpoints.go @@ -154,7 +154,7 @@ func (ep *endpointsProcessor) setStateMultipleOverwrite(c *gin.Context) { err = ep.facade.SetStateMultipleOverwrite(stateSlice) if err != nil { - shared.RespondWithBadRequest(c, fmt.Sprintf("cannot set state, error: %s", err.Error())) + shared.RespondWithBadRequest(c, fmt.Sprintf("cannot overwrite state, error: %s", err.Error())) return }