-
Notifications
You must be signed in to change notification settings - Fork 116
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
rpc: implement DecodeAssetInvoice #1253
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12398373932Details
💛 - Coveralls |
2f24d76
to
1924f08
Compare
1924f08
to
e656e8e
Compare
2524248
to
4cc0203
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.
Nice feature!
4cc0203
to
57c2454
Compare
In this commit, we implement the `DecodeAssetPayReq` command. This command allows a caller to decode a normal LN invoice, adding the asset specific information along the way. This includes the corresponding asset unit amount, asset group information, and also the decimal display information. Fixes lightninglabs#1238
57c2454
to
610300a
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.
LGTM 🎉
|
||
// assetInvoiceAmt calculates the amount of asset units to pay for an invoice | ||
// which is expressed in sats. | ||
func (r *rpcServer) assetInvoiceAmt(ctx context.Context, targetAsset asset.Specifier, |
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.
nit: line too long (linter error is somewhat cryptic).
return 0, fmt.Errorf("error querying ask price: %w", err) | ||
} | ||
if oracleResp.Err != nil { | ||
return 0, fmt.Errorf("error querying ask price: %w", err) |
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.
nit: use oracleResp.Err
in the error message?
In this commit, we implement the
DecodeAssetInvoice
command. Thiscommand allows a caller to decode a normal LN invoice, adding the asset
specific information along the way. This includes the corresponding
asset unit amount, asset group information, and also the decimal display
information.
Fixes #1238
Fixes #1166