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

Rename to *_trade_pubkey in smallorder struct #75

Merged
merged 2 commits into from
Dec 23, 2024
Merged

Conversation

grunch
Copy link
Member

@grunch grunch commented Dec 23, 2024

SmallOrder is used to show information to users
we are not sending identity keys anymore

Summary by CodeRabbit

  • New Features

    • Updated package version to 0.6.20.
  • Bug Fixes

    • Renamed fields in the SmallOrder struct for clarity:
      • master_buyer_pubkey is now buyer_trade_pubkey.
      • master_seller_pubkey is now seller_trade_pubkey.

SmallOrder is used to show information to users
we are not sending identity keys anymore
Copy link
Contributor

coderabbitai bot commented Dec 23, 2024

Walkthrough

This pull request introduces minor updates to the mostro-core package. The changes involve renaming two fields in the SmallOrder struct within the src/order.rs file, specifically changing master_buyer_pubkey to buyer_trade_pubkey and master_seller_pubkey to seller_trade_pubkey. Simultaneously, the package version in Cargo.toml has been incremented from 0.6.19 to 0.6.20.

Changes

File Change Summary
Cargo.toml Package version updated from 0.6.19 to 0.6.20
src/order.rs Renamed SmallOrder struct fields:
- master_buyer_pubkeybuyer_trade_pubkey
- master_seller_pubkeyseller_trade_pubkey

Poem

🐰 A Rabbit's Renaming Rhyme 🐰

In Mostro's code, a subtle dance,
Pubkeys renamed with gentle stance,
From master to trade, a name's new art,
Small changes that set a fresh restart!
Version bumped with a playful hop,
Our code evolves, it just won't stop! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/order.rs (1)

238-239: Retain clarity by adding doc comments.

Fields "buyer_trade_pubkey" and "seller_trade_pubkey" are newly introduced. Consider adding short doc comments explaining how these trade public keys differ from traditional identity keys, thus reinforcing their purpose for future contributors.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f946919 and b0f9d63.

📒 Files selected for processing (2)
  • Cargo.toml (1 hunks)
  • src/order.rs (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Cargo.toml
🔇 Additional comments (2)
src/order.rs (2)

194-196: Rename fields match the PR objective.

Renaming "master_buyer_pubkey" and "master_seller_pubkey" to "buyer_trade_pubkey" and "seller_trade_pubkey" aligns perfectly with the PR objective of removing references to identity keys. This is a straightforward and logical improvement in naming consistency.


219-220: Ensure external references are updated to match new parameter names.

These new parameter names in the constructor are consistent, but please verify that all invocations of the constructor throughout the codebase are updated. This helps avoid any compilation or runtime errors caused by mismatch.

✅ Verification successful

Let me check the constructor definition to verify the parameter order and names.


No issues found with constructor parameter usage

Looking at the constructor invocations and its definition, all existing usages in the codebase are passing only the first 5 parameters (id, kind, status, amount, fiat_code) while the remaining parameters are using their default values through the struct initialization. The new parameters buyer_trade_pubkey and seller_trade_pubkey are optional and added at the end of the parameter list, maintaining backward compatibility with existing calls.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search constructor usages of `SmallOrder::new` to ensure they match the new parameter names.
rg -A 5 "SmallOrder::new"

Length of output: 881


Script:

#!/bin/bash
# Get the constructor definition of SmallOrder::new
ast-grep --pattern 'impl SmallOrder {
  $$$
  pub fn new($$$) -> Self {
    $$$
  }
  $$$
}'

Length of output: 3175

@grunch grunch merged commit f6c71e4 into main Dec 23, 2024
2 checks passed
@grunch grunch deleted the rename-master-pubkey branch December 23, 2024 21:29
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.

1 participant