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 transaction details #486

Merged
merged 2 commits into from
Apr 9, 2024
Merged

Conversation

reez
Copy link
Collaborator

@reez reez commented Apr 7, 2024

Description

Enhances transactions method on Wallet.

Notes to the reviewers

Previously #432 had a simplified return type to list Transactions. This PR enhances transactions to return additional types.

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Summary by CodeRabbit

  • New Features
    • Enhanced transaction details display across platforms (Android, JVM, Python, Swift) with the addition of CanonicalTx and ChainPosition.
  • Refactor
    • Updated transaction retrieval methods to ensure consistency in how transaction information is accessed and displayed.

@reez reez self-assigned this Apr 7, 2024
@reez reez marked this pull request as ready for review April 8, 2024 13:25
Copy link

coderabbitai bot commented Apr 8, 2024

Walkthrough

The recent updates across various Bitcoin Dev Kit (BDK) libraries focus on improving transaction detail retrieval and representation. By transitioning to a more detailed CanonicalTx structure and introducing ChainPosition for confirmation details, these changes aim to provide richer and more precise information about transactions. This unified approach ensures a consistent way of accessing and handling transaction details across different parts of the codebase.

Changes

Files Change Summary
bdk-ffi/src/bdk.udl
bdk-ffi/src/wallet.rs
Updated Wallet interface to return CanonicalTx instead of Transaction, introducing ChainPosition and CanonicalTx for enhanced confirmation details.
bdk-ffi/src/bitcoin.rs
bdk-ffi/src/lib.rs
Added imports for ChainPosition and CanonicalTx from the types module, enriching transaction information handling.
bdk-android/.../LiveWalletTest.kt
bdk-jvm/.../LiveWalletTest.kt
bdk-python/tests/test_live_wallet.py
bdk-swift/Tests/.../LiveWalletTests.swift
Refactored to access txid() from the transaction object directly, impacting how transaction identifiers are retrieved.

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:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@thunderbiscuit
Copy link
Member

Love it! It's a neat way to pull what we need out of that complex data type.

I just need to look into understanding the lifetime parameters more before giving the final review, but should be able to do this later today.

@reez
Copy link
Collaborator Author

reez commented Apr 8, 2024

Love it! It's a neat way to pull what we need out of that complex data type.

I just need to look into understanding the lifetime parameters more before giving the final review, but should be able to do this later today.

Great! Our conversation last week spurred me on to this, so thanks for that. And thanks for the heads up on reviewing it.

@reez reez requested a review from thunderbiscuit April 8, 2024 16:42
@thunderbiscuit
Copy link
Member

Good stuff. I cleared up my issue with the lifetimes, and as per the call earlier added a commit that renames those structures to the Rust based ones, as well as moved them to the types.rs file.

Copy link

@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

Actionable comments outside the diff hunks (1)
bdk-ffi/src/types.rs (1)

Line range hint 109-109: TODO comment regarding Peek implementation.

The TODO comment indicates an incomplete implementation for the Peek variant of AddressIndex. Would you like assistance in addressing this?

@reez
Copy link
Collaborator Author

reez commented Apr 9, 2024

Good stuff. I cleared up my issue with the lifetimes, and as per the call earlier added a commit that renames those structures to the Rust based ones, as well as moved them to the types.rs file.

Ok. Sorry I didn't mean for you to have to make a commit, just a comment on the PR with the requested changes and I could make the commit with the changes. But since you have the commit pushed up for it are you going to rename pub confirmation: ChainPosition, to pub chain_position: ChainPosition,?

@thunderbiscuit
Copy link
Member

thunderbiscuit commented Apr 9, 2024

Oh shoot I misunderstood you on the call. And thanks for the review! I just pushed the fix now.

Copy link
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

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

ACK f698d46.

@reez
Copy link
Collaborator Author

reez commented Apr 9, 2024

Oh shoot I misunderstood you on the call. And thanks for the review! I just pushed the fix now.

LGTM!

@thunderbiscuit thunderbiscuit merged commit f698d46 into bitcoindevkit:master Apr 9, 2024
25 checks passed
@reez reez deleted the confirmation branch April 9, 2024 18:46
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