Skip to content

Commit

Permalink
refactor: migrate deprecated msg to codec
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code committed Jan 26, 2025
1 parent 308b680 commit ba44ab0
Show file tree
Hide file tree
Showing 56 changed files with 21,142 additions and 24,182 deletions.
2,163 changes: 591 additions & 1,572 deletions api/fx/erc20/v1/legacy.pulsar.go → api/fx/erc20/v1/erc20_legacy.pulsar.go

Large diffs are not rendered by default.

708 changes: 354 additions & 354 deletions api/fx/gov/v1/gov_legacy.pulsar.go

Large diffs are not rendered by default.

6,647 changes: 6,647 additions & 0 deletions api/fx/gravity/crosschain/v1/crosschain_legacy.pulsar.go

Large diffs are not rendered by default.

11,122 changes: 0 additions & 11,122 deletions api/fx/gravity/crosschain/v1/legacy.pulsar.go

This file was deleted.

2,349 changes: 1,444 additions & 905 deletions api/fx/gravity/crosschain/v1/query.pulsar.go

Large diffs are not rendered by default.

3,425 changes: 2,937 additions & 488 deletions api/fx/gravity/crosschain/v1/tx.pulsar.go

Large diffs are not rendered by default.

3,978 changes: 1,293 additions & 2,685 deletions api/fx/gravity/v1/gravity_legacy.pulsar.go

Large diffs are not rendered by default.

1,492 changes: 1,492 additions & 0 deletions api/fx/gravity/v1/legacy.pulsar.go

Large diffs are not rendered by default.

