From e3f3bd76fadab60b45befb14e8fb9f0fff0d1967 Mon Sep 17 00:00:00 2001
From: jaeseung-bae <119839167+jaeseung-bae@users.noreply.github.com>
Date: Mon, 13 May 2024 11:37:59 +0900
Subject: [PATCH] fix: add missing router registration (#1379)

* fix: add missing router register

* chore: update changelog

* chore: lint fix

* chore: lint fix
---
 CHANGELOG.md             | 1 +
 x/fswap/keeper/keeper.go | 2 +-
 x/fswap/module.go        | 5 ++++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index c7271e2220..6a2d07a063 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -88,6 +88,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
 * (x/fbridge) [\#1361](https://github.com/Finschia/finschia-sdk/pull/1361) Fixes fbridge auth checking bug
 * (x/fswap) [\#1365](https://github.com/Finschia/finschia-sdk/pull/1365) fix update swap keys for possibly overlapped keys(`(hello,world) should be different to (hel,loworld)`)
 * (x/fswap, x/fbridge) [\#1378](https://github.com/Finschia/finschia-sdk/pull/1378) Fix bug where amino is not supported in fswap and fbridge
+* (x/fswap) [\#1379](https://github.com/Finschia/finschia-sdk/pull/1379) add missing router registration
 
 ### Removed
 
diff --git a/x/fswap/keeper/keeper.go b/x/fswap/keeper/keeper.go
index 6b153150a1..7686c3af5d 100644
--- a/x/fswap/keeper/keeper.go
+++ b/x/fswap/keeper/keeper.go
@@ -319,7 +319,7 @@ func (k Keeper) increaseSwapCount(ctx sdk.Context) error {
 	}
 
 	prev := stats.SwapCount
-	stats.SwapCount += 1
+	stats.SwapCount++
 	if stats.SwapCount < prev {
 		return types.ErrInvalidState.Wrap("overflow detected")
 	}
diff --git a/x/fswap/module.go b/x/fswap/module.go
index d561bbe296..acca5b9976 100644
--- a/x/fswap/module.go
+++ b/x/fswap/module.go
@@ -1,6 +1,7 @@
 package fswap
 
 import (
+	"context"
 	"encoding/json"
 	"fmt"
 
@@ -65,7 +66,9 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingCo
 
 // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.
 func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
-	// this line is used by starport scaffolding # 2
+	if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {
+		panic(err)
+	}
 }
 
 // GetTxCmd returns the fswap module's root tx command.