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 asset group burn itest, logging, and missing error handling #732

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Dec 11, 2023

This PR adds an itest which ensures that we can burn an asset from an asset group in the simplest case.

It makes the following changes to the BurnAsset RPC endpoint:

  • Adds additional logging.
  • Adds missing error handling when attempting to retrieve a group key.

This PR was created in an attempt to re-produce bug #704

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 changes! Though I think the first commit is incomplete or can now fail, see inline comment.

rpcserver.go Outdated Show resolved Hide resolved
rpcserver.go Outdated Show resolved Hide resolved
itest/burn_test.go Show resolved Hide resolved
itest/burn_test.go Outdated Show resolved Hide resolved
@ffranr ffranr force-pushed the burn-asset-bug branch 2 times, most recently from ff16f28 to 271fbeb Compare December 11, 2023 15:43
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.

LGTM 🎉

rpcserver.go Outdated Show resolved Hide resolved
Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

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

Very straight-forward test & easy to follow! 🪜


encodedGroupKey = hex.EncodeToString(assetGroupKey)
assetGroup = assetGroups.Groups[encodedGroupKey]
require.Len(t.t, assetGroup.Assets, 2)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we could (in a future PR) extend this. I am curious what would happen if we burned all the amount from the second mint. Would this then have to be require.Len(t.t, assetGroup.Assets, 1) ?

@GeorgeTsagk
Copy link
Member

How are we dealing with the failing vector? I think it will keep this pr from merging

@guggero
Copy link
Member

guggero commented Dec 12, 2023

How are we dealing with the failing vector? I think it will keep this pr from merging

I think I might have found the issue, see #733 (comment).

This commit adds code which handles `err != nil` which was previously
absent.
This commit adds a few simple logging statements relating to the asset
burn endpoint.
@ffranr ffranr enabled auto-merge December 12, 2023 14:33
@ffranr ffranr added this pull request to the merge queue Dec 12, 2023
Merged via the queue into lightninglabs:main with commit 9c85a55 Dec 12, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants