-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add fee params arg to createInvoice #666
Conversation
@@ -198,9 +198,13 @@ class CreateInvoicePageState extends State<CreateInvoicePage> { | |||
final accountBloc = context.read<AccountBloc>(); | |||
final currencyBloc = context.read<CurrencyBloc>(); | |||
|
|||
final lspInfo = context.read<LSPBloc>().state?.lspInfo; | |||
final cheapestFeeParams = lspInfo?.openingFeeParamsList.values.first; |
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 seems to work but I think it is better to have one stream of the LSP that wraps the build method and pass the fee params explicitly to this _createInvoice
function.
This fee params also should be passed to the ReceivableBTCBox
.
This way we are sure that the same fee params that are displayed to the user are sent to the create invoice and it is trivial to understand that from the code.
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.
we can use context.watch which listens to changes to ().state. Though we need to define it earlier in the build method so that it rebuilds if there are any changes.
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
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.
tACK
looks good to me
Add the cheapest known feerate as argument to
createInvoice
.Fixes #643