-
Notifications
You must be signed in to change notification settings - Fork 120
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
split enableEmission
into newGroupedAsset
and groupedAsset
#681
Conversation
3696293
to
1f43cf5
Compare
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.
PR looks good, will also do some manual testing
vectors seem to be failing? (kicked it, will see if it passes)
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.
Great to see this cleared up 👍
taprpc/mintrpc/mint.proto
Outdated
@@ -33,40 +33,74 @@ service Mint { | |||
rpc ListBatches (ListBatchRequest) returns (ListBatchResponse); | |||
} | |||
|
|||
message MintAsset { | |||
message MintSeedling { |
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.
Is this the first time we're exposing users to the concept of a "seedling"? Perhaps we should add a doc comment to explain what this message type is.
I don't think we should hold up this PR on terminology. But perhaps we should think carefully about "seepling" if this is the first time a user might encounter that word in this context. MintCandidateAsset
?
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, this will also trigger a larger breaking change as well (proto compilation failing). Seems non-essential?
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 like just for display, could be PendingBatchAsset
, or just PendingAsset
.
@@ -785,7 +785,7 @@ func (b *BatchCaretaker) stateStep(currentState BatchState) (BatchState, error) | |||
case strings.Contains(err.Error(), "already exists"): | |||
break | |||
|
|||
case err != nil: | |||
default: |
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.
isn't this equiv to the above? A non-nil error ends up here w/ the prior version that had explicit err check. A commit body message could help here re rationale/understanding.
@@ -546,12 +546,15 @@ func (c *Custodian) importAddrToWallet(addr *address.AddrWithKeyInfo) error { | |||
// along if so. | |||
case strings.Contains(err.Error(), "already exists"): | |||
|
|||
case err != nil: | |||
default: |
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.
Same here, or there's a condition that ptrAddr
is nil but the error non-nil? Either way, seems equiv.
taprpc/mintrpc/mint.proto
Outdated
@@ -33,40 +33,74 @@ service Mint { | |||
rpc ListBatches (ListBatchRequest) returns (ListBatchResponse); | |||
} | |||
|
|||
message MintAsset { | |||
message MintSeedling { |
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, this will also trigger a larger breaking change as well (proto compilation failing). Seems non-essential?
taprpc/mintrpc/mint.proto
Outdated
@@ -79,14 +113,20 @@ message MintAssetRequest { | |||
If true, then the asset will be created with a group key, which allows for | |||
future asset issuance. | |||
*/ | |||
bool enable_emission = 2; | |||
bool new_grouped_asset = 2; |
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.
Any reason to not move this into MintAsset
?
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.
There was a reason when MintAsset
was used within MintingBatch
- now that that isn't the case, these could be moved into MintAsset
.
taprpc/mintrpc/mint.proto
Outdated
@@ -33,40 +33,74 @@ service Mint { | |||
rpc ListBatches (ListBatchRequest) returns (ListBatchResponse); | |||
} | |||
|
|||
message MintAsset { | |||
message MintSeedling { |
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 like just for display, could be PendingBatchAsset
, or just PendingAsset
.
In this commit, we replace the enableEmission flag for minting with two flags, newGroupedAsset and GroupedAsset. These are mutually exclusive and less ambigious than the parsing of enableEmission. newGroupedAsset is used when creating a group anchor, and groupedAsset is used when issuing into an existing group. We also add the MintSeedling type to better display the state of a pending batch, as the enableEmission variable was missing before.
1f43cf5
to
4fd858f
Compare
Rebased + renamed |
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.
LGTM 🧜♀️
Fixes #236 , #627 .
We replace the
enableEmission
flag with two flags,newGroupedAsset
andgroupedAsset
, at both the RPC and CLI level.Correct usage:
Asset that creates an asset group, allows future emission / reissuance:
--new_grouped_asset
Asset minted into an asset group specified by group key:
--grouped_asset --group_key
Asset minted into the same group as another asset in the same minting batch, specified by asset name:
--grouped_asset --group_anchor
We also fix a small bug where displaying a pending batch would not show if an asset had
--new_grouped_asset
set, and port a fix for a logging issue that could cause a crash.