Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No more numbering #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions tests/events/bolt1-01-init.events
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,75 @@
# Trivial variable to serve as a demonstration
EXPECT_INIT=expect-send: type=init

1. connect: privkey=0000000000000000000000000000000000000000000000000000000000000003
2. $EXPECT_INIT
3. recv: type=init globalfeatures= localfeatures=
* connect: privkey=0000000000000000000000000000000000000000000000000000000000000003
+ $EXPECT_INIT
+ recv: type=init globalfeatures= localfeatures=

1. nothing
1. disconnect:
* nothing
* disconnect:

4. connect: privkey=0000000000000000000000000000000000000000000000000000000000000002
+ connect: privkey=0000000000000000000000000000000000000000000000000000000000000002
# Even if we don't send anything, it should send init.
1. $EXPECT_INIT
* $EXPECT_INIT

# Minimal possible init message.
# Spec: MUST send `init` as the first Lightning message for any connection.
1. $EXPECT_INIT
2. recv: type=init globalfeatures= localfeatures=
* $EXPECT_INIT
+ recv: type=init globalfeatures= localfeatures=

# SHOULD NOT set features greater than 13 in `globalfeatures`.
1. $EXPECT_INIT globalfeatures=000000/030000
* $EXPECT_INIT globalfeatures=000000/030000
# init msg with unknown odd global bit (19): no error
2. recv: type=init globalfeatures=020000 localfeatures=
+ recv: type=init globalfeatures=020000 localfeatures=

# Sanity check that bits 34 and 35 are not used!
1. $EXPECT_INIT localfeatures=0000000000/0300000000
* $EXPECT_INIT localfeatures=0000000000/0300000000
# init msg with unknown odd local bit (19): no error
2. recv: type=init globalfeatures= localfeatures=020000
+ recv: type=init globalfeatures= localfeatures=020000

# init msg with unknown even global bit (34): you will error
1. $EXPECT_INIT
2. recv: type=init globalfeatures=0100000000 localfeatures=
3. expect-error:
* $EXPECT_INIT
+ recv: type=init globalfeatures=0100000000 localfeatures=
+ expect-error:

# init msg with unknown even local bit (34): you will error
1. $EXPECT_INIT
2. recv: type=init globalfeatures= localfeatures=0100000000
3. expect-error:
* $EXPECT_INIT
+ recv: type=init globalfeatures= localfeatures=0100000000
+ expect-error:

# If you don't support `option_data_loss_protect`, you will be ok if
# we ask for it.
1. $EXPECT_INIT localfeatures=00/03 !option_data_loss_protect
2. recv: type=init globalfeatures= localfeatures=02 !option_data_loss_protect
* $EXPECT_INIT localfeatures=00/03 !option_data_loss_protect
+ recv: type=init globalfeatures= localfeatures=02 !option_data_loss_protect

# If you don't support `option_data_loss_protect`, you will error if
# we require it.
1. $EXPECT_INIT localfeatures=00/03 !option_data_loss_protect
2. recv: type=init globalfeatures= localfeatures=01 !option_data_loss_protect
3. expect-error: !option_data_loss_protect
* $EXPECT_INIT localfeatures=00/03 !option_data_loss_protect
+ recv: type=init globalfeatures= localfeatures=01 !option_data_loss_protect
+ expect-error: !option_data_loss_protect

# If you support `option_data_loss_protect`, you will advertize it odd.
1. $EXPECT_INIT localfeatures=02/03 option_data_loss_protect/odd
* $EXPECT_INIT localfeatures=02/03 option_data_loss_protect/odd

# If you require `option_data_loss_protect`, you will advertize it even.
1. $EXPECT_INIT localfeatures=01/03 option_data_loss_protect/even
* $EXPECT_INIT localfeatures=01/03 option_data_loss_protect/even

