Skip to content

Commit

Permalink
lint fix + remove default path
Browse files Browse the repository at this point in the history
  • Loading branch information
iansuvak committed Jan 7, 2025
1 parent 0275d36 commit ee7ab28
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/utils/signature_aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import (
)

const (
DEFAULT_SIG_AGG_PATH = "~/.teleporter-deps/icm-services/signature-aggregator"
DEFAULT_API_PORT = 8080
SIG_AGG_API_PATH = "/aggregate-signatures"
DEFAULT_API_PORT = 8080
SIG_AGG_API_PATH = "/aggregate-signatures"
)

// This is a wrapper around a signature aggregator binary instead of importing the package directly
Expand Down Expand Up @@ -65,9 +64,7 @@ func (s *SignatureAggregator) Shutdown() {
// Aggregator utils
func NewSignatureAggregator(apiUri string, l1IDs []ids.ID) *SignatureAggregator {
sigAggPath := os.Getenv("SIG_AGG_PATH")
if sigAggPath == "" {
sigAggPath = DEFAULT_SIG_AGG_PATH
}
Expect(sigAggPath).ShouldNot(BeEmpty())
l1IdStrings := make([]string, 0, len(l1IDs))
for _, l1Id := range l1IDs {
l1IdStrings = append(l1IdStrings, l1Id.String())
Expand Down Expand Up @@ -146,10 +143,10 @@ func (s *SignatureAggregator) CreateSignedMessage(
}
req.Header.Set("Content-Type", "application/json")
res, err := client.Do(req)
defer res.Body.Close()
if err != nil {
return nil, err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
return nil, fmt.Errorf("expected status code 200, got %d", res.StatusCode)
}
Expand Down

0 comments on commit ee7ab28

Please sign in to comment.