Skip to content
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

PoC using DLC-Channels from rust-dlc#master #1788

Merged
merged 15 commits into from
Jan 4, 2024
Merged

PoC using DLC-Channels from rust-dlc#master #1788

merged 15 commits into from
Jan 4, 2024

Conversation

bonomat
Copy link
Contributor

@bonomat bonomat commented Jan 4, 2024

No description provided.

@bonomat bonomat force-pushed the feat/dlc-channels branch 2 times, most recently from e3294ac to 7a74d92 Compare January 4, 2024 10:31
@@ -549,7 +547,9 @@ impl Node {
let action = if position_contracts + trade_contracts == Decimal::ZERO {
TradeAction::Close(subchannel.channel_id)
} else {
TradeAction::Resize(subchannel.channel_id)
// TODO(bonomat) implement channel resize on dlc-channels
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None => 1.0,
};
fn coordinator_leverage_for_trade(&self, _counterparty_peer_id: &PublicKey) -> Result<f32> {
// TODO(bonomat): we will need to configure the leverage on the coordinator differently now
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.propose_dlc_channel(channel_details.clone(), contract_input)
.await
if let Err(e) =
// TODO(bonomat): we will need to use the new dlc channel protocol here
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -278,6 +274,29 @@ impl<S: TenTenOneStorage, N: Storage> dlc_manager::Wallet for LnDlcWallet<S, N>
_: Option<u64>,
lock_utxos: bool,
) -> Result<Vec<Utxo>, Error> {
// TODO(bonomat): this should not be necessary to store it in the db and then load again
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let (node_id, reject) = self
.sub_channel_manager
.reject_sub_channel_offer(*channel_id)?;
// TODO: implement reject dlc channel offer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (margin.sats < minTradeMargin.sats) {
return "Min margin is ${minTradeMargin.sats}";
}
// TODO(bonomat): we need new checks here. For now, YOLO
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'USD-P',
];

List<BalanceRow> balances = [
const BalanceRow(walletType: WalletType.onChain),
// TODO(bonomat): this should show the balance from the dlc channel now
Copy link
Contributor Author

@bonomat bonomat Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,6 +1,7 @@
import 'package:get_10101/common/domain/model.dart';

class SharePaymentRequest {
// TODO(bonomat): this should be removed
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -46,7 +46,9 @@ class WalletScreen extends StatelessWidget {
onPressed: () {
context.go((hasChannel || walletChangeNotifier.lightning().sats > 0)
? ReceiveScreen.route
: OnboardingScreen.route);
:
// TODO: we should have a dedicated on-boarding screen for on-boarding with on-chain funds
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {
ln_dlc::create_invoice(amount_sats, description)?
};
// TODO(bonomat): this can be removed as we don't support LN for now
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Ok(PaymentRequest {
bip21: format!("bitcoin:{addr}{amount_query}"),
lightning: ln_invoice.to_string(),
lightning: "TODO: remove this part".to_string(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bonomat bonomat force-pushed the feat/dlc-channels branch from 7a74d92 to 620935d Compare January 4, 2024 10:49
bonomat and others added 13 commits January 4, 2024 11:54
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
@bonomat bonomat force-pushed the feat/dlc-channels branch from 620935d to 81c3747 Compare January 4, 2024 11:00
@bonomat bonomat mentioned this pull request Jan 4, 2024
@@ -193,6 +193,8 @@ jobs:

e2e-tests:
runs-on: ubuntu-latest
# TODO(bonomat): re-run e2e tests
if: false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bonomat bonomat force-pushed the feat/dlc-channels branch from 9e8486f to dcd35ca Compare January 4, 2024 12:53
@bonomat bonomat force-pushed the feat/dlc-channels branch from dcd35ca to f3e520d Compare January 4, 2024 12:55
Copy link
Contributor

@1010Tom 1010Tom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@bonomat bonomat added this pull request to the merge queue Jan 4, 2024
@bonomat
Copy link
Contributor Author

bonomat commented Jan 4, 2024

Going ahead and merge this.

Merged via the queue into main with commit 0d76d2d Jan 4, 2024
9 checks passed
@bonomat bonomat deleted the feat/dlc-channels branch January 4, 2024 13:16
@luckysori luckysori changed the title Feat/dlc channels PoC using DLC-Channels from rust-dlc#master Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants