@@ -29,6 +29,7 @@ public function testFromHexP2PK()
2929 $ output = OutputFactory::fromHex ('210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac ' );
3030 $ this ->assertInstanceOf (P2pk::class, $ output );
3131 $ this ->assertEquals ($ output ->getPubKey (), hex2bin ('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 ' ));
32+ $ this ->assertEquals ($ output ->type (), 'p2pk ' );
3233 }
3334
3435 /**
@@ -39,6 +40,7 @@ public function testFromHexP2PKH()
3940 $ output = OutputFactory::fromHex ('76a914751e76e8199196d454941c45d1b3a323f1433bd688ac ' );
4041 $ this ->assertInstanceOf (P2pkh::class, $ output );
4142 $ this ->assertEquals ($ output ->getPubKeyHash (), hex2bin ('751e76e8199196d454941c45d1b3a323f1433bd6 ' ));
43+ $ this ->assertEquals ($ output ->type (), 'p2pkh ' );
4244 }
4345
4446 /**
@@ -50,6 +52,7 @@ public function testFromHexP2MS()
5052 $ this ->assertInstanceOf (P2ms::class, $ output );
5153 $ this ->assertEquals ($ output ->getPubKeys (), [hex2bin ('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 ' )]);
5254 $ this ->assertEquals ($ output ->getSigCount (), 1 );
55+ $ this ->assertEquals ($ output ->type (), 'p2ms ' );
5356 }
5457
5558 /**
@@ -60,6 +63,7 @@ public function testFromHexP2SH()
6063 $ output = OutputFactory::fromHex ('a91483eebb7d79aa1d388e3b0ac65b98ac580c4da01a87 ' );
6164 $ this ->assertInstanceOf (P2sh::class, $ output );
6265 $ this ->assertEquals ($ output ->getScriptHash (), hex2bin ('83eebb7d79aa1d388e3b0ac65b98ac580c4da01a ' ));
66+ $ this ->assertEquals ($ output ->type (), 'p2sh ' );
6367 }
6468
6569 /**
@@ -70,6 +74,7 @@ public function testFromHexP2WPKH()
7074 $ output = OutputFactory::fromHex ('0014751e76e8199196d454941c45d1b3a323f1433bd6 ' );
7175 $ this ->assertInstanceOf (P2wpkh::class, $ output );
7276 $ this ->assertEquals ($ output ->getPubKeyHash (), hex2bin ('751e76e8199196d454941c45d1b3a323f1433bd6 ' ));
77+ $ this ->assertEquals ($ output ->type (), 'p2wpkh ' );
7378 }
7479
7580 /**
@@ -80,6 +85,7 @@ public function testFromHexP2WSH()
8085 $ output = OutputFactory::fromHex ('002028205333db922f66e8a941b4a32d66de5cea03d9cda46e3e6658935272b9b24f ' );
8186 $ this ->assertInstanceOf (P2wsh::class, $ output );
8287 $ this ->assertEquals ($ output ->getWitnessHash (), hex2bin ('28205333db922f66e8a941b4a32d66de5cea03d9cda46e3e6658935272b9b24f ' ));
88+ $ this ->assertEquals ($ output ->type (), 'p2wsh ' );
8389 }
8490
8591 /**
@@ -90,5 +96,6 @@ public function testFromHexP2TR()
9096 $ output = OutputFactory::fromHex ('5120a60869f0dbcf1dc659c9cecbaf8050135ea9e8cdc487053f1dc6880949dc684c ' );
9197 $ this ->assertInstanceOf (P2tr::class, $ output );
9298 $ this ->assertEquals ($ output ->getTaprootPubKey (), hex2bin ('a60869f0dbcf1dc659c9cecbaf8050135ea9e8cdc487053f1dc6880949dc684c ' ));
99+ $ this ->assertEquals ($ output ->type (), 'p2tr ' );
93100 }
94101}
0 commit comments