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

Update offer test vectors #2914

Merged
merged 1 commit into from
Oct 7, 2024
Merged
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
38 changes: 30 additions & 8 deletions eclair-core/src/test/resources/offers-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,29 @@
}
]
},
{
"description": "same, with blinded path first_node_id using sciddir",
"valid": true,
"bolt12": "lno1pgx9getnwss8vetrw3hhyucs3yqqqqqqqqqqqqp2qgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqqyqqqqqqqqqqqqqqqqqqqqqqqqqqqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqqgzyg3zyg3zyg3z93pqthvwfzadd7jejes8q9lhc4rvjxd022zv5l44g6qah82ru5rdpnpj",
"field info": "short_channel_id is 0x0x42, direction is 0",
"fields": [
{
"type": 10,
"length": 12,
"hex": "5465737420766563746f7273"
},
{
"type": 16,
"length": 137,
"hex": "00000000000000002a0202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020200100000000000000000000000000000000002020202020202020202020202020202020202020202020202020202020202020200081111111111111111"
},
{
"type": 22,
"length": 33,
"hex": "02eec7245d6b7d2ccb30380bfbe2a3648cd7a942653f5aa340edcea1f283686619"
}
]
},
{
"description": "with no issuer_id and blinded path via Bob (0x424242...), blinding 020202...",
"valid": true,
Expand Down Expand Up @@ -541,17 +564,17 @@
"bolt12": "lno1pgz5znzfgdz3vggzqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgp06wu6egp9qgr0u2xq4dh3kdevrf4zg6hx8a60jv0gxe0ptgyfc6xkryqqqqqqqq"
},
{
"description": "Contains unknown feature 22 -- feature 22 is not unknown, we accept this offer",
"valid": true,
"bolt12": "lno1pgx9getnwss8vetrw3hhyucvqdqqqqqkyypwa3eyt44h6txtxquqh7lz5djge4afgfjn7k4rgrkuag0jsd5xvxg"
"description": "Contains unknown feature 122",
"valid": false,
"bolt12": "lno1pgx9getnwss8vetrw3hhyucvzqzqqqqqqqqqqqqqqqqqqqqqqqqpvggzamrjghtt05kvkvpcp0a79gmy3nt6jsn98ad2xs8de6sl9qmgvcvs"
},
{
"description": "Missing offer_description and offer_amount -- offer_description and offer_amount are optional, we accept this offer",
"valid": true,
"bolt12": "lno1zcss9mk8y3wkklfvevcrszlmu23kfrxh49px20665dqwmn4p72pksese"
"description": "Missing offer_description, but has offer_amount",
"valid": false,
"bolt12": "lno1pqpzwyqkyypwa3eyt44h6txtxquqh7lz5djge4afgfjn7k4rgrkuag0jsd5xvxg"
},
{
"description": "Missing offer_issuer_id",
"description": "Missing offer_issuer_id and no offer_path",
"valid": false,
"bolt12": "lno1pgx9getnwss8vetrw3hhyuc"
},
Expand All @@ -561,4 +584,3 @@
"bolt12": "lno1pgx9getnwss8vetrw3hhyucsespjgef743p5fzqq9nqxh0ah7y87rzv3ud0eleps9kl2d5348hq2k8qzqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgqpqqqqqqqqqqqqqqqqqqqqqqqqqqqzqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqqzq3zyg3zyg3zygszqqqqyqqqqsqqvpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqsq"
}
]

Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class OfferTypesSpec extends AnyFunSuite {
src.close()
for (vector <- testVectors) {
val offer = Offer.decode(vector.bolt12)
assert(offer.isSuccess == vector.valid, vector.description)
assert((offer.isSuccess && offer.get.features.unknown.forall(_.bitIndex % 2 == 1)) == vector.valid, vector.description)
}
}
}
Loading