# If you don't support `option_static_remotekey`, you will be ok if
# we ask for it.
1. $EXPECT_INIT localfeatures=0000/3000 !option_static_remotekey
2. recv: type=init globalfeatures= localfeatures=2000 !option_static_remotekey
* $EXPECT_INIT localfeatures=0000/3000 !option_static_remotekey
+ recv: type=init globalfeatures= localfeatures=2000 !option_static_remotekey

# If you don't support `option_static_remotekey`, you will error if
# we require it.
1. $EXPECT_INIT localfeatures=0000/3000 !option_static_remotekey
2. recv: type=init globalfeatures= localfeatures=1000 !option_static_remotekey
3. expect-error: !option_static_remotekey
* $EXPECT_INIT localfeatures=0000/3000 !option_static_remotekey
+ recv: type=init globalfeatures= localfeatures=1000 !option_static_remotekey
+ expect-error: !option_static_remotekey

# If you support `option_static_remotekey`, you will advertize it odd.
1. $EXPECT_INIT localfeatures=2000/3000 option_static_remotekey/odd
* $EXPECT_INIT localfeatures=2000/3000 option_static_remotekey/odd

# If you require `option_static_remotekey`, you will advertize it even.
1. $EXPECT_INIT localfeatures=1000/3000 option_static_remotekey/even
* $EXPECT_INIT localfeatures=1000/3000 option_static_remotekey/even

# Note: it's undefined what you'll do if implementation requires
# an option and isn't offered it. The recipient of the required feature
Expand Down
14 changes: 7 additions & 7 deletions tests/events/bolt1-02-unknown-messages.events
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
# - upon receiving unknown _even_ feature bits that are non-zero:
# - MUST fail the connection.

1. connect: privkey=0000000000000000000000000000000000000000000000000000000000000003
2. expect-send: type=init
3. recv: type=init globalfeatures= localfeatures=
* connect: privkey=0000000000000000000000000000000000000000000000000000000000000003
+ expect-send: type=init
+ recv: type=init globalfeatures= localfeatures=

1. nothing
* nothing

# Unknown odd is OK.
1. recv: type=9999
* recv: type=9999

# Unknown even causes error.
1. recv: type=10000
2. expect-error:
* recv: type=10000
+ expect-error:
62 changes: 31 additions & 31 deletions tests/events/bolt2-01-open_channel.events
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#
include setup.incl

1. block: $BLOCK_102
* block: $BLOCK_102

2. connect: privkey=0000000000000000000000000000000000000000000000000000000000000002
3. expect-send: type=init
4. recv: type=init globalfeatures= localfeatures=
+ connect: privkey=0000000000000000000000000000000000000000000000000000000000000002
+ expect-send: type=init
+ recv: type=init globalfeatures= localfeatures=

# Start with the 'accepter' side of an open_channel (test runner initiates)
# We assume a funding_per_kw=253 Satoshi/kSipa.
# This gives a channel of 999878sat
1. recv: type=open_channel
* recv: type=open_channel
chain_hash=06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f
temporary_channel_id=0000000000000000000000000000000000000000000000000000000000000000
funding_satoshis=999878
Expand Down Expand Up @@ -39,10 +39,10 @@ include setup.incl
channel_flags=01

# Ignore unknown odd messages
1. nothing
1. recv: type=9999
* nothing
* recv: type=9999

2. expect-send: type=accept_channel
+ expect-send: type=accept_channel
temporary_channel_id=0000000000000000000000000000000000000000000000000000000000000000
# funding_privkey=0000000000000000000000000000000000000000000000000000000000000010
funding_pubkey=03e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a
Expand All @@ -63,10 +63,10 @@ include setup.incl
channel_reserve_satoshis=9998

# Ignore unknown messages
1. nothing
1. recv: type=9999
* nothing
* recv: type=9999

3. recv: type=funding_created
+ recv: type=funding_created
temporary_channel_id=0000000000000000000000000000000000000000000000000000000000000000
# Funding tx is 020000000001016b85f654d8186f4d5dd32a977b2cf8c4b01ff4634152acba16b654c1c85a83160100000000ffffffff01c6410f0000000000220020c46bf3d1686d6dbb2d9244f8f67b90370c5aa2747045f1aeccb77d818711738202473044022047e9e6e798ba9adb6c84bdcd6230a96fb6de9dcca84d81103fb2bc08906cb884022027599b1e80289eaf238e9a00119a79a0ccceab7d83d54719e10bd0c3300a0d34012102d6a3c2d0cf7904ab6af54d7c959435a452b24a63194e1c4e7c337d3ebbb3017b00000000
# txid=41085b995c1f591cfc3ae79ccde012bf0b37c7bde23d80a61c9732bdd6210b2f
Expand All @@ -75,32 +75,32 @@ include setup.incl
# node's commitment tx is 02000000012f0b21d6bd32971ca6803de2bdc7370bbf12e0cd9ce73afc1c591f5c995b08410000000000f436a980010f410f0000000000160014749af8703f0d1fd8890a553bd62e9caf15f7bad44cff0020
signature=SIG(0000000000000000000000000000000000000000000000000000000000000020:97b9f4b67c7d404c82f97d86d7e5b2689e366abf1609abd889143a5999c6df47)

4. expect-send: type=funding_signed
+ expect-send: type=funding_signed
channel_id=2f0b21d6bd32971ca6803de2bdc7370bbf12e0cd9ce73afc1c591f5c995b0841
# test's commitment tx is 02000000012f0b21d6bd32971ca6803de2bdc7370bbf12e0cd9ce73afc1c591f5c995b08410000000000f436a980010f410f0000000000220020233d69d88092351875ce0b9fd5ea576b2307c539eaed7abdf97fbb26720f01ac4cff0020
signature=SIG(0000000000000000000000000000000000000000000000000000000000000010:49fcc656b58e78f639b8af4bca65fe1ee948ea36eb7629222320518e33a42f29)

5. block: height=103 n=3 tx=020000000001016b85f654d8186f4d5dd32a977b2cf8c4b01ff4634152acba16b654c1c85a83160100000000ffffffff01c6410f0000000000220020c46bf3d1686d6dbb2d9244f8f67b90370c5aa2747045f1aeccb77d818711738202473044022047e9e6e798ba9adb6c84bdcd6230a96fb6de9dcca84d81103fb2bc08906cb884022027599b1e80289eaf238e9a00119a79a0ccceab7d83d54719e10bd0c3300a0d34012102d6a3c2d0cf7904ab6af54d7c959435a452b24a63194e1c4e7c337d3ebbb3017b00000000
+ block: height=103 n=3 tx=020000000001016b85f654d8186f4d5dd32a977b2cf8c4b01ff4634152acba16b654c1c85a83160100000000ffffffff01c6410f0000000000220020c46bf3d1686d6dbb2d9244f8f67b90370c5aa2747045f1aeccb77d818711738202473044022047e9e6e798ba9adb6c84bdcd6230a96fb6de9dcca84d81103fb2bc08906cb884022027599b1e80289eaf238e9a00119a79a0ccceab7d83d54719e10bd0c3300a0d34012102d6a3c2d0cf7904ab6af54d7c959435a452b24a63194e1c4e7c337d3ebbb3017b00000000

6. expect-send: type=funding_locked
+ expect-send: type=funding_locked
channel_id=2f0b21d6bd32971ca6803de2bdc7370bbf12e0cd9ce73afc1c591f5c995b0841
next_per_commitment_point=032405cbd0f41225d5f203fe4adac8401321a9e05767c5f8af97d51d2e81fbb206

7. recv: type=funding_locked
+ recv: type=funding_locked
channel_id=2f0b21d6bd32971ca6803de2bdc7370bbf12e0cd9ce73afc1c591f5c995b0841
next_per_commitment_point=027eed8389cf8eb715d73111b73d94d2c2d04bf96dc43dfd5b0970d80b3617009d

