Skip to content

Commit 33b94a9

Browse files
committed
rpc: in MintAsset, use a blank meta if dec display provided, but not asset meta is set
In this commit, we relax the checks for MintAsset. This'll enable a user to set only decimal display, without setting a custom meta data as well.
1 parent 58547ab commit 33b94a9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

rpcserver.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,14 @@ func (r *rpcServer) MintAsset(ctx context.Context,
505505
return nil, err
506506
}
507507

508-
// If a custom decimal display is set, we require the AssetMeta to be
509-
// set. That means the user has to at least specify the meta type.
508+
// If a custom decimal display is set, but the user didn't specify an
509+
// asset meta, then we'll assume an opaque type.
510510
if req.Asset.DecimalDisplay != 0 && req.Asset.AssetMeta == nil {
511-
return nil, fmt.Errorf("decimal display requires asset " +
512-
"metadata")
511+
rpcsLog.Infof("No asset meta specified, using opaque type "+
512+
"for decimal display %d", req.Asset.DecimalDisplay)
513+
514+
req.Asset.AssetMeta = &taprpc.AssetMeta{}
515+
513516
}
514517

515518
// Decimal display doesn't really make sense for collectibles.

0 commit comments

Comments
 (0)