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

fix: add burn funds command to console wallet (see issue #4547) #4655

Conversation

jorgeantonio21
Copy link
Contributor

Description

Adds command to burn funds on Tari console wallet.

Motivation and Context

Tackle issue #4547.

How Has This Been Tested?

Proper unit tests.

@jorgeantonio21 jorgeantonio21 marked this pull request as ready for review September 9, 2022 09:47
@jorgeantonio21
Copy link
Contributor Author

Fixes #4547.

Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

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

Looking good, but I believe we need a cucumber test for this:

  • Let a miner connected to a wallet mine some blocks (20?)
  • Mine some blocks (3?) without a connected wallet to have all funds available
  • Verify the miner wallet's available balance (and possibly the balance of the entire UTXO set)
  • Create and submit a burn funds transaction to burn (almost) all funds in the wallet
  • Mine some blocks (3?) without a connected wallet
  • Verify the balance of the entire UTXO set

Comment on lines 624 to 625
BurnFunds(args) => {
match burn_tari(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these two names should match - BurnFunds vs. burn_tari

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely ! Thanks for the suggestions

@stringhandler
Copy link
Collaborator

Happy to merge, but let's add the cucumber test first

@SWvheerden
Copy link
Collaborator

SWvheerden commented Sep 13, 2022

We have cucumber tests for the burns, verify balance etc.
We just need one for the cli

Look at:
WalletTransactions.feature - Create burn transaction
Sync.feature - Sync burned output
Sync.feature - Pruned node should handle burned output

@stringhandler stringhandler merged commit 0242b1d into tari-project:development Sep 14, 2022
sdbondi added a commit to sdbondi/tari that referenced this pull request Sep 16, 2022
* development: (72 commits)
  fix: reinsert transactions from failed block (tari-project#4675)
  fix: stray clippy error (tari-project#4685)
  fix(wallet): mark mined_height as null when pending outputs are cancelled (tari-project#4686)
  chore: updated dependancies (tari-project#4684)
  fix(p2p): remove DETACH flag usage (tari-project#4682)
  fix(comms): simplify and remove possibility of deadlock from pipelines and substream close (tari-project#4676)
  feat(ci): add default CI and FFI testing with custom dispatch (tari-project#4672)
  chore: remove broken test (tari-project#4678)
  fix: fix potential race condition between add_block and sync (tari-project#4677)
  fix deadlock (tari-project#4674)
  fix: add burn funds command to console wallet (see issue tari-project#4547) (tari-project#4655)
  v0.38.3
  fix: fee estimate (tari-project#4656)
  fix(comms/messaging): fix possible deadlock in outbound pipeline (tari-project#4657)
  fix: replace Luhn checksum with DammSum (tari-project#4639)
  fix(core/sync): handle deadline timeouts by changing peer (tari-project#4649)
  fix(ci): libtor build on Ubuntu (tari-project#4644)
  chore: fix log (tari-project#4634)
  v0.38.2
  fix(comms/rpc): detect early close in all cases (tari-project#4647)
  ...
stringhandler pushed a commit that referenced this pull request Sep 20, 2022
Description
---
Refactor previously incorrect cucumber for burn funds via cli test.

Motivation and Context
---
PR #4655 introduced a specific cucumber for testing burn funds via cli. This test was incorrectly designed. This PR addresses the situation. 

How Has This Been Tested?
---
Cucumber
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.

4 participants