# Ignore unknown odd messages
1. nothing
1. recv: type=9999
* nothing
* recv: type=9999


# Now we test the 'opener' side of an open_channel (node initiates)
# We set funding_per_kw=253 Satoshi/kSipa.
1. fundchannel: amount=999877 utxo=16835ac8c154b616baac524163f41fb0c4f82c7b972ad35d4d6f18d854f6856b/1 feerate=253perkw
* fundchannel: amount=999877 utxo=16835ac8c154b616baac524163f41fb0c4f82c7b972ad35d4d6f18d854f6856b/1 feerate=253perkw

# This gives a channel of 999877sat
1. expect-send: type=open_channel
* expect-send: type=open_channel
chain_hash=06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f
temporary_channel_id=0000000000000000000000000000000000000000000000000000000000000000
funding_satoshis=999877
Expand Down Expand Up @@ -128,10 +128,10 @@ include setup.incl
channel_flags=01

# Ignore unknown odd messages
1. nothing
1. recv: type=9999
* nothing
* recv: type=9999

2. recv: type=accept_channel
+ recv: type=accept_channel
temporary_channel_id=0000000000000000000000000000000000000000000000000000000000000000
dust_limit_satoshis=546
max_htlc_value_in_flight_msat=4294967295
Expand All @@ -156,10 +156,10 @@ include setup.incl
first_per_commitment_point=02037803a3228ec3a517835480ffac64c0557d9d75e0fe85861ab0be9eb224e6f8

# Ignore unknown messages
1. nothing
1. recv: type=9999
* nothing
* recv: type=9999

3. expect-send: type=funding_created
+ expect-send: type=funding_created
temporary_channel_id=0000000000000000000000000000000000000000000000000000000000000000
# Funding tx is
# txid=189c40b0728f382fe91c87270926584e48e0af3a6789f37454afee6c7560311d
Expand All @@ -168,22 +168,22 @@ include setup.incl
# opener's commitment tx is 02000000011d3160756ceeaf5474f389673aafe0484e58260927871ce92f388f72b0409c1800000000006d669280010e410f000000000022002002ea9a3a14d15893571391cb43308d0cf2c873025a7ee3e1c59fc94e7d0b820750e05c20
signature=SIG(0000000000000000000000000000000000000000000000000000000000000010:b5f455ab7e6dc6cbdd0e4f5ff9623091f5e2317d90215734f0b7b468b2de4d9f)

4. recv: type=funding_signed
+ recv: type=funding_signed
channel_id=1d3160756ceeaf5474f389673aafe0484e58260927871ce92f388f72b0409c18
# accepter's commitment tx is 02000000011d3160756ceeaf5474f389673aafe0484e58260927871ce92f388f72b0409c1800000000006d669280010e410f000000000016001413619a3971c150996e7d1f391d9ade1405df87ec50e05c20
signature=SIG(0000000000000000000000000000000000000000000000000000000000000020:9afc89f545df32a456355a74f435d9f40bdb0b255f38af3d19ff344ab3ea0ea1)

5. block: height=103 n=3
+ block: height=103 n=3

6. recv: type=funding_locked
+ recv: type=funding_locked
channel_id=1d3160756ceeaf5474f389673aafe0484e58260927871ce92f388f72b0409c18
next_per_commitment_point=027eed8389cf8eb715d73111b73d94d2c2d04bf96dc43dfd5b0970d80b3617009d

7. expect-send: type=funding_locked
+ expect-send: type=funding_locked
channel_id=1d3160756ceeaf5474f389673aafe0484e58260927871ce92f388f72b0409c18
next_per_commitment_point=032405cbd0f41225d5f203fe4adac8401321a9e05767c5f8af97d51d2e81fbb206

# Ignore unknown odd messages
1. nothing
1. recv: type=9999
* nothing
* recv: type=9999

Loading