Skip to content

Commit

Permalink
Remove unused code and some refactor. (#140)
Browse files Browse the repository at this point in the history
* Remove unused code.

* Refactor code in app and cmd

* Correct proto name and doc.
  • Loading branch information
tnv1 authored Jan 24, 2024
1 parent f4e167f commit 49f968c
Show file tree
Hide file tree
Showing 29 changed files with 354 additions and 1,889 deletions.
7 changes: 0 additions & 7 deletions app/params/params.go

This file was deleted.

23 changes: 0 additions & 23 deletions app/params/weights.go

This file was deleted.

2 changes: 0 additions & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ func init() {
simcli.GetSimulatorFlags()
}

// Profile with:
// /usr/local/go/bin/go test -benchmem -run=^$ github.com/cosmos/cosmos-sdk/feeappApp -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out
func BenchmarkFullAppSimulation(b *testing.B) {
config := simcli.NewConfigFromFlags()

Expand Down
2 changes: 1 addition & 1 deletion cmd/feeappd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {

rootCmd := &cobra.Command{
Use: "feeappd",
Short: "Stargate Cosmos Hub App",
Short: "Fee Abstraction App",
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags())
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions cmd/feeappd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var (
flagOutputDir = "output-dir"
flagNodeDaemonHome = "node-daemon-home"
flagStartingIPAddress = "starting-ip-address"
flagKeyAlgorithm = "key-algorithm"
)

// get cmd to initialize all files for tendermint testnet and application
Expand Down Expand Up @@ -77,7 +78,7 @@ Example:
nodeDaemonHome, _ := cmd.Flags().GetString(flagNodeDaemonHome)
startingIPAddress, _ := cmd.Flags().GetString(flagStartingIPAddress)
numValidators, _ := cmd.Flags().GetInt(flagNumValidators)
algo, _ := cmd.Flags().GetString(flags.FlagKeyAlgorithm)
algo, _ := cmd.Flags().GetString(flagKeyAlgorithm)

return InitTestnet(
clientCtx, cmd, config, mbm, genBalIterator, outputDir, chainID, minGasPrices,
Expand All @@ -94,7 +95,7 @@ Example:
cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created")
cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)")
cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)")
cmd.Flags().String(flags.FlagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for")
cmd.Flags().String(flagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for")

return cmd
}
Expand Down
9 changes: 0 additions & 9 deletions proto/feeabstraction/absfee/v1beta1/feepool.proto

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package feeabstraction.absfee.v1beta1;
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
syntax = "proto3";
package feeabstraction.absfee.v1beta1;
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "feeabstraction/absfee/v1beta1/params.proto";
import "feeabstraction/absfee/v1beta1/epoch.proto";
import "feeabstraction/feeabs/v1beta1/params.proto";
import "feeabstraction/feeabs/v1beta1/epoch.proto";

option go_package = "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types";

// Params defines the parameters for the feeabs module.
// GenesisState defines the feeabs module's genesis state.
message GenesisState {
Params params = 1 [
(gogoproto.moretags) = "yaml:\"params\"",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package feeabstraction.absfee.v1beta1;
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package feeabstraction.absfee.v1beta1;
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package feeabstraction.absfee.v1beta1;
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
syntax = "proto3";
package feeabstraction.absfee.v1beta1;
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "feeabstraction/absfee/v1beta1/params.proto";
import "feeabstraction/absfee/v1beta1/osmosisibc.proto";
import "feeabstraction/absfee/v1beta1/proposal.proto";
import "feeabstraction/feeabs/v1beta1/params.proto";
import "feeabstraction/feeabs/v1beta1/osmosisibc.proto";
import "feeabstraction/feeabs/v1beta1/proposal.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types";

// Query defines the gRPC querier service.
service Query {
// OsmosisSpotPrice return spot price of pair Osmo/nativeToken
// OsmosisArithmeticTwap return spot price of pair Osmo/nativeToken
rpc OsmosisArithmeticTwap(QueryOsmosisArithmeticTwapRequest)
returns (QueryOsmosisArithmeticTwapResponse) {
option (google.api.http).get =
Expand Down Expand Up @@ -46,8 +46,8 @@ message QueryHostChainConfigResponse {
];
}

// QueryOsmosisSpotPriceRequest is the request type for the Query/Feeabs RPC
// method.
// QueryOsmosisArithmeticTwapRequest is the request type for the Query/Feeabs
// RPC method.
message QueryOsmosisArithmeticTwapRequest { string ibc_denom = 1; }

message QueryOsmosisArithmeticTwapResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
syntax = "proto3";
package feeabstraction.absfee.v1beta1;
package feeabstraction.feeabs.v1beta1;

import "gogoproto/gogo.proto";
import "feeabstraction/absfee/v1beta1/params.proto";
import "feeabstraction/absfee/v1beta1/epoch.proto";
import "feeabstraction/feeabs/v1beta1/params.proto";
import "feeabstraction/feeabs/v1beta1/epoch.proto";
import "cosmos/base/v1beta1/coin.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/osmosis-labs/fee-abstraction/v7/x/feeabs/types";

// Msg is the cosmos.group.v1 Msg service.
service Msg {
rpc SendQueryIbcDenomTWAP(MsgSendQueryIbcDenomTWAP)
returns (MsgSendQueryIbcDenomTWAPResponse);
Expand All @@ -18,7 +17,6 @@ service Msg {
returns (MsgFundFeeAbsModuleAccountResponse);
}

// Msg fund module account
message MsgFundFeeAbsModuleAccount {
string from_address = 1;
repeated cosmos.base.v1beta1.Coin amount = 2 [
Expand All @@ -30,12 +28,10 @@ message MsgFundFeeAbsModuleAccount {

message MsgFundFeeAbsModuleAccountResponse {}

// Params defines the parameters for the feeabs module.
message MsgSendQueryIbcDenomTWAP { string from_address = 1; }

message MsgSendQueryIbcDenomTWAPResponse {}

// Params defines the parameters for the feeabs module.
message MsgSwapCrossChain {
string from_address = 1;
string ibc_denom = 2;
Expand Down
2 changes: 1 addition & 1 deletion scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eo pipefail
# get protoc executions
echo "Generating gogo proto code"
cd proto
proto_dirs=$(find ./feeabstraction/absfee/v1beta1/ -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
proto_dirs=$(find ./feeabstraction/feeabs/v1beta1/ -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
if grep go_package $file &>/dev/null; then
Expand Down
3 changes: 0 additions & 3 deletions x/feeabs/ibctesting/README.md

This file was deleted.

Loading

0 comments on commit 49f968c

Please sign in to comment.