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

change the way to create any obj #542

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

taiki1frsh
Copy link
Collaborator

close #442

  • Remove the string as arg in the code
  • Tested by running chain and throwing tx by enabling derivatives module in local


market := types.Market{
BaseDenom: baseDenom,
QuoteDenom: quoteDenom,
}
msg := types.NewMsgOpenPosition(sender, margin, market, positionInstance)
msg := types.NewMsgOpenPosition(sender, margin, market, *piAny)
if err := msg.ValidateBasic(); err != nil {
return err
}

Choose a reason for hiding this comment

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

The code appears to be making changes in a blockchain application, specifically in the open-position function of the perpetual-futures transaction.

As for the specific review points:

  • The commented out code block suggests that the previous approach using positionInstBz has been replaced with piAny. This is likely done to improve efficiency since Any is Protobuf's way of handling arbitrary types.
  • There are no apparent bug risks on the updated lines of code.
  • One suggestion for improvement could be to comment why the previous code block was commented out, just for clarity purposes.

@taiki1frsh taiki1frsh self-assigned this May 19, 2023
@kimurayu45z kimurayu45z merged commit 23ec2fc into newDevelop Jun 5, 2023
@kimurayu45z kimurayu45z deleted the feature/change-the-way-to-instanciate-any branch June 5, 2023 04:58
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.

[derivatives] Don't create Any instance directly
2 participants