Skip to content

Commit

Permalink
update design
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Feb 8, 2024
1 parent fe74b46 commit ad6b522
Show file tree
Hide file tree
Showing 10 changed files with 2,797 additions and 4,707 deletions.
1,430 changes: 474 additions & 956 deletions api/regen/ecocredit/v1/events.pulsar.go

Large diffs are not rendered by default.

202 changes: 101 additions & 101 deletions api/regen/ecocredit/v1/state.pulsar.go

Large diffs are not rendered by default.

3,512 changes: 1,323 additions & 2,189 deletions api/regen/ecocredit/v1/tx.pulsar.go

Large diffs are not rendered by default.

169 changes: 62 additions & 107 deletions api/regen/ecocredit/v1/tx_grpc.pb.go

Large diffs are not rendered by default.

50 changes: 28 additions & 22 deletions proto/regen/ecocredit/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -261,37 +261,43 @@ message EventBurnRegen {
string reason = 3;
}

// EventUpdateProjectClass is emitted when a project admin submits or updates
// a project class relationship's metadata, usually relating to credit class
// application.
message EventUpdateProjectClass {
// EventUpdateApplication is emitted when a project admin creates, updates
// or withdraws a project's application to a credit class.
message EventUpdateApplication {
// project_id is the unique identifier of the project that was updated.
string project_id = 1;

// class_id is the unique identifier of the class that was updated.
string class_id = 2;

// new_project_metadata is the new project metadata.
string new_project_metadata = 3;
}
// Action describes an action taken on an application.
enum Action {
// ACTION_UNSPECIFIED is the default value for the action and is invalid.
ACTION_UNSPECIFIED = 0;

// EventWithdrawProjectClass is emitted when a project admin withdraws a project
// from a credit class.
message EventWithdrawProjectClass {
// project_id is the unique identifier of the project which withdrew from the
// class.
string project_id = 1;
// ACTION_CREATE is the action taken when a project admin creates an
// application to a credit class.
ACTION_CREATE = 1;

// class_id is the unique identifier of the class that was withdrawn from.
string class_id = 2;
// ACTION_UPDATE is the action taken when a project admin updates an
// application to a credit class.
ACTION_UPDATE = 2;

// ACTION_WITHDRAW is the action taken when a project admin withdraws an
// application to a credit class.
ACTION_WITHDRAW = 3;
}

// action is the action that was taken on the application.
Action action = 3;

// old_status is the old status of the project class relationship before withdrawal.
ProjectEnrollmentStatus old_status = 3;
// new_application_metadata is any new application metadata.
string new_application_metadata = 4;
}

// EventEvaluateProjectClass is emitted when a project class relationship is
// evaluated by a credit class issuer.
message EventEvaluateProjectClass {
// EventUpdateProjectEnrollment is emitted when a credit class issuer updates
// the enrollment status of a project.
message EventUpdateProjectEnrollment {
// issuer is the address of the credit class issuer which evaluated the
// project.
string issuer = 1;
Expand All @@ -309,6 +315,6 @@ message EventEvaluateProjectClass {
// new_status is the new status of the project class relationship.
ProjectEnrollmentStatus new_status = 5;

// new_class_metadata is any new class metadata.
string new_class_metadata = 6;
// new_enrollment_metadata is any new enrollment metadata.
string new_enrollment_metadata = 6;
}
16 changes: 7 additions & 9 deletions proto/regen/ecocredit/v1/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,13 @@ message ProjectEnrollment {
// status is the status of the enrollment.
ProjectEnrollmentStatus status = 4;

// project_metadata is any arbitrary metadata set by the project
// admin. This should primarily be used to store metadata regarding the project's
// application to the credit class.
string project_metadata = 5;

// class_metadata is any arbitrary metadata set by a credit
// class issuer. This should primarily be used to store metadata regarding the
// project's application to the credit class.
string class_metadata = 6;
// application_metadata is any arbitrary metadata set by the project
// admin related to its application to the credit class.
string application_metadata = 5;

// enrollment_metadata is any arbitrary metadata set by the credit class
// admin evaluating the project's application to the credit class.
string enrollment_metadata = 6;
}

// Application represents the evaluation status that a credit class issuer
Expand Down
104 changes: 42 additions & 62 deletions proto/regen/ecocredit/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,33 @@ service Msg {
rpc CreateUnregisteredProject(MsgCreateUnregisteredProject)
returns (MsgCreateUnregisteredProjectResponse);

// UpdateProjectEnrollment creates a new project credit class application, updates
// an existing one or updates an existing relationship when changes are requested.
// A project may be enrolled in at most one credit class per credit type
// but can be enrolled in multiple credit classes across different credit
// types. This can be useful, for example for issuing pre-financing forward contracts
// while making progress towards issuing credits in an outcome based program.
// Projects that are already accepted into a credit class can only update
// their metadata when an issuer has changed the status of the relations
// to "changes requested".
// CreateOrUpdateApplicaton creates a new project credit class application, updates
// the metadata for an existing one when changes have been requested, or withdraws
// the application.
//
// Since Revision 3
rpc UpdateProjectEnrollment(MsgUpdateProjectEnrollment)
returns (MsgUpdateProjectEnrollmentResponse);

// WithdrawProjectEnrollment withdraws a project from a credit class application
// or enrollment unilaterally on the part of a project admin.
//
// Since Revision 3
rpc WithdrawProjectEnrollment(MsgWithdrawProjectEnrollment)
returns (MsgWithdrawProjectEnrollmentResponse);

// EvaluateProjectClass allows a credit class issuer to evaluate a project
// application or existing relationship, either approving, requesting changes to, or
// rejecting it. Any issuer in the credit class may update the project credit
// class status using this method. If more sophisticated rules are required to coordinate
// between different issuers, the credit class admin should set up an on or off-chain
// governance process to coordinate this. Issuers may not admit projects into
// credit classes using this method without the project first creating an
// application. For an issuer to admit a project into a credit class without an
rpc CreateOrUpdateApplication(MsgCreateOrUpdateApplication)
returns (MsgCreateOrUpdateApplicationResponse);

// UpdateProjectEnrollment allows a credit class issuer to evaluate a project
// application - either approving, requesting changes to, or
// rejecting it, or to terminate an existing enrollment.
// Any issuer in the credit class may update the project credit
// class enrollment status using this method. If more sophisticated rules are
// required to coordinate between different issuers, the credit class admin
// should set up an on or off-chain governance process to coordinate this.
// Issuers may not admit projects into credit classes using this method
// without the project first creating an application. For an issuer to
// admit a project into a credit class without an
// application the CreateProject method should be used instead.
//
// If a project has not yet been accepted then the issuer may change the
// status to either changes requested, accepted or rejected. If the status
// is already accepted, the issuer may only change the status to terminated.
//
// Since Revision 3
rpc EvaluateProjectEnrollment(MsgEvaluateProjectEnrollment)
returns (MsgEvaluateProjectEnrollmentResponse);
rpc UpdateProjectEnrollment(MsgUpdateProjectEnrollment)
returns (MsgUpdateProjectEnrollmentResponse);

// CreateBatch creates a new batch of credits under the given project with a
// start and end date representing the monitoring period, a list of credits to
Expand Down Expand Up @@ -347,8 +340,8 @@ message MsgCreateUnregisteredProjectResponse {
string project_id = 1;
}

// MsgUpdateProjectEnrollment is the Msg/UpdateProjectEnrollment request type.
message MsgUpdateProjectEnrollment {
// MsgCreateOrUpdateApplication is the Msg/CreateOrUpdateApplication request type.
message MsgCreateOrUpdateApplication {
option (cosmos.msg.v1.signer) = "project_admin";

// project_admin is the address of the account that is the admin of the
Expand All @@ -367,53 +360,40 @@ message MsgUpdateProjectEnrollment {
// that includes or references any metadata relevant to the application.
// This could be used as a digital reference to the actual contents of the application.
string metadata = 4;
}

// MsgUpdateProjectEnrollmentResponse is the Msg/UpdateProjectEnrollment response type.
message MsgUpdateProjectEnrollmentResponse {}

// MsgWithdrawProjectEnrollment is the Msg/WithdrawProjectEnrollment request type.
message MsgWithdrawProjectEnrollment {
option (cosmos.msg.v1.signer) = "project_admin";

// project_admin is the address of the account that is the admin of the
// project which is withdrawing its application to the credit class.
string project_admin = 1;

// application_id is the identifier of the application to withdraw.
uint64 application_id = 2;

// metadata is any optional arbitrary string with a maximum length of 256 characters
// that includes or references any metadata relevant to the withdrawal. This
// will only be included in events.
string metadata = 3;
// withdraw is a boolean that indicates whether the application is being
// withdrawn rather than updated.
bool withdraw = 5;
}

// MsgWithdrawProjectEnrollmentResponse is the Msg/WithdrawProjectEnrollment response type.
message MsgWithdrawProjectEnrollmentResponse {}
// MsgCreateOrUpdateApplicationResponse is the Msg/CreateOrUpdateApplication response type.
message MsgCreateOrUpdateApplicationResponse {}

// MsgEvaluateProjectEnrollment is the Msg/EvaluateProjectEnrollment request type.
message MsgEvaluateProjectEnrollment {
// MsgUpdateProjectEnrollment is the Msg/UpdateProjectEnrollment request type.
message MsgUpdateProjectEnrollment {
option (cosmos.msg.v1.signer) = "issuer";

// issuer is the address of the account that is the issuer of the credit class
// which is evaluating the application.
// which is updating the project enrollment status.
string issuer = 1;

// application_id is the identifier of the application to evaluate.
uint64 application_id = 2;
// project_id is the identifier of the project.
string project_id = 2;

// evaluation is the evaluation of the application.
ProjectEnrollmentStatus evaluation = 3;
// class_id is the identifier of the credit class.
string class_id = 3;

// new_status is the new status of the project enrollment.
ProjectEnrollmentStatus new_status = 4;

// metadata is any optiopnal arbitrary string with a maximum length of 256 characters
// that includes or references the reason for the approving, requesting changes
// to, or rejecting the application.
string metadata = 4;
// to, or rejecting the application, or terminating the project.
string metadata = 5;
}

// MsgEvaluateProjectEnrollmentResponse is the Msg/EvaluateProjectEnrollment response type.
message MsgEvaluateProjectEnrollmentResponse {}
message MsgUpdateProjectEnrollmentResponse {}

// MsgCreateBatch is the Msg/CreateBatch request type.
message MsgCreateBatch {
Expand Down
Loading

0 comments on commit ad6b522

Please sign in to comment.