Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Dec 7, 2024
1 parent 92b9d7b commit 2493b5a
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_deserialize():
"vtxinwit": [],
"lock_time": 0,
"tx_hash": "54cc399879446c4eaa7774bb764b319a2680709f99704ce60344587f49ff97e8",
"tx_id": "54cc399879446c4eaa7774bb764b319a2680709f99704ce60344587f49ff97e8",
"__data__": "0100000001db3acf37743ac015808f7911a88761530c801819b3b907340aa65dfb6d98ce24030000006a473044022002961f4800cb157f8c0913084db0ee148fa3e1130e0b5e40c3a46a6d4f83ceaf02202c3dd8e631bf24f4c0c5341b3e1382a27f8436d75f3e0a095915995b0bf7dc8e01210395c223fbf96e49e5b9e06a236ca7ef95b10bf18c074bd91a5942fc40360d0b68fdffffff040000000000000000536a4c5058325bd61325dc633fadf05bec9157c23106759cee40954d39d9dbffc17ec5851a2d1feb5d271da422e0e24c7ae8ad29d2eeabf7f9ca3de306bd2bc98e2a39e47731aa000caf400053000c1283000149c8000000000000001976a91462bef4110f98fdcb4aac3c1869dbed9bce8702ed88acc80000000000000017a9144317f779c0a2ccf8f6bc3d440bd9e536a5bff75287fa3e5100000000001976a914bf2646b8ba8b4a143220528bde9c306dac44a01c88ac00000000",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,15 @@
"check_signatures_sighash_flag": [
{
"in": (
{"tx_hash": "c8091f1ef768a2f00d48e6d0f7a2c2d272a5d5c8063db78bf39977adcb12e103"},
{"tx_id": "c8091f1ef768a2f00d48e6d0f7a2c2d272a5d5c8063db78bf39977adcb12e103"},
),
"out": None,
},
{
"comment": "P2PK",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": False,
"vin": [
{
Expand All @@ -543,7 +543,7 @@
"comment": "P2PK",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": False,
"vin": [
{
Expand All @@ -554,13 +554,13 @@
],
},
),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_hash"),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_id"),
},
{
"comment": "P2PKH",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": False,
"vin": [
{
Expand All @@ -577,7 +577,7 @@
"comment": "P2PKH",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": False,
"vin": [
{
Expand All @@ -588,13 +588,13 @@
],
},
),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_hash"),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_id"),
},
{
"comment": "P2MS",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": False,
"vin": [
{
Expand All @@ -611,7 +611,7 @@
"comment": "P2MS",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": False,
"vin": [
{
Expand All @@ -622,13 +622,13 @@
],
},
),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_hash"),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_id"),
},
{
"comment": "P2WPKH",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": True,
"vin": [
{
Expand All @@ -649,28 +649,35 @@
"comment": "P2WPKH",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id", # c8091f1ef768a2f00d48e6d0f7a2c2d272a5d5c8063db78bf39977adcb12e103
"segwit": True,
"vin": [
{
"script_sig": b"",
}
},
{
"script_sig": b"",
},
],
"vtxinwit": [
[
"3045022100c7fb3bd38bdceb315a28a0793d85f31e4e1d9983122b4a5de741d6ddca5caf8202207b2821abd7a1a2157a9d5e69d2fdba3502b0a96be809c34981f8445555bdafdb83",
"03f465315805ed271eb972e43d84d2a9e19494d10151d9f6adb32b8534bfd764ab",
]
"304502210095dfc652a9c03911b7c4a0bc7de574ee4764cd1de78ab6599c196c69c741efbe022078ba83e9756e7d0751cb97402f031886bb34e00c70758710b4507db17649795983",
"03fef14a1660447a52f507af16a81b6e05ca8e579e0b74b11b44c6d9db6109a415",
],
[
"3044022031150e6703f6fb7e924446b021211a1d216724693d78634c5a47a43c4edf8e1102203652e2879e9bd62dc1e5994045d81fdb4adacaec4b6c366cb18be74fc020d99601",
"031e9c58fa7828643a91fa06cc0146d97fe75b982218bf38745d6579309cfba5fe",
],
],
},
),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_hash"),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_id"),
},
{
"comment": "P2TR key path spend",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": True,
"vin": [
{
Expand All @@ -690,7 +697,7 @@
"comment": "P2TR key path spend",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": True,
"vin": [
{
Expand All @@ -704,13 +711,13 @@
],
},
),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_hash"),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_id"),
},
{
"comment": "P2TR script path spend",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": True,
"vin": [
{
Expand All @@ -732,7 +739,7 @@
"comment": "P2TR script path spend",
"in": (
{
"tx_hash": "tx_hash",
"tx_id": "tx_id",
"segwit": True,
"vin": [
{
Expand All @@ -748,7 +755,56 @@
],
},
),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_hash"),
"error": (SighashFlagError, "invalid SIGHASH flag for transaction tx_id"),
},
{
"comment": "P2SH segwit",
"in": (
{
"tx_id": "fa7e8c4a582b4284bd4726de620cd87dfef6b634ee3ebb043ed0dc08901eee83",
"segwit": True,
"vin": [
{
"script_sig": binascii.unhexlify(
"16001415a13032cb59a7b51dd761223e189a48a7f67338"
),
}
],
"vtxinwit": [
[
"3045022100ceeccea697ed5fc7583387ba298ba1a84b6cdc24eeb97cf4021e967d795b27ca022070b398697abb41eb402994984c122fc6b4edccaeed819188be5c5ef40b8c685a01",
"039db968bfd35439d215dd26196266e8859a1fae89c462b587416779f0b8854e48",
]
],
},
),
"out": None,
},
{
"comment": "P2SH segwit",
"in": (
{
"tx_id": "fa7e8c4a582b4284bd4726de620cd87dfef6b634ee3ebb043ed0dc08901eee83",
"segwit": True,
"vin": [
{
"script_sig": binascii.unhexlify(
"16001415a13032cb59a7b51dd761223e189a48a7f67338"
),
}
],
"vtxinwit": [
[
"3045022100ceeccea697ed5fc7583387ba298ba1a84b6cdc24eeb97cf4021e967d795b27ca022070b398697abb41eb402994984c122fc6b4edccaeed819188be5c5ef40b8c685a83",
"039db968bfd35439d215dd26196266e8859a1fae89c462b587416779f0b8854e48",
]
],
},
),
"error": (
SighashFlagError,
"invalid SIGHASH flag for transaction fa7e8c4a582b4284bd4726de620cd87dfef6b634ee3ebb043ed0dc08901eee83",
),
},
],
},
Expand Down

0 comments on commit 2493b5a

Please sign in to comment.