Skip to content

Commit

Permalink
Merge pull request #33 from rarimo/fix/addprefix
Browse files Browse the repository at this point in the history
Fix rarimo prefix: replace cosmos prefix to rarimo prefix
  • Loading branch information
Zaptoss authored Jun 20, 2024
2 parents 0678c90 + ae99cf9 commit fa78cd0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/service/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package service
import (
"context"

"github.com/cosmos/cosmos-sdk/types"
"github.com/go-chi/chi"
"github.com/rarimo/rarime-points-svc/internal/config"
"github.com/rarimo/rarime-points-svc/internal/service/handlers"
"gitlab.com/distributed_lab/ape"
)

func Run(ctx context.Context, cfg config.Config) {
setBech32Prefixes()
r := chi.NewRouter()

r.Use(
Expand Down Expand Up @@ -60,3 +62,11 @@ func Run(ctx context.Context, cfg config.Config) {
cfg.Log().Info("Service started")
ape.Serve(ctx, r, cfg, ape.ServeOpts{})
}

func setBech32Prefixes() {
c := types.GetConfig()
c.SetBech32PrefixForAccount("rarimo", "rarimopub")
c.SetBech32PrefixForValidator("rarimovaloper", "rarimovaloperpub")
c.SetBech32PrefixForConsensusNode("rarimovalcons", "rarimovalconspub")
c.Seal()
}

0 comments on commit fa78cd0

Please sign in to comment.