Skip to content

Commit

Permalink
docs, fix sims/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Mar 31, 2024
1 parent cafe075 commit b3a7eb3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/regen/ecocredit/v1/state.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 proto/regen/ecocredit/v1/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ message CreditType {

// abbreviation is a 1-3 character uppercase abbreviation of the CreditType
// name, used in batch denominations within the CreditType. It must be unique.
// The letter P is reserved as the project prefix and cannot be used as a
// credit type to avoid confusion.
string abbreviation = 1;

// name is the name of the credit type (e.g. carbon, biodiversity).
Expand Down
3 changes: 3 additions & 0 deletions x/ecocredit/base/simulation/msg_add_credit_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func SimulateMsgAddCreditType(ak ecocredit.AccountKeeper, bk ecocredit.BankKeepe

abbrev := simtypes.RandStringOfLength(r, simtypes.RandIntBetween(r, 1, 3))
abbrev = strings.ToUpper(abbrev)
if abbrev == "P" { // the abbreviation "P" is reserved for projects
abbrev = "PP"
}
name := simtypes.RandStringOfLength(r, simtypes.RandIntBetween(r, 1, 10))

_, err = qryClient.CreditType(sdkCtx, &types.QueryCreditTypeRequest{
Expand Down
1 change: 1 addition & 0 deletions x/ecocredit/base/simulation/msg_create_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func SimulateMsgCreateBatch(ak ecocredit.AccountKeeper, bk ecocredit.BankKeeper,
msg := &types.MsgCreateBatch{
Issuer: issuer.Address.String(),
ProjectId: project.Id,
ClassId: class.Id,
Issuance: generateBatchIssuance(r, accs),
StartDate: &now,
EndDate: &tenHours,
Expand Down
2 changes: 2 additions & 0 deletions x/ecocredit/base/types/v1/state.pb.go

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

1 change: 1 addition & 0 deletions x/ecocredit/client/testsuite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
s.batchDenom = s.createBatch(s.val.ClientCtx, &basetypes.MsgCreateBatch{
Issuer: s.addr1.String(),
ProjectId: s.projectID,
ClassId: s.classID,
Issuance: []*basetypes.BatchIssuance{
{
Recipient: s.addr1.String(),
Expand Down
1 change: 1 addition & 0 deletions x/ecocredit/client/testsuite/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func (s *IntegrationTestSuite) TestTxCreateBatchCmd() {
bz, err := s.val.ClientCtx.Codec.MarshalJSON(&types.MsgCreateBatch{
Issuer: issuer,
ProjectId: s.projectID,
ClassId: s.classID,
Issuance: []*types.BatchIssuance{
{
Recipient: recipient,
Expand Down

0 comments on commit b3a7eb3

Please sign in to comment.