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

fix: add non-zero check of nextTokenID.Id for genesis #1276

Merged
merged 6 commits into from
Mar 15, 2024

Conversation

jaeseung-bae
Copy link
Contributor

@jaeseung-bae jaeseung-bae commented Mar 12, 2024

Description

  • (audit issue) This eliminates potential risk for Insufficient Sanity Check of tokenID in Genesis

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 69.74%. Comparing base (3e087f8) to head (762d7b3).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1276      +/-   ##
==========================================
- Coverage   69.74%   69.74%   -0.01%     
==========================================
  Files         643      643              
  Lines       67255    67261       +6     
==========================================
+ Hits        46906    46909       +3     
- Misses      18176    18179       +3     
  Partials     2173     2173              
Files Coverage Δ
x/collection/genesis.go 91.51% <80.00%> (-1.70%) ⬇️

@jaeseung-bae jaeseung-bae marked this pull request as ready for review March 13, 2024 09:06
@jaeseung-bae jaeseung-bae added the A: bug Something isn't working label Mar 15, 2024
@jaeseung-bae jaeseung-bae requested review from ulbqb and 170210 March 15, 2024 07:35
ulbqb
ulbqb previously approved these changes Mar 15, 2024
Copy link
Collaborator

@0Tech 0Tech left a comment

Choose a reason for hiding this comment

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

It would be better to update ValidateGenesis(), not InitGenesis().

@jaeseung-bae jaeseung-bae requested review from ulbqb and 0Tech March 15, 2024 08:29
@jaeseung-bae jaeseung-bae merged commit 47a5e9f into Finschia:main Mar 15, 2024
38 checks passed
@jaeseung-bae jaeseung-bae deleted the fix/collection-check-tokenid branch March 15, 2024 09:12
mergify bot pushed a commit that referenced this pull request Mar 15, 2024
* fix: add non-zero check of nextTokenID.Id for genesis

* chore: add testcase

* chore: update changelog

* chore: move validation logic to validate function

* chore: add testcase

(cherry picked from commit 47a5e9f)

# Conflicts:
#	CHANGELOG.md
jaeseung-bae added a commit that referenced this pull request Mar 19, 2024
#1282)

* fix: add non-zero check of nextTokenID.Id for genesis (#1276)

* fix: add non-zero check of nextTokenID.Id for genesis

* chore: add testcase

* chore: update changelog

* chore: move validation logic to validate function

* chore: add testcase

(cherry picked from commit 47a5e9f)

# Conflicts:
#	CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: 170210 <85928898+170210@users.noreply.github.com>

* chore: update changelog

---------

Co-authored-by: jaeseung-bae <119839167+jaeseung-bae@users.noreply.github.com>
Co-authored-by: jaeseung.bae <jaeseung.bae@linecorp.com>
Co-authored-by: 170210 <85928898+170210@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants