Skip to content

Commit

Permalink
feat(x/ecocredit)!: migrate add-allow-denom proposal to msg based pro…
Browse files Browse the repository at this point in the history
…posal (#1342)

* feat: add proto message

* feat: implement msg server

* chore: fix build

* feat: add unit tests

* feat: add integration tests

* chore: add changelog

* Update proto/regen/ecocredit/marketplace/v1/types.proto

* Update proto/regen/ecocredit/marketplace/v1/types.proto

* Update CHANGELOG.md

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update x/ecocredit/server/marketplace/features/msg_add_allowed_denom.feature

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>

* Update x/ecocredit/server/marketplace/msg_add_allowed_denom_test.go

* revert go package option and add deprecated comment

* remove stringer option

* remove unused gogo import

Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: ryanchristo <12519942+ryanchristo@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 12, 2022
1 parent 073b1e4 commit d68aa03
Show file tree
Hide file tree
Showing 29 changed files with 2,317 additions and 641 deletions.
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;
}
}
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

0 comments on commit d68aa03

Please sign in to comment.