Skip to content

Commit 93d07cb

Browse files
authored
refactor: remove fungible params (#2004)
* Remove unused params from fungible module * Make generate * Changelog * Lint fix * Lint fix
1 parent e74ae5f commit 93d07cb

31 files changed

+96
-1167
lines changed

app/app.go

-2
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ func New(
419419
appCodec,
420420
keys[fungibletypes.StoreKey],
421421
keys[fungibletypes.MemStoreKey],
422-
app.GetSubspace(fungibletypes.ModuleName),
423422
app.AccountKeeper,
424423
app.EvmKeeper,
425424
app.BankKeeper,
@@ -432,7 +431,6 @@ func New(
432431
keys[crosschaintypes.StoreKey],
433432
keys[crosschaintypes.MemStoreKey],
434433
&stakingKeeper,
435-
app.GetSubspace(crosschaintypes.ModuleName),
436434
app.AccountKeeper,
437435
app.BankKeeper,
438436
app.ObserverKeeper,

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* [1966](https://github.com/zeta-chain/node/pull/1966) - move TSS vote message from crosschain to observer
2828
* [1853](https://github.com/zeta-chain/node/pull/1853) - refactor vote inbound tx and vote outbound tx
2929
* [2001](https://github.com/zeta-chain/node/pull/2001) - replace broadcast mode block with sync
30+
* [2004](https://github.com/zeta-chain/node/pull/2004) - remove fungible params
3031

3132
### Features
3233

docs/cli/zetacored/zetacored_query_fungible.md

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ zetacored query fungible [flags]
3030
* [zetacored query fungible gas-stability-pool-balance](zetacored_query_fungible_gas-stability-pool-balance.md) - query the balance of a gas stability pool for a chain
3131
* [zetacored query fungible gas-stability-pool-balances](zetacored_query_fungible_gas-stability-pool-balances.md) - query all gas stability pool balances
3232
* [zetacored query fungible list-foreign-coins](zetacored_query_fungible_list-foreign-coins.md) - list all ForeignCoins
33-
* [zetacored query fungible params](zetacored_query_fungible_params.md) - shows the parameters of the module
3433
* [zetacored query fungible show-foreign-coins](zetacored_query_fungible_show-foreign-coins.md) - shows a ForeignCoins
3534
* [zetacored query fungible system-contract](zetacored_query_fungible_system-contract.md) - query system contract
3635

docs/cli/zetacored/zetacored_query_fungible_params.md

-33
This file was deleted.

docs/openapi/openapi.swagger.yaml

-25
Original file line numberDiff line numberDiff line change
@@ -27401,21 +27401,6 @@ paths:
2740127401
format: int64
2740227402
tags:
2740327403
- Query
27404-
/zeta-chain/fungible/params:
27405-
get:
27406-
summary: Parameters queries the parameters of the module.
27407-
operationId: Query_Params
27408-
responses:
27409-
"200":
27410-
description: A successful response.
27411-
schema:
27412-
$ref: '#/definitions/zetacorefungibleQueryParamsResponse'
27413-
default:
27414-
description: An unexpected error response.
27415-
schema:
27416-
$ref: '#/definitions/googlerpcStatus'
27417-
tags:
27418-
- Query
2741927404
/zeta-chain/fungible/system_contract:
2742027405
get:
2742127406
summary: Queries SystemContract
@@ -54764,16 +54749,6 @@ definitions:
5476454749
$ref: '#/definitions/zetacoreemissionsParams'
5476554750
description: params holds all the parameters of this module.
5476654751
description: QueryParamsResponse is response type for the Query/Params RPC method.
54767-
zetacorefungibleParams:
54768-
type: object
54769-
description: Params defines the parameters for the module.
54770-
zetacorefungibleQueryParamsResponse:
54771-
type: object
54772-
properties:
54773-
params:
54774-
$ref: '#/definitions/zetacorefungibleParams'
54775-
description: params holds all the parameters of this module.
54776-
description: QueryParamsResponse is response type for the Query/Params RPC method.
5477754752
zetacoreobserverParams:
5477854753
type: object
5477954754
properties:

proto/fungible/genesis.proto

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ syntax = "proto3";
22
package zetachain.zetacore.fungible;
33

44
import "fungible/foreign_coins.proto";
5-
import "fungible/params.proto";
65
import "fungible/system_contract.proto";
76
import "gogoproto/gogo.proto";
87

98
option go_package = "github.com/zeta-chain/zetacore/x/fungible/types";
109

1110
// GenesisState defines the fungible module's genesis state.
1211
message GenesisState {
13-
Params params = 1 [(gogoproto.nullable) = false];
14-
repeated ForeignCoins foreignCoinsList = 2 [(gogoproto.nullable) = false];
15-
SystemContract systemContract = 3;
12+
repeated ForeignCoins foreignCoinsList = 1 [(gogoproto.nullable) = false];
13+
SystemContract systemContract = 2;
1614
}

proto/fungible/params.proto

-11
This file was deleted.

proto/fungible/query.proto

-15
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package zetachain.zetacore.fungible;
33

44
import "cosmos/base/query/v1beta1/pagination.proto";
55
import "fungible/foreign_coins.proto";
6-
import "fungible/params.proto";
76
import "fungible/system_contract.proto";
87
import "gogoproto/gogo.proto";
98
import "google/api/annotations.proto";
@@ -12,11 +11,6 @@ option go_package = "github.com/zeta-chain/zetacore/x/fungible/types";
1211

1312
// Query defines the gRPC querier service.
1413
service Query {
15-
// Parameters queries the parameters of the module.
16-
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
17-
option (google.api.http).get = "/zeta-chain/fungible/params";
18-
}
19-
2014
// Queries a ForeignCoins by index.
2115
rpc ForeignCoins(QueryGetForeignCoinsRequest) returns (QueryGetForeignCoinsResponse) {
2216
option (google.api.http).get = "/zeta-chain/fungible/foreign_coins/{index}";
@@ -53,15 +47,6 @@ service Query {
5347
}
5448
}
5549

56-
// QueryParamsRequest is request type for the Query/Params RPC method.
57-
message QueryParamsRequest {}
58-
59-
// QueryParamsResponse is response type for the Query/Params RPC method.
60-
message QueryParamsResponse {
61-
// params holds all the parameters of this module.
62-
Params params = 1 [(gogoproto.nullable) = false];
63-
}
64-
6550
message QueryGetForeignCoinsRequest {
6651
string index = 1;
6752
}

testutil/keeper/crosschain.go

-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ func CrosschainKeeperWithMocks(
7575
cdc,
7676
db,
7777
stateStore,
78-
sdkKeepers.ParamsKeeper,
7978
sdkKeepers.AuthKeeper,
8079
sdkKeepers.BankKeeper,
8180
sdkKeepers.EvmKeeper,
@@ -134,7 +133,6 @@ func CrosschainKeeperWithMocks(
134133
storeKey,
135134
memStoreKey,
136135
stakingKeeper,
137-
sdkKeepers.ParamsKeeper.Subspace(types.ModuleName),
138136
authKeeper,
139137
bankKeeper,
140138
observerKeeper,

testutil/keeper/fungible.go

-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/cosmos/cosmos-sdk/store"
99
storetypes "github.com/cosmos/cosmos-sdk/store/types"
1010
sdk "github.com/cosmos/cosmos-sdk/types"
11-
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
1211
"github.com/evmos/ethermint/x/evm/statedb"
1312
evmtypes "github.com/evmos/ethermint/x/evm/types"
1413
"github.com/stretchr/testify/mock"
@@ -44,7 +43,6 @@ func initFungibleKeeper(
4443
cdc codec.Codec,
4544
db *tmdb.MemDB,
4645
ss store.CommitMultiStore,
47-
paramKeeper paramskeeper.Keeper,
4846
authKeeper types.AccountKeeper,
4947
bankKeepr types.BankKeeper,
5048
evmKeeper types.EVMKeeper,
@@ -60,7 +58,6 @@ func initFungibleKeeper(
6058
cdc,
6159
storeKey,
6260
memKey,
63-
paramKeeper.Subspace(types.ModuleName),
6461
authKeeper,
6562
evmKeeper,
6663
bankKeepr,
@@ -145,7 +142,6 @@ func FungibleKeeperWithMocks(t testing.TB, mockOptions FungibleMockOptions) (*ke
145142
cdc,
146143
storeKey,
147144
memStoreKey,
148-
sdkKeepers.ParamsKeeper.Subspace(types.ModuleName),
149145
authKeeper,
150146
evmKeeper,
151147
bankKeeper,

typescript/fungible/genesis_pb.d.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
77
import { Message, proto3 } from "@bufbuild/protobuf";
8-
import type { Params } from "./params_pb.js";
98
import type { ForeignCoins } from "./foreign_coins_pb.js";
109
import type { SystemContract } from "./system_contract_pb.js";
1110

@@ -16,17 +15,12 @@ import type { SystemContract } from "./system_contract_pb.js";
1615
*/
1716
export declare class GenesisState extends Message<GenesisState> {
1817
/**
19-
* @generated from field: zetachain.zetacore.fungible.Params params = 1;
20-
*/
21-
params?: Params;
22-
23-
/**
24-
* @generated from field: repeated zetachain.zetacore.fungible.ForeignCoins foreignCoinsList = 2;
18+
* @generated from field: repeated zetachain.zetacore.fungible.ForeignCoins foreignCoinsList = 1;
2519
*/
2620
foreignCoinsList: ForeignCoins[];
2721

2822
/**
29-
* @generated from field: zetachain.zetacore.fungible.SystemContract systemContract = 3;
23+
* @generated from field: zetachain.zetacore.fungible.SystemContract systemContract = 2;
3024
*/
3125
systemContract?: SystemContract;
3226

typescript/fungible/index.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export * from "./events_pb";
22
export * from "./foreign_coins_pb";
33
export * from "./genesis_pb";
4-
export * from "./params_pb";
54
export * from "./query_pb";
65
export * from "./system_contract_pb";
76
export * from "./tx_pb";

typescript/fungible/params_pb.d.ts

-29
This file was deleted.

typescript/fungible/query_pb.d.ts

-50
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,10 @@
55

66
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
77
import { Message, proto3 } from "@bufbuild/protobuf";
8-
import type { Params } from "./params_pb.js";
98
import type { ForeignCoins } from "./foreign_coins_pb.js";
109
import type { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination_pb.js";
1110
import type { SystemContract } from "./system_contract_pb.js";
1211

13-
/**
14-
* QueryParamsRequest is request type for the Query/Params RPC method.
15-
*
16-
* @generated from message zetachain.zetacore.fungible.QueryParamsRequest
17-
*/
18-
export declare class QueryParamsRequest extends Message<QueryParamsRequest> {
19-
constructor(data?: PartialMessage<QueryParamsRequest>);
20-
21-
static readonly runtime: typeof proto3;
22-
static readonly typeName = "zetachain.zetacore.fungible.QueryParamsRequest";
23-
static readonly fields: FieldList;
24-
25-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): QueryParamsRequest;
26-
27-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): QueryParamsRequest;
28-
29-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): QueryParamsRequest;
30-
31-
static equals(a: QueryParamsRequest | PlainMessage<QueryParamsRequest> | undefined, b: QueryParamsRequest | PlainMessage<QueryParamsRequest> | undefined): boolean;
32-
}
33-
34-
/**
35-
* QueryParamsResponse is response type for the Query/Params RPC method.
36-
*
37-
* @generated from message zetachain.zetacore.fungible.QueryParamsResponse
38-
*/
39-
export declare class QueryParamsResponse extends Message<QueryParamsResponse> {
40-
/**
41-
* params holds all the parameters of this module.
42-
*
43-
* @generated from field: zetachain.zetacore.fungible.Params params = 1;
44-
*/
45-
params?: Params;
46-
47-
constructor(data?: PartialMessage<QueryParamsResponse>);
48-
49-
static readonly runtime: typeof proto3;
50-
static readonly typeName = "zetachain.zetacore.fungible.QueryParamsResponse";
51-
static readonly fields: FieldList;
52-
53-
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): QueryParamsResponse;
54-
55-
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): QueryParamsResponse;
56-
57-
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): QueryParamsResponse;
58-
59-
static equals(a: QueryParamsResponse | PlainMessage<QueryParamsResponse> | undefined, b: QueryParamsResponse | PlainMessage<QueryParamsResponse> | undefined): boolean;
60-
}
61-
6212
/**
6313
* @generated from message zetachain.zetacore.fungible.QueryGetForeignCoinsRequest
6414
*/

x/crosschain/keeper/keeper.go

-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/cosmos/cosmos-sdk/codec"
77
storetypes "github.com/cosmos/cosmos-sdk/store/types"
88
sdk "github.com/cosmos/cosmos-sdk/types"
9-
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
109
"github.com/tendermint/tendermint/libs/log"
1110
"github.com/zeta-chain/zetacore/x/crosschain/types"
1211
)
@@ -18,7 +17,6 @@ type (
1817
memKey storetypes.StoreKey
1918

2019
stakingKeeper types.StakingKeeper
21-
paramstore paramtypes.Subspace
2220
authKeeper types.AccountKeeper
2321
bankKeeper types.BankKeeper
2422
zetaObserverKeeper types.ObserverKeeper
@@ -32,7 +30,6 @@ func NewKeeper(
3230
storeKey,
3331
memKey storetypes.StoreKey,
3432
stakingKeeper types.StakingKeeper, // custom
35-
paramstore paramtypes.Subspace,
3633
authKeeper types.AccountKeeper,
3734
bankKeeper types.BankKeeper,
3835
zetaObserverKeeper types.ObserverKeeper,
@@ -50,7 +47,6 @@ func NewKeeper(
5047
storeKey: storeKey,
5148
memKey: memKey,
5249
stakingKeeper: stakingKeeper,
53-
paramstore: paramstore,
5450
authKeeper: authKeeper,
5551
bankKeeper: bankKeeper,
5652
zetaObserverKeeper: zetaObserverKeeper,

x/fungible/client/cli/query.go

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ func GetQueryCmd(_ string) *cobra.Command {
2020
}
2121

2222
cmd.AddCommand(
23-
CmdQueryParams(),
2423
CmdListForeignCoins(),
2524
CmdShowForeignCoins(),
2625
CmdGasStabilityPoolAddress(),

0 commit comments

Comments
 (0)