Skip to content

Commit

Permalink
fixes + changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano committed Mar 11, 2024
1 parent 168e38d commit 76a8219
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Bug Fixes

* [99](https://github.com/cosmos/rosetta/pull/99) Rosetta now can connect to cometBFT over https.

### Improvements

* [93](https://github.com/cosmos/rosetta/pull/93) Removes the use of `LegacyMsg.GetSigners()` in favor of `codec.GetMsgV1Signers`.
Expand Down
8 changes: 5 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const (
HTTP = "http"
HTTPS = "https"
TCP = "tcp"

HTTPSPORT = "443"
)

// configuration defaults constants
Expand Down Expand Up @@ -156,7 +158,7 @@ func (c *Config) validate() error {
if c.TendermintRPC == "" {
return crgerrs.WrapError(crgerrs.ErrConfig, "cometbft rpc not provided")
}
validatedURL, err := c.validateUrl(c.TendermintRPC)
validatedURL, err := c.validateURL(c.TendermintRPC)
if err != nil {
return err
}
Expand All @@ -165,13 +167,13 @@ func (c *Config) validate() error {
return nil
}

func (c *Config) validateUrl(tendermintRPC string) (string, error) {
func (c *Config) validateURL(tendermintRPC string) (string, error) {
u, err := url.Parse(tendermintRPC)
if err != nil {
return "", crgerrs.WrapError(crgerrs.ErrConfig, err.Error())
}

if u.Port() == "443" && u.Scheme != HTTPS {
if u.Port() == HTTPSPORT && u.Scheme != HTTPS {
u.Scheme = HTTPS
}

Expand Down

0 comments on commit 76a8219

Please sign in to comment.