Skip to content

Commit

Permalink
[Feature] Remove Treasury bespoke proposals (#475)
Browse files Browse the repository at this point in the history
* remove treasury proposals

* update swagger docs
  • Loading branch information
yys authored and yun-yeo committed Aug 11, 2021
1 parent 0eb5ee0 commit cfb1b9e
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 2,110 deletions.
6 changes: 1 addition & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ import (
oraclekeeper "github.com/terra-project/core/x/oracle/keeper"
oracletypes "github.com/terra-project/core/x/oracle/types"
"github.com/terra-project/core/x/treasury"
treasuryclient "github.com/terra-project/core/x/treasury/client"
treasurykeeper "github.com/terra-project/core/x/treasury/keeper"
treasurytypes "github.com/terra-project/core/x/treasury/types"
"github.com/terra-project/core/x/vesting"
Expand Down Expand Up @@ -160,8 +159,6 @@ var (
distrclient.ProposalHandler,
upgradeclient.ProposalHandler,
upgradeclient.CancelProposalHandler,
treasuryclient.TaxRateUpdateProposalHandler,
treasuryclient.RewardWeightUpdateProposalHandler,
ibcclientclient.UpdateClientProposalHandler,
ibcclientclient.UpgradeProposalHandler,
),
Expand Down Expand Up @@ -428,8 +425,7 @@ func NewTerraApp(
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(treasurytypes.RouterKey, treasury.NewTreasuryPolicyUpdateHandler(app.TreasuryKeeper))
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))
app.GovKeeper = govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
&stakingKeeper, govRouter,
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

45 changes: 19 additions & 26 deletions custom/gov/legacy/v043/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
v040upgrade "github.com/cosmos/cosmos-sdk/x/upgrade/types"

v04treasury "github.com/terra-project/core/x/treasury/legacy/v04"
v05treasury "github.com/terra-project/core/x/treasury/types"
)

func migrateVoteOption(oldVoteOption v034gov.VoteOption) v043gov.VoteOption {
Expand Down Expand Up @@ -134,19 +133,11 @@ func migrateContent(oldContent v036gov.Content) *codectypes.Any {
}
case v04treasury.TaxRateUpdateProposal:
{
protoProposal = &v05treasury.TaxRateUpdateProposal{
Description: oldContent.Description,
Title: oldContent.Title,
TaxRate: oldContent.TaxRate,
}
return nil
}
case v04treasury.RewardWeightUpdateProposal:
{
protoProposal = &v05treasury.RewardWeightUpdateProposal{
Description: oldContent.Description,
Title: oldContent.Title,
RewardWeight: oldContent.RewardWeight,
}
return nil
}
default:
panic(fmt.Errorf("%T is not a valid proposal content type", oldContent))
Expand Down Expand Up @@ -189,21 +180,23 @@ func Migrate(oldGovState v036gov.GenesisState) *v043gov.GenesisState {

newProposals := make([]v043gov.Proposal, len(oldGovState.Proposals))
for i, oldProposal := range oldGovState.Proposals {
newProposals[i] = v043gov.Proposal{
ProposalId: oldProposal.ProposalID,
Content: migrateContent(oldProposal.Content),
Status: migrateProposalStatus(oldProposal.Status),
FinalTallyResult: v043gov.TallyResult{
Yes: oldProposal.FinalTallyResult.Yes,
Abstain: oldProposal.FinalTallyResult.Abstain,
No: oldProposal.FinalTallyResult.No,
NoWithVeto: oldProposal.FinalTallyResult.NoWithVeto,
},
SubmitTime: oldProposal.SubmitTime,
DepositEndTime: oldProposal.DepositEndTime,
TotalDeposit: oldProposal.TotalDeposit,
VotingStartTime: oldProposal.VotingStartTime,
VotingEndTime: oldProposal.VotingEndTime,
if content := migrateContent(oldProposal.Content); content != nil {
newProposals[i] = v043gov.Proposal{
ProposalId: oldProposal.ProposalID,
Content: content,
Status: migrateProposalStatus(oldProposal.Status),
FinalTallyResult: v043gov.TallyResult{
Yes: oldProposal.FinalTallyResult.Yes,
Abstain: oldProposal.FinalTallyResult.Abstain,
No: oldProposal.FinalTallyResult.No,
NoWithVeto: oldProposal.FinalTallyResult.NoWithVeto,
},
SubmitTime: oldProposal.SubmitTime,
DepositEndTime: oldProposal.DepositEndTime,
TotalDeposit: oldProposal.TotalDeposit,
VotingStartTime: oldProposal.VotingStartTime,
VotingEndTime: oldProposal.VotingEndTime,
}
}
}

Expand Down
92 changes: 0 additions & 92 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -878,12 +878,6 @@
- [GenesisState](#terra.treasury.v1beta1.GenesisState)
- [TaxCap](#terra.treasury.v1beta1.TaxCap)

- [terra/treasury/v1beta1/proposal.proto](#terra/treasury/v1beta1/proposal.proto)
- [RewardWeightUpdateProposal](#terra.treasury.v1beta1.RewardWeightUpdateProposal)
- [RewardWeightUpdateProposalWithDeposit](#terra.treasury.v1beta1.RewardWeightUpdateProposalWithDeposit)
- [TaxRateUpdateProposal](#terra.treasury.v1beta1.TaxRateUpdateProposal)
- [TaxRateUpdateProposalWithDeposit](#terra.treasury.v1beta1.TaxRateUpdateProposalWithDeposit)

- [terra/treasury/v1beta1/query.proto](#terra/treasury/v1beta1/query.proto)
- [QueryIndicatorsRequest](#terra.treasury.v1beta1.QueryIndicatorsRequest)
- [QueryIndicatorsResponse](#terra.treasury.v1beta1.QueryIndicatorsResponse)
Expand Down Expand Up @@ -12701,92 +12695,6 @@ TaxCap is the max tax amount can be charged for the given denom



<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="terra/treasury/v1beta1/proposal.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## terra/treasury/v1beta1/proposal.proto



<a name="terra.treasury.v1beta1.RewardWeightUpdateProposal"></a>

### RewardWeightUpdateProposal
RewardWeightUpdateProposal defines a proposal to update the reward_weight.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `title` | [string](#string) | | |
| `description` | [string](#string) | | |
| `reward_weight` | [string](#string) | | |






<a name="terra.treasury.v1beta1.RewardWeightUpdateProposalWithDeposit"></a>

### RewardWeightUpdateProposalWithDeposit
RewardWeightUpdateProposalWithDeposit defines a proposal to update the reward_weight.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `title` | [string](#string) | | |
| `description` | [string](#string) | | |
| `reward_weight` | [string](#string) | | |
| `deposit` | [string](#string) | | |






<a name="terra.treasury.v1beta1.TaxRateUpdateProposal"></a>

### TaxRateUpdateProposal
TaxRateUpdateProposal defines a proposal to update the tax_rate.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `title` | [string](#string) | | |
| `description` | [string](#string) | | |
| `tax_rate` | [string](#string) | | |






<a name="terra.treasury.v1beta1.TaxRateUpdateProposalWithDeposit"></a>

### TaxRateUpdateProposalWithDeposit
TaxRateUpdateProposalWithDeposit defines a proposal to update the tax_rate.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `title` | [string](#string) | | |
| `description` | [string](#string) | | |
| `tax_rate` | [string](#string) | | |
| `deposit` | [string](#string) | | |





<!-- end messages -->

<!-- end enums -->
Expand Down
57 changes: 0 additions & 57 deletions proto/terra/treasury/v1beta1/proposal.proto

This file was deleted.

134 changes: 0 additions & 134 deletions x/treasury/client/cli/tx.go

This file was deleted.

Loading

0 comments on commit cfb1b9e

Please sign in to comment.