Skip to content

Commit ba84f32

Browse files
committed
fix: incorrect conversion of remote URL to remote address
1 parent ae8a49c commit ba84f32

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

x/node/migrations/migrator.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package migrations
22

33
import (
4+
"net"
5+
"net/url"
46
"time"
57

68
"github.com/cosmos/cosmos-sdk/codec"
@@ -86,11 +88,18 @@ func (k *Migrator) migrateNodes(ctx sdk.Context) {
8688
panic(err)
8789
}
8890

91+
remoteURL, err := url.ParseRequestURI(item.RemoteURL)
92+
if err != nil {
93+
panic(err)
94+
}
95+
96+
remoteAddr := net.JoinHostPort(remoteURL.Hostname(), remoteURL.Port())
97+
8998
node := v3.Node{
9099
Address: item.Address,
91100
GigabytePrices: gigabytePrices,
92101
HourlyPrices: hourlyPrices,
93-
RemoteAddrs: []string{item.RemoteURL},
102+
RemoteAddrs: []string{remoteAddr},
94103
InactiveAt: item.InactiveAt,
95104
Status: item.Status,
96105
StatusAt: item.StatusAt,

0 commit comments

Comments
 (0)