-
Notifications
You must be signed in to change notification settings - Fork 118
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
mintrpc+tapgarden: add universe announcement flag to asset minting #1173
base: main
Are you sure you want to change the base?
Conversation
Move validation logic for MintAsset RPC requests into a standalone function to improve readability. This makes it clearer where the bulk of the request validation logic ends.
Remove inaccurate statement in `prepAssetSeedling` doc comment. Improve clarity of comment at `prepAssetSeedling` call site.
Update doc comment for PendingBatch to improve clarity. Test to verify that nil is returned when no pending batch exists.
This commit adds a new flag to the `MintAsset` RPC request message. When set to true, this flag enables the universe announcement feature for the minting batch. To comply with this feature, the minting batch must be restricted to assets that share the same group key.
Pull Request Test Coverage Report for Build 11686896618Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Still some bits to figure out about exactly which constraints will apply to the batches here.
@@ -574,7 +597,7 @@ func (r *rpcServer) MintAsset(ctx context.Context, | |||
} | |||
} | |||
|
|||
if specificGroupInternalKey { | |||
if req.Asset.GroupInternalKey != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't have the same meaning as before. specificGroupInternalKey
was true
if the seedling is being minted into an existing group.
GroupInternalKey
is only non-nil if you are creating a new group, and you want to use a specific internal key instead of whichever key tapd
will generate automatically.
@@ -309,6 +315,35 @@ func (m *MintingBatch) HasSeedlings() bool { | |||
return len(m.Seedlings) != 0 | |||
} | |||
|
|||
// ValidateSeedling checks if a seedling is valid for the batch. | |||
func (m *MintingBatch) ValidateSeedling(newSeedling Seedling) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC we want this to be a logical AND between this flag for each seedling, and the matching flag for the batch.
So the first seedling of the batch should update the batch flag, and every other seedling should match. This implies that every seedling would have EnableUniAnnounce
set to true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I'm going for. EnableUniAnnounce
set to true
on each seedling if it's true on the batch. They need to correspond basically. We can relax that sort of thing in the future. Let me know if you have thoughts on that sort of approach.
This PR adds a new flag to the
MintAsset
RPC request message. When set to true, this flag enables the universe announcement feature for the minting batch. To comply with this feature, the minting batch must be restricted to assets that share the same group key.This PR is part of the work towards closing: #1094