@@ -49,7 +49,8 @@ class WaitForOpenChannelStateSpec extends TestKitBaseClass with FixtureAnyFunSui
4949
5050 import setup ._
5151 val channelConfig = ChannelConfig .standard
52- val (aliceParams, bobParams, channelType) = computeFeatures(setup, test.tags)
52+ val (aliceParams, bobParams, defaultChannelType) = computeFeatures(setup, test.tags)
53+ val channelType = if (test.tags.contains(" standard-channel-type" )) ChannelTypes .Standard else defaultChannelType
5354 val initialFeeratePerKw = if (channelType == ChannelTypes .AnchorOutputs ) TestConstants .anchorOutputsFeeratePerKw else TestConstants .feeratePerKw
5455 val aliceInit = Init (aliceParams.initFeatures)
5556 val bobInit = Init (bobParams.initFeatures)
@@ -65,11 +66,12 @@ class WaitForOpenChannelStateSpec extends TestKitBaseClass with FixtureAnyFunSui
6566 import f ._
6667 val open = alice2bob.expectMsgType[OpenChannel ]
6768 // Since https://github.com/lightningnetwork/lightning-rfc/pull/714 we must include an empty upfront_shutdown_script.
68- assert(open.tlvStream.get[ ChannelTlv . UpfrontShutdownScriptTlv ] === Some (ChannelTlv . UpfrontShutdownScriptTlv ( ByteVector .empty) ))
69+ assert(open.upfrontShutdownScript_opt === Some (ByteVector .empty))
6970 // We always send a channel type, even for standard channels.
7071 assert(open.channelType_opt === Some (ChannelTypes .Standard ))
7172 alice2bob.forward(bob)
7273 awaitCond(bob.stateName == WAIT_FOR_FUNDING_CREATED )
74+ assert(bob.stateData.asInstanceOf [DATA_WAIT_FOR_FUNDING_CREATED ].channelFeatures.channelType === ChannelTypes .Standard )
7375 }
7476
7577 test(" recv OpenChannel (anchor outputs)" , Tag (ChannelStateTestsTags .AnchorOutputs )) { f =>
@@ -78,6 +80,16 @@ class WaitForOpenChannelStateSpec extends TestKitBaseClass with FixtureAnyFunSui
7880 assert(open.channelType_opt === Some (ChannelTypes .AnchorOutputs ))
7981 alice2bob.forward(bob)
8082 awaitCond(bob.stateName == WAIT_FOR_FUNDING_CREATED )
83+ assert(bob.stateData.asInstanceOf [DATA_WAIT_FOR_FUNDING_CREATED ].channelFeatures.channelType === ChannelTypes .AnchorOutputs )
84+ }
85+
86+ test(" recv OpenChannel (non-default channel type)" , Tag (ChannelStateTestsTags .AnchorOutputs ), Tag (" standard-channel-type" )) { f =>
87+ import f ._
88+ val open = alice2bob.expectMsgType[OpenChannel ]
89+ assert(open.channelType_opt === Some (ChannelTypes .Standard ))
90+ alice2bob.forward(bob)
91+ awaitCond(bob.stateName == WAIT_FOR_FUNDING_CREATED )
92+ assert(bob.stateData.asInstanceOf [DATA_WAIT_FOR_FUNDING_CREATED ].channelFeatures.channelType === ChannelTypes .Standard )
8193 }
8294
8395 test(" recv OpenChannel (invalid chain)" ) { f =>
0 commit comments