Repository navigation
smite-scenarios: use helpers for second funded channel - #286
Conversation
Create helpers for tests that need two different negotiated channels and use them to simplify the relevant tests.
|
|
||
| /// A [`sample_funding_negotiation`] with a different `temporary_channel_id` and | ||
| /// funding amount, so that it funds a different channel. | ||
| pub fn second_funding_negotiation() -> PendingChannel { |
There was a problem hiding this comment.
nit: If we directly port this to run via instructions in the future instead of injecting the negotiation, this will start to fail AcceptChannelOracle, e.g: here open_channel.funding_satoshis > 16777215 or accept_channel reuses the PCP from the first negotiation.
It doesn't really matter much here, since sample_funding_negotiation itself also violates some oracles, so I'm fine with grouping the fix with that in the future if you prefer
| let temporary_channel_id = | ||
| b.append(Operation::LoadChannelId(second.temporary_channel_id.0), &[]); | ||
| b.append( | ||
| Operation::SendFundingCreated, |
There was a problem hiding this comment.
I know this is just a refactor of the existing instructions, but this will start to fail once we add an oracle to channel_ready that checks whether funding_signed was sent
There was a problem hiding this comment.
Yes, we will need to change this for the new oracle check. I didn't want to change it during the refactor though.
Create helpers for tests that need two different negotiated channels and use them to simplify the relevant tests.
Addresses #260 (comment).