You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`get_channel_signer` previously had two different responsibilites:
generating unique `channel_keys_id` and using said ID to derive channel
keys. We decide to split it into two methods `generate_channel_keys_id`
and `derive_channel_signer`, such that we can use the latter to fulfill
our goal of re-deriving signers instead of persisting them. There's no
point in storing data that can be easily re-derived.
let keys_manager = Arc::new(KeyProvider{node_secret: our_network_key.clone(),inbound_payment_key:KeyMaterial(inbound_payment_key.try_into().unwrap()),counter:AtomicU64::new(0)});
Copy file name to clipboardExpand all lines: lightning/src/ln/chan_utils.rs
+6-6
Original file line number
Diff line number
Diff line change
@@ -1627,8 +1627,8 @@ mod tests {
1627
1627
let seed = [42;32];
1628
1628
let network = Network::Testnet;
1629
1629
let keys_provider = test_utils::TestKeysInterface::new(&seed, network);
1630
-
let signer = keys_provider.get_channel_signer(false,3000);
1631
-
let counterparty_signer = keys_provider.get_channel_signer(false,3000);
1630
+
let signer = keys_provider.derive_channel_signer(3000, keys_provider.generate_channel_keys_id(false,1_000_000,0));
1631
+
let counterparty_signer = keys_provider.derive_channel_signer(3000, keys_provider.generate_channel_keys_id(true,1_000_000,1));
1632
1632
let delayed_payment_base = &signer.pubkeys().delayed_payment_basepoint;
1633
1633
let per_commitment_secret = SecretKey::from_slice(&hex::decode("1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100").unwrap()[..]).unwrap();
1634
1634
let per_commitment_point = PublicKey::from_secret_key(&secp_ctx,&per_commitment_secret);
0 commit comments