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

Add additions and removals to get_offer_summary API response #17333

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

mikehw
Copy link
Contributor

@mikehw mikehw commented Jan 14, 2024

Purpose:

This PR adds additions and removals to the get_offer_summary wallet rpc api response.

Addition and removal coin IDs can be compared against mempool transactions and block additions and removals to determine if an offer is being cancelled or accepted.

Current Behavior:

POST get_offer_summary

{
  "id": "0x55cfb60b6f4258085df644601fff874d659a4110cbc06baca6f811b198b85c26",
  "success": true,
  "summary": {
    "fees": 0,
    "infos": {
      "367c6b0d8df5d86e5a06da7e57dc1f339a684516435c6bc86f69af1ec1adddb6": {
        "tail": "0x367c6b0d8df5d86e5a06da7e57dc1f339a684516435c6bc86f69af1ec1adddb6",
        "type": "CAT"
      },
      "4275bd94b6913028adc4b183288a873c7cabf65c163e6db7d5686e4ccdc0bb35": {
        "tail": "0x4275bd94b6913028adc4b183288a873c7cabf65c163e6db7d5686e4ccdc0bb35",
        "type": "CAT"
      },
      "9841225e2372fb4a32791dd96ca231b25e4f7d14e9b59d217b8881a82f858806": {
        "tail": "0x9841225e2372fb4a32791dd96ca231b25e4f7d14e9b59d217b8881a82f858806",
        "type": "CAT"
      },
      "dc77ba1f5599fa63c126b8e512573eacd3496b3e4f6712d1252b119f1e6bec2d": {
        "tail": "0xdc77ba1f5599fa63c126b8e512573eacd3496b3e4f6712d1252b119f1e6bec2d",
        "type": "CAT"
      }
    },
    "offered": {
      "4275bd94b6913028adc4b183288a873c7cabf65c163e6db7d5686e4ccdc0bb35": 600000,
      "dc77ba1f5599fa63c126b8e512573eacd3496b3e4f6712d1252b119f1e6bec2d": 180000
    },
    "requested": {
      "367c6b0d8df5d86e5a06da7e57dc1f339a684516435c6bc86f69af1ec1adddb6": 12000,
      "9841225e2372fb4a32791dd96ca231b25e4f7d14e9b59d217b8881a82f858806": 60000
    },
    "valid_times": {
      "max_height": null,
      "max_time": null,
      "min_height": null,
      "min_time": null
    }
  }
}

New Behavior:

POST get_offer_summary

{
  "id": "0x55cfb60b6f4258085df644601fff874d659a4110cbc06baca6f811b198b85c26",
  "success": true,
  "summary": {
    "additions": [
      "7e04b480098c94fb4d0de73c7445b59b83f939186cd1d2c1445a773c7581b031",
      "60eee94bfae0880e05677a5419f0c91d269dd2cbdf2e0309fc8d5b529302b65f",
      "9b86995d30f99681a710eeeef19abd74f12c303d372725d519d229fe7b9ac3c9",
      "0bd30e5398cbd149724a15d8d1845bb463956ad14c5909162bf1bef82f1242d4"
    ],
    "fees": 0,
    "infos": {
      "367c6b0d8df5d86e5a06da7e57dc1f339a684516435c6bc86f69af1ec1adddb6": {
        "tail": "0x367c6b0d8df5d86e5a06da7e57dc1f339a684516435c6bc86f69af1ec1adddb6",
        "type": "CAT"
      },
      "4275bd94b6913028adc4b183288a873c7cabf65c163e6db7d5686e4ccdc0bb35": {
        "tail": "0x4275bd94b6913028adc4b183288a873c7cabf65c163e6db7d5686e4ccdc0bb35",
        "type": "CAT"
      },
      "9841225e2372fb4a32791dd96ca231b25e4f7d14e9b59d217b8881a82f858806": {
        "tail": "0x9841225e2372fb4a32791dd96ca231b25e4f7d14e9b59d217b8881a82f858806",
        "type": "CAT"
      },
      "dc77ba1f5599fa63c126b8e512573eacd3496b3e4f6712d1252b119f1e6bec2d": {
        "tail": "0xdc77ba1f5599fa63c126b8e512573eacd3496b3e4f6712d1252b119f1e6bec2d",
        "type": "CAT"
      }
    },
    "offered": {
      "4275bd94b6913028adc4b183288a873c7cabf65c163e6db7d5686e4ccdc0bb35": 600000,
      "dc77ba1f5599fa63c126b8e512573eacd3496b3e4f6712d1252b119f1e6bec2d": 180000
    },
    "removals": [
      "14c0c7648a12f191c40c4d3720f7751fcef3f0db6a34d0100dd6d568a5babec9",
      "0056ba6d4b617d68f4b56eb17c37300e2abf177c946898f667779f4ad39363fa"
    ],
    "requested": {
      "367c6b0d8df5d86e5a06da7e57dc1f339a684516435c6bc86f69af1ec1adddb6": 12000,
      "9841225e2372fb4a32791dd96ca231b25e4f7d14e9b59d217b8881a82f858806": 60000
    },
    "valid_times": {
      "max_height": null,
      "max_time": null,
      "min_height": null,
      "min_time": null
    }
  }
}

Testing Notes:

@mikehw mikehw requested a review from a team as a code owner January 14, 2024 17:43
@arvidn arvidn added the Added Required label for PR that categorizes merge commit message as "Added" for changelog label Jan 23, 2024
Copy link

Pull Request Test Coverage Report for Build 7520779446

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 90.512%

Totals Coverage Status
Change from base Build 7508322150: -0.1%
Covered Lines: 94738
Relevant Lines: 104621

💛 - Coveralls

@Starttoaster Starttoaster merged commit d5188c7 into Chia-Network:main Jan 24, 2024
260 of 261 checks passed
@mikehw mikehw deleted the add-offered-coins-to-summary branch January 25, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Added Required label for PR that categorizes merge commit message as "Added" for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants