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: fix to prevent external filesystem dependency of simulations #695

Merged
merged 10 commits into from
Oct 18, 2022

Conversation

da1suk8
Copy link
Member

@da1suk8 da1suk8 commented Oct 4, 2022

Description

Fixed to prevent external filesystem dependency of simulation.
The code has been modified as follows.

WeightedOperations returns a function, so I added a test to compare types.

Motivation and context

Because if the path is not resolved correctly or the file is not found, the call may fail and execution may panic.

How has this been tested?

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

@da1suk8 da1suk8 self-assigned this Oct 4, 2022
@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Merging #695 (e6f6c74) into main (f856957) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #695      +/-   ##
==========================================
- Coverage   62.01%   61.97%   -0.05%     
==========================================
  Files         874      877       +3     
  Lines       98614    98764     +150     
==========================================
+ Hits        61156    61206      +50     
- Misses      33841    33938      +97     
- Partials     3617     3620       +3     
Impacted Files Coverage Δ
x/wasm/simulation/operations.go 36.69% <100.00%> (ø)
x/token/validation.go 90.90% <0.00%> (-5.46%) ⬇️
x/token/msgs.go 34.51% <0.00%> (-2.04%) ⬇️
x/wasm/simulation/params.go 0.00% <0.00%> (ø)
x/wasm/simulation/genesis.go 0.00% <0.00%> (ø)
x/collection/msgs.go 43.51% <0.00%> (+3.14%) ⬆️

@da1suk8 da1suk8 marked this pull request as ready for review October 4, 2022 15:33
Copy link
Member

@zemyblue zemyblue left a comment

Choose a reason for hiding this comment

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

Please add changelog about this PR to CHANGELOG.md file

And could you add unittest about this changes.

Copy link
Member

@zemyblue zemyblue left a comment

Choose a reason for hiding this comment

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

Please change the title more detail.
I couldn't understand and guess what is change.

@da1suk8 da1suk8 changed the title fix: use go_embed fix: fix to avoid such external filesystem dependency for simulations Oct 12, 2022
@da1suk8 da1suk8 changed the title fix: fix to avoid such external filesystem dependency for simulations fix: fix to avoid external filesystem dependency for simulations Oct 12, 2022
@da1suk8 da1suk8 changed the title fix: fix to avoid external filesystem dependency for simulations fix: fix to prevent external filesystem dependency of simulations Oct 12, 2022
@da1suk8 da1suk8 requested a review from zemyblue October 13, 2022 09:44
Comment on lines 67 to 68
if err != nil {
panic(err)
Copy link
Member

Choose a reason for hiding this comment

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

How about adding the unittest of this lines?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is dead code, so I deleted it.

@da1suk8 da1suk8 requested a review from zemyblue October 14, 2022 10:06
Copy link
Member

@zemyblue zemyblue left a comment

Choose a reason for hiding this comment

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

Please check conflict

@da1suk8 da1suk8 requested a review from zemyblue October 17, 2022 07:01
@da1suk8 da1suk8 merged commit d4635de into Finschia:main Oct 18, 2022
@da1suk8 da1suk8 deleted the fix/use_go_embed branch October 18, 2022 06:39
@zemyblue zemyblue mentioned this pull request Oct 27, 2022
5 tasks
@zemyblue zemyblue mentioned this pull request Nov 28, 2022
5 tasks
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.

3 participants