staticaddr: channel funding with deposits#937
staticaddr: channel funding with deposits#937hieblmi wants to merge 9 commits intolightninglabs:masterfrom
Conversation
60286d0 to
97049c1
Compare
6c330e5 to
4184f2d
Compare
fbe14d2 to
59975f0
Compare
|
Rebased |
59975f0 to
596b1df
Compare
|
Rebased |
596b1df to
4d0e787
Compare
|
Rebased master |
4d0e787 to
818b915
Compare
|
Rebased master. |
818b915 to
c4dc989
Compare
bf7bd29 to
7bd2fd0
Compare
|
Rebased with latest master |
| @@ -0,0 +1,134 @@ | |||
| package staticutil | |||
There was a problem hiding this comment.
Non-ascii characters in the commit message. I think we can remove it.
| ) | ||
|
|
||
| // ToPrevOuts converts a slice of deposits to a map of outpoints to TxOuts. | ||
| func ToPrevOuts(deposits []*deposit.Deposit, |
There was a problem hiding this comment.
I propose to cover the function with unit tests.
| ) | ||
| } | ||
|
|
||
| func (m *Manager) toPrevOuts(deposits []*deposit.Deposit, |
There was a problem hiding this comment.
Shouldn't this method reuse staticutil.ToPrevOuts?
Also we have loopin.StaticAddressLoopIn.toPrevOuts method. I guess it should also reuse staticutil.ToPrevOuts, right?
There was a problem hiding this comment.
Yes right, fixed it.
| signer lndclient.SignerClient, deposits []*deposit.Deposit, | ||
| addrParams *address.Parameters, | ||
| staticAddress *script.StaticAddress) ([]*input.MuSig2SessionInfo, | ||
| [][]byte, error) { |
There was a problem hiding this comment.
I propose to cover the function with unit tests.
| } | ||
|
|
||
| // CreateMusig2Sessions creates a musig2 session for a number of deposits. | ||
| func CreateMusig2Sessions(ctx context.Context, |
There was a problem hiding this comment.
Can we reuse this function in loopin.StaticAddressLoopIn.createMusig2Sessions?
There was a problem hiding this comment.
yes, I removed the methods in loopin and use the methods in staticutil instead.
looprpc/client.proto
Outdated
| returns (StaticAddressSummaryResponse); | ||
|
|
||
| /* loop:`static` | ||
| /* loop:`in` |
looprpc/client.proto
Outdated
| rpc StaticAddressLoopIn (StaticAddressLoopInRequest) | ||
| returns (StaticAddressLoopInResponse); | ||
|
|
||
| /* loop:`openchannel` |
looprpc/client.proto
Outdated
| /* | ||
| An optional error string. | ||
| */ | ||
| string error = 2; |
There was a problem hiding this comment.
Can't we deliver errors via gRPC errors?
There was a problem hiding this comment.
yep, removed this field.
looprpc/client.proto
Outdated
| uint64 asset_cost_offchain = 3; | ||
| } | ||
|
|
||
| message OpenChannelRequest { |
There was a problem hiding this comment.
PTAL at hieblmi#2
I removed all the code below this line from this file and used the original LND types from lntypes.
a0fe637 to
706c1ff
Compare
|
I noticed that static loop-in methods are missing in file |
f9f6792 to
a2d4650
Compare
97653cd to
35cbada
Compare
52e1651 to
e05a2ca
Compare
|
@starius: review reminder |
e05a2ca to
16d56f1
Compare
Make our own type StaticAddressLoopInRequest which has a single field of type lnrpc.OpenChannelRequest. Removed copy-pasted lnrpc types which are needed for OpenChannelRequest.
This PR introduces a
openchannelsubcommand to static addresses.It provides the same experience as
lncli openchannel.Exmples:
Open a channel with all available deposits:
Open a channel with specified local funding amount, coin-selected from available deposits under fee and dust considerations.
Open a channel from two deposits AAA and BBB while taking their combined value(fundmax) as funding amount and considering fees and dust limit.
Open a channel from two deposits AAA and BBB while taking a specified amount(local_amt) as funding amount and considering fees and dust limit.
TODOs: