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: make Gen_market set initial perp versions #1677

Merged
merged 6 commits into from
Nov 27, 2023

Conversation

matthiasmatt
Copy link
Contributor

@matthiasmatt matthiasmatt commented Nov 22, 2023

Description

Gen market cli call does not set up the market and amms last version, causing every GetMarket to fail.

Purpose

Fix localnet mainly

Summary by CodeRabbit

  • New Features

    • Introduced initialization of perpetual versions within the market component to enhance system reliability.
  • Documentation

    • Updated CHANGELOG to reflect the new initialization process for perpetual market versions.

@matthiasmatt matthiasmatt requested a review from a team as a code owner November 22, 2023 09:58
Copy link
Contributor

coderabbitai bot commented Nov 22, 2023

Walkthrough

A new pull request has been merged, enhancing the Gen_market component by initializing perpetual versions to ensure proper setup. This update involves populating a new field with version data for each market, which is then serialized into JSON format.

Changes

File Change Summary
CHANGELOG.md Added PR #1677 to document the initialization of perpetual versions in Gen_market.
x/perp/v2/client/cli/gen_market.go
x/perp/v2/types/genesis_test.go
Modified to populate MarketLastVersions with initial version data for each market. Assertion for genesis.CollateralDenom changed from empty to non-nil value.
x/perp/v2/types/genesis.go Added CollateralDenom field with value TestingCollateralDenomNUSD to DefaultGenesis function.

🐇🌼 In the code's garden, changes bloom,
A rabbit hops by, under the moon.
With each version's perpetual tune,
The market's set right, none too soon. 🌙


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 442c8a0 and 800f9fc.
Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • x/perp/v2/client/cli/gen_market.go (1 hunks)
Additional comments: 2
CHANGELOG.md (1)
x/perp/v2/client/cli/gen_market.go (1)
  • 80-95:
    Ensure that the Version field of each market in perpGenState.Markets is being set correctly before this code block is executed, as it relies on that field to populate MarketLastVersions.

@matthiasmatt matthiasmatt enabled auto-merge (squash) November 22, 2023 13:52
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 800f9fc and c8c8c2e.
Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Additional comments: 1
CHANGELOG.md (1)

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Merging #1677 (864317b) into master (f1f17bd) will increase coverage by 0.16%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1677      +/-   ##
==========================================
+ Coverage   73.75%   73.92%   +0.16%     
==========================================
  Files         192      192              
  Lines       15388    15398      +10     
==========================================
+ Hits        11350    11383      +33     
+ Misses       3379     3355      -24     
- Partials      659      660       +1     
Files Coverage Δ
x/perp/v2/client/cli/gen_market.go 83.09% <100.00%> (+1.14%) ⬆️
x/perp/v2/types/genesis.go 85.71% <100.00%> (+0.34%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c8c8c2e and 436c954.
Files selected for processing (1)
  • x/perp/v2/types/genesis.go (1 hunks)
Additional comments: 1
x/perp/v2/types/genesis.go (1)
  • 19-22: The addition of the CollateralDenom field to the DefaultGenesis function is a significant change. Ensure that all relevant documentation, tests, and dependent modules are updated to reflect this new field in the genesis state.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 436c954 and 43f0335.
Files selected for processing (1)
  • x/perp/v2/types/genesis_test.go (1 hunks)
Additional comments: 1
x/perp/v2/types/genesis_test.go (1)
  • 25-28: The test TestDefaultGenesis has been updated to check for a non-nil CollateralDenom. This change aligns with the new expectation that CollateralDenom should have a value in the default genesis state. Ensure that the default genesis state is correctly initializing CollateralDenom with a non-empty value.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 43f0335 and 864317b.
Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Additional comments: 1
CHANGELOG.md (1)

@matthiasmatt matthiasmatt merged commit 2d59c9d into master Nov 27, 2023
16 checks passed
@matthiasmatt matthiasmatt deleted the fix/fix-version-at-genesis branch November 27, 2023 19:23
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.

2 participants