Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(x/ecocredit)!: migrate add-allow-denom proposal to msg based proposal #1342

Merged
merged 17 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### app

### x/ecocredit

#### API Breaking Changes

- [#1342](https://github.com/regen-network/regen-ledger/pull/1342) The `NewKeeper` method in `ecocredit/marketplace` requires an `authority` address.
- [#1342](https://github.com/regen-network/regen-ledger/pull/1342) Removed `AllowedDenom` proposal handler.

#### Added

- [#1337](https://github.com/regen-network/regen-ledger/pull/1342) `AddAllowedDenom` is added for msg-based gov proposal.


#### Removed

- [#1258](https://github.com/regen-network/regen-ledger/pull/1258) Remove group module from experimental config
Expand Down
1,482 changes: 1,289 additions & 193 deletions api/regen/ecocredit/marketplace/v1/tx.pulsar.go

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 34 additions & 35 deletions api/regen/ecocredit/marketplace/v1/types.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/regen/ecocredit/v1/types.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ import (
"github.com/regen-network/regen-ledger/x/ecocredit"
"github.com/regen-network/regen-ledger/x/ecocredit/basket"
ecocreditmodule "github.com/regen-network/regen-ledger/x/ecocredit/module"
ecoServer "github.com/regen-network/regen-ledger/x/ecocredit/server"

// unnamed import of statik for swagger UI support
_ "github.com/regen-network/regen-ledger/v4/client/docs/statik"
Expand Down Expand Up @@ -389,8 +388,6 @@ func NewRegenApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
}
app.smm.RegisterInvariants(&app.CrisisKeeper)

govRouter.AddRoute(ecocredit.RouterKey, ecoServer.NewProposalHandler(ecocreditModule.Keeper))

govConfig := govtypes.DefaultConfig()
app.GovKeeper = govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
Expand Down
28 changes: 28 additions & 0 deletions proto/regen/ecocredit/marketplace/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ service Msg {

// BuyDirect purchases credits directly from the specified sell order.
rpc BuyDirect(MsgBuyDirect) returns (MsgBuyDirectResponse);

// AddAllowedDenom is a governance method that allows the addition of
// new allowed denom.
// Since Revision 1
rpc AddAllowedDenom(MsgAddAllowedDenom) returns (MsgAddAllowedDenomResponse);
}

// MsgSell is the Msg/Sell request type.
Expand Down Expand Up @@ -155,3 +160,26 @@ message MsgBuyDirect {

// MsgBuyDirectResponse is the Msg/BuyDirect response type.
message MsgBuyDirectResponse {}

// MsgAddAllowedDenom is the Msg/AddAllowedDenom request type.
// Since Revision 1
message MsgAddAllowedDenom {
// authority is the address of the governance account.
string authority = 1;

// denom is the bank denom to allow (ex. ibc/GLKHDSG423SGS)
string bank_denom = 2;

// display_denom is the denom to display to the user and is informational.
// Because the denom is likely an IBC denom, this should be chosen by
// governance to represent the consensus trusted name of the denom.
string display_denom = 3;

// exponent is the exponent that relates the denom to the display_denom and is
// informational
uint32 exponent = 4;
}

// MsgAddAllowedDenomResponse is the Msg/AddAllowedDenom response type.
// Since Revision 1
message MsgAddAllowedDenomResponse {}
6 changes: 3 additions & 3 deletions proto/regen/ecocredit/marketplace/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ syntax = "proto3";

package regen.ecocredit.marketplace.v1;

import "gogoproto/gogo.proto";
import "regen/ecocredit/marketplace/v1/state.proto";

option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/marketplace";

// AllowDenomProposal is a gov Content type for approving a denom for use in the
// marketplace.
// Deprecated (Since Revision 1): This message is no longer used and will be removed
// in the next version. See MsgAddAllowedDenom.
message AllowDenomProposal {
option (gogoproto.goproto_stringer) = false;

// title is the title of the proposal.
string title = 1;
Expand All @@ -21,4 +21,4 @@ message AllowDenomProposal {
// denom contains coin denom information that will be added to the
// list of allowed denoms for use in the marketplace.
AllowedDenom denom = 3;
}
}
aleem1314 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions proto/regen/ecocredit/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ message OriginTx {
}

// CreditTypeProposal is a gov Content type for adding a credit type.
// Deprecated (Since Revision 1): This message is no longer used and will be removed
// in the next version. See MsgAddCreditType.
message CreditTypeProposal {
option (gogoproto.goproto_stringer) = false;

Expand Down
80 changes: 0 additions & 80 deletions x/ecocredit/client/marketplace/proposal.go

This file was deleted.

2 changes: 2 additions & 0 deletions x/ecocredit/core/types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading