Skip to content

Commit 3b21ecd

Browse files
aaroncclevinson
andauthoredFeb 16, 2024··
feat(x/ecocredit): independent project API (#2150)
Co-authored-by: Cory <[email protected]>
1 parent 45044a3 commit 3b21ecd

23 files changed

+27754
-11808
lines changed
 

‎api/regen/ecocredit/marketplace/v1/tx.pulsar.go

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/regen/ecocredit/v1/events.pulsar.go

+1,636-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/regen/ecocredit/v1/query.pulsar.go

+2,756-464
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/regen/ecocredit/v1/query_grpc.pb.go

+86
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/regen/ecocredit/v1/state.cosmos_orm.go

+199
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/regen/ecocredit/v1/state.pulsar.go

+1,635-251
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/regen/ecocredit/v1/tx.pulsar.go

+11,288-6,498
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/regen/ecocredit/v1/tx_grpc.pb.go

+244-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎proto/regen/ecocredit/v1/events.proto

+59
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ syntax = "proto3";
22

33
package regen.ecocredit.v1;
44

5+
import "regen/ecocredit/v1/state.proto";
56
import "regen/ecocredit/v1/types.proto";
67

78
option go_package = "github.com/regen-network/regen-ledger/x/ecocredit/base/types/v1";
@@ -259,3 +260,61 @@ message EventBurnRegen {
259260
// reason is the reason for the burn.
260261
string reason = 3;
261262
}
263+
264+
// EventUpdateApplication is emitted when a project admin creates, updates
265+
// or withdraws a project's application to a credit class.
266+
message EventUpdateApplication {
267+
// project_id is the unique identifier of the project that was updated.
268+
string project_id = 1;
269+
270+
// class_id is the unique identifier of the class that was updated.
271+
string class_id = 2;
272+
273+
// Action describes an action taken on an application.
274+
enum Action {
275+
// ACTION_UNSPECIFIED is the default value for the action and is invalid.
276+
ACTION_UNSPECIFIED = 0;
277+
278+
// ACTION_CREATE is the action taken when a project admin creates an
279+
// application to a credit class.
280+
ACTION_CREATE = 1;
281+
282+
// ACTION_UPDATE is the action taken when a project admin updates an
283+
// application to a credit class.
284+
ACTION_UPDATE = 2;
285+
286+
// ACTION_WITHDRAW is the action taken when a project admin withdraws an
287+
// application to a credit class.
288+
ACTION_WITHDRAW = 3;
289+
}
290+
291+
// action is the action that was taken on the application.
292+
Action action = 3;
293+
294+
// new_application_metadata is any new application metadata.
295+
string new_application_metadata = 4;
296+
}
297+
298+
// EventUpdateProjectEnrollment is emitted when a credit class issuer updates
299+
// the enrollment status of a project.
300+
message EventUpdateProjectEnrollment {
301+
// issuer is the address of the credit class issuer which evaluated the
302+
// project.
303+
string issuer = 1;
304+
305+
// project_id is the unique identifier of the project that was evaluated.
306+
string project_id = 2;
307+
308+
// class_id is the unique identifier of the class in which the project was
309+
// evaluated.
310+
string class_id = 3;
311+
312+
// old_status is the old status of the project class relationship.
313+
ProjectEnrollmentStatus old_status = 4;
314+
315+
// new_status is the new status of the project class relationship.
316+
ProjectEnrollmentStatus new_status = 5;
317+
318+
// new_enrollment_metadata is any new enrollment metadata.
319+
string new_enrollment_metadata = 6;
320+
}

‎proto/regen/ecocredit/v1/query.proto

+62
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,24 @@ service Query {
259259
returns (QueryAllowedBridgeChainsResponse) {
260260
option (google.api.http).get = "/regen/ecocredit/v1/allowed-bridge-chains";
261261
}
262+
263+
// ProjectEnrollment queries information about a project's enrollment in a
264+
// credit class.
265+
//
266+
// Since Revision 3
267+
rpc ProjectEnrollment(QueryProjectEnrollmentRequest) returns (QueryProjectEnrollmentResponse) {
268+
option (google.api.http) = {
269+
get : "/regen/ecocredit/v1/project/{project_id}/enrollments/{class_id}"
270+
};
271+
}
272+
273+
// ProjectEnrollments queries all credit class enrollments associated with a
274+
// project.
275+
rpc ProjectEnrollments(QueryProjectEnrollmentsRequest) returns (QueryProjectEnrollmentsResponse) {
276+
option (google.api.http) = {
277+
get : "/regen/ecocredit/v1/project/{project_id}/enrollments"
278+
};
279+
}
262280
}
263281

264282
// QueryClassesRequest is the Query/Classes request type.
@@ -826,3 +844,47 @@ message QueryAllowedBridgeChainsResponse {
826844
// bridge operations.
827845
repeated string allowed_bridge_chains = 1;
828846
}
847+
848+
// QueryProjectEnrollmentRequest is the Query/ProjectEnrollment request type.
849+
//
850+
// Since Revision 3
851+
message QueryProjectEnrollmentRequest {
852+
853+
// project_id is the unique identifier of the project to query.
854+
string project_id = 1;
855+
856+
// class_id is the unique identifier of the credit class to query.
857+
string class_id = 2;
858+
}
859+
860+
// QueryProjectEnrollmentResponse is the Query/ProjectEnrollment response type.
861+
//
862+
// Since Revision 3
863+
message QueryProjectEnrollmentResponse {
864+
865+
// project_class is the fetched project class relationship.
866+
ProjectEnrollment project_class = 1;
867+
}
868+
869+
// QueryProjectEnrollmentsRequest is the Query/ProjectEnrollments request type.
870+
//
871+
// Since Revision 3
872+
message QueryProjectEnrollmentsRequest {
873+
// project_id is the unique identifier of the project to query.
874+
string project_id = 1;
875+
876+
// pagination defines an optional pagination for the request.
877+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
878+
}
879+
880+
// QueryProjectEnrollmentsResponse is the Query/ProjectEnrollments response type.
881+
//
882+
// Since Revision 3
883+
message QueryProjectEnrollmentsResponse {
884+
885+
// enrollments are the fetched project credit class enrollments.
886+
repeated ProjectEnrollment enrollments = 1;
887+
888+
// pagination defines the pagination in the response.
889+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
890+
}

‎proto/regen/ecocredit/v1/state.proto

+79-2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ message Batch {
122122
index : {id : 2 fields : "project_key"}
123123
index : {id : 3 fields : "start_date"}
124124
index : {id : 4 fields : "issuer"}
125+
index : {id: 5 fields : "class_key"}
125126
};
126127

127128
// key is the table row identifier of the credit batch used internally for
@@ -137,8 +138,9 @@ message Batch {
137138
uint64 project_key = 3;
138139

139140
// denom is the unique identifier of the credit batch formed from the
140-
// project id, the batch sequence number, and the start and end date of the
141-
// credit batch.
141+
// credit class ID (or just project ID for old project IDs which included the credit class),
142+
// project id, the batch sequence number, and the start and
143+
// end date of the credit batch.
142144
string denom = 4;
143145

144146
// metadata is any arbitrary metadata attached to the credit batch.
@@ -158,6 +160,10 @@ message Batch {
158160
// open tells if it's possible to mint new credits in the future.
159161
// Once `open` is set to false, it can't be toggled any more.
160162
bool open = 9;
163+
164+
// class_key is the table row identifier of the credit class used internally
165+
// for efficient lookups. This links a batch to a credit class.
166+
uint64 class_key = 10;
161167
}
162168

163169
// ClassSequence stores and increments the sequence number for credit classes
@@ -381,3 +387,74 @@ message AllowedBridgeChain {
381387
// chain_name is the name of the chain allowed to bridge ecocredits to.
382388
string chain_name = 1;
383389
}
390+
391+
// ProjectEnrollment stores the data a project's enrollment in a credit class.
392+
message ProjectEnrollment {
393+
option (cosmos.orm.v1.table) = {
394+
id : 17
395+
primary_key : {fields : "project_key,class_key"}
396+
index: {id: 1, fields: "class_key"}
397+
};
398+
399+
// project_key is the table row identifier of the project used internally for
400+
// efficient lookups.
401+
uint64 project_key = 1;
402+
403+
// class_key is the table row identifier of the credit class used internally
404+
// for efficient lookups.
405+
uint64 class_key = 3;
406+
407+
// status is the status of the enrollment.
408+
ProjectEnrollmentStatus status = 4;
409+
410+
// application_metadata is any arbitrary metadata set by the project
411+
// admin related to its application to the credit class.
412+
string application_metadata = 5;
413+
414+
// enrollment_metadata is any arbitrary metadata set by the credit class
415+
// admin evaluating the project's application to the credit class.
416+
string enrollment_metadata = 6;
417+
}
418+
419+
// Application represents the evaluation status that a credit class issuer
420+
// assigns to a credit class application.
421+
enum ProjectEnrollmentStatus {
422+
// PROJECT_ENROLLMENT_STATUS_UNSPECIFIED indicates that a credit class application
423+
// has been submitted but not evaluated.
424+
PROJECT_ENROLLMENT_STATUS_UNSPECIFIED = 0;
425+
426+
// PROJECT_ENROLLMENT_STATUS_ACCEPTED indicates that the project has been
427+
// accepted into the credit class.
428+
PROJECT_ENROLLMENT_STATUS_ACCEPTED = 1;
429+
430+
// PROJECT_ENROLLMENT_STATUS_CHANGES_REQUESTED indicates that an application to
431+
// a credit class has been reviewed and that changes to the application have
432+
// been requested. It can also be used to indicate that a project within a credit
433+
// class has had its status reassessed and that changes to the project are
434+
// requested in order to continue in the credit class.
435+
PROJECT_ENROLLMENT_STATUS_CHANGES_REQUESTED = 2;
436+
437+
// PROJECT_ENROLLMENT_STATUS_REJECTED indicates that the application has been
438+
// rejected and that the project will not be accepted into the credit class.
439+
PROJECT_ENROLLMENT_STATUS_REJECTED = 3;
440+
441+
// PROJECT_ENROLLMENT_STATUS_TERMINATED indicates that the project has been
442+
// terminated from the credit class. This status is used when a project the
443+
// was previously accepted into the credit class but has been removed or
444+
// completed.
445+
PROJECT_ENROLLMENT_STATUS_TERMINATED = 4;
446+
}
447+
448+
// ProjectFee is the project creation fee. If not set, a project creation fee is
449+
// not required. This table is controlled via governance.
450+
//
451+
// Since Revision 3
452+
message ProjectFee {
453+
option (cosmos.orm.v1.singleton) = {
454+
id : 18
455+
};
456+
457+
// fee is the project creation fee. If not set, a project creation fee is not
458+
// required.
459+
cosmos.base.v1beta1.Coin fee = 1;
460+
}

‎proto/regen/ecocredit/v1/tx.proto

+170-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,45 @@ service Msg {
2828
// class. The creator becomes the admin of the project upon creation.
2929
rpc CreateProject(MsgCreateProject) returns (MsgCreateProjectResponse);
3030

31+
// CreateUnregisteredProject creates a new project without registering it
32+
// under a credit class. This method is intended to be used by project proponents
33+
// who are not yet ready to register their project under a credit class, but who
34+
// want to create a project and receive a project ID.
35+
rpc CreateUnregisteredProject(MsgCreateUnregisteredProject)
36+
returns (MsgCreateUnregisteredProjectResponse);
37+
38+
// CreateOrUpdateApplicaton creates a new project credit class application, updates
39+
// the metadata for an existing one when changes have been requested, or withdraws
40+
// the application. When an application is withdrawn, its data will be deleted from
41+
// state and the project may apply again to the same credit class in the future.
42+
//
43+
// Since Revision 3
44+
rpc CreateOrUpdateApplication(MsgCreateOrUpdateApplication)
45+
returns (MsgCreateOrUpdateApplicationResponse);
46+
47+
// UpdateProjectEnrollment allows a credit class issuer to evaluate a project
48+
// application - either approving, requesting changes to, or
49+
// rejecting it, or to terminate an existing enrollment.
50+
// Any issuer in the credit class may update the project credit
51+
// class enrollment status using this method. If more sophisticated rules are
52+
// required to coordinate between different issuers, the credit class admin
53+
// should set up an on or off-chain governance process to coordinate this.
54+
// Issuers may not admit projects into credit classes using this method
55+
// without the project first creating an application. For an issuer to
56+
// admit a project into a credit class without an
57+
// application the CreateProject method should be used instead.
58+
//
59+
// If a project has not yet been accepted then the issuer may change the
60+
// status to either changes requested, accepted or rejected. If the status
61+
// is already accepted, the issuer may only change the status to terminated.
62+
// Whenever a project is rejected or terminated, the project's enrollment
63+
// the enrollment state will be deleted and the project may apply again
64+
// to the same credit class in the future.
65+
//
66+
// Since Revision 3
67+
rpc UpdateProjectEnrollment(MsgUpdateProjectEnrollment)
68+
returns (MsgUpdateProjectEnrollmentResponse);
69+
3170
// CreateBatch creates a new batch of credits under the given project with a
3271
// start and end date representing the monitoring period, a list of credits to
3372
// be issued with each issuance specifying a recipient, the amount of tradable
@@ -158,6 +197,14 @@ service Msg {
158197
// Since Revision 2
159198
rpc UpdateClassFee(MsgUpdateClassFee) returns (MsgUpdateClassFeeResponse);
160199

200+
// UpdateProjectFee is a governance method that allows for updating the
201+
// project creation fee. If no fee is specified in the request, the project
202+
// creation fee will be removed and no fee will be required to create a
203+
// project.
204+
//
205+
// Since Revision 3
206+
rpc UpdateProjectFee(MsgUpdateProjectFee) returns (MsgUpdateProjectFeeResponse);
207+
161208
// AddAllowedBridgeChain is a governance method that allows for the
162209
// addition of a chain to bridge ecocredits to.
163210
//
@@ -264,6 +311,13 @@ message MsgCreateProject {
264311
// reference_id is any arbitrary string used to reference the project with a
265312
// maximum length of 32 characters.
266313
string reference_id = 5;
314+
315+
// fee is the project creation fee. An equal fee is required if the project
316+
// creation fee parameter is set. The provided fee can be greater than the
317+
// parameter, but only the amount in the parameter will be charged.
318+
//
319+
// Since Revision 3
320+
cosmos.base.v1beta1.Coin fee = 6;
267321
}
268322

269323
// MsgCreateProjectResponse is the Msg/CreateProject response type.
@@ -273,12 +327,106 @@ message MsgCreateProjectResponse {
273327
string project_id = 1;
274328
}
275329

330+
// MsgCreateUnregisteredProject is the Msg/CreateUnregisteredProject request type.
331+
message MsgCreateUnregisteredProject {
332+
option (cosmos.msg.v1.signer) = "admin";
333+
334+
// admin is the address of the account creating the project that will become
335+
// the admin of the project upon creation.
336+
string admin = 1;
337+
338+
// metadata is any arbitrary string with a maximum length of 256 characters
339+
// that includes or references metadata to attach to the project.
340+
string metadata = 2;
341+
342+
// jurisdiction is the jurisdiction of the project. A jurisdiction has with
343+
// the format: <country-code>[-<sub-national-code>[ <postal-code>]]
344+
// The country-code must be 2 alphabetic characters, the sub-national-code
345+
// can be 1-3 alphanumeric characters, and the postal-code can be up to 64
346+
// alphanumeric characters. Only the country-code is required, while the
347+
// sub-national-code and postal-code are optional and can be added for
348+
// increased precision.
349+
string jurisdiction = 3;
350+
351+
// reference_id is any arbitrary string used to reference the project with a
352+
// maximum length of 32 characters.
353+
string reference_id = 4;
354+
355+
// fee is the project creation fee. An equal fee is required if the project
356+
// creation fee parameter is set. The provided fee can be greater than the
357+
// parameter, but only the amount in the parameter will be charged.
358+
//
359+
// Since Revision 3
360+
cosmos.base.v1beta1.Coin fee = 5;
361+
}
362+
363+
// MsgCreateUnregisteredProjectResponse is the Msg/CreateUnregisteredProject response type.
364+
message MsgCreateUnregisteredProjectResponse {
365+
// project_id is the unique identifier of the project.
366+
string project_id = 1;
367+
}
368+
369+
// MsgCreateOrUpdateApplication is the Msg/CreateOrUpdateApplication request type.
370+
message MsgCreateOrUpdateApplication {
371+
option (cosmos.msg.v1.signer) = "project_admin";
372+
373+
// project_admin is the address of the account that is the admin of the
374+
// project which is applying to the credit class.
375+
string project_admin = 1;
376+
377+
// project_id is the identifier of the project which is applying to
378+
// the credit class.
379+
string project_id = 2;
380+
381+
// class_id is the identifier of the credit class which the project is
382+
// applying to.
383+
string class_id = 3;
384+
385+
// metadata is any optional arbitrary string with a maximum length of 256 characters
386+
// that includes or references any metadata relevant to the application.
387+
// This could be used as a digital reference to the actual contents of the application.
388+
string metadata = 4;
389+
390+
// withdraw is a boolean that indicates whether the application is being
391+
// withdrawn rather than updated.
392+
bool withdraw = 5;
393+
}
394+
395+
// MsgCreateOrUpdateApplicationResponse is the Msg/CreateOrUpdateApplication response type.
396+
message MsgCreateOrUpdateApplicationResponse {}
397+
398+
// MsgUpdateProjectEnrollment is the Msg/UpdateProjectEnrollment request type.
399+
message MsgUpdateProjectEnrollment {
400+
option (cosmos.msg.v1.signer) = "issuer";
401+
402+
// issuer is the address of the account that is the issuer of the credit class
403+
// which is updating the project enrollment status.
404+
string issuer = 1;
405+
406+
// project_id is the identifier of the project.
407+
string project_id = 2;
408+
409+
// class_id is the identifier of the credit class.
410+
string class_id = 3;
411+
412+
// new_status is the new status of the project enrollment.
413+
ProjectEnrollmentStatus new_status = 4;
414+
415+
// metadata is any optiopnal arbitrary string with a maximum length of 256 characters
416+
// that includes or references the reason for the approving, requesting changes
417+
// to, or rejecting the application, or terminating the project.
418+
string metadata = 5;
419+
}
420+
421+
// MsgEvaluateProjectEnrollmentResponse is the Msg/EvaluateProjectEnrollment response type.
422+
message MsgUpdateProjectEnrollmentResponse {}
423+
276424
// MsgCreateBatch is the Msg/CreateBatch request type.
277425
message MsgCreateBatch {
278426
option (cosmos.msg.v1.signer) = "issuer";
279427

280428
// issuer is the address of the account issuing the credits and must be an
281-
// approved issuer within the credit class of the project.
429+
// approved issuer within a credit class of the project.
282430
string issuer = 1;
283431

284432
// project_id is the unique identifier of the project under which the credit
@@ -313,6 +461,12 @@ message MsgCreateBatch {
313461
// issuing credits and should only be set when bridging assets from another
314462
// chain or registry as a result of a bridge operation.
315463
OriginTx origin_tx = 8;
464+
465+
// class_id is the unique identifier of the credit class under which the
466+
// credit batch will be created.
467+
//
468+
// Since Revision 3
469+
string class_id = 9;
316470
}
317471

318472
// MsgCreateBatchResponse is the Msg/CreateBatch response type.
@@ -750,6 +904,21 @@ message MsgUpdateClassFee {
750904
// Since Revision 2
751905
message MsgUpdateClassFeeResponse {}
752906

907+
// MsgUpdateProjectFee is the Msg/UpdateProjectFee request type.
908+
message MsgUpdateProjectFee {
909+
option (cosmos.msg.v1.signer) = "authority";
910+
911+
// authority is the address of the governance account.
912+
string authority = 1;
913+
914+
// fee is the project creation fee. If not set, the project creation fee will
915+
// be removed and no fee will be required to create a project.
916+
cosmos.base.v1beta1.Coin fee = 2;
917+
}
918+
919+
// MsgUpdateProjectFeeResponse is the Msg/UpdateProjectFee response type.
920+
message MsgUpdateProjectFeeResponse {}
921+
753922
// MsgAddAllowedBridgeChain is the Msg/AddAllowedBridgeChain request type.
754923
//
755924
// Since Revision 2

‎x/ecocredit/base/keeper/keeper.go

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ var (
1616
)
1717

1818
type Keeper struct {
19+
*types.UnimplementedMsgServer
20+
*types.UnimplementedQueryServer
21+
1922
stateStore api.StateStore
2023
bankKeeper ecocredit.BankKeeper
2124
moduleAddress sdk.AccAddress

‎x/ecocredit/base/types/v1/events.pb.go

+815-44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package v1
2+
3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
6+
)
7+
8+
var _ legacytx.LegacyMsg = &MsgCreateOrUpdateApplication{}
9+
10+
// Route implements the LegacyMsg interface.
11+
func (m *MsgCreateOrUpdateApplication) Route() string { return sdk.MsgTypeURL(m) }
12+
13+
// Type implements the LegacyMsg interface.
14+
func (m *MsgCreateOrUpdateApplication) Type() string { return sdk.MsgTypeURL(m) }
15+
16+
// GetSignBytes implements the LegacyMsg interface.
17+
func (m *MsgCreateOrUpdateApplication) GetSignBytes() []byte {
18+
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m))
19+
}
20+
21+
// ValidateBasic does a sanity check on the provided data.
22+
func (m *MsgCreateOrUpdateApplication) ValidateBasic() error {
23+
panic("implement me")
24+
}
25+
26+
// GetSigners returns the expected signers for MsgCreateOrUpdateApplication.
27+
func (m *MsgCreateOrUpdateApplication) GetSigners() []sdk.AccAddress {
28+
return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.ProjectAdmin)}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package v1
2+
3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
6+
)
7+
8+
var _ legacytx.LegacyMsg = &MsgCreateUnregisteredProject{}
9+
10+
// Route implements the LegacyMsg interface.
11+
func (m *MsgCreateUnregisteredProject) Route() string { return sdk.MsgTypeURL(m) }
12+
13+
// Type implements the LegacyMsg interface.
14+
func (m *MsgCreateUnregisteredProject) Type() string { return sdk.MsgTypeURL(m) }
15+
16+
// GetSignBytes implements the LegacyMsg interface.
17+
func (m *MsgCreateUnregisteredProject) GetSignBytes() []byte {
18+
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m))
19+
}
20+
21+
// ValidateBasic does a sanity check on the provided data.
22+
func (m *MsgCreateUnregisteredProject) ValidateBasic() error {
23+
panic("implement me")
24+
}
25+
26+
// GetSigners returns the expected signers for MsgCreateUnregisteredProject.
27+
func (m *MsgCreateUnregisteredProject) GetSigners() []sdk.AccAddress {
28+
return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.Admin)}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package v1
2+
3+
import (
4+
sdk "github.com/cosmos/cosmos-sdk/types"
5+
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
6+
)
7+
8+
var _ legacytx.LegacyMsg = &MsgUpdateProjectEnrollment{}
9+
10+
// Route implements the LegacyMsg interface.
11+
func (m *MsgUpdateProjectEnrollment) Route() string { return sdk.MsgTypeURL(m) }
12+
13+
// Type implements the LegacyMsg interface.
14+
func (m *MsgUpdateProjectEnrollment) Type() string { return sdk.MsgTypeURL(m) }
15+
16+
// GetSignBytes implements the LegacyMsg interface.
17+
func (m *MsgUpdateProjectEnrollment) GetSignBytes() []byte {
18+
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(m))
19+
}
20+
21+
// ValidateBasic does a sanity check on the provided data.
22+
func (m *MsgUpdateProjectEnrollment) ValidateBasic() error {
23+
panic("implement me")
24+
}
25+
26+
// GetSigners returns the expected signers for MsgUpdateProjectEnrollment.
27+
func (m *MsgUpdateProjectEnrollment) GetSigners() []sdk.AccAddress {
28+
return []sdk.AccAddress{sdk.MustAccAddressFromBech32(m.Issuer)}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package v1
2+
3+
import (
4+
"cosmossdk.io/errors"
5+
6+
sdk "github.com/cosmos/cosmos-sdk/types"
7+
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
8+
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
9+
)
10+
11+
var _ legacytx.LegacyMsg = &MsgUpdateProjectFee{}
12+
13+
// Route implements the LegacyMsg interface.
14+
func (m MsgUpdateProjectFee) Route() string { return sdk.MsgTypeURL(&m) }
15+
16+
// Type implements the LegacyMsg interface.
17+
func (m MsgUpdateProjectFee) Type() string { return sdk.MsgTypeURL(&m) }
18+
19+
// GetSignBytes implements the LegacyMsg interface.
20+
func (m MsgUpdateProjectFee) GetSignBytes() []byte {
21+
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
22+
}
23+
24+
// ValidateBasic does a sanity check on the provided data.
25+
func (m *MsgUpdateProjectFee) ValidateBasic() error {
26+
if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil {
27+
return errors.Wrapf(err, "invalid authority address")
28+
}
29+
30+
if m.Fee != nil {
31+
if err := m.Fee.Validate(); err != nil {
32+
return sdkerrors.ErrInvalidRequest.Wrapf("%s", err)
33+
}
34+
}
35+
36+
return nil
37+
}
38+
39+
// GetSigners returns the expected signers for MsgUpdateProjectFee.
40+
func (m *MsgUpdateProjectFee) GetSigners() []sdk.AccAddress {
41+
addr, _ := sdk.AccAddressFromBech32(m.Authority)
42+
return []sdk.AccAddress{addr}
43+
}

‎x/ecocredit/base/types/v1/query.pb.go

+1,160-177
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎x/ecocredit/base/types/v1/query.pb.gw.go

+242
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎x/ecocredit/base/types/v1/state.pb.go

+703-77
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎x/ecocredit/base/types/v1/tx.pb.go

+6,414-4,150
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎x/ecocredit/marketplace/types/v1/tx.pb.go

+67-67
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.