Skip to content

Commit

Permalink
- use v1 message type proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole committed Dec 1, 2023
1 parent d5da81a commit 3491df2
Show file tree
Hide file tree
Showing 19 changed files with 5,533 additions and 2,331 deletions.
3 changes: 3 additions & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,12 @@ func NewAppKeepers(
appKeepers.StakingKeeper, appKeepers.DistrKeeper,
&appKeepers.WasmKeeper, distrtypes.ModuleName,
)

appKeepers.TaxExemptionKeeper = taxexemptionkeeper.NewKeeper(
appCodec, appKeepers.keys[taxexemptiontypes.StoreKey],
appKeepers.GetSubspace(taxexemptiontypes.ModuleName),
appKeepers.AccountKeeper,
string(appKeepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName)),
)

wasmConfig, err := wasm.ReadWasmConfig(appOpts)
Expand Down
5 changes: 1 addition & 4 deletions app/keepers/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
ibcclienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types"

"github.com/classic-terra/core/v2/x/taxexemption"
taxexemptiontypes "github.com/classic-terra/core/v2/x/taxexemption/types"
"github.com/classic-terra/core/v2/x/treasury"
treasurytypes "github.com/classic-terra/core/v2/x/treasury/types"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
Expand All @@ -37,8 +35,7 @@ func (appKeepers *AppKeepers) newGovRouter() govv1beta1.Router {
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(appKeepers.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)).
AddRoute(treasurytypes.RouterKey, treasury.NewProposalHandler(appKeepers.TreasuryKeeper)).
AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(appKeepers.WasmKeeper, wasm.EnableAllProposals)).
AddRoute(taxexemptiontypes.RouterKey, taxexemption.NewProposalHandler(appKeepers.TaxExemptionKeeper))
AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(appKeepers.WasmKeeper, wasm.EnableAllProposals))

return govRouter
}
Expand Down
67 changes: 0 additions & 67 deletions proto/terra/taxexemption/v1beta1/gov.proto

This file was deleted.

80 changes: 79 additions & 1 deletion proto/terra/taxexemption/v1beta1/taxexemption.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";
package terra.taxexemption.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/classic-terra/core/v2/x/taxexemption/types";

Expand All @@ -14,4 +15,81 @@ message Zone {

message ZoneList {
repeated string zones = 1 [(gogoproto.moretags) = "yaml:\"zones\""];
}
}

message ProposalMetadata {
string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
string forum = 3 [(gogoproto.moretags) = "yaml:\"forum\""];
string other = 4 [(gogoproto.moretags) = "yaml:\"other\""];
}

message AddTaxExemptionZoneProposal {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";

string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
string zone = 3 [(gogoproto.moretags) = "yaml:\"zone\""];
bool outgoing = 4 [(gogoproto.moretags) = "yaml:\"outgoing\""];
bool incoming = 5 [(gogoproto.moretags) = "yaml:\"incoming\""];
bool cross_zone = 6 [(gogoproto.moretags) = "yaml:\"cross_zone\""];
repeated string addresses = 7 [(gogoproto.moretags) = "yaml:\"addresses\""];
string authority = 8 [(gogoproto.moretags) = "yaml:\"authority\""];

}

message RemoveTaxExemptionZoneProposal {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";

string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
string zone = 3 [(gogoproto.moretags) = "yaml:\"zone\""];
string authority = 4 [(gogoproto.moretags) = "yaml:\"authority\""];
}

message ModifyTaxExemptionZoneProposal {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";

string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
string zone = 3 [(gogoproto.moretags) = "yaml:\"zone\""];
bool outgoing = 4 [(gogoproto.moretags) = "yaml:\"outgoing\""];
bool incoming = 5 [(gogoproto.moretags) = "yaml:\"incoming\""];
bool cross_zone = 6 [(gogoproto.moretags) = "yaml:\"cross_zone\""];
string authority = 7 [(gogoproto.moretags) = "yaml:\"authority\""];
}

message AddTaxExemptionAddressProposal {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";

string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
string zone = 3 [(gogoproto.moretags) = "yaml:\"zone\""];
repeated string addresses = 4 [(gogoproto.moretags) = "yaml:\"addresses\""];
string authority = 5 [(gogoproto.moretags) = "yaml:\"authority\""];
}

message RemoveTaxExemptionAddressProposal {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;
option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";

string title = 1 [(gogoproto.moretags) = "yaml:\"title\""];
string description = 2 [(gogoproto.moretags) = "yaml:\"description\""];
string zone = 3 [(gogoproto.moretags) = "yaml:\"zone\""];
repeated string addresses = 4 [(gogoproto.moretags) = "yaml:\"addresses\""];
string authority = 5 [(gogoproto.moretags) = "yaml:\"authority\""];
}
85 changes: 85 additions & 0 deletions proto/terra/taxexemption/v1beta1/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
syntax = "proto3";
package terra.taxexemption.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/classic-terra/core/v2/x/taxexemption/types";

// Msg defines the taxexemption Msg service.
service Msg {
rpc AddTaxExemptionZone(MsgAddTaxExemptionZone) returns (MsgAddTaxExemptionZoneResponse);
rpc RemoveTaxExemptionZone(MsgRemoveTaxExemptionZone) returns (MsgRemoveTaxExemptionZoneResponse);
rpc ModifyTaxExemptionZone(MsgModifyTaxExemptionZone) returns (MsgModifyTaxExemptionZoneResponse);
rpc AddTaxExemptionAddress(MsgAddTaxExemptionAddress) returns (MsgAddTaxExemptionAddressResponse);
rpc RemoveTaxExemptionAddress(MsgRemoveTaxExemptionAddress) returns (MsgRemoveTaxExemptionAddressResponse);
}

// MsgAddTaxExemptionZone defines a message for adding a tax exemption zone.
message MsgAddTaxExemptionZone {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

string zone = 1 [(gogoproto.moretags) = "yaml:\"zone\""];
bool outgoing = 2 [(gogoproto.moretags) = "yaml:\"outgoing\""];
bool incoming = 3 [(gogoproto.moretags) = "yaml:\"incoming\""];
bool cross_zone = 4 [(gogoproto.moretags) = "yaml:\"cross_zone\""];
repeated string addresses = 5 [(gogoproto.moretags) = "yaml:\"addresses\""];
string authority = 6 [(gogoproto.moretags) = "yaml:\"authority\""];
}

message MsgAddTaxExemptionZoneResponse {}

// MsgRemoveTaxExemptionZone defines a message for removing a tax exemption zone.
message MsgRemoveTaxExemptionZone {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

string zone = 1 [(gogoproto.moretags) = "yaml:\"zone\""];
string authority = 2 [(gogoproto.moretags) = "yaml:\"authority\""];
}

message MsgRemoveTaxExemptionZoneResponse {}

// MsgModifyTaxExemptionZone defines a message for modifying a tax exemption zone.
message MsgModifyTaxExemptionZone {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

string zone = 1 [(gogoproto.moretags) = "yaml:\"zone\""];
bool outgoing = 2 [(gogoproto.moretags) = "yaml:\"outgoing\""];
bool incoming = 3 [(gogoproto.moretags) = "yaml:\"incoming\""];
bool cross_zone = 4 [(gogoproto.moretags) = "yaml:\"cross_zone\""];
string authority = 5 [(gogoproto.moretags) = "yaml:\"authority\""];
}

message MsgModifyTaxExemptionZoneResponse {}

// MsgAddTaxExemptionAddress defines a message for adding tax exemption addresses.
message MsgAddTaxExemptionAddress {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

string zone = 1 [(gogoproto.moretags) = "yaml:\"zone\""];
repeated string addresses = 2 [(gogoproto.moretags) = "yaml:\"addresses\""];
string authority = 3 [(gogoproto.moretags) = "yaml:\"authority\""];
}

message MsgAddTaxExemptionAddressResponse {}

// MsgRemoveTaxExemptionAddress defines a message for removing tax exemption addresses.
message MsgRemoveTaxExemptionAddress {
option (gogoproto.equal) = true;
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

string zone = 1 [(gogoproto.moretags) = "yaml:\"zone\""];
repeated string addresses = 2 [(gogoproto.moretags) = "yaml:\"addresses\""];
string authority = 3 [(gogoproto.moretags) = "yaml:\"authority\""];
}

message MsgRemoveTaxExemptionAddressResponse {}
Loading

0 comments on commit 3491df2

Please sign in to comment.