@@ -126,6 +126,64 @@ func genRandomOpenChannelShell() (*channeldb.OpenChannel, error) {
126126
127127 chanType := channeldb .ChannelType (rand .Intn (8 ))
128128
129+ localCfg := channeldb.ChannelConfig {
130+ ChannelStateBounds : channeldb.ChannelStateBounds {},
131+ CommitmentParams : channeldb.CommitmentParams {
132+ CsvDelay : uint16 (rand .Int63 ()),
133+ },
134+ MultiSigKey : keychain.KeyDescriptor {
135+ KeyLocator : keychain.KeyLocator {
136+ Family : keychain .KeyFamily (rand .Int63 ()),
137+ Index : uint32 (rand .Int63 ()),
138+ },
139+ },
140+ RevocationBasePoint : keychain.KeyDescriptor {
141+ KeyLocator : keychain.KeyLocator {
142+ Family : keychain .KeyFamily (rand .Int63 ()),
143+ Index : uint32 (rand .Int63 ()),
144+ },
145+ },
146+ PaymentBasePoint : keychain.KeyDescriptor {
147+ KeyLocator : keychain.KeyLocator {
148+ Family : keychain .KeyFamily (rand .Int63 ()),
149+ Index : uint32 (rand .Int63 ()),
150+ },
151+ },
152+ DelayBasePoint : keychain.KeyDescriptor {
153+ KeyLocator : keychain.KeyLocator {
154+ Family : keychain .KeyFamily (rand .Int63 ()),
155+ Index : uint32 (rand .Int63 ()),
156+ },
157+ },
158+ HtlcBasePoint : keychain.KeyDescriptor {
159+ KeyLocator : keychain.KeyLocator {
160+ Family : keychain .KeyFamily (rand .Int63 ()),
161+ Index : uint32 (rand .Int63 ()),
162+ },
163+ },
164+ }
165+
166+ remoteCfg := channeldb.ChannelConfig {
167+ CommitmentParams : channeldb.CommitmentParams {
168+ CsvDelay : uint16 (rand .Int63 ()),
169+ },
170+ MultiSigKey : keychain.KeyDescriptor {
171+ PubKey : pub ,
172+ },
173+ RevocationBasePoint : keychain.KeyDescriptor {
174+ PubKey : pub ,
175+ },
176+ PaymentBasePoint : keychain.KeyDescriptor {
177+ PubKey : pub ,
178+ },
179+ DelayBasePoint : keychain.KeyDescriptor {
180+ PubKey : pub ,
181+ },
182+ HtlcBasePoint : keychain.KeyDescriptor {
183+ PubKey : pub ,
184+ },
185+ }
186+
129187 return & channeldb.OpenChannel {
130188 ChainHash : chainHash ,
131189 ChanType : chanType ,
@@ -134,63 +192,10 @@ func genRandomOpenChannelShell() (*channeldb.OpenChannel, error) {
134192 ShortChannelID : lnwire .NewShortChanIDFromInt (
135193 uint64 (rand .Int63 ()),
136194 ),
137- ThawHeight : rand .Uint32 (),
138- IdentityPub : pub ,
139- LocalChanCfg : channeldb.ChannelConfig {
140- ChannelConstraints : channeldb.ChannelConstraints {
141- CsvDelay : uint16 (rand .Int63 ()),
142- },
143- MultiSigKey : keychain.KeyDescriptor {
144- KeyLocator : keychain.KeyLocator {
145- Family : keychain .KeyFamily (rand .Int63 ()),
146- Index : uint32 (rand .Int63 ()),
147- },
148- },
149- RevocationBasePoint : keychain.KeyDescriptor {
150- KeyLocator : keychain.KeyLocator {
151- Family : keychain .KeyFamily (rand .Int63 ()),
152- Index : uint32 (rand .Int63 ()),
153- },
154- },
155- PaymentBasePoint : keychain.KeyDescriptor {
156- KeyLocator : keychain.KeyLocator {
157- Family : keychain .KeyFamily (rand .Int63 ()),
158- Index : uint32 (rand .Int63 ()),
159- },
160- },
161- DelayBasePoint : keychain.KeyDescriptor {
162- KeyLocator : keychain.KeyLocator {
163- Family : keychain .KeyFamily (rand .Int63 ()),
164- Index : uint32 (rand .Int63 ()),
165- },
166- },
167- HtlcBasePoint : keychain.KeyDescriptor {
168- KeyLocator : keychain.KeyLocator {
169- Family : keychain .KeyFamily (rand .Int63 ()),
170- Index : uint32 (rand .Int63 ()),
171- },
172- },
173- },
174- RemoteChanCfg : channeldb.ChannelConfig {
175- ChannelConstraints : channeldb.ChannelConstraints {
176- CsvDelay : uint16 (rand .Int63 ()),
177- },
178- MultiSigKey : keychain.KeyDescriptor {
179- PubKey : pub ,
180- },
181- RevocationBasePoint : keychain.KeyDescriptor {
182- PubKey : pub ,
183- },
184- PaymentBasePoint : keychain.KeyDescriptor {
185- PubKey : pub ,
186- },
187- DelayBasePoint : keychain.KeyDescriptor {
188- PubKey : pub ,
189- },
190- HtlcBasePoint : keychain.KeyDescriptor {
191- PubKey : pub ,
192- },
193- },
195+ ThawHeight : rand .Uint32 (),
196+ IdentityPub : pub ,
197+ LocalChanCfg : localCfg ,
198+ RemoteChanCfg : remoteCfg ,
194199 RevocationProducer : shaChainProducer ,
195200 }, nil
196201}
0 commit comments