58 changes: 31 additions & 27 deletions api/fx/ibc/applications/transfer/v1/ibc_legacy.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 26 additions & 23 deletions api/fx/staking/v1/staking_legacy.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import (
gaspricev1 "github.com/pundiai/fx-core/v8/server/grpc/gasprice/v1"
gaspricev2 "github.com/pundiai/fx-core/v8/server/grpc/gasprice/v2"
fxtypes "github.com/pundiai/fx-core/v8/types"
legacytypes "github.com/pundiai/fx-core/v8/types/legacy"
"github.com/pundiai/fx-core/v8/x/crosschain"
"github.com/pundiai/fx-core/v8/x/crosschain/keeper"
crosschaintypes "github.com/pundiai/fx-core/v8/x/crosschain/types"
Expand Down Expand Up @@ -118,6 +119,9 @@ func New(
ibcmiddlewaretypes.RegisterLegacyAminoCodec(legacyAmino)
ibcmiddlewaretypes.RegisterInterfaces(interfaceRegistry)

legacytypes.RegisterInterfaces(interfaceRegistry)
legacytypes.RegisterLegacyAminoCodec(legacyAmino)

legacy.Cdc = legacyAmino

// App Opts
Expand Down
46 changes: 32 additions & 14 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,46 @@ import (

"github.com/pundiai/fx-core/v8/testutil/helpers"
"github.com/pundiai/fx-core/v8/types/legacy"
"github.com/pundiai/fx-core/v8/types/legacy/gravity"
crosschaintypes "github.com/pundiai/fx-core/v8/x/crosschain/types"
erc20types "github.com/pundiai/fx-core/v8/x/erc20/types"
)

func Test_MsgServiceRouter(t *testing.T) {
myApp := helpers.NewApp()

msgServiceRouter := myApp.MsgServiceRouter()
deprecated := map[string]struct{}{
sdk.MsgTypeURL(&crosschaintypes.MsgSetOrchestratorAddress{}): {},
sdk.MsgTypeURL(&crosschaintypes.MsgAddOracleDeposit{}): {},
sdk.MsgTypeURL(&legacy.MsgUpdateParams{}): {},
sdk.MsgTypeURL(&legacy.MsgUpdateFXParams{}): {},
sdk.MsgTypeURL(&legacy.MsgUpdateEGFParams{}): {},
sdk.MsgTypeURL(&crosschaintypes.MsgCancelSendToExternal{}): {},
sdk.MsgTypeURL(&crosschaintypes.MsgIncreaseBridgeFee{}): {},
sdk.MsgTypeURL(&crosschaintypes.MsgRequestBatch{}): {},
sdk.MsgTypeURL(&erc20types.MsgConvertDenom{}): {},
sdk.MsgTypeURL(&erc20types.MsgConvertERC20{}): {},
sdk.MsgTypeURL(&erc20types.MsgUpdateDenomAlias{}): {},
sdk.MsgTypeURL(&erc20types.MsgRegisterERC20{}): {},
sdk.MsgTypeURL(&erc20types.MsgRegisterCoin{}): {},
sdk.MsgTypeURL(&legacy.MsgUpdateParams{}): {},
sdk.MsgTypeURL(&legacy.MsgUpdateFXParams{}): {},
sdk.MsgTypeURL(&legacy.MsgUpdateEGFParams{}): {},

sdk.MsgTypeURL(&legacy.MsgConvertDenom{}): {},
sdk.MsgTypeURL(&legacy.MsgConvertERC20{}): {},
sdk.MsgTypeURL(&legacy.MsgUpdateDenomAlias{}): {},
sdk.MsgTypeURL(&legacy.MsgRegisterERC20{}): {},
sdk.MsgTypeURL(&legacy.MsgRegisterCoin{}): {},

sdk.MsgTypeURL(&legacy.MsgValsetConfirm{}): {},
sdk.MsgTypeURL(&legacy.MsgConfirmBatch{}): {},
sdk.MsgTypeURL(&gravity.MsgSetOrchestratorAddress{}): {},
sdk.MsgTypeURL(&legacy.MsgFxOriginatedTokenClaim{}): {},
sdk.MsgTypeURL(&gravity.MsgRequestBatch{}): {},
sdk.MsgTypeURL(&legacy.MsgWithdrawClaim{}): {},
sdk.MsgTypeURL(&legacy.MsgSendToEth{}): {},
sdk.MsgTypeURL(&legacy.MsgCancelSendToEth{}): {},
sdk.MsgTypeURL(&legacy.MsgValsetUpdatedClaim{}): {},
sdk.MsgTypeURL(&legacy.MsgDepositClaim{}): {},

sdk.MsgTypeURL(&legacy.MsgGrantPrivilege{}): {},
sdk.MsgTypeURL(&legacy.MsgEditConsensusPubKey{}): {},

sdk.MsgTypeURL(&legacy.MsgSetOrchestratorAddress{}): {},
sdk.MsgTypeURL(&legacy.MsgAddOracleDeposit{}): {},
sdk.MsgTypeURL(&legacy.MsgCancelSendToExternal{}): {},
sdk.MsgTypeURL(&legacy.MsgIncreaseBridgeFee{}): {},
sdk.MsgTypeURL(&legacy.MsgRequestBatch{}): {},

sdk.MsgTypeURL(&legacy.MsgTransfer{}): {},

// MsgClaim
sdk.MsgTypeURL(&crosschaintypes.MsgSendToExternalClaim{}): {},
Expand Down
2 changes: 1 addition & 1 deletion app/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestRegisterInterfaces(t *testing.T) {
for implInterfaces.Next() {
count2++
}
assert.Equal(t, 299, count2)
assert.Equal(t, 312, count2) // This number can only increase, not decrease.

typeURLMap := interfaceRegistry.FieldByName("typeURLMap").MapRange()
for typeURLMap.Next() {
Expand Down
26 changes: 26 additions & 0 deletions app/interface_registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,22 @@
"/fx.gravity.crosschain.v1.MsgWithdrawReward",
"/fx.gravity.crosschain.v1.MsgWithdrawRewardResponse",
"/fx.gravity.crosschain.v1.UpdateChainOraclesProposal",
"/fx.gravity.v1.MsgCancelSendToEth",
"/fx.gravity.v1.MsgConfirmBatch",
"/fx.gravity.v1.MsgDepositClaim",
"/fx.gravity.v1.MsgFxOriginatedTokenClaim",
"/fx.gravity.v1.MsgRequestBatch",
"/fx.gravity.v1.MsgSendToEth",
"/fx.gravity.v1.MsgSetOrchestratorAddress",
"/fx.gravity.v1.MsgValsetConfirm",
"/fx.gravity.v1.MsgValsetUpdatedClaim",
"/fx.gravity.v1.MsgWithdrawClaim",
"/fx.ibc.applications.transfer.v1.IbcCallEvmPacket",
"/fx.ibc.applications.transfer.v1.MsgTransfer",
"/fx.migrate.v1.MsgMigrateAccount",
"/fx.migrate.v1.MsgMigrateAccountResponse",
"/fx.staking.v1.MsgEditConsensusPubKey",
"/fx.staking.v1.MsgGrantPrivilege",
"/ibc.applications.transfer.v1.MsgTransfer",
"/ibc.applications.transfer.v1.MsgTransferResponse",
"/ibc.applications.transfer.v1.MsgUpdateParams",
Expand Down Expand Up @@ -440,7 +453,20 @@
"/fx.gravity.crosschain.v1.MsgUpdateChainOracles",
"/fx.gravity.crosschain.v1.MsgUpdateParams",
"/fx.gravity.crosschain.v1.MsgWithdrawReward",
"/fx.gravity.v1.MsgCancelSendToEth",
"/fx.gravity.v1.MsgConfirmBatch",
"/fx.gravity.v1.MsgDepositClaim",
"/fx.gravity.v1.MsgFxOriginatedTokenClaim",
"/fx.gravity.v1.MsgRequestBatch",
"/fx.gravity.v1.MsgSendToEth",
"/fx.gravity.v1.MsgSetOrchestratorAddress",
"/fx.gravity.v1.MsgValsetConfirm",
"/fx.gravity.v1.MsgValsetUpdatedClaim",
"/fx.gravity.v1.MsgWithdrawClaim",
"/fx.ibc.applications.transfer.v1.MsgTransfer",
"/fx.migrate.v1.MsgMigrateAccount",
"/fx.staking.v1.MsgEditConsensusPubKey",
"/fx.staking.v1.MsgGrantPrivilege",
"/ibc.applications.transfer.v1.MsgTransfer",
"/ibc.applications.transfer.v1.MsgUpdateParams",
"/ibc.core.channel.v1.MsgAcknowledgement",
Expand Down
2 changes: 1 addition & 1 deletion docs/statik/statik.go

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7904,9 +7904,6 @@ paths:
type: string
denom:
type: string
channel_ibc:
type: string
title: 'Deprecated: after upgrade v3'
default:
description: An unexpected error response.
schema:
Expand Down Expand Up @@ -42167,9 +42164,6 @@ definitions:
type: string
denom:
type: string
channel_ibc:
type: string
title: 'Deprecated: after upgrade v3'
fx.gravity.crosschain.v1.BridgeValidator:
type: object
properties:
Expand Down Expand Up @@ -42794,9 +42788,6 @@ definitions:
type: string
denom:
type: string
channel_ibc:
type: string
title: 'Deprecated: after upgrade v3'
fx.gravity.crosschain.v1.QueryCurrentOracleSetResponse:
type: object
properties:
Expand Down
Loading

0 comments on commit ba44ab0

Please sign in to comment.