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): update batch metadata #1623

Merged
merged 3 commits into from
Nov 22, 2022

Conversation

ryanchristo
Copy link
Member

@ryanchristo ryanchristo commented Nov 21, 2022

Description

Closes: #1582

This pull request adds UpdateBatchMetadata, which can only be called by the issuer on an open batch.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@ryanchristo ryanchristo marked this pull request as ready for review November 21, 2022 19:48
@ryanchristo ryanchristo requested a review from a team November 21, 2022 19:48
@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Merging #1623 (a22104c) into main (ccea01d) will increase coverage by 0.10%.
The diff coverage is 90.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1623      +/-   ##
==========================================
+ Coverage   77.48%   77.59%   +0.10%     
==========================================
  Files         264      266       +2     
  Lines       19298    19457     +159     
==========================================
+ Hits        14954    15098     +144     
- Misses       3479     3490      +11     
- Partials      865      869       +4     
Impacted Files Coverage Δ
x/ecocredit/client/tx.go 0.00% <0.00%> (ø)
...ecocredit/base/keeper/msg_update_batch_metadata.go 72.72% <72.72%> (ø)
x/ecocredit/base/client/tx.go 80.17% <88.88%> (+0.43%) ⬆️
...ocredit/base/types/v1/msg_update_batch_metadata.go 90.47% <90.47%> (ø)
x/ecocredit/base/types/v1/codec.go 100.00% <100.00%> (ø)
x/ecocredit/client/testsuite/suite.go 96.41% <100.00%> (+<0.01%) ⬆️
x/ecocredit/client/testsuite/tx.go 100.00% <100.00%> (ø)

@ryanchristo ryanchristo changed the title feat: update batch metadata if open batch feat(x/ecocredit): update batch metadata if open batch Nov 21, 2022
@ryanchristo ryanchristo changed the title feat(x/ecocredit): update batch metadata if open batch feat(x/ecocredit): update batch metadata Nov 21, 2022
Copy link
Member

@blushi blushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return sdkerrors.ErrInvalidRequest.Wrapf("batch denom: %s", err)
}

// we allow removing metadata for class and project but not for batch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to this task but it seems like we can create a batch initially without any metadata (see MsgCreateBatch.ValidateBasic()) should this be fixed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. My thinking is we allow for class and project because they can be updated for batch it is required.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll open a followup since this has already been approved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryanchristo ryanchristo merged commit dccf079 into main Nov 22, 2022
@ryanchristo ryanchristo deleted the ryan/1582-update-batch-metadata branch November 22, 2022 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow metadata to be updated for open batches
3 participants