Skip to content

Commit

Permalink
refactor(campaign): remove AuctionsOfCampaign (#892)
Browse files Browse the repository at this point in the history
* proto

* remove queries

* remove fundraising dependency
  • Loading branch information
lumtis authored Jul 13, 2022
1 parent 16209ef commit 01cb342
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 821 deletions.
1 change: 0 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ func New(
app.DistrKeeper,
app.ProfileKeeper,
app.RewardKeeper,
app.FundraisingKeeper,
)
app.CampaignKeeper = *campaignKeeper
app.LaunchKeeper.SetCampaignKeeper(campaignKeeper)
Expand Down
13 changes: 0 additions & 13 deletions proto/campaign/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ service Query {
option (google.api.http).get = "/tendermint/spn/campaign/total_shares";
}

// Queries a list of auction IDs of a campaign
rpc AuctionsOfCampaign(QueryAuctionsOfCampaignRequest) returns (QueryAuctionsOfCampaignResponse) {
option (google.api.http).get = "/tendermint/spn/campaign/auctions_of_campaign/{campaignID}";
}

// this line is used by starport scaffolding # 2
}

Expand Down Expand Up @@ -197,12 +192,4 @@ message QueryTotalSharesResponse {
uint64 totalShares = 1;
}

message QueryAuctionsOfCampaignRequest {
uint64 campaignID = 1;
}

message QueryAuctionsOfCampaignResponse {
repeated uint64 auctionIDs = 1;
}

// this line is used by starport scaffolding # 3
1 change: 0 additions & 1 deletion testutil/keeper/initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ func (i initializer) Campaign(
distrKeeper,
profileKeeper,
rewardKeeper,
fundraisingKeeper,
)
}

Expand Down
1 change: 0 additions & 1 deletion x/campaign/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
CmdListCampaignSummary(),
CmdQueryParams(),
CmdQueryTotalShares(),
CmdAuctionsOfCampaign(),
)

// this line is used by starport scaffolding # 1
Expand Down
47 changes: 0 additions & 47 deletions x/campaign/client/cli/query_auctions_by_campaign.go

This file was deleted.

42 changes: 0 additions & 42 deletions x/campaign/keeper/grpc_auctions_by_campaign.go

This file was deleted.

85 changes: 0 additions & 85 deletions x/campaign/keeper/grpc_auctions_by_campaign_test.go

This file was deleted.

39 changes: 18 additions & 21 deletions x/campaign/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ type RewardKeeper interface {

type (
Keeper struct {
cdc codec.BinaryCodec
storeKey sdk.StoreKey
memKey sdk.StoreKey
launchKeeper LaunchKeeper
bankKeeper types.BankKeeper
distrKeeper types.DistributionKeeper
profileKeeper types.ProfileKeeper
rewardKeeper RewardKeeper
fundraisingKeeper types.FundraisingKeeper
paramSpace paramtypes.Subspace
cdc codec.BinaryCodec
storeKey sdk.StoreKey
memKey sdk.StoreKey
launchKeeper LaunchKeeper
bankKeeper types.BankKeeper
distrKeeper types.DistributionKeeper
profileKeeper types.ProfileKeeper
rewardKeeper RewardKeeper
paramSpace paramtypes.Subspace
}
)

Expand All @@ -61,24 +60,22 @@ func NewKeeper(
distrKeeper types.DistributionKeeper,
profileKeeper types.ProfileKeeper,
rewardKeeper RewardKeeper,
fundraisingKeeper types.FundraisingKeeper,
) *Keeper {
// set KeyTable if it has not already been set
if !paramSpace.HasKeyTable() {
paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
}

return &Keeper{
cdc: cdc,
storeKey: storeKey,
memKey: memKey,
paramSpace: paramSpace,
launchKeeper: launchKeeper,
bankKeeper: bankKeeper,
distrKeeper: distrKeeper,
profileKeeper: profileKeeper,
rewardKeeper: rewardKeeper,
fundraisingKeeper: fundraisingKeeper,
cdc: cdc,
storeKey: storeKey,
memKey: memKey,
paramSpace: paramSpace,
launchKeeper: launchKeeper,
bankKeeper: bankKeeper,
distrKeeper: distrKeeper,
profileKeeper: profileKeeper,
rewardKeeper: rewardKeeper,
}
}

Expand Down
5 changes: 0 additions & 5 deletions x/campaign/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
fundraisingtypes "github.com/tendermint/fundraising/x/fundraising/types"

profiletypes "github.com/tendermint/spn/x/profile/types"
)
Expand Down Expand Up @@ -32,7 +31,3 @@ type AccountKeeper interface {
type DistributionKeeper interface {
FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error
}

type FundraisingKeeper interface {
IterateAuctions(ctx sdk.Context, cb func(auction fundraisingtypes.AuctionI) (stop bool))
}
Loading

0 comments on commit 01cb342

Please sign in to comment.