Skip to content

Commit

Permalink
Merge pull request #1002 from lightninglabs/fix-decimal-precision
Browse files Browse the repository at this point in the history
proof: relax parsing in `DecDisplayForAssetID`
  • Loading branch information
Roasbeef authored Jul 10, 2024
2 parents 5236dea + 4491aff commit 5e1529c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -6668,7 +6668,16 @@ func (r *rpcServer) DecDisplayForAssetID(ctx context.Context,
}

_, decDisplay, err := meta.GetDecDisplay()
if err != nil && !errors.Is(err, proof.ErrNotJSON) {
switch {
// If it isn't JSON, or doesn't have a dec display, we'll just return 0
// below.
case errors.Is(err, proof.ErrNotJSON):
fallthrough
case errors.Is(err, proof.ErrDecDisplayMissing):
fallthrough
case errors.Is(err, proof.ErrDecDisplayInvalidType):
break
case err != nil:
return 0, fmt.Errorf("unable to extract decimal "+
"display for asset_id=%v :%v", id, err)
}
Expand Down

0 comments on commit 5e1529c

Please sign in to comment.