From 28b44ed3d5d56977355e19c6cea59ab6c9acd498 Mon Sep 17 00:00:00 2001 From: "jaeseung.bae" Date: Wed, 12 Jun 2024 19:20:49 +0900 Subject: [PATCH] chore: remove unnecessary code --- x/fswap/types/msgs_test.go | 55 -------------------------------------- 1 file changed, 55 deletions(-) diff --git a/x/fswap/types/msgs_test.go b/x/fswap/types/msgs_test.go index d4769b1666..d6091af476 100644 --- a/x/fswap/types/msgs_test.go +++ b/x/fswap/types/msgs_test.go @@ -5,8 +5,6 @@ import ( "testing" "github.com/stretchr/testify/require" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/Finschia/finschia-sdk/crypto/keys/secp256k1" sdk "github.com/Finschia/finschia-sdk/types" @@ -89,59 +87,6 @@ func TestAminoJSON(t *testing.T) { } } -func TestQuerySwapRequestValidate(t *testing.T) { - tests := []struct { - name string - msg *fswaptypes.QuerySwapRequest - expectedGrpcCode codes.Code - }{ - { - name: "valid", - msg: &fswaptypes.QuerySwapRequest{ - FromDenom: "cony", - ToDenom: "kei", - }, - expectedGrpcCode: codes.OK, - }, - { - name: "invalid: nil request", - msg: nil, - expectedGrpcCode: codes.InvalidArgument, - }, - { - name: "invalid: empty fromDenom", - msg: &fswaptypes.QuerySwapRequest{ - FromDenom: "", - ToDenom: "kei", - }, - expectedGrpcCode: codes.InvalidArgument, - }, - { - name: "invalid: empty toDenom", - msg: &fswaptypes.QuerySwapRequest{ - FromDenom: "cony", - ToDenom: "", - }, - expectedGrpcCode: codes.InvalidArgument, - }, - { - name: "invalid: the same fromDenom and toDenom", - msg: &fswaptypes.QuerySwapRequest{ - FromDenom: "cony", - ToDenom: "cony", - }, - expectedGrpcCode: codes.InvalidArgument, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - err := tc.msg.Validate() - actualGrpcCode := status.Code(err) - require.Equal(t, tc.expectedGrpcCode, actualGrpcCode) - }) - } -} - func TestMsgSwapValidate(t *testing.T) { pk := secp256k1.GenPrivKey().PubKey() address, err := sdk.Bech32ifyAddressBytes("link", pk.Address())