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

tarodb: add chain_fees to chain_txns #184

Merged
merged 2 commits into from
Nov 4, 2022
Merged

tarodb: add chain_fees to chain_txns #184

merged 2 commits into from
Nov 4, 2022

Conversation

positiveblue
Copy link
Contributor

@positiveblue positiveblue commented Oct 27, 2022

Store how much we spent in on-chain fee for minting/transfers operations.

Fixes #144
Affects #177

@@ -0,0 +1,2 @@
ALTER TABLE chain_txns ADD chain_fees INTEGER;

Copy link
Member

Choose a reason for hiding this comment

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

We're still in alpha and already know that users will need to drop their DB state with the next release. So this can be added directly to the original migration file.

@positiveblue positiveblue marked this pull request as ready for review November 3, 2022 13:27
@lightninglabs-deploy
Copy link

@guggero: review reminder

Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Nice and clean, LGTM 🎉

tarofreighter/chain_porter.go Outdated Show resolved Hide resolved
tarodb/sqlite/queries/assets.sql Outdated Show resolved Hide resolved
Populate the new field using the funded PSBT data.
Store on-chain fees as a separate column so we can directly execute queries
in our database using this value.

Not all chain tx will have this field populated. We will store the fees
only for the tx that we create (minting and trasfer operations but not
importing).
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🕷

@Roasbeef Roasbeef merged commit 19af433 into lightninglabs:main Nov 4, 2022
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.

tarod: add explicit chain fee tracking for all relevant operations
4 participants