From 124d2438cf0871e8e2e849138856cb9f5938737c Mon Sep 17 00:00:00 2001 From: Alfonso Bribiesca Date: Fri, 23 Oct 2026 03:40:24 -0600 Subject: [PATCH] refactor: drop protonlabs/bitcoin dependency (#203) --- .github/workflows/format.yml | 21 +- .github/workflows/test.yml | 11 +- .gitignore | 4 +- .php-cs-fixer.cache | 1 - .php-cs-fixer.php | 23 +- composer.json | 17 +- composer.lock | 4120 ++++++++--------- phpunit.xml.dist | 32 +- src/Binary/Bytes.php | 81 + src/Configuration/Network.php | 3 - src/Identities/Address.php | 37 +- src/Identities/PrivateKey.php | 168 +- src/Identities/PublicKey.php | 131 +- src/Identities/WIF.php | 2 +- src/Networks/AbstractNetwork.php | 90 +- src/Transactions/Deserializer.php | 2 +- src/Transactions/Serializer.php | 10 +- src/Transactions/Types/HtlcLock.php | 7 +- src/Transactions/Types/IPFS.php | 7 +- src/Transactions/Types/MultiPayment.php | 7 +- src/Transactions/Types/Transaction.php | 29 +- src/Transactions/Types/Transfer.php | 7 +- src/Utils/Base58.php | 128 + src/Utils/Hash.php | 68 + src/Utils/Message.php | 16 +- src/Utils/Secp256k1.php | 40 + tests/Analysis/AnalysisTest.php | 29 - tests/Concerns/Deserialize.php | 26 +- tests/Concerns/Fixtures.php | 4 +- tests/Concerns/Serialize.php | 2 +- tests/Helpers.php | 7 - tests/Pest.php | 11 +- tests/Unit/Binary/BytesTest.php | 42 + tests/Unit/ByteBuffer/ByteBufferTest.php | 564 +-- .../ByteBuffer/Concerns/InitialisableTest.php | 166 +- .../ByteBuffer/Concerns/OffsetableTest.php | 66 +- .../ByteBuffer/Concerns/PositionableTest.php | 122 +- .../ByteBuffer/Concerns/Reads/FloatsTest.php | 60 +- .../ByteBuffer/Concerns/Reads/HexTest.php | 46 +- .../ByteBuffer/Concerns/Reads/IntegerTest.php | 150 +- .../ByteBuffer/Concerns/Reads/StringsTest.php | 78 +- .../Concerns/Reads/UnsignedIntegerTest.php | 150 +- .../Unit/ByteBuffer/Concerns/SizeableTest.php | 98 +- .../ByteBuffer/Concerns/TransformableTest.php | 188 +- .../ByteBuffer/Concerns/Writes/FloatsTest.php | 54 +- .../ByteBuffer/Concerns/Writes/HexTest.php | 24 +- .../Concerns/Writes/IntegerTest.php | 134 +- .../Concerns/Writes/StringsTest.php | 108 +- .../Concerns/Writes/UnsignedIntegerTest.php | 134 +- tests/Unit/ByteBuffer/LengthMapTest.php | 66 +- tests/Unit/Configuration/FeeTest.php | 44 +- tests/Unit/Configuration/NetworkTest.php | 48 +- tests/Unit/CoreCompatibilityTest.php | 59 + tests/Unit/Identities/AddressTest.php | 117 +- tests/Unit/Identities/PrivateKeyTest.php | 133 +- tests/Unit/Identities/PublicKeyTest.php | 124 +- tests/Unit/Identities/WIFTest.php | 22 +- tests/Unit/Networks/AbstractNetworkTest.php | 44 + tests/Unit/Networks/DevnetTest.php | 34 - tests/Unit/Networks/MainnetTest.php | 35 - tests/Unit/Networks/NetworkTestCase.php | 41 - tests/Unit/Networks/TestnetTest.php | 35 - .../Builder/DelegateRegistrationTest.php | 102 +- .../Builder/DelegateResignationTest.php | 78 +- .../Transactions/Builder/HtlcClaimTest.php | 106 +- .../Transactions/Builder/HtlcLockTest.php | 228 +- .../Transactions/Builder/HtlcRefundTest.php | 102 +- tests/Unit/Transactions/Builder/IPFSTest.php | 102 +- .../Transactions/Builder/MultiPaymentTest.php | 168 +- .../MultiSignatureRegistrationTest.php | 90 +- .../SecondSignatureRegistrationTest.php | 54 +- .../Transactions/Builder/TransferTest.php | 188 +- tests/Unit/Transactions/Builder/VoteTest.php | 102 +- .../DelegateRegistrationTest.php | 73 +- .../Deserializers/DelegateResignationTest.php | 63 +- .../Deserializers/HtlcClaimTest.php | 75 +- .../Deserializers/HtlcLockTest.php | 75 +- .../Deserializers/HtlcRefundTest.php | 75 +- .../Transactions/Deserializers/IPFSTest.php | 59 +- .../Deserializers/MultiPaymentTest.php | 63 +- .../MultiSignatureRegistrationTest.php | 77 +- .../SecondSignatureRegistrationTest.php | 63 +- .../Deserializers/TransferTest.php | 95 +- .../Transactions/Deserializers/VoteTest.php | 73 +- .../Serializers/DelegateRegistrationTest.php | 28 +- .../Serializers/DelegateResignationTest.php | 28 +- .../Serializers/HtlcClaimTest.php | 24 +- .../Transactions/Serializers/HtlcLockTest.php | 24 +- .../Serializers/HtlcRefundTest.php | 24 +- .../Transactions/Serializers/IPFSTest.php | 29 +- .../Serializers/MultiPaymentTest.php | 28 +- .../MultiSignatureRegistrationTest.php | 32 +- .../SecondSignatureRegistrationTest.php | 20 +- .../Transactions/Serializers/TransferTest.php | 45 +- .../Transactions/Serializers/VoteTest.php | 29 +- tests/Unit/Transactions/TransactionTest.php | 121 +- tests/Unit/Utils/Base58Test.php | 63 + tests/Unit/Utils/HashTest.php | 30 + tests/Unit/Utils/MessageTest.php | 208 +- tests/Unit/Utils/SlotTest.php | 36 +- tests/fixtures/core-vectors.json | 209 + 101 files changed, 5304 insertions(+), 5912 deletions(-) delete mode 100644 .php-cs-fixer.cache create mode 100644 src/Binary/Bytes.php create mode 100644 src/Utils/Base58.php create mode 100644 src/Utils/Hash.php create mode 100644 src/Utils/Secp256k1.php delete mode 100644 tests/Analysis/AnalysisTest.php delete mode 100644 tests/Helpers.php create mode 100644 tests/Unit/Binary/BytesTest.php create mode 100644 tests/Unit/CoreCompatibilityTest.php create mode 100644 tests/Unit/Networks/AbstractNetworkTest.php delete mode 100644 tests/Unit/Networks/DevnetTest.php delete mode 100644 tests/Unit/Networks/MainnetTest.php delete mode 100644 tests/Unit/Networks/NetworkTestCase.php delete mode 100644 tests/Unit/Networks/TestnetTest.php create mode 100644 tests/Unit/Utils/Base58Test.php create mode 100644 tests/Unit/Utils/HashTest.php create mode 100644 tests/fixtures/core-vectors.json diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 3c277c88..b95f2076 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -10,17 +10,24 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.GH_TOKEN }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.5" + extensions: gmp + coverage: none - name: Install - run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs + run: composer install --no-interaction --no-progress --prefer-dist --no-scripts - name: Run php-cs-fixer - run: ./vendor/bin/php-cs-fixer fix + run: composer format - - uses: stefanzweifel/git-auto-commit-action@v2.1.0 + - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "style: resolve style guide violations" - branch: ${{ github.head_ref }} - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28acd015..06d42632 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,10 +13,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.5" + extensions: gmp + coverage: none - name: Install - run: composer update --no-interaction --no-suggest --ignore-platform-reqs + run: composer install --no-interaction --no-progress --prefer-dist - name: Unit tests run: composer test diff --git a/.gitignore b/.gitignore index 9e419f28..708bb36b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ phpunit.xml vendor clover.xml -.php_cs.cache -.phpunit.result.cache .coverage coverage.xml +.php-cs-fixer.cache +.phpunit.cache diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache deleted file mode 100644 index 0f6e3735..00000000 --- a/.php-cs-fixer.cache +++ /dev/null @@ -1 +0,0 @@ -{"php":"8.3.6","version":"3.76.0:v3.76.0#0e3c484cef0ae9314b0f85986a36296087432c40","indent":" ","lineEnding":"\n","rules":{"array_syntax":{"syntax":"short"},"binary_operator_spaces":{"default":"single_space","operators":{"=":"align","=>":"align"}},"blank_line_after_namespace":true,"blank_line_after_opening_tag":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"braces":true,"cast_spaces":true,"class_attributes_separation":{"elements":{"const":"one","method":"one","property":"one"}},"class_definition":true,"concat_space":{"spacing":"none"},"constant_case":{"case":"lower"},"declare_equal_normalize":true,"declare_strict_types":true,"echo_tag_syntax":{"format":"long"},"elseif":true,"encoding":true,"final_internal_class":true,"full_opening_tag":true,"fully_qualified_strict_types":true,"function_declaration":true,"function_typehint_space":true,"heredoc_to_nowdoc":true,"include":true,"increment_style":{"style":"post"},"indentation_type":true,"linebreak_after_opening_tag":true,"line_ending":true,"lowercase_cast":true,"lowercase_keywords":true,"lowercase_static_reference":true,"magic_method_casing":true,"magic_constant_casing":true,"method_argument_space":true,"multiline_whitespace_before_semicolons":{"strategy":"no_multi_line"},"native_function_casing":true,"new_with_braces":true,"no_alias_functions":true,"no_blank_lines_after_class_opening":true,"no_blank_lines_after_phpdoc":true,"no_closing_tag":true,"no_empty_phpdoc":true,"no_empty_statement":true,"no_extra_blank_lines":{"tokens":["extra","throw","use","use_trait"]},"no_leading_import_slash":true,"no_leading_namespace_whitespace":true,"no_mixed_echo_print":{"use":"echo"},"no_multiline_whitespace_around_double_arrow":true,"no_short_bool_cast":true,"no_singleline_whitespace_before_semicolons":true,"no_spaces_after_function_name":true,"no_spaces_around_offset":{"positions":["inside"]},"no_spaces_inside_parenthesis":true,"no_trailing_comma_in_list_call":true,"no_trailing_comma_in_singleline_array":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"no_unneeded_control_parentheses":{"statements":["break","clone","continue","echo_print","return","switch_case","yield"]},"no_unreachable_default_argument_value":true,"no_unused_imports":true,"no_useless_else":true,"no_useless_return":true,"no_whitespace_before_comma_in_array":true,"no_whitespace_in_blank_line":true,"normalize_index_brace":true,"not_operator_with_successor_space":true,"object_operator_without_whitespace":true,"ordered_class_elements":true,"ordered_imports":{"sort_algorithm":"alpha"},"php_unit_strict":true,"php_unit_test_class_requires_covers":true,"phpdoc_add_missing_param_annotation":true,"phpdoc_indent":true,"phpdoc_inline_tag_normalizer":true,"phpdoc_no_access":true,"phpdoc_no_package":true,"phpdoc_no_useless_inheritdoc":true,"phpdoc_order":true,"phpdoc_scalar":true,"phpdoc_single_line_var_spacing":true,"phpdoc_summary":true,"phpdoc_to_comment":{"ignored_tags":["var"]},"phpdoc_trim":true,"phpdoc_types":true,"phpdoc_var_without_name":true,"psr_autoloading":true,"self_accessor":true,"semicolon_after_instruction":true,"short_scalar_cast":true,"simplified_null_return":true,"single_blank_line_at_eof":true,"single_blank_line_before_namespace":true,"single_class_element_per_statement":{"elements":["const","property"]},"single_import_per_statement":true,"single_line_after_imports":true,"single_line_comment_style":{"comment_types":["hash"]},"single_quote":true,"single_trait_insert_per_statement":true,"space_after_semicolon":true,"standardize_not_equals":true,"strict_comparison":true,"strict_param":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"ternary_operator_spaces":true,"trailing_comma_in_multiline":{"elements":["arrays"]},"trim_array_spaces":true,"unary_operator_spaces":true,"visibility_required":{"elements":["property","method","const"]},"whitespace_after_comma_in_array":true},"hashes":{"src\/Helpers.php":"5736c281d8bb805826442682be38c1dc","src\/Identities\/PublicKey.php":"8cbe249d218989c54dde4ceb8eefc8e1","src\/Identities\/PrivateKey.php":"7259bbea2e5da198ee87bcde45661666","src\/Identities\/Address.php":"17da781bf1b9c717670918fecce1bc7b","src\/Identities\/WIF.php":"09b3bf1f9077384e6e6c9b6661ca9152","src\/Networks\/Devnet.php":"4f0097e6ec4d87f8c72f8bafeaee8892","src\/Networks\/AbstractNetwork.php":"c774f58977a6f2ed3fbdba69d2489e4e","src\/Networks\/Testnet.php":"5a1b266a1c176bcaf9a9ec6068c53b33","src\/Networks\/Mainnet.php":"df2645844a8c6dfe8f99a471dc1d85f7","src\/Enums\/Fees.php":"ac38a4162fea543d56563c975360270a","src\/Enums\/Types.php":"4d5534dd1a0bbcf26c2f20dd4e7e0c9b","src\/Enums\/TypeGroup.php":"2df34e8073d807a26f63cb5a92aa4466","src\/Utils\/Slot.php":"415aefcc91d5ee4e5fb0ad58bb4c2242","src\/Utils\/Message.php":"9805c970ca9353cab3c5385055c4a6ae","src\/Transactions\/Builder\/MultiSignatureRegistrationBuilder.php":"4fc820ea18d3844a7545bd182697842e","src\/Transactions\/Builder\/HtlcRefundBuilder.php":"172069a2c1744c7e1c26fc3d4506be33","src\/Transactions\/Builder\/SecondSignatureRegistrationBuilder.php":"3e00a57bac43eb656a092a649740251f","src\/Transactions\/Builder\/DelegateRegistrationBuilder.php":"94b1cb6bd077a5b9771be530635ea1e2","src\/Transactions\/Builder\/HtlcLockBuilder.php":"f9dff632706b6c63f3c1aade509c6301","src\/Transactions\/Builder\/DelegateResignationBuilder.php":"f0c849690575a8d158519d6319805e25","src\/Transactions\/Builder\/TransferBuilder.php":"d62a16edd17aae91e9cd5c20b271ea83","src\/Transactions\/Builder\/HtlcClaimBuilder.php":"26fa61beaf17a5dc5aa17270f48d02cf","src\/Transactions\/Builder\/IPFSBuilder.php":"c07a3cb80fcb3e23a38fab812d4516f6","src\/Transactions\/Builder\/AbstractTransactionBuilder.php":"b8c23d843ac1abfdd67f328487482dbc","src\/Transactions\/Builder\/MultiPaymentBuilder.php":"3befa6a0db1ba663a33f0934a2e3ed68","src\/Transactions\/Builder\/VoteBuilder.php":"256a00c4888c2e04a6fa46b8305b034b","src\/Transactions\/Serializer.php":"5663addddc99a09e0e60a8c2834872a2","src\/Transactions\/Types\/Vote.php":"9932a1b40eca6b47cd67316f4f0b3aa9","src\/Transactions\/Types\/DelegateRegistration.php":"7d02c0b996e22c4c480b4bd704f54815","src\/Transactions\/Types\/Transaction.php":"80534e6f6d28c853d5f6ee16bf353189","src\/Transactions\/Types\/Transfer.php":"fac76b00748e5b83819bfce8f0520a39","src\/Transactions\/Types\/HtlcRefund.php":"1a7c6aa917c84da527e8ba679342dd14","src\/Transactions\/Types\/DelegateResignation.php":"43d3b2784c388367154ea03b204eb9de","src\/Transactions\/Types\/HtlcClaim.php":"ca80737b8eb8de8af5b11a8f2584da45","src\/Transactions\/Types\/MultiPayment.php":"dd7c11fd4a726a6f2e04890622c797ce","src\/Transactions\/Types\/IPFS.php":"289389ba4072e543c4438cb95816d429","src\/Transactions\/Types\/MultiSignatureRegistration.php":"c314aaa3f8add62a8abbbec9fe92ce7e","src\/Transactions\/Types\/SecondSignatureRegistration.php":"f9808925fe8103587d9d2c357ee5c5e8","src\/Transactions\/Types\/HtlcLock.php":"cce0b1037c17a6a5ca75fae86831b3b1","src\/Transactions\/Deserializer.php":"1badd55a247238e0ba15fd7613abe668","src\/Configuration\/Fee.php":"009bd25096d57c05b8f76a42e3b1c1ed","src\/Configuration\/Network.php":"db39fa961d1f67dde1127324ebc29a88","src\/ByteBuffer\/ByteOrder.php":"c183930b74c3f6216fce6af0ad547412","src\/ByteBuffer\/Concerns\/Readable.php":"1703e1781f4882cc7427ed5e3eab1b90","src\/ByteBuffer\/Concerns\/Positionable.php":"8fe18d603bcba8ad7ec525c5fea9122a","src\/ByteBuffer\/Concerns\/Transformable.php":"4b9ded9d8a5b7005f3cbbace02315415","src\/ByteBuffer\/Concerns\/Offsetable.php":"784a6f9b0aa7c7624d455da260480541","src\/ByteBuffer\/Concerns\/Writeable.php":"d809e2408af8e181ef5c3d3101fde0ad","src\/ByteBuffer\/Concerns\/Sizeable.php":"81c7fbf368a593bb92bf4c9f58a9f72d","src\/ByteBuffer\/Concerns\/Writes\/UnsignedInteger.php":"4f08096933dcd65121bab249422f8d4c","src\/ByteBuffer\/Concerns\/Writes\/Floats.php":"e7bd39863ddb227ec17d44ef487579d5","src\/ByteBuffer\/Concerns\/Writes\/Hex.php":"936ce2ebb44b67b39aeb2706f77b197c","src\/ByteBuffer\/Concerns\/Writes\/Strings.php":"4a06210be32a336cb06a642a2f772c26","src\/ByteBuffer\/Concerns\/Writes\/Integer.php":"45863cd3a3048e5d8e6523d3d7cffc07","src\/ByteBuffer\/Concerns\/Initialisable.php":"1aa3c826684e71339aa6297582c7fcc3","src\/ByteBuffer\/Concerns\/Reads\/UnsignedInteger.php":"82da46facba54107aceb630852447893","src\/ByteBuffer\/Concerns\/Reads\/Floats.php":"bbfe09b67301bb9b8ee003f7b153322b","src\/ByteBuffer\/Concerns\/Reads\/Hex.php":"d3c2432f4a3584750387451be2b069d0","src\/ByteBuffer\/Concerns\/Reads\/Strings.php":"e9e2946752da1ed0b71351028deb7eea","src\/ByteBuffer\/Concerns\/Reads\/Integer.php":"cb71d199dafd21c47c2aecb3a6d9b4b5","src\/ByteBuffer\/ByteBuffer.php":"460fdd2bf51bacb8d5df479af9c3bac7","src\/ByteBuffer\/LengthMap.php":"d992e88d544bfcd6d169a1632f3e3d05","src\/Binary\/Integer\/Reader.php":"fc382f0d5cb346069e87bdf57af42dd4","src\/Binary\/Integer\/Writer.php":"c95566b5f15e7440a357a400f4957557","src\/Binary\/Hex\/Reader.php":"84c560f1a4210dcc04cf76e61b741681","src\/Binary\/Hex\/Writer.php":"1fda8dc1fda5769e71492375945421a6","src\/Binary\/UnsignedInteger\/Reader.php":"45f7182e4f5983c886ee8a589175f83a","src\/Binary\/UnsignedInteger\/Writer.php":"352dd6fbf6d6e6a96773bda8dbdc15b1","src\/Binary\/Buffer\/Writer\/Concerns\/UnsignedInteger.php":"c2efefef99eefa7cf2c67649f97b7faf","src\/Binary\/Buffer\/Writer\/Concerns\/Generic.php":"484fea469ac07931d69f3c53e1fd09aa","src\/Binary\/Buffer\/Writer\/Concerns\/Hex.php":"f53059caa2118b5f6a4960afbbcf2d73","src\/Binary\/Buffer\/Writer\/Concerns\/Integer.php":"6d3c042771c2fd307b216d45532a73a3","src\/Binary\/Buffer\/Writer\/Buffer.php":"165a089ce688104a8db5941cf9ff6558","src\/Binary\/Buffer\/Reader\/Concerns\/UnsignedInteger.php":"02f2f4774316d2484fb2b57feb086ea1","src\/Binary\/Buffer\/Reader\/Concerns\/Hex.php":"3ee8fd0133cfbcaf15bd9c28a37a5be9","src\/Binary\/Buffer\/Reader\/Concerns\/Integer.php":"581d0559ed948f5feab6967c074892c0","src\/Binary\/Buffer\/Reader\/Buffer.php":"927b99c8047ccb9061e8193f8f144dc7","tests\/Unit\/Identities\/PublicKeyTest.php":"4cfded5f1e35c1083fed2ad7efeea615","tests\/Unit\/Identities\/PrivateKeyTest.php":"a1f81695d6331d223ac6a3312a00b193","tests\/Unit\/Identities\/AddressTest.php":"d7d375a29f37a4b9b772c75684c74b48","tests\/Unit\/Identities\/WIFTest.php":"b611511584dd0bfba84f113295365508","tests\/Unit\/Networks\/TestnetTest.php":"a6984eb7fa87bc6cf693bc241188e698","tests\/Unit\/Networks\/MainnetTest.php":"3307b4e256af4b9fd66437a5ebd0e8a2","tests\/Unit\/Networks\/NetworkTestCase.php":"f529bc550cd6b9d68f1287d0181ae150","tests\/Unit\/Networks\/DevnetTest.php":"17996bb8318d23a417339e72f330c3bd","tests\/Unit\/Utils\/SlotTest.php":"e2e6bf33055513aeaff285e4904099a4","tests\/Unit\/Utils\/MessageTest.php":"a9a261798733199bf3c7f9f813181875","tests\/Unit\/Transactions\/Builder\/DelegateRegistrationTest.php":"b4c0f10f2b10a91728e8352790f8f538","tests\/Unit\/Transactions\/Builder\/HtlcRefundTest.php":"e1113d28fa608fb7ff0ad4447a8b2f20","tests\/Unit\/Transactions\/Builder\/VoteTest.php":"db91e16f8987dd6c050471bd0704523a","tests\/Unit\/Transactions\/Builder\/TransferTest.php":"70cdd71c9cbb57bfb51c3e4a1bd74e86","tests\/Unit\/Transactions\/Builder\/IPFSTest.php":"310d8ef8251e14a9a6498b03cdd0d912","tests\/Unit\/Transactions\/Builder\/HtlcClaimTest.php":"619401dcbbee5dc4034429824bec865c","tests\/Unit\/Transactions\/Builder\/MultiPaymentTest.php":"968a69c19596fbbba3f07e022c44ba12","tests\/Unit\/Transactions\/Builder\/HtlcLockTest.php":"3c2c4fd37a0d14b006833fd1ac62663d","tests\/Unit\/Transactions\/Builder\/SecondSignatureRegistrationTest.php":"55f2fc9a05b4417820c3574aa828fdb3","tests\/Unit\/Transactions\/Builder\/MultiSignatureRegistrationTest.php":"e5b48524e7e97683ec8a1f7c9b43ba8e","tests\/Unit\/Transactions\/Builder\/DelegateResignationTest.php":"527f6988349a098d4fa6b92c78570954","tests\/Unit\/Transactions\/TransactionTest.php":"ac2e2e1de31db779f543a7d3f257822c","tests\/Unit\/Transactions\/Deserializers\/DelegateRegistrationTest.php":"9b0ce921e9b1c575f715ec028c5aec42","tests\/Unit\/Transactions\/Deserializers\/HtlcRefundTest.php":"22afd8ec2418d0406e4f42ee0e431b42","tests\/Unit\/Transactions\/Deserializers\/VoteTest.php":"fc61b9e98d001ee47dc6d61e87dddc1b","tests\/Unit\/Transactions\/Deserializers\/TransferTest.php":"0a7038846d256444b667fe80381698e0","tests\/Unit\/Transactions\/Deserializers\/IPFSTest.php":"53e714f862c3256e29660ab97ec6bf94","tests\/Unit\/Transactions\/Deserializers\/HtlcClaimTest.php":"30cacd4874af19e6026bafb57ee78b0a","tests\/Unit\/Transactions\/Deserializers\/MultiPaymentTest.php":"73b1d1ce139b3efac75814e4d13fedc0","tests\/Unit\/Transactions\/Deserializers\/HtlcLockTest.php":"cc70be6e68236f806f89b93bac7696ca","tests\/Unit\/Transactions\/Deserializers\/SecondSignatureRegistrationTest.php":"dfff4015d30f5e785a1933eb3475818d","tests\/Unit\/Transactions\/Deserializers\/MultiSignatureRegistrationTest.php":"1eb49e69bccee286f928c156633711ab","tests\/Unit\/Transactions\/Deserializers\/DelegateResignationTest.php":"8be75e4b6a9dd2072c7862dae1116b8e","tests\/Unit\/Transactions\/Serializers\/DelegateRegistrationTest.php":"04d9dc16c57e35bed0f98cd305302e3b","tests\/Unit\/Transactions\/Serializers\/HtlcRefundTest.php":"7af106a7fd38c4cdc8c57ecf6e03ab9c","tests\/Unit\/Transactions\/Serializers\/VoteTest.php":"632138bad64d4a325a95447a133bf3ca","tests\/Unit\/Transactions\/Serializers\/TransferTest.php":"bbf565785bd31035aac40b0c61bb4d6a","tests\/Unit\/Transactions\/Serializers\/IPFSTest.php":"9cbab01a748f824e2fa66a996268cf2e","tests\/Unit\/Transactions\/Serializers\/HtlcClaimTest.php":"69759df1d1377a02216573ac4e0c7694","tests\/Unit\/Transactions\/Serializers\/MultiPaymentTest.php":"04c22b03bffce8c2a713880517b0b1ec","tests\/Unit\/Transactions\/Serializers\/HtlcLockTest.php":"62d7af16064c66ced72b535ead234a8f","tests\/Unit\/Transactions\/Serializers\/SecondSignatureRegistrationTest.php":"7ffcc9bcfdf6ccde05c8d08b81b7273f","tests\/Unit\/Transactions\/Serializers\/MultiSignatureRegistrationTest.php":"d33995e48fe07147304a582454df446e","tests\/Unit\/Transactions\/Serializers\/DelegateResignationTest.php":"17dcdb013d1a6b2d0dc02d077ec101e2","tests\/Unit\/Configuration\/NetworkTest.php":"302b258b1f3ae05e0216d25929b69ea7","tests\/Unit\/Configuration\/FeeTest.php":"ce7f567b72dd0126683277b243fa9fc3","tests\/Unit\/ByteBuffer\/Concerns\/TransformableTest.php":"28470f16ddf35d79384b866973652813","tests\/Unit\/ByteBuffer\/Concerns\/OffsetableTest.php":"784101c1b5986dcdd939d47bc966684d","tests\/Unit\/ByteBuffer\/Concerns\/InitialisableTest.php":"e6f2608e0921d2b2c25e3796e0e0a920","tests\/Unit\/ByteBuffer\/Concerns\/Writes\/HexTest.php":"4280210224bfe01b431348823fd37902","tests\/Unit\/ByteBuffer\/Concerns\/Writes\/StringsTest.php":"4a0b5b96e2a1e4b849eebf1f3c8781c8","tests\/Unit\/ByteBuffer\/Concerns\/Writes\/UnsignedIntegerTest.php":"8617547d4052341646e500679de73dd8","tests\/Unit\/ByteBuffer\/Concerns\/Writes\/IntegerTest.php":"548c09489f87edce63066c196b4c35f2","tests\/Unit\/ByteBuffer\/Concerns\/Writes\/FloatsTest.php":"8bbe9a2d00b2c16e6f07d526ec86954e","tests\/Unit\/ByteBuffer\/Concerns\/Reads\/HexTest.php":"69e5e34cf122bfa36a64602fd9df0127","tests\/Unit\/ByteBuffer\/Concerns\/Reads\/StringsTest.php":"044f6a5480ac976533db063f28b3b0e3","tests\/Unit\/ByteBuffer\/Concerns\/Reads\/UnsignedIntegerTest.php":"5432d25fb0292b9e637f6e04af104745","tests\/Unit\/ByteBuffer\/Concerns\/Reads\/IntegerTest.php":"ec65fb8a8be71266fb0191449ae24173","tests\/Unit\/ByteBuffer\/Concerns\/Reads\/FloatsTest.php":"21babc31150ab55f010c0709328bf92d","tests\/Unit\/ByteBuffer\/Concerns\/SizeableTest.php":"09a667b97f0b5625bd2a267ae06b35ff","tests\/Unit\/ByteBuffer\/Concerns\/PositionableTest.php":"f3724a1f16a007a2d1a59001556d7cad","tests\/Unit\/ByteBuffer\/LengthMapTest.php":"5951a16b75f5be22726c8f7db5bc9e17","tests\/Unit\/ByteBuffer\/ByteBufferTest.php":"e2eae23b9c271db3191c07b1025640b1","tests\/Helpers.php":"362fa87b858b91ed6cb4112224fba1c2","tests\/Pest.php":"f56068e0b3ed7b33d7200c0d7684d2b4","tests\/Concerns\/Fixtures.php":"a1cbc1ecf6e31bd07fdac1c230d7aa6f","tests\/Concerns\/Serialize.php":"134128506ad4e0f69949f773c1df3a70","tests\/Concerns\/Deserialize.php":"68b8f4b8877221e5052c9dd5f011aaa9","tests\/Analysis\/AnalysisTest.php":"a9d0b7406e5a6894ce689229a4b939ff","tests\/TestCase.php":"8ad8b9b7b084dc0d2c28a247ac4a7988"}} \ No newline at end of file diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 267806e4..57db94fd 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -26,13 +26,20 @@ 'try', ], ], - 'braces' => true, + 'braces_position' => true, 'cast_spaces' => true, + 'control_structure_braces' => true, + 'control_structure_continuation_position' => true, + 'declare_parentheses' => true, + 'no_multiple_statements_per_line' => true, + 'single_space_around_construct' => true, + 'statement_indentation' => true, 'class_attributes_separation' => [ 'elements' => [ 'const' => 'one', 'method' => 'one', 'property' => 'one', + 'trait_import' => 'none', ], ], 'class_definition' => true, @@ -47,7 +54,7 @@ 'full_opening_tag' => true, 'fully_qualified_strict_types' => true, 'function_declaration' => true, - 'function_typehint_space' => true, + 'type_declaration_spaces' => true, 'heredoc_to_nowdoc' => true, 'include' => true, 'increment_style' => ['style' => 'post'], @@ -62,7 +69,7 @@ 'method_argument_space' => true, 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], 'native_function_casing' => true, - 'new_with_braces' => true, + 'new_with_parentheses' => true, 'no_alias_functions' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, @@ -74,7 +81,6 @@ 'extra', 'throw', 'use', - 'use_trait', ], ], 'no_leading_import_slash' => true, @@ -87,9 +93,8 @@ 'no_spaces_around_offset' => [ 'positions' => ['inside'], ], - 'no_spaces_inside_parenthesis' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, + 'spaces_inside_parentheses' => true, + 'no_trailing_comma_in_singleline' => true, 'no_trailing_whitespace' => true, 'no_trailing_whitespace_in_comment' => true, 'no_unneeded_control_parentheses' => [ @@ -137,7 +142,7 @@ 'short_scalar_cast' => true, 'simplified_null_return' => true, 'single_blank_line_at_eof' => true, - 'single_blank_line_before_namespace' => true, + 'blank_lines_before_namespace' => true, 'single_class_element_per_statement' => [ 'elements' => [ 'const', @@ -163,7 +168,7 @@ ], 'trim_array_spaces' => true, 'unary_operator_spaces' => true, - 'visibility_required' => [ + 'modifier_keywords' => [ 'elements' => [ 'property', 'method', diff --git a/composer.json b/composer.json index b5a09cb7..e001051e 100755 --- a/composer.json +++ b/composer.json @@ -17,16 +17,13 @@ } ], "require": { - "php": "^8.2", - "protonlabs/bitcoin": "^1.0", + "php": "^8.5", + "ext-gmp": "*", "simplito/elliptic-php": "^1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.59", - "graham-campbell/analyzer": "^3.1", - "illuminate/support": "^8.8", - "pestphp/pest": "^1.23", - "pestphp/pest-plugin-parallel": "^1.2" + "friendsofphp/php-cs-fixer": "^3.95", + "pestphp/pest": "^5.3" }, "autoload": { "psr-4": { @@ -55,9 +52,7 @@ "vendor/bin/php-cs-fixer fix" ], "test": [ - "./vendor/bin/pest --parallel" + "vendor/bin/pest --parallel" ] - }, - "minimum-stability": "dev", - "prefer-stable": true + } } diff --git a/composer.lock b/composer.lock index 07147103..1cef59fc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,502 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "682b7bb64cd5c4cd87e84d4c4300e87d", + "content-hash": "8bf7cc5e2656f88bf253a50059647755", "packages": [ - { - "name": "bitwasp/bech32", - "version": "v0.0.1", - "source": { - "type": "git", - "url": "https://github.com/Bit-Wasp/bech32.git", - "reference": "e1ea58c848a4ec59d81b697b3dfe9cc99968d0e7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Bit-Wasp/bech32/zipball/e1ea58c848a4ec59d81b697b3dfe9cc99968d0e7", - "reference": "e1ea58c848a4ec59d81b697b3dfe9cc99968d0e7", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "^5.4.0", - "squizlabs/php_codesniffer": "^2.0.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/bech32.php" - ], - "psr-4": { - "BitWasp\\Bech32\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Unlicense" - ], - "authors": [ - { - "name": "Thomas Kerin", - "homepage": "https://thomaskerin.io", - "role": "Author" - } - ], - "description": "Pure (no dependencies) implementation of bech32", - "homepage": "https://github.com/bit-wasp/bech32", - "support": { - "issues": "https://github.com/Bit-Wasp/bech32/issues", - "source": "https://github.com/Bit-Wasp/bech32/tree/more-tests" - }, - "time": "2018-02-05T22:23:47+00:00" - }, - { - "name": "composer/semver", - "version": "3.4.3", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.11", - "symfony/phpunit-bridge": "^3 || ^7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2024-09-19T14:15:21+00:00" - }, - { - "name": "fgrosse/phpasn1", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/fgrosse/PHPASN1.git", - "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/42060ed45344789fb9f21f9f1864fc47b9e3507b", - "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "~2.0", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "suggest": { - "ext-bcmath": "BCmath is the fallback extension for big integer calculations", - "ext-curl": "For loading OID information from the web if they have not bee defined statically", - "ext-gmp": "GMP is the preferred extension for big integer calculations", - "phpseclib/bcmath_compat": "BCmath polyfill for servers where neither GMP nor BCmath is available" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "FG\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Friedrich Große", - "email": "friedrich.grosse@gmail.com", - "homepage": "https://github.com/FGrosse", - "role": "Author" - }, - { - "name": "All contributors", - "homepage": "https://github.com/FGrosse/PHPASN1/contributors" - } - ], - "description": "A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.", - "homepage": "https://github.com/FGrosse/PHPASN1", - "keywords": [ - "DER", - "asn.1", - "asn1", - "ber", - "binary", - "decoding", - "encoding", - "x.509", - "x.690", - "x509", - "x690" - ], - "support": { - "issues": "https://github.com/fgrosse/PHPASN1/issues", - "source": "https://github.com/fgrosse/PHPASN1/tree/v2.5.0" - }, - "abandoned": true, - "time": "2022-12-19T11:08:26+00:00" - }, - { - "name": "lastguest/murmurhash", - "version": "2.1.1", - "source": { - "type": "git", - "url": "https://github.com/lastguest/murmurhash-php.git", - "reference": "0150ba26fb7025d1f936983a167cdc74149f87c8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lastguest/murmurhash-php/zipball/0150ba26fb7025d1f936983a167cdc74149f87c8", - "reference": "0150ba26fb7025d1f936983a167cdc74149f87c8", - "shasum": "" - }, - "require": { - "php": "^7||^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7||^9" - }, - "type": "library", - "autoload": { - "psr-4": { - "lastguest\\": "src/lastguest/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Stefano Azzolini", - "email": "lastguest@gmail.com", - "homepage": "https://github.com/lastguest/murmurhash-php" - } - ], - "description": "MurmurHash3 Hash", - "homepage": "https://github.com/lastguest/murmurhash-php", - "keywords": [ - "hash", - "hashing", - "murmur" - ], - "support": { - "issues": "https://github.com/lastguest/murmurhash-php/issues", - "source": "https://github.com/lastguest/murmurhash-php/tree/2.1.1" - }, - "time": "2021-04-13T16:23:45+00:00" - }, - { - "name": "pleonasm/merkle-tree", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/pleonasm/merkle-tree.git", - "reference": "6abdf5aacd79b6d502f944c96edd1a896ef6039b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pleonasm/merkle-tree/zipball/6abdf5aacd79b6d502f944c96edd1a896ef6039b", - "reference": "6abdf5aacd79b6d502f944c96edd1a896ef6039b", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/php-invoker": "*", - "phpunit/phpunit": "^5.7", - "satooshi/php-coveralls": "*@dev", - "squizlabs/php_codesniffer": "*" - }, - "type": "library", - "autoload": { - "psr-0": { - "Pleo": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Matt Nagi", - "email": "matthew.nagi@base-2.net" - } - ], - "description": "An implementation of a Merkle Tree in PHP", - "support": { - "issues": "https://github.com/pleonasm/merkle-tree/issues", - "source": "https://github.com/pleonasm/merkle-tree/tree/master" - }, - "time": "2017-02-10T15:26:01+00:00" - }, - { - "name": "protonlabs/bitcoin", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/ProtonMail/bitcoin-php.git", - "reference": "4499c52069c6d6a4d3311213229a1af557eb26b9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ProtonMail/bitcoin-php/zipball/4499c52069c6d6a4d3311213229a1af557eb26b9", - "reference": "4499c52069c6d6a4d3311213229a1af557eb26b9", - "shasum": "" - }, - "require": { - "bitwasp/bech32": "^0.0.1", - "composer/semver": "^1.4.0|^3.2.0", - "lastguest/murmurhash": "^v2.0.0", - "php-64bit": ">=7.1", - "pleonasm/merkle-tree": "~1.0.0", - "protonlabs/buffertools": "^0.5.0", - "shanecurran/phpecc": "^0.0.1" - }, - "require-dev": { - "bitwasp/bitcoinconsensus": "v3.0.0", - "bitwasp/secp256k1-php": "^v0.2.0", - "ext-json": "*", - "nbobtc/bitcoind-php": "v2.0.2", - "phpunit/phpunit": "^8.0.0", - "squizlabs/php_codesniffer": "^3.0.0" - }, - "suggest": { - "ext-bitcoinconsensus": "The bitcoinconsensus library for safest possible script verification", - "ext-secp256k1": "The secp256k1 library for fast and safe elliptic curve operations" - }, - "type": "library", - "autoload": { - "files": [ - "src/Script/functions.php" - ], - "psr-4": { - "BitWasp\\Bitcoin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Unlicense" - ], - "authors": [ - { - "name": "Thomas Kerin", - "homepage": "https://thomaskerin.io", - "role": "Author" - } - ], - "description": "PHP Bitcoin library with functions for transactions, signatures, serialization, Random/Deterministic ECDSA keys, blocks, RPC bindings", - "homepage": "https://github.com/bit-wasp/bitcoin-php", - "support": { - "issues": "https://github.com/ProtonMail/bitcoin-php/issues", - "source": "https://github.com/ProtonMail/bitcoin-php/tree/v1.1.0" - }, - "time": "2025-05-22T08:01:04+00:00" - }, - { - "name": "protonlabs/buffertools", - "version": "v0.5.9", - "source": { - "type": "git", - "url": "https://github.com/ProtonMail/buffertools-php.git", - "reference": "cf0e260eabbc92ada92a1d958e19a22843e137bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ProtonMail/buffertools-php/zipball/cf0e260eabbc92ada92a1d958e19a22843e137bf", - "reference": "cf0e260eabbc92ada92a1d958e19a22843e137bf", - "shasum": "" - }, - "require": { - "php-64bit": ">=7.0.0" - }, - "replace": { - "bitwasp/buffertools": "^0.5.0" - }, - "require-dev": { - "phpstan/phpstan": "v0.9.x", - "phpunit/phpunit": "^6.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "BitWasp\\Buffertools\\": "src/Buffertools/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Thomas Kerin", - "homepage": "https://thomaskerin.io" - }, - { - "name": "Ruben de Vries", - "email": "ruben@rubensayshi.com" - } - ], - "description": "Toolbox for working with binary and hex data. Similar to NodeJS Buffer.", - "support": { - "source": "https://github.com/ProtonMail/buffertools-php/tree/v0.5.9" - }, - "time": "2025-06-17T10:03:56+00:00" - }, - { - "name": "shanecurran/phpecc", - "version": "v0.0.1", - "source": { - "type": "git", - "url": "https://github.com/shanecurran/phpecc.git", - "reference": "2f99b2c785e7bac48485b0da7cc1db7d9c0e5d87" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/shanecurran/phpecc/zipball/2f99b2c785e7bac48485b0da7cc1db7d9c0e5d87", - "reference": "2f99b2c785e7bac48485b0da7cc1db7d9c0e5d87", - "shasum": "" - }, - "require": { - "ext-gmp": "*", - "fgrosse/phpasn1": "^2.0", - "php": "^7.0||^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0||^8.0||^9.0", - "squizlabs/php_codesniffer": "^2.0", - "symfony/yaml": "^2.6|^3.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Mdanter\\Ecc\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matyas Danter", - "homepage": "http://matejdanter.com/", - "role": "Author" - }, - { - "name": "Thibaud Fabre", - "email": "thibaud@aztech.io", - "homepage": "http://aztech.io", - "role": "Maintainer" - }, - { - "name": "Thomas Kerin", - "email": "afk11@users.noreply.github.com", - "role": "Maintainer" - }, - { - "name": "Shane Curran", - "email": "shanecurran@users.noreply.github.com", - "role": "Maintainer" - } - ], - "description": "PHP Elliptic Curve Cryptography library", - "homepage": "https://github.com/shanecurran/phpecc", - "keywords": [ - "Diffie", - "ECDSA", - "Hellman", - "curve", - "ecdh", - "elliptic", - "nistp192", - "nistp224", - "nistp256", - "nistp384", - "nistp521", - "phpecc", - "secp256k1", - "secp256r1" - ], - "support": { - "source": "https://github.com/shanecurran/phpecc/tree/v0.0.1" - }, - "time": "2023-03-08T19:51:13+00:00" - }, { "name": "simplito/bigint-wrapper-php", "version": "1.0.0", @@ -651,16 +157,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v6.11.1", + "version": "v7.27.3", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "78e297a969049ca7cc370e80ff5e102921ef39a3" + "reference": "428bbd887c2e811686c9bfd7e0eda8f09cff6964" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/78e297a969049ca7cc370e80ff5e102921ef39a3", - "reference": "78e297a969049ca7cc370e80ff5e102921ef39a3", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/428bbd887c2e811686c9bfd7e0eda8f09cff6964", + "reference": "428bbd887c2e811686c9bfd7e0eda8f09cff6964", "shasum": "" }, "require": { @@ -668,29 +174,30 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0", - "jean85/pretty-package-versions": "^2.0.5", - "php": "^7.3 || ^8.0", - "phpunit/php-code-coverage": "^9.2.25", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-timer": "^5.0.3", - "phpunit/phpunit": "^9.6.4", - "sebastian/environment": "^5.1.5", - "symfony/console": "^5.4.28 || ^6.3.4 || ^7.0.0", - "symfony/process": "^5.4.28 || ^6.3.4 || ^7.0.0" + "fidry/cpu-core-counter": "^1.4.1", + "jean85/pretty-package-versions": "^2.1.1", + "php": "~8.4.0 || ~8.5.0 || ~8.6.0", + "phpunit/php-code-coverage": "^14.4.1", + "phpunit/php-file-iterator": "^7.0.2", + "phpunit/php-timer": "^9", + "phpunit/phpunit": "^13.4.3", + "sebastian/environment": "^9.3.3", + "symfony/console": "^7.4.20 || ^8.1.8", + "symfony/process": "^7.4.19 || ^8.1.7" }, "require-dev": { - "doctrine/coding-standard": "^12.0.0", + "doctrine/coding-standard": "^14.0.0", + "ext-pcntl": "*", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.27.6", - "squizlabs/php_codesniffer": "^3.7.2", - "symfony/filesystem": "^5.4.25 || ^6.3.1 || ^7.0.0", - "vimeo/psalm": "^5.7.7" + "phpstan/phpstan": "^2.3.1", + "phpstan/phpstan-deprecation-rules": "^2.0.5", + "phpstan/phpstan-phpunit": "^2.1.1", + "phpstan/phpstan-strict-rules": "^2.1.0", + "symfony/filesystem": "^7.4.18 || ^8.1.6" }, "bin": [ "bin/paratest", - "bin/paratest.bat", "bin/paratest_for_phpstorm" ], "type": "library", @@ -727,7 +234,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.11.1" + "source": "https://github.com/paratestphp/paratest/tree/v7.27.3" }, "funding": [ { @@ -739,76 +246,7 @@ "type": "paypal" } ], - "time": "2024-03-13T06:54:29+00:00" - }, - { - "name": "carbonphp/carbon-doctrine-types", - "version": "3.2.0", - "source": { - "type": "git", - "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", - "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "conflict": { - "doctrine/dbal": "<4.0.0 || >=5.0.0" - }, - "require-dev": { - "doctrine/dbal": "^4.0.0", - "nesbot/carbon": "^2.71.0 || ^3.0.0", - "phpunit/phpunit": "^10.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "KyleKatarn", - "email": "kylekatarnls@gmail.com" - } - ], - "description": "Types to use Carbon in Doctrine", - "keywords": [ - "carbon", - "date", - "datetime", - "doctrine", - "time" - ], - "support": { - "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" - }, - "funding": [ - { - "url": "https://github.com/kylekatarnls", - "type": "github" - }, - { - "url": "https://opencollective.com/Carbon", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", - "type": "tidelift" - } - ], - "time": "2024-02-09T16:56:22+00:00" + "time": "2026-10-21T05:29:09+00:00" }, { "name": "clue/ndjson-react", @@ -876,28 +314,29 @@ }, { "name": "composer/pcre", - "version": "3.3.2", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + "reference": "d5a341b3fb61f3001970940afb1d332968a183ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", - "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "url": "https://api.github.com/repos/composer/pcre/zipball/d5a341b3fb61f3001970940afb1d332968a183ed", + "reference": "d5a341b3fb61f3001970940afb1d332968a183ed", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, "conflict": { - "phpstan/phpstan": "<1.11.10" + "phpstan/phpstan": "<2.2.2" }, "require-dev": { - "phpstan/phpstan": "^1.12 || ^2", - "phpstan/phpstan-strict-rules": "^1 || ^2", - "phpunit/phpunit": "^8 || ^9" + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^9" }, "type": "library", "extra": { @@ -935,7 +374,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.2" + "source": "https://github.com/composer/pcre/tree/3.4.0" }, "funding": [ { @@ -945,13 +384,86 @@ { "url": "https://github.com/composer", "type": "github" + } + ], + "time": "2026-06-07T11:47:49+00:00" + }, + { + "name": "composer/semver", + "version": "3.5.1", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "528948210cc46f967a4b98e83b19e76f2b504993" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/528948210cc46f967a4b98e83b19e76f2b504993", + "reference": "528948210cc46f967a4b98e83b19e76f2b504993", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" }, { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Version comparison library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.5.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" } ], - "time": "2024-11-12T16:29:46+00:00" + "time": "2026-10-05T13:12:12+00:00" }, { "name": "composer/xdebug-handler", @@ -1021,174 +533,99 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.5", + "version": "1.1.6", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" + "reference": "d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", - "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca", + "reference": "d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "conflict": { - "phpunit/phpunit": "<=7.5 || >=13" + "phpunit/phpunit": "<=7.5 || >=14" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12 || ^13", - "phpstan/phpstan": "1.4.10 || 2.1.11", + "doctrine/coding-standard": "^9 || ^12 || ^14", + "phpstan/phpstan": "1.4.10 || 2.1.30", "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", - "psr/log": "^1 || ^2 || ^3" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.5" - }, - "time": "2025-04-07T20:06:18+00:00" - }, - { - "name": "doctrine/inflector", - "version": "2.0.10", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", - "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12.4 || ^13.0", + "psr/log": "^1 || ^2 || ^3" }, - "require-dev": { - "doctrine/coding-standard": "^11.0", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25 || ^5.4" + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", - "homepage": "https://www.doctrine-project.org/projects/inflector.html", - "keywords": [ - "inflection", - "inflector", - "lowercase", - "manipulation", - "php", - "plural", - "singular", - "strings", - "uppercase", - "words" - ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", "support": { - "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.10" + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.6" }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", - "type": "tidelift" - } - ], - "time": "2024-02-18T20:23:39+00:00" + "time": "2026-02-07T07:09:04+00:00" }, { - "name": "doctrine/instantiator", - "version": "2.0.0", + "name": "ergebnis/agent-detector", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + "url": "https://github.com/ergebnis/agent-detector.git", + "reference": "0cd815cec1207873c37624d33f0f2853523152f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "url": "https://api.github.com/repos/ergebnis/agent-detector/zipball/0cd815cec1207873c37624d33f0f2853523152f3", + "reference": "0cd815cec1207873c37624d33f0f2853523152f3", "shasum": "" }, "require": { - "php": "^8.1" + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0" }, "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" + "ergebnis/composer-normalize": "^2.54.0", + "ergebnis/license": "^2.8.0", + "ergebnis/php-cs-fixer-config": "^6.60.2", + "ergebnis/phpstan-rules": "^2.14.0", + "ergebnis/phpunit-slow-test-detector": "^2.26.0", + "ergebnis/rector-rules": "^1.18.5", + "fakerphp/faker": "^1.24.1", + "infection/infection": "^0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.2.14", + "phpstan/phpstan-deprecation-rules": "^2.0.5", + "phpstan/phpstan-phpunit": "^2.1.1", + "phpstan/phpstan-strict-rules": "^2.1.0", + "phpunit/phpunit": "^9.6.34", + "rector/rector": "^2.7.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.3-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "Ergebnis\\AgentDetector\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1197,36 +634,19 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], + "description": "Provides a detector for detecting the presence of an agent.", + "homepage": "https://github.com/ergebnis/agent-detector", "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + "issues": "https://github.com/ergebnis/agent-detector/issues", + "security": "https://github.com/ergebnis/agent-detector/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/agent-detector" }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" + "time": "2026-10-15T11:13:32+00:00" }, { "name": "evenement/evenement", @@ -1277,30 +697,31 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.2.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "8520451a140d3f46ac33042715115e290cf5785f" + "reference": "d384a7d0d6e67aa497327260ca95023e92dc2032" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", - "reference": "8520451a140d3f46ac33042715115e290cf5785f", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/d384a7d0d6e67aa497327260ca95023e92dc2032", + "reference": "d384a7d0d6e67aa497327260ca95023e92dc2032", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "fidry/makefile": "^0.2.0", + "fidry/makefile": "^0.2.0 || ^1.1.2", "fidry/php-cs-fixer-config": "^1.1.2", "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "symfony/polyfill-mbstring": "^1.33", "webmozarts/strict-phpunit": "^7.5" }, "type": "library", @@ -1326,7 +747,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.4.1" }, "funding": [ { @@ -1334,20 +755,20 @@ "type": "github" } ], - "time": "2024-08-06T10:04:20+00:00" + "time": "2026-09-29T22:11:39+00:00" }, { "name": "filp/whoops", - "version": "2.18.3", + "version": "2.18.7", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "59a123a3d459c5a23055802237cb317f609867e5" + "reference": "50670ba239926c50f2073e868f6672f775cd57ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/59a123a3d459c5a23055802237cb317f609867e5", - "reference": "59a123a3d459c5a23055802237cb317f609867e5", + "url": "https://api.github.com/repos/filp/whoops/zipball/50670ba239926c50f2073e868f6672f775cd57ec", + "reference": "50670ba239926c50f2073e868f6672f775cd57ec", "shasum": "" }, "require": { @@ -1356,8 +777,8 @@ }, "require-dev": { "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^4.0 || ^5.0" + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3 || ^10.5.58", + "symfony/var-dumper": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -1397,7 +818,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.18.3" + "source": "https://github.com/filp/whoops/tree/2.18.7" }, "funding": [ { @@ -1405,379 +826,78 @@ "type": "github" } ], - "time": "2025-06-16T00:02:10+00:00" + "time": "2026-10-18T13:17:38+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.76.0", + "version": "v3.95.27", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "0e3c484cef0ae9314b0f85986a36296087432c40" + "reference": "1d0c68ee5f37446d8ad5970b82384cd1bb0a3317" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/0e3c484cef0ae9314b0f85986a36296087432c40", - "reference": "0e3c484cef0ae9314b0f85986a36296087432c40", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/1d0c68ee5f37446d8ad5970b82384cd1bb0a3317", + "reference": "1d0c68ee5f37446d8ad5970b82384cd1bb0a3317", "shasum": "" }, "require": { - "clue/ndjson-react": "^1.0", + "clue/ndjson-react": "^1.3", "composer/semver": "^3.4", "composer/xdebug-handler": "^3.0.5", + "ergebnis/agent-detector": "^1.2", "ext-filter": "*", "ext-hash": "*", "ext-json": "*", "ext-tokenizer": "*", - "fidry/cpu-core-counter": "^1.2", + "fidry/cpu-core-counter": "^1.3", "php": "^7.4 || ^8.0", - "react/child-process": "^0.6.6", - "react/event-loop": "^1.0", - "react/promise": "^2.11 || ^3.0", - "react/socket": "^1.0", - "react/stream": "^1.0", - "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0", - "symfony/console": "^5.4.45 || ^6.4.13 || ^7.0", - "symfony/event-dispatcher": "^5.4.45 || ^6.4.13 || ^7.0", - "symfony/filesystem": "^5.4.45 || ^6.4.13 || ^7.0", - "symfony/finder": "^5.4.45 || ^6.4.17 || ^7.0", - "symfony/options-resolver": "^5.4.45 || ^6.4.16 || ^7.0", - "symfony/polyfill-mbstring": "^1.32", - "symfony/polyfill-php80": "^1.32", - "symfony/polyfill-php81": "^1.32", - "symfony/process": "^5.4.47 || ^6.4.20 || ^7.2", - "symfony/stopwatch": "^5.4.45 || ^6.4.19 || ^7.0" - }, - "require-dev": { - "facile-it/paraunit": "^1.3.1 || ^2.6", - "infection/infection": "^0.29.14", - "justinrainbow/json-schema": "^5.3 || ^6.4", - "keradus/cli-executor": "^2.2", - "mikey179/vfsstream": "^1.6.12", - "php-coveralls/php-coveralls": "^2.8", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", - "phpunit/phpunit": "^9.6.23 || ^10.5.47 || ^11.5.25", - "symfony/polyfill-php84": "^1.32", - "symfony/var-dumper": "^5.4.48 || ^6.4.23 || ^7.3.1", - "symfony/yaml": "^5.4.45 || ^6.4.23 || ^7.3.1" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "exclude-from-classmap": [ - "src/Fixer/Internal/*" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "keywords": [ - "Static code analysis", - "fixer", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.76.0" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2025-06-30T14:15:06+00:00" - }, - { - "name": "graham-campbell/analyzer", - "version": "v3.1.1", - "source": { - "type": "git", - "url": "https://github.com/GrahamCampbell/Analyzer.git", - "reference": "0a1d452c1b41f342c7132188f0c25ca26e0be6d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Analyzer/zipball/0a1d452c1b41f342c7132188f0c25ca26e0be6d8", - "reference": "0a1d452c1b41f342c7132188f0c25ca26e0be6d8", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.13", - "php": "^7.4.15 || ^8.0.2", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/reflection-docblock": "^5.3", - "phpdocumentor/type-resolver": "^1.6" - }, - "require-dev": { - "phpunit/phpunit": "^9.5.21" - }, - "suggest": { - "phpunit/phpunit": "Required to use the analysis trait." - }, - "type": "library", - "autoload": { - "psr-4": { - "GrahamCampbell\\Analyzer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - } - ], - "description": "Checks if referenced classes really exist.", - "keywords": [ - "Graham Campbell", - "GrahamCampbell", - "analysis", - "analyzer", - "classes", - "testing" - ], - "support": { - "issues": "https://github.com/GrahamCampbell/Analyzer/issues", - "source": "https://github.com/GrahamCampbell/Analyzer/tree/v3.1.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/graham-campbell/analyzer", - "type": "tidelift" - } - ], - "time": "2023-02-25T14:28:39+00:00" - }, - { - "name": "illuminate/collections", - "version": "v8.83.27", - "source": { - "type": "git", - "url": "https://github.com/illuminate/collections.git", - "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/705a4e1ef93cd492c45b9b3e7911cccc990a07f4", - "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4", - "shasum": "" - }, - "require": { - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "php": "^7.3|^8.0" - }, - "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.4)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } - }, - "autoload": { - "files": [ - "helpers.php" - ], - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Collections package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2022-06-23T15:29:49+00:00" - }, - { - "name": "illuminate/contracts", - "version": "v8.83.27", - "source": { - "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", - "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Contracts\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Contracts package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2022-01-13T14:47:47+00:00" - }, - { - "name": "illuminate/macroable", - "version": "v8.83.27", - "source": { - "type": "git", - "url": "https://github.com/illuminate/macroable.git", - "reference": "aed81891a6e046fdee72edd497f822190f61c162" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", - "reference": "aed81891a6e046fdee72edd497f822190f61c162", - "shasum": "" - }, - "require": { - "php": "^7.3|^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Macroable package.", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "time": "2021-11-16T13:57:03+00:00" - }, - { - "name": "illuminate/support", - "version": "v8.83.27", - "source": { - "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "1c79242468d3bbd9a0f7477df34f9647dde2a09b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/1c79242468d3bbd9a0f7477df34f9647dde2a09b", - "reference": "1c79242468d3bbd9a0f7477df34f9647dde2a09b", - "shasum": "" - }, - "require": { - "doctrine/inflector": "^1.4|^2.0", - "ext-json": "*", - "ext-mbstring": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "nesbot/carbon": "^2.53.1", - "php": "^7.3|^8.0", - "voku/portable-ascii": "^1.6.1" + "react/child-process": "^0.6.6", + "react/event-loop": "^1.5", + "react/socket": "^1.16", + "react/stream": "^1.4", + "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0 || ^8.0 || ^9.0", + "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.37", + "symfony/polyfill-php80": "^1.37", + "symfony/polyfill-php81": "^1.37", + "symfony/polyfill-php84": "^1.37", + "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2 || ^8.0", + "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0" }, - "conflict": { - "tightenco/collect": "<5.5.33" + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.11.0", + "infection/infection": "^0.32.7", + "justinrainbow/json-schema": "^6.12.0", + "keradus/cli-executor": "^2.3", + "php-coveralls/php-coveralls": "^2.9.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.8", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.8", + "phpunit/phpunit": "^9.6.36 || ^10.5.64 || ^11.5.56 || ^12.5.35 || ^13.3.3", + "symfony/polyfill-php85": "^1.41", + "symfony/var-dumper": "^5.4.48 || ^6.4.45 || ^7.4.18 || ^8.1.7", + "symfony/yaml": "^5.4.53 || ^6.4.45 || ^7.4.18 || ^8.1.6" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", - "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", - "symfony/process": "Required to use the composer class (^5.4).", - "symfony/var-dumper": "Required to use the dd function (^5.4).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", "autoload": { - "files": [ - "helpers.php" - ], "psr-4": { - "Illuminate\\Support\\": "" - } + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/**/Internal/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1785,17 +905,32 @@ ], "authors": [ { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" } ], - "description": "The Illuminate Support package.", - "homepage": "https://laravel.com", + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.27" }, - "time": "2022-09-21T21:30:03+00:00" + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2026-09-22T09:54:55+00:00" }, { "name": "jean85/pretty-package-versions", @@ -1859,20 +994,20 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.1", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.0" }, "conflict": { "doctrine/collections": "<1.6.8", @@ -1907,222 +1042,215 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0" }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" + "url": "https://github.com/mnapoli", + "type": "github" } ], - "time": "2025-04-29T12:36:36+00:00" + "time": "2026-08-11T10:17:44+00:00" }, { - "name": "nesbot/carbon", - "version": "2.73.0", + "name": "nikic/php-parser", + "version": "v5.9.0", "source": { "type": "git", - "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "9228ce90e1035ff2f0db84b40ec2e023ed802075" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/9228ce90e1035ff2f0db84b40ec2e023ed802075", - "reference": "9228ce90e1035ff2f0db84b40ec2e023ed802075", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9e33da9553fe7786f0962b35f4e4ecf01be89def", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def", "shasum": "" }, "require": { - "carbonphp/carbon-doctrine-types": "*", "ext-json": "*", - "php": "^7.1.8 || ^8.0", - "psr/clock": "^1.0", - "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" - }, - "provide": { - "psr/clock-implementation": "1.0" + "ext-tokenizer": "*", + "php": ">=7.4" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", - "doctrine/orm": "^2.7 || ^3.0", - "friendsofphp/php-cs-fixer": "^3.0", - "kylekatarnls/multi-tester": "^2.0", - "ondrejmirtes/better-reflection": "<6", - "phpmd/phpmd": "^2.9", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.99 || ^1.7.14", - "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", - "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", - "squizlabs/php_codesniffer": "^3.4" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" }, "bin": [ - "bin/carbon" + "bin/php-parse" ], "type": "library", "extra": { - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - }, - "phpstan": { - "includes": [ - "extension.neon" - ] - }, "branch-alias": { - "dev-2.x": "2.x-dev", - "dev-master": "3.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "Carbon\\": "src/Carbon/" + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "https://markido.com" - }, - { - "name": "kylekatarnls", - "homepage": "https://github.com/kylekatarnls" + "name": "Nikita Popov" } ], - "description": "An API extension for DateTime that supports 281 different languages.", - "homepage": "https://carbon.nesbot.com", + "description": "A PHP parser written in PHP", "keywords": [ - "date", - "datetime", - "time" + "parser", + "php" ], "support": { - "docs": "https://carbon.nesbot.com/docs", - "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon" + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.9.0" }, - "funding": [ - { - "url": "https://github.com/sponsors/kylekatarnls", - "type": "github" - }, - { - "url": "https://opencollective.com/Carbon#sponsor", - "type": "opencollective" - }, - { - "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", - "type": "tidelift" - } - ], - "time": "2025-01-08T20:10:23+00:00" + "time": "2026-09-13T18:51:52+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.19.4", + "name": "nunomaduro/collision", + "version": "v8.9.5", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + "url": "https://github.com/nunomaduro/collision.git", + "reference": "fb53eacd509a1d303858e2d20cfebf2d630254ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/fb53eacd509a1d303858e2d20cfebf2d630254ec", + "reference": "fb53eacd509a1d303858e2d20cfebf2d630254ec", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=7.1" + "filp/whoops": "^2.18.4", + "nunomaduro/termwind": "^2.4.0", + "php": "^8.2.0", + "symfony/console": "^7.4.14 || ^8.1.1" + }, + "conflict": { + "laravel/framework": "<11.48.0 || >=14.0.0", + "phpunit/phpunit": "<11.5.50 || >=14.0.0" }, "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "brianium/paratest": "^7.8.5", + "larastan/larastan": "^3.10.0", + "laravel/framework": "^11.48.0 || ^12.56.0 || ^13.20.0", + "laravel/pint": "^1.29.3", + "orchestra/testbench-core": "^9.12.0 || ^10.12.1 || ^11.3.5", + "pestphp/pest": "^3.8.5 || ^4.7.5 || ^5.0.0", + "sebastian/environment": "^7.2.1 || ^8.1.2 || ^9.3.2" }, - "bin": [ - "bin/php-parse" - ], "type": "library", "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + }, "branch-alias": { - "dev-master": "4.9-dev" + "dev-8.x": "8.x-dev" } }, "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], "psr-4": { - "PhpParser\\": "lib/PhpParser" + "NunoMaduro\\Collision\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nikita Popov" + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" } ], - "description": "A PHP parser written in PHP", + "description": "Cli error handling for console/command-line PHP applications.", "keywords": [ - "parser", - "php" + "artisan", + "cli", + "command-line", + "console", + "dev", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" ], "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" }, - "time": "2024-09-29T15:01:53+00:00" + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2026-07-15T19:09:14+00:00" }, { - "name": "nunomaduro/collision", - "version": "v6.4.0", + "name": "nunomaduro/termwind", + "version": "v2.4.0", "source": { "type": "git", - "url": "https://github.com/nunomaduro/collision.git", - "reference": "f05978827b9343cba381ca05b8c7deee346b6015" + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/f05978827b9343cba381ca05b8c7deee346b6015", - "reference": "f05978827b9343cba381ca05b8c7deee346b6015", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/712a31b768f5daea284c2169a7d227031001b9a8", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8", "shasum": "" }, "require": { - "filp/whoops": "^2.14.5", - "php": "^8.0.0", - "symfony/console": "^6.0.2" + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.4.4 || ^8.0.4" }, "require-dev": { - "brianium/paratest": "^6.4.1", - "laravel/framework": "^9.26.1", - "laravel/pint": "^1.1.1", - "nunomaduro/larastan": "^1.0.3", - "nunomaduro/mock-final-classes": "^1.1.0", - "orchestra/testbench": "^7.7", - "phpunit/phpunit": "^9.5.23", - "spatie/ignition": "^1.4.1" + "illuminate/console": "^11.47.0", + "laravel/pint": "^1.27.1", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.3.2", + "phpstan/phpstan": "^1.12.32", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.3.5 || ^8.0.4", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" }, "type": "library", "extra": { "laravel": { "providers": [ - "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + "Termwind\\Laravel\\TermwindServiceProvider" ] }, "branch-alias": { - "dev-develop": "6.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { + "files": [ + "src/Functions.php" + ], "psr-4": { - "NunoMaduro\\Collision\\": "src/" + "Termwind\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2135,22 +1263,18 @@ "email": "enunomaduro@gmail.com" } ], - "description": "Cli error handling for console/command-line PHP applications.", + "description": "It's like Tailwind CSS, but for the console.", "keywords": [ - "artisan", "cli", - "command-line", "console", - "error", - "handling", - "laravel", - "laravel-zero", + "css", + "package", "php", - "symfony" + "style" ], "support": { - "issues": "https://github.com/nunomaduro/collision/issues", - "source": "https://github.com/nunomaduro/collision" + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.4.0" }, "funding": [ { @@ -2162,38 +1286,52 @@ "type": "github" }, { - "url": "https://www.patreon.com/nunomaduro", - "type": "patreon" + "url": "https://github.com/xiCO2k", + "type": "github" } ], - "time": "2023-01-03T12:54:54+00:00" + "time": "2026-02-16T23:10:27+00:00" }, { "name": "pestphp/pest", - "version": "v1.23.1", + "version": "v5.3.3", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "5c56ad8772b89611c72a07e23f6e30aa29dc677a" + "reference": "c947def97e1d56a3f3f9a3ced04c6af74b7e3caf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/5c56ad8772b89611c72a07e23f6e30aa29dc677a", - "reference": "5c56ad8772b89611c72a07e23f6e30aa29dc677a", + "url": "https://api.github.com/repos/pestphp/pest/zipball/c947def97e1d56a3f3f9a3ced04c6af74b7e3caf", + "reference": "c947def97e1d56a3f3f9a3ced04c6af74b7e3caf", "shasum": "" }, "require": { - "nunomaduro/collision": "^5.11.0|^6.4.0", - "pestphp/pest-plugin": "^1.1.0", - "php": "^7.3 || ^8.0", - "phpunit/phpunit": "^9.6.10" + "brianium/paratest": "^7.26.1", + "nunomaduro/collision": "^8.9.5", + "nunomaduro/termwind": "^2.4.0", + "pestphp/pest-plugin": "^5.0.0", + "pestphp/pest-plugin-arch": "^5.0.0", + "pestphp/pest-plugin-mutate": "^5.0.2", + "pestphp/pest-plugin-profanity": "^5.0.1", + "php": "^8.4", + "phpunit/phpunit": "^13.4.3", + "symfony/process": "^8.1.7" + }, + "conflict": { + "filp/whoops": "<2.18.3", + "laravel/boost": "<2.6.0", + "phpunit/phpunit": ">13.4.3", + "sebastian/exporter": "<7.0.0", + "webmozart/assert": "<1.11.0" }, "require-dev": { - "illuminate/console": "^8.83.27", - "illuminate/support": "^8.83.27", - "laravel/dusk": "^6.25.2", - "pestphp/pest-dev-tools": "^1.0.0", - "pestphp/pest-plugin-parallel": "^1.2.1" + "pestphp/pest-dev-tools": "^5.0.0", + "pestphp/pest-plugin-browser": "^5.1.2", + "pestphp/pest-plugin-phpstan": "^5.2.2", + "pestphp/pest-plugin-rector": "^5.0.6", + "pestphp/pest-plugin-type-coverage": "^5.0.3", + "psy/psysh": "^0.12.24" }, "bin": [ "bin/pest" @@ -2202,19 +1340,32 @@ "extra": { "pest": { "plugins": [ + "Pest\\Mutate\\Plugins\\Mutate", + "Pest\\Plugins\\Configuration", + "Pest\\Plugins\\Bail", + "Pest\\Plugins\\Cache", "Pest\\Plugins\\Coverage", "Pest\\Plugins\\Init", + "Pest\\Plugins\\Environment", + "Pest\\Plugins\\Help", + "Pest\\Plugins\\Memory", + "Pest\\Plugins\\Only", + "Pest\\Plugins\\Printer", + "Pest\\Plugins\\ProcessIsolation", + "Pest\\Plugins\\Profile", + "Pest\\Plugins\\Retry", + "Pest\\Plugins\\Snapshot", + "Pest\\Plugins\\Verbose", "Pest\\Plugins\\Version", - "Pest\\Plugins\\Environment" + "Pest\\Plugins\\Shard", + "Pest\\Plugins\\Tia", + "Pest\\Plugins\\Parallel" ] }, - "laravel": { - "providers": [ - "Pest\\Laravel\\PestServiceProvider" + "phpstan": { + "includes": [ + "extension.neon" ] - }, - "branch-alias": { - "dev-1.x": "1.x-dev" } }, "autoload": { @@ -2236,7 +1387,7 @@ "email": "enunomaduro@gmail.com" } ], - "description": "An elegant PHP Testing Framework.", + "description": "The elegant PHP Testing Framework.", "keywords": [ "framework", "pest", @@ -2247,7 +1398,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v1.23.1" + "source": "https://github.com/pestphp/pest/tree/v5.3.3" }, "funding": [ { @@ -2259,40 +1410,38 @@ "type": "github" } ], - "time": "2023-07-12T19:42:47+00:00" + "time": "2026-10-18T11:51:10+00:00" }, { "name": "pestphp/pest-plugin", - "version": "v1.1.0", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest-plugin.git", - "reference": "606c5f79c6a339b49838ffbee0151ca519efe378" + "reference": "87283f41aafa2561b7618be53eab00f2d06f4140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/606c5f79c6a339b49838ffbee0151ca519efe378", - "reference": "606c5f79c6a339b49838ffbee0151ca519efe378", + "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/87283f41aafa2561b7618be53eab00f2d06f4140", + "reference": "87283f41aafa2561b7618be53eab00f2d06f4140", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1.0 || ^2.0.0", - "php": "^7.3 || ^8.0" + "composer-plugin-api": "^2.0.0", + "composer-runtime-api": "^2.2.2", + "php": "^8.4" }, "conflict": { - "pestphp/pest": "<1.0" + "pestphp/pest": "<5.0.0" }, "require-dev": { - "composer/composer": "^2.4.2", - "pestphp/pest": "^1.22.1", - "pestphp/pest-dev-tools": "^1.0.0" + "composer/composer": "^2.10.2", + "pestphp/pest": "^5.0.0", + "pestphp/pest-dev-tools": "^5.0.0" }, "type": "composer-plugin", "extra": { - "class": "Pest\\Plugin\\Manager", - "branch-alias": { - "dev-master": "1.x-dev" - } + "class": "Pest\\Plugin\\Manager" }, "autoload": { "psr-4": { @@ -2315,7 +1464,7 @@ "unit" ], "support": { - "source": "https://github.com/pestphp/pest-plugin/tree/v1.1.0" + "source": "https://github.com/pestphp/pest-plugin/tree/v5.0.0" }, "funding": [ { @@ -2331,66 +1480,59 @@ "type": "patreon" } ], - "time": "2022-09-18T13:18:17+00:00" + "time": "2026-07-18T17:10:45+00:00" }, { - "name": "pestphp/pest-plugin-parallel", - "version": "v1.2.1", + "name": "pestphp/pest-plugin-arch", + "version": "v5.0.0", "source": { "type": "git", - "url": "https://github.com/pestphp/pest-plugin-parallel.git", - "reference": "842592eba2439ba6477f6d6c7ee4a4e7bccdcd10" + "url": "https://github.com/pestphp/pest-plugin-arch.git", + "reference": "244465d5dc9ea9fb5ac5c9badb7eb47d1594e4c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest-plugin-parallel/zipball/842592eba2439ba6477f6d6c7ee4a4e7bccdcd10", - "reference": "842592eba2439ba6477f6d6c7ee4a4e7bccdcd10", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/244465d5dc9ea9fb5ac5c9badb7eb47d1594e4c1", + "reference": "244465d5dc9ea9fb5ac5c9badb7eb47d1594e4c1", "shasum": "" }, "require": { - "brianium/paratest": "^6.8.1", - "pestphp/pest-plugin": "^1.1.0", - "php": "^7.3 || ^8.0" + "pestphp/pest-plugin": "^5.0.0", + "php": "^8.4", + "ta-tikoma/phpunit-architecture-test": "^0.8.7" }, "conflict": { - "laravel/framework": "<8.55", - "nunomaduro/collision": "<5.8", - "pestphp/pest": "<1.16" + "pestphp/pest": "<5.0.0" }, "require-dev": { - "pestphp/pest": "^1.22.3", - "pestphp/pest-dev-tools": "^1.0.0" + "pestphp/pest": "^5.0.0", + "pestphp/pest-dev-tools": "^5.0.0" }, "type": "library", "extra": { "pest": { "plugins": [ - "Pest\\Parallel\\Plugin" + "Pest\\Arch\\Plugin" ] } }, "autoload": { "files": [ - "src/Autoload.php", - "build/RunnerWorker.php", - "build/BaseRunner.php" + "src/Autoload.php" ], "psr-4": { - "Pest\\Parallel\\": "src/" - }, - "exclude-from-classmap": [ - "ParaTest\\Runners\\PHPUnit\\Worker\\RunnerWorker", - "ParaTest\\Runners\\PHPUnit\\BaseRunner" - ] + "Pest\\Arch\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "The Pest Parallel Plugin", + "description": "The Arch plugin for Pest PHP.", "keywords": [ + "arch", + "architecture", "framework", - "parallel", "pest", "php", "plugin", @@ -2399,39 +1541,159 @@ "unit" ], "support": { - "source": "https://github.com/pestphp/pest-plugin-parallel/tree/v1.2.1" + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v5.0.0" }, "funding": [ { - "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "url": "https://www.paypal.com/paypalme/enunomaduro", "type": "custom" }, - { - "url": "https://github.com/lukeraymonddowning", - "type": "github" - }, { "url": "https://github.com/nunomaduro", "type": "github" - }, + } + ], + "time": "2026-07-21T07:48:55+00:00" + }, + { + "name": "pestphp/pest-plugin-mutate", + "version": "v5.0.2", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-mutate.git", + "reference": "d0c87110416b699413cc073b8dcc92e440d81931" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-mutate/zipball/d0c87110416b699413cc073b8dcc92e440d81931", + "reference": "d0c87110416b699413cc073b8dcc92e440d81931", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.8.0", + "pestphp/pest-plugin": "^5.0.0", + "php": "^8.4", + "phpunit/php-code-coverage": "^14.3.0", + "psr/simple-cache": "^3.0.0" + }, + "conflict": { + "pestphp/pest": "<5.0.0" + }, + "require-dev": { + "pestphp/pest": "^5.0.4", + "pestphp/pest-dev-tools": "^5.0.0", + "pestphp/pest-plugin-type-coverage": "^5.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Pest\\Mutate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "url": "https://github.com/octoper", - "type": "github" + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" }, { - "url": "https://github.com/olivernybroe", - "type": "github" + "name": "Sandro Gehri", + "email": "sandrogehri@gmail.com" + } + ], + "description": "Mutates your code to find untested cases", + "keywords": [ + "framework", + "mutate", + "mutation", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-mutate/tree/v5.0.2" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" }, { - "url": "https://github.com/owenvoke", + "url": "https://github.com/gehrisandro", "type": "github" }, { - "url": "https://www.patreon.com/nunomaduro", - "type": "patreon" + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2026-08-10T11:01:27+00:00" + }, + { + "name": "pestphp/pest-plugin-profanity", + "version": "v5.0.1", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-profanity.git", + "reference": "2b5fc73ce561b835ba5bf9596c97a84333af2eb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-profanity/zipball/2b5fc73ce561b835ba5bf9596c97a84333af2eb8", + "reference": "2b5fc73ce561b835ba5bf9596c97a84333af2eb8", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^5.0.0", + "php": "^8.4" + }, + "conflict": { + "pestphp/pest": "<5.0.0", + "phpunit/phpunit": "<13.4.1" + }, + "require-dev": { + "faissaloux/pest-plugin-inside": "^1.11", + "pestphp/pest": "^5.0.0", + "pestphp/pest-dev-tools": "^5.0.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Profanity\\Plugin" + ] + } + }, + "autoload": { + "psr-4": { + "Pest\\Profanity\\": "src/" } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest Profanity Plugin", + "keywords": [ + "framework", + "pest", + "php", + "plugin", + "profanity", + "test", + "testing", + "unit" ], - "time": "2023-02-03T13:01:17+00:00" + "support": { + "source": "https://github.com/pestphp/pest-plugin-profanity/tree/v5.0.1" + }, + "time": "2026-10-07T19:41:52+00:00" }, { "name": "phar-io/manifest", @@ -2553,20 +1815,25 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "reference": "ee15a5a2022c8383906b225055e9496a6a5e6e3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/ee15a5a2022c8383906b225055e9496a6a5e6e3b", + "reference": "ee15a5a2022c8383906b225055e9496a6a5e6e3b", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -2590,7 +1857,7 @@ } ], "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "homepage": "https://www.phpdoc.org", "keywords": [ "FQSEN", "phpDocumentor", @@ -2600,22 +1867,22 @@ ], "support": { "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.2.1" }, - "time": "2020-06-27T09:03:43+00:00" + "time": "2025-11-10T21:21:55+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.2", + "version": "6.0.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" + "reference": "7bae67520aa9f5ecc506d646810bd40d9da54582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", - "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/7bae67520aa9f5ecc506d646810bd40d9da54582", + "reference": "7bae67520aa9f5ecc506d646810bd40d9da54582", "shasum": "" }, "require": { @@ -2623,9 +1890,9 @@ "ext-filter": "*", "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7|^2.0", - "webmozart/assert": "^1.9.1" + "phpdocumentor/type-resolver": "^2.0", + "phpstan/phpdoc-parser": "^2.0", + "webmozart/assert": "^1.9.1 || ^2" }, "require-dev": { "mockery/mockery": "~1.3.5 || ~1.6.0", @@ -2634,7 +1901,8 @@ "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "psalm/phar": "^5.26" + "psalm/phar": "^5.26", + "shipmonk/dead-code-detector": "^0.5.1" }, "type": "library", "extra": { @@ -2664,44 +1932,44 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/6.0.3" }, - "time": "2025-04-13T19:20:35+00:00" + "time": "2026-03-18T20:49:53+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.10.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" + "reference": "dbe2133bb23e2e33a6834f4ed417f24a1b167769" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dbe2133bb23e2e33a6834f4ed417f24a1b167769", + "reference": "dbe2133bb23e2e33a6834f4ed417f24a1b167769", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.18|^2.0" + "phpstan/phpdoc-parser": "^2.0" }, "require-dev": { "ext-tokenizer": "*", "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" + "psalm/phar": "^4" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-1.x": "1.x-dev", + "dev-2.x": "2.x-dev" } }, "autoload": { @@ -2722,22 +1990,22 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/2.1.0" }, - "time": "2024-11-09T15:12:26+00:00" + "time": "2026-09-27T19:32:54+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "2.1.0", + "version": "2.3.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68" + "reference": "1427af4647235b4a73b13940b1f1258d3584f36e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", - "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1427af4647235b4a73b13940b1f1258d3584f36e", + "reference": "1427af4647235b4a73b13940b1f1258d3584f36e", "shasum": "" }, "require": { @@ -2769,41 +2037,41 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.1.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.6" }, - "time": "2025-02-19T13:28:12+00:00" + "time": "2026-09-27T20:07:45+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "14.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "f1e54f06b6b4cea73cd6104ba3c0cfa0efa6d73f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1e54f06b6b4cea73cd6104ba3c0cfa0efa6d73f", + "reference": "f1e54f06b6b4cea73cd6104ba3c0cfa0efa6d73f", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", + "ext-mbstring": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", - "theseer/tokenizer": "^1.2.3" + "nikic/php-parser": "^5.9.0", + "php": ">=8.4", + "phpunit/php-text-template": "^6.0.1", + "sebastian/complexity": "^6.0", + "sebastian/environment": "^9.3.3", + "sebastian/git-state": "^1.0", + "sebastian/lines-of-code": "^5.0.2", + "sebastian/version": "^7.0", + "theseer/tokenizer": "^2.0.1" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^13.3.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -2812,7 +2080,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-main": "14.4.x-dev" } }, "autoload": { @@ -2841,40 +2109,52 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/14.4.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2026-10-03T14:05:38+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "9bb4e6c58b62c1e043be995c66abec7c97307aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/9bb4e6c58b62c1e043be995c66abec7c97307aae", + "reference": "9bb4e6c58b62c1e043be995c66abec7c97307aae", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -2901,36 +2181,49 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/7.0.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2026-08-25T14:47:43+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.0" }, "suggest": { "ext-pcntl": "*" @@ -2938,7 +2231,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -2964,40 +2257,53 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/7.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-invoker", + "type": "tidelift" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2026-02-06T04:34:47+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "97107691cb2b6c743b5e0c44be19e983cb337a02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/97107691cb2b6c743b5e0c44be19e983cb337a02", + "reference": "97107691cb2b6c743b5e0c44be19e983cb337a02", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -3023,40 +2329,53 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/6.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-text-template", + "type": "tidelift" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2026-10-03T04:54:24+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "9.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a0e12065831f6ab0d83120dc61513eb8d9a966f6", + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -3082,62 +2401,72 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/9.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-timer", + "type": "tidelift" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2026-02-06T04:37:53+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.23", + "version": "13.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95" + "reference": "2180c47c4229e5da117ff248753370443c074f10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", - "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2180c47c4229e5da117ff248753370443c074f10", + "reference": "2180c47c4229e5da117ff248753370443c074f10", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", + "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", - "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.1", + "myclabs/deep-copy": "^1.14.0", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "php": ">=8.4.1", + "phpunit/php-code-coverage": "^14.4.1", + "phpunit/php-file-iterator": "^7.0.2", + "phpunit/php-invoker": "^7.0.0", + "phpunit/php-text-template": "^6.0.1", + "phpunit/php-timer": "^9.0.0", + "sebastian/cli-parser": "^5.0.1", + "sebastian/comparator": "^8.4", + "sebastian/diff": "^9.0.1", + "sebastian/environment": "^9.3.3", + "sebastian/exporter": "^8.2.1", + "sebastian/file-filter": "^1.0", + "sebastian/git-state": "^1.0", + "sebastian/global-state": "^9.0.1", + "sebastian/object-enumerator": "^8.1.0", + "sebastian/recursion-context": "^8.0.1", + "sebastian/type": "^7.0.2", + "sebastian/version": "^7.0.1", + "staabm/side-effects-detector": "^1.0.5" }, "bin": [ "phpunit" @@ -3145,7 +2474,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "13.4-dev" } }, "autoload": { @@ -3177,98 +2506,39 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23" + "source": "https://github.com/sebastianbergmann/phpunit/tree/13.4.3" }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "time": "2025-05-02T06:40:34+00:00" - }, - { - "name": "psr/clock", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/clock.git", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Clock\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "url": "https://phpunit.de/sponsoring.html", + "type": "other" } ], - "description": "Common interface for reading the clock.", - "homepage": "https://github.com/php-fig/clock", - "keywords": [ - "clock", - "now", - "psr", - "psr-20", - "time" - ], - "support": { - "issues": "https://github.com/php-fig/clock/issues", - "source": "https://github.com/php-fig/clock/tree/1.0.0" - }, - "time": "2022-11-25T14:36:26+00:00" + "time": "2026-10-16T05:56:47+00:00" }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -3295,9 +2565,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/event-dispatcher", @@ -3401,25 +2671,25 @@ }, { "name": "psr/simple-cache", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -3434,7 +2704,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -3446,9 +2716,9 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" }, - "time": "2017-10-23T01:57:42+00:00" + "time": "2021-10-29T13:26:27+00:00" }, { "name": "react/cache", @@ -3524,16 +2794,16 @@ }, { "name": "react/child-process", - "version": "v0.6.6", + "version": "v0.6.7", "source": { "type": "git", "url": "https://github.com/reactphp/child-process.git", - "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", - "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/970f0e71945556422ee4570ccbabaedc3cf04ad3", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3", "shasum": "" }, "require": { @@ -3587,7 +2857,7 @@ ], "support": { "issues": "https://github.com/reactphp/child-process/issues", - "source": "https://github.com/reactphp/child-process/tree/v0.6.6" + "source": "https://github.com/reactphp/child-process/tree/v0.6.7" }, "funding": [ { @@ -3595,20 +2865,20 @@ "type": "open_collective" } ], - "time": "2025-01-01T16:37:48+00:00" + "time": "2025-12-23T15:25:20+00:00" }, { "name": "react/dns", - "version": "v1.13.0", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/reactphp/dns.git", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", - "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3", "shasum": "" }, "require": { @@ -3663,7 +2933,7 @@ ], "support": { "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.13.0" + "source": "https://github.com/reactphp/dns/tree/v1.14.0" }, "funding": [ { @@ -3671,20 +2941,20 @@ "type": "open_collective" } ], - "time": "2024-06-13T14:18:03+00:00" + "time": "2025-11-18T19:34:28+00:00" }, { "name": "react/event-loop", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/reactphp/event-loop.git", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", - "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", "shasum": "" }, "require": { @@ -3735,7 +3005,7 @@ ], "support": { "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" }, "funding": [ { @@ -3743,27 +3013,27 @@ "type": "open_collective" } ], - "time": "2023-11-13T13:48:05+00:00" + "time": "2025-11-17T20:46:25+00:00" }, { "name": "react/promise", - "version": "v3.2.0", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a", "shasum": "" }, "require": { "php": ">=7.1.0" }, "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpstan/phpstan": "1.12.28 || 1.4.10", "phpunit/phpunit": "^9.6 || ^7.5" }, "type": "library", @@ -3808,7 +3078,7 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.2.0" + "source": "https://github.com/reactphp/promise/tree/v3.3.0" }, "funding": [ { @@ -3816,20 +3086,20 @@ "type": "open_collective" } ], - "time": "2024-05-24T10:39:05+00:00" + "time": "2025-08-19T18:57:03+00:00" }, { "name": "react/socket", - "version": "v1.16.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/reactphp/socket.git", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", - "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08", "shasum": "" }, "require": { @@ -3888,7 +3158,7 @@ ], "support": { "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.16.0" + "source": "https://github.com/reactphp/socket/tree/v1.17.0" }, "funding": [ { @@ -3896,7 +3166,7 @@ "type": "open_collective" } ], - "time": "2024-07-26T10:38:09+00:00" + "time": "2025-11-19T20:47:34+00:00" }, { "name": "react/stream", @@ -3957,161 +3227,49 @@ "keywords": [ "event-driven", "io", - "non-blocking", - "pipe", - "reactphp", - "readable", - "stream", - "writable" - ], - "support": { - "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.4.0" - }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2024-06-11T12:45:25+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:27:43+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2024-06-11T12:45:25+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "name": "sebastian/cli-parser", + "version": "5.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/eeb759ad3146b7096fb59c3195d39e071cd409e3", + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -4126,49 +3284,68 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/5.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/cli-parser", + "type": "tidelift" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2026-08-01T04:27:14+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "8.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/3b070e608146cba00fd6fd1f0ffba89e5a8897fb", + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.4", + "sebastian/diff": "^9.0", + "sebastian/exporter": "^8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "8.4-dev" } }, "autoload": { @@ -4207,41 +3384,54 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/8.4.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2026-08-07T07:23:13+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "reference": "c5651c795c98093480df79350cb050813fc7a2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c5651c795c98093480df79350cb050813fc7a2f3", + "reference": "c5651c795c98093480df79350cb050813fc7a2f3", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -4264,41 +3454,54 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/6.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/complexity", + "type": "tidelift" } ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2026-02-06T04:41:32+00:00" }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "9.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "a2df6626c1baf31d5a88674882a3072f151b5a26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/a2df6626c1baf31d5a88674882a3072f151b5a26", + "reference": "a2df6626c1baf31d5a88674882a3072f151b5a26", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^13.3.1", + "symfony/process": "^7.4.17" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -4330,35 +3533,48 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/9.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/diff", + "type": "tidelift" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2026-08-25T15:38:55+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "9.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "d4dd10267a11055066a2a78ae04583d8ddd4f595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d4dd10267a11055066a2a78ae04583d8ddd4f595", + "reference": "d4dd10267a11055066a2a78ae04583d8ddd4f595", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3.6" }, "suggest": { "ext-posix": "*" @@ -4366,7 +3582,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "9.3-dev" } }, "autoload": { @@ -4385,7 +3601,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -4393,42 +3609,55 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/9.3.3" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2026-10-01T12:37:56+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "8.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/24a3b69bba4a12ab615fca9d34680c5598d9ab7a", + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "8.2-dev" } }, "autoload": { @@ -4470,46 +3699,194 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/8.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2026-08-07T07:22:06+00:00" + }, + { + "name": "sebastian/file-filter", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/file-filter.git", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/file-filter/zipball/33a26f394330f6faa7684bb9cc73afb7727aae93", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for filtering files", + "homepage": "https://github.com/sebastianbergmann/file-filter", + "support": { + "issues": "https://github.com/sebastianbergmann/file-filter/issues", + "security": "https://github.com/sebastianbergmann/file-filter/security/policy", + "source": "https://github.com/sebastianbergmann/file-filter/tree/1.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/file-filter", + "type": "tidelift" + } + ], + "time": "2026-04-22T07:20:04+00:00" + }, + { + "name": "sebastian/git-state", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/git-state.git", + "reference": "31a565f463686f0eefa85f899549256bf5805985" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/git-state/zipball/31a565f463686f0eefa85f899549256bf5805985", + "reference": "31a565f463686f0eefa85f899549256bf5805985", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.4.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for describing the state of a Git checkout", + "homepage": "https://github.com/sebastianbergmann/git-state", + "support": { + "issues": "https://github.com/sebastianbergmann/git-state/issues", + "security": "https://github.com/sebastianbergmann/git-state/security/policy", + "source": "https://github.com/sebastianbergmann/git-state/tree/1.1.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/git-state", + "type": "tidelift" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2026-10-21T05:59:52+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "9.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.4", + "sebastian/object-reflector": "^6.0", + "sebastian/recursion-context": "^8.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^13.1.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -4528,47 +3905,60 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/9.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2026-06-01T15:11:33+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.4", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "nikic/php-parser": "^5.8.0", + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -4591,42 +3981,54 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/5.0.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/lines-of-code", + "type": "tidelift" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2026-07-09T08:42:34+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "8.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/511064ecde82bd747e2ba2fab3dda8d977b59576", + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "8.1-dev" } }, "autoload": { @@ -4648,40 +4050,53 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/8.1.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/object-enumerator", + "type": "tidelift" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2026-08-13T07:05:05+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f71bbcdc4f95456b4622810bec64eb06372e25b2", + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -4703,40 +4118,53 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/6.1.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/object-reflector", + "type": "tidelift" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2026-08-13T06:34:36+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "8.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -4766,40 +4194,53 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/8.0.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2026-08-03T05:58:12+00:00" }, { - "name": "sebastian/resource-operations", - "version": "3.0.4", + "name": "sebastian/type", + "version": "7.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "bd1df467864cb95140414059a535b2d906173fcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/bd1df467864cb95140414059a535b2d906173fcf", + "reference": "bd1df467864cb95140414059a535b2d906173fcf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -4814,46 +4255,58 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/7.0.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/type", + "type": "tidelift" } ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2026-08-10T08:00:57+00:00" }, { - "name": "sebastian/type", - "version": "3.2.1", + "name": "sebastian/version", + "version": "7.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1", + "reference": "f1598cf1d8d1ca4c0f194a52f2fe72a559a7b0b1", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" + "php": ">=8.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -4872,116 +4325,130 @@ "role": "lead" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/7.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/version", + "type": "tidelift" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2026-10-04T05:51:14+00:00" }, { - "name": "sebastian/version", - "version": "3.0.2", + "name": "staabm/side-effects-detector", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", "shasum": "" }, "require": { - "php": ">=7.3" + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" }, + "type": "library", "autoload": { "classmap": [ - "src/" + "lib/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/staabm", "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2024-10-20T05:08:20+00:00" }, { "name": "symfony/console", - "version": "v6.4.23", + "version": "v8.1.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9056771b8eca08d026cd3280deeec3cfd99c4d93" + "reference": "630e74196a2635ec0f06c12bd3fb47cfedf85157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9056771b8eca08d026cd3280deeec3cfd99c4d93", - "reference": "9056771b8eca08d026cd3280deeec3cfd99c4d93", + "url": "https://api.github.com/repos/symfony/console/zipball/630e74196a2635ec0f06c12bd3fb47cfedf85157", + "reference": "630e74196a2635ec0f06c12bd3fb47cfedf85157", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.4.1", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php85": "^1.32", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/string": "^7.4.6|^8.0.6" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<8.1", + "symfony/event-dispatcher": "<8.1" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^6.4|^7.0", - "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^8.1", + "symfony/event-dispatcher": "^8.1", + "symfony/filesystem": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/lock": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/process": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -5015,7 +4482,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.23" + "source": "https://github.com/symfony/console/tree/v8.1.9" }, "funding": [ { @@ -5026,25 +4493,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-06-27T19:37:22+00:00" + "time": "2026-10-12T19:11:16+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.6.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", - "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", "shasum": "" }, "require": { @@ -5057,7 +4528,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.6-dev" + "dev-main": "3.7-dev" } }, "autoload": { @@ -5082,7 +4553,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" }, "funding": [ { @@ -5093,33 +4564,38 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:21:43+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v7.3.0", + "version": "v8.1.5", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "497f73ac996a598c92409b44ac43b6690c4f666d" + "reference": "7458da64220376b2e0dc2d8451bf43382c1ad297" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/497f73ac996a598c92409b44ac43b6690c4f666d", - "reference": "497f73ac996a598c92409b44ac43b6690c4f666d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7458da64220376b2e0dc2d8451bf43382c1ad297", + "reference": "7458da64220376b2e0dc2d8451bf43382c1ad297", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<6.4", + "symfony/security-http": "<7.4", "symfony/service-contracts": "<2.5" }, "provide": { @@ -5128,13 +4604,14 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/error-handler": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/framework-bundle": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^6.4|^7.0" + "symfony/stopwatch": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -5162,7 +4639,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.3.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v8.1.5" }, "funding": [ { @@ -5173,25 +4650,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-22T09:11:45+00:00" + "time": "2026-08-21T17:47:34+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.6.0", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "59eb412e93815df44f05f342958efa9f46b1e586" + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586", - "reference": "59eb412e93815df44f05f342958efa9f46b1e586", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c7de7a00ffb67842132da02ea92988a39ccd9f4e", + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e", "shasum": "" }, "require": { @@ -5205,7 +4686,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.6-dev" + "dev-main": "3.7-dev" } }, "autoload": { @@ -5238,7 +4719,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.1" }, "funding": [ { @@ -5249,34 +4730,39 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:21:43+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/filesystem", - "version": "v7.3.0", + "version": "v8.1.9", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" + "reference": "43d109c803d22c00bb820ed45df250b6a8792ca2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", - "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/43d109c803d22c00bb820ed45df250b6a8792ca2", + "reference": "43d109c803d22c00bb820ed45df250b6a8792ca2", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^6.4|^7.0" + "symfony/process": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -5304,7 +4790,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.3.0" + "source": "https://github.com/symfony/filesystem/tree/v8.1.9" }, "funding": [ { @@ -5315,32 +4801,36 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-10-25T15:15:23+00:00" + "time": "2026-10-06T20:05:50+00:00" }, { "name": "symfony/finder", - "version": "v7.3.0", + "version": "v8.1.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ec2344cf77a48253bbca6939aa3d2477773ea63d" + "reference": "bd4fed193a3132c91c5c93595cbfc78988915822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ec2344cf77a48253bbca6939aa3d2477773ea63d", - "reference": "ec2344cf77a48253bbca6939aa3d2477773ea63d", + "url": "https://api.github.com/repos/symfony/finder/zipball/bd4fed193a3132c91c5c93595cbfc78988915822", + "reference": "bd4fed193a3132c91c5c93595cbfc78988915822", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.4.1" }, "require-dev": { - "symfony/filesystem": "^6.4|^7.0" + "symfony/filesystem": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -5368,7 +4858,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.3.0" + "source": "https://github.com/symfony/finder/tree/v8.1.8" }, "funding": [ { @@ -5379,29 +4869,33 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-12-30T19:00:26+00:00" + "time": "2026-09-26T06:33:49+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.3.0", + "version": "v8.1.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "afb9a8038025e5dbc657378bfab9198d75f10fca" + "reference": "88f9c561f678a02d54b897014049fa839e33ff82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/afb9a8038025e5dbc657378bfab9198d75f10fca", - "reference": "afb9a8038025e5dbc657378bfab9198d75f10fca", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/88f9c561f678a02d54b897014049fa839e33ff82", + "reference": "88f9c561f678a02d54b897014049fa839e33ff82", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4.1", "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", @@ -5435,7 +4929,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.3.0" + "source": "https://github.com/symfony/options-resolver/tree/v8.1.0" }, "funding": [ { @@ -5446,25 +4940,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-04T13:12:05+00:00" + "time": "2026-05-29T05:06:50+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.32.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { @@ -5514,7 +5012,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" }, "funding": [ { @@ -5525,32 +5023,207 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.32.0", + "version": "v1.43.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + "reference": "5cac8f4db97208823aa353f59a01faad2da52c75" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5cac8f4db97208823aa353f59a01faad2da52c75", + "reference": "5cac8f4db97208823aa353f59a01faad2da52c75", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.43.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-25T15:46:47+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.43.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "ebd57ccc7edb93d632e184efbe7693d2517bab3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/ebd57ccc7edb93d632e184efbe7693d2517bab3b", + "reference": "ebd57ccc7edb93d632e184efbe7693d2517bab3b", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.43.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-09-23T22:02:09+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.43.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", + "reference": "4d5d331bf731e0aedbc6b2f5e61135b7b7996a72", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { - "ext-intl": "For best performance" + "ext-mbstring": "For best performance" }, "type": "library", "extra": { @@ -5564,7 +5237,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -5581,18 +5254,17 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's grapheme_* functions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "grapheme", - "intl", + "mbstring", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.43.0" }, "funding": [ { @@ -5603,33 +5275,34 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-24T15:19:04+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.32.0", + "name": "symfony/polyfill-php80", + "version": "v1.43.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "3833d7255cc303546435cb650316bff708a1c75c" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", - "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74", + "reference": "9c6a5d6b01ca51d486c813e9a9c0ed55f208bb74", "shasum": "" }, "require": { "php": ">=7.2" }, - "suggest": { - "ext-intl": "For best performance" - }, "type": "library", "extra": { "thanks": { @@ -5642,7 +5315,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, "classmap": [ "Resources/stubs" @@ -5653,6 +5326,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -5662,18 +5339,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "intl", - "normalizer", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.43.0" }, "funding": [ { @@ -5684,37 +5359,34 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-25T15:50:05+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.32.0", + "name": "symfony/polyfill-php81", + "version": "v1.38.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/6bfb9c766cacffbc8e118cb87217d08ed84e5cd7", + "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7", "shasum": "" }, "require": { - "ext-iconv": "*", "php": ">=7.2" }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, "type": "library", "extra": { "thanks": { @@ -5727,8 +5399,11 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5744,17 +5419,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.38.1" }, "funding": [ { @@ -5765,25 +5439,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-12-23T08:48:59+00:00" + "time": "2026-05-26T12:45:58+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.32.0", + "name": "symfony/polyfill-php84", + "version": "v1.43.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/22c6548499cbe5c5bb072fc0c42312dff062a015", + "reference": "22c6548499cbe5c5bb072fc0c42312dff062a015", "shasum": "" }, "require": { @@ -5801,7 +5479,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Polyfill\\Php84\\": "" }, "classmap": [ "Resources/stubs" @@ -5812,10 +5490,6 @@ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -5825,7 +5499,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -5834,7 +5508,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.43.0" }, "funding": [ { @@ -5845,25 +5519,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-01-02T08:10:11+00:00" + "time": "2026-09-23T22:01:09+00:00" }, { - "name": "symfony/polyfill-php81", - "version": "v1.32.0", + "name": "symfony/polyfill-php85", + "version": "v1.43.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/86a42cbcc07adc331481a5ab310a4024bfc227f6", + "reference": "86a42cbcc07adc331481a5ab310a4024bfc227f6", "shasum": "" }, "require": { @@ -5881,7 +5559,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" + "Symfony\\Polyfill\\Php85\\": "" }, "classmap": [ "Resources/stubs" @@ -5901,7 +5579,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -5910,7 +5588,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" + "source": "https://github.com/symfony/polyfill-php85/tree/v1.43.0" }, "funding": [ { @@ -5921,29 +5599,33 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2026-09-25T15:46:47+00:00" }, { "name": "symfony/process", - "version": "v7.3.0", + "version": "v8.1.9", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af" + "reference": "59a682fd049b2d4d37c444f5ac21b7d01b8c7189" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", - "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", + "url": "https://api.github.com/repos/symfony/process/zipball/59a682fd049b2d4d37c444f5ac21b7d01b8c7189", + "reference": "59a682fd049b2d4d37c444f5ac21b7d01b8c7189", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.4.1" }, "type": "library", "autoload": { @@ -5971,7 +5653,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.3.0" + "source": "https://github.com/symfony/process/tree/v8.1.9" }, "funding": [ { @@ -5982,25 +5664,29 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-17T09:11:12+00:00" + "time": "2026-10-08T16:57:43+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.6.0", + "version": "v3.7.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", - "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", "shasum": "" }, "require": { @@ -6018,7 +5704,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "3.6-dev" + "dev-main": "3.7-dev" } }, "autoload": { @@ -6054,7 +5740,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" }, "funding": [ { @@ -6065,29 +5751,33 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-25T09:37:31+00:00" + "time": "2026-07-27T15:39:01+00:00" }, { "name": "symfony/stopwatch", - "version": "v7.3.0", + "version": "v8.1.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd" + "reference": "21c07b026905d596e8379caeb115d87aa479499d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", - "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/21c07b026905d596e8379caeb115d87aa479499d", + "reference": "21c07b026905d596e8379caeb115d87aa479499d", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.4.1", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -6116,7 +5806,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.3.0" + "source": "https://github.com/symfony/stopwatch/tree/v8.1.0" }, "funding": [ { @@ -6127,44 +5817,47 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-02-24T10:49:57+00:00" + "time": "2026-05-29T05:06:50+00:00" }, { "name": "symfony/string", - "version": "v7.3.0", + "version": "v8.1.9", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125" + "reference": "07fb208558f941eab50ec49c89c2a6a93fb11f01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f3570b8c61ca887a9e2938e85cb6458515d2b125", - "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125", + "url": "https://api.github.com/repos/symfony/string/zipball/07fb208558f941eab50ec49c89c2a6a93fb11f01", + "reference": "07fb208558f941eab50ec49c89c2a6a93fb11f01", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=8.4.1", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" }, "conflict": { "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/emoji": "^7.1", - "symfony/error-handler": "^6.4|^7.0", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" + "symfony/var-exporter": "^7.4|^8.0" }, "type": "library", "autoload": { @@ -6203,7 +5896,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.3.0" + "source": "https://github.com/symfony/string/tree/v8.1.9" }, "funding": [ { @@ -6215,98 +5908,7 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-04-20T20:19:01+00:00" - }, - { - "name": "symfony/translation", - "version": "v6.4.23", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "de8afa521e04a5220e9e58a1dc99971ab7cac643" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/de8afa521e04a5220e9e58a1dc99971ab7cac643", - "reference": "de8afa521e04a5220e9e58a1dc99971ab7cac643", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.5|^3.0" - }, - "conflict": { - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/http-client-contracts": "<2.5", - "symfony/http-kernel": "<5.4", - "symfony/service-contracts": "<2.5", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4" - }, - "provide": { - "symfony/translation-implementation": "2.3|3.0" - }, - "require-dev": { - "nikic/php-parser": "^4.18|^5.0", - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/console": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/http-client-contracts": "^2.5|^3.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/intl": "^5.4|^6.0|^7.0", - "symfony/polyfill-intl-icu": "^1.21", - "symfony/routing": "^5.4|^6.0|^7.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to internationalize your application", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/translation/tree/v6.4.23" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/nicolas-grekas", "type": "github" }, { @@ -6314,42 +5916,38 @@ "type": "tidelift" } ], - "time": "2025-06-26T21:24:02+00:00" + "time": "2026-10-03T15:16:03+00:00" }, { - "name": "symfony/translation-contracts", - "version": "v3.6.0", + "name": "ta-tikoma/phpunit-architecture-test", + "version": "0.8.7", "source": { "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "df210c7a2573f1913b2d17cc95f90f53a73d8f7d" + "url": "https://github.com/ta-tikoma/phpunit-architecture-test.git", + "reference": "1248f3f506ca9641d4f68cebcd538fa489754db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/df210c7a2573f1913b2d17cc95f90f53a73d8f7d", - "reference": "df210c7a2573f1913b2d17cc95f90f53a73d8f7d", + "url": "https://api.github.com/repos/ta-tikoma/phpunit-architecture-test/zipball/1248f3f506ca9641d4f68cebcd538fa489754db8", + "reference": "1248f3f506ca9641d4f68cebcd538fa489754db8", "shasum": "" }, "require": { - "php": ">=8.1" + "nikic/php-parser": "^4.18.0 || ^5.0.0", + "php": "^8.1.0", + "phpdocumentor/reflection-docblock": "^5.3.0 || ^6.0.0", + "phpunit/phpunit": "^10.5.5 || ^11.0.0 || ^12.0.0 || ^13.0.0", + "symfony/finder": "^6.4.0 || ^7.0.0 || ^8.0.0" }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "3.6-dev" - } + "require-dev": { + "laravel/pint": "^1.13.7", + "phpstan/phpstan": "^1.10.52" }, + "type": "library", "autoload": { "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] + "PHPUnit\\Architecture\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6357,62 +5955,47 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Ni Shi", + "email": "futik0ma011@gmail.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" } ], - "description": "Generic abstractions related to translation", - "homepage": "https://symfony.com", + "description": "Methods for testing application architecture", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "architecture", + "phpunit", + "stucture", + "test", + "testing" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.6.0" + "issues": "https://github.com/ta-tikoma/phpunit-architecture-test/issues", + "source": "https://github.com/ta-tikoma/phpunit-architecture-test/tree/0.8.7" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-27T08:32:26+00:00" + "time": "2026-02-17T17:25:14+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4", + "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" + "php": "^8.1" }, "type": "library", "autoload": { @@ -6434,7 +6017,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + "source": "https://github.com/theseer/tokenizer/tree/2.0.1" }, "funding": [ { @@ -6442,111 +6025,41 @@ "type": "github" } ], - "time": "2024-03-03T12:36:25+00:00" - }, - { - "name": "voku/portable-ascii", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/voku/portable-ascii.git", - "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a", - "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a", - "shasum": "" - }, - "require": { - "php": ">=7.0.0" - }, - "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" - }, - "suggest": { - "ext-intl": "Use Intl for transliterator_transliterate() support" - }, - "type": "library", - "autoload": { - "psr-4": { - "voku\\": "src/voku/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" - } - ], - "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", - "homepage": "https://github.com/voku/portable-ascii", - "keywords": [ - "ascii", - "clean", - "php" - ], - "support": { - "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/1.6.1" - }, - "funding": [ - { - "url": "https://www.paypal.me/moelleken", - "type": "custom" - }, - { - "url": "https://github.com/voku", - "type": "github" - }, - { - "url": "https://opencollective.com/portable-ascii", - "type": "open_collective" - }, - { - "url": "https://www.patreon.com/voku", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", - "type": "tidelift" - } - ], - "time": "2022-01-24T18:55:24+00:00" + "time": "2025-12-08T11:19:18+00:00" }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "8a163706bbcac613733dba03f51e13b5eb1bb819" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/8a163706bbcac613733dba03f51e13b5eb1bb819", + "reference": "8a163706bbcac613733dba03f51e13b5eb1bb819", "shasum": "" }, "require": { "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" + "ext-date": "*", + "ext-filter": "*", + "php": "^8.2" }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { + "psalm": { + "pluginClass": "Webmozart\\Assert\\PsalmPlugin" + }, "branch-alias": { - "dev-master": "1.10-dev" + "dev-master": "2.0-dev", + "dev-feature/2-0": "2.0-dev" } }, "autoload": { @@ -6562,6 +6075,10 @@ { "name": "Bernhard Schussek", "email": "bschussek@gmail.com" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com" } ], "description": "Assertions to validate method input/output with nice error messages.", @@ -6572,19 +6089,20 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/2.5.0" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2026-10-05T23:14:19+00:00" } ], "aliases": [], - "minimum-stability": "dev", + "minimum-stability": "stable", "stability-flags": {}, - "prefer-stable": true, + "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.2" + "php": "^8.5", + "ext-gmp": "*" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f454a3f8..89dfc152 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,31 +1,25 @@ - - - ./tests/Analysis - ./tests/Unit - - - src/ - - + + + src + + diff --git a/src/Binary/Bytes.php b/src/Binary/Bytes.php new file mode 100644 index 00000000..6426cf8f --- /dev/null +++ b/src/Binary/Bytes.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Crypto\Binary; + +use InvalidArgumentException; + +/** + * An immutable sequence of raw bytes. + */ +class Bytes +{ + /** + * @var string + */ + private $binary; + + /** + * @param string $binary + */ + public function __construct(string $binary = '') + { + $this->binary = $binary; + } + + /** + * Create an instance from a hex string. + * + * @param string $hex + * + * @return self + */ + public static function fromHex(string $hex): self + { + if (strlen($hex) % 2 !== 0 || ($hex !== '' && ! ctype_xdigit($hex))) { + throw new InvalidArgumentException('The given value is not a valid hex string.'); + } + + return new self((string) hex2bin($hex)); + } + + /** + * Get the bytes as a binary string. + * + * @return string + */ + public function getBinary(): string + { + return $this->binary; + } + + /** + * Get the bytes as a lowercase hex string. + * + * @return string + */ + public function getHex(): string + { + return bin2hex($this->binary); + } + + /** + * Get the number of bytes. + * + * @return int + */ + public function getSize(): int + { + return strlen($this->binary); + } +} diff --git a/src/Configuration/Network.php b/src/Configuration/Network.php index 32c4d28a..0a937228 100644 --- a/src/Configuration/Network.php +++ b/src/Configuration/Network.php @@ -15,7 +15,6 @@ use ArkEcosystem\Crypto\Networks\AbstractNetwork; use ArkEcosystem\Crypto\Networks\Devnet; -use BitWasp\Bitcoin\Bitcoin; /** * This is the network configuration class. @@ -62,7 +61,5 @@ public static function get(): AbstractNetwork public static function set(AbstractNetwork $network): void { static::$network = $network; - - Bitcoin::setNetwork($network); } } diff --git a/src/Identities/Address.php b/src/Identities/Address.php index a798a755..e51d8fd7 100644 --- a/src/Identities/Address.php +++ b/src/Identities/Address.php @@ -17,12 +17,9 @@ use ArkEcosystem\Crypto\Configuration\Network as NetworkConfiguration; use ArkEcosystem\Crypto\Helpers; use ArkEcosystem\Crypto\Networks\AbstractNetwork; -use BitWasp\Bitcoin\Address\AddressCreator; -use BitWasp\Bitcoin\Address\PayToPubKeyHashAddress; -use BitWasp\Bitcoin\Base58; -use BitWasp\Bitcoin\Crypto\EcAdapter\Impl\PhpEcc\Key\PrivateKey as EccPrivateKey; -use BitWasp\Bitcoin\Crypto\Hash; -use BitWasp\Buffertools\Buffer; +use ArkEcosystem\Crypto\Utils\Base58; +use ArkEcosystem\Crypto\Utils\Hash; +use InvalidArgumentException; /** * This is the address class. @@ -39,7 +36,7 @@ class Address * * @return string */ - public static function fromPassphrase(string $passphrase, AbstractNetwork $network = null): string + public static function fromPassphrase(string $passphrase, ?AbstractNetwork $network = null): string { return static::fromPrivateKey(PrivateKey::fromPassphrase($passphrase), $network); } @@ -69,25 +66,22 @@ public static function fromPublicKey(string $publicKey, $network = null): string { $network = $network ?? NetworkConfiguration::get(); - $ripemd160 = Hash::ripemd160(PublicKey::fromHex($publicKey)->getBuffer()); - $seed = Writer::bit8(Helpers::version($network)).$ripemd160->getBinary(); + $ripemd160 = Hash::ripemd160(PublicKey::fromHex($publicKey)->getBinary()); - return Base58::encodeCheck(new Buffer($seed)); + return Base58::encodeCheck(Writer::bit8(Helpers::version($network)).$ripemd160->getBinary()); } /** * Derive the address from the given private key. * - * @param EccPrivateKey $privateKey - * @param AbstractNetwork|null $network + * @param PrivateKey $privateKey + * @param AbstractNetwork|null $network * * @return string */ - public static function fromPrivateKey(EccPrivateKey $privateKey, AbstractNetwork $network = null): string + public static function fromPrivateKey(PrivateKey $privateKey, ?AbstractNetwork $network = null): string { - $digest = Hash::ripemd160($privateKey->getPublicKey()->getBuffer()); - - return (new PayToPubKeyHashAddress($digest))->getAddress($network); + return static::fromPublicKey($privateKey->getPublicKey()->getHex(), $network); } /** @@ -100,13 +94,14 @@ public static function fromPrivateKey(EccPrivateKey $privateKey, AbstractNetwork */ public static function validate(string $address, $network = null): bool { - try { - $addressCreator = new AddressCreator(); - $addressCreator->fromString($address, $network); + $network = $network ?? NetworkConfiguration::get(); - return true; - } catch (\Exception $e) { + try { + $payload = Base58::decodeCheck($address); + } catch (InvalidArgumentException $e) { return false; } + + return strlen($payload) === 21 && ord($payload[0]) === Helpers::version($network); } } diff --git a/src/Identities/PrivateKey.php b/src/Identities/PrivateKey.php index f7ec97a5..fa51b328 100644 --- a/src/Identities/PrivateKey.php +++ b/src/Identities/PrivateKey.php @@ -13,13 +13,15 @@ namespace ArkEcosystem\Crypto\Identities; +use ArkEcosystem\Crypto\Binary\Bytes; +use ArkEcosystem\Crypto\Configuration\Network as NetworkConfiguration; use ArkEcosystem\Crypto\Networks\AbstractNetwork; -use BitWasp\Bitcoin\Bitcoin; -use BitWasp\Bitcoin\Crypto\EcAdapter\EcAdapterFactory; -use BitWasp\Bitcoin\Crypto\EcAdapter\Impl\PhpEcc\Key\PrivateKey as EcPrivateKey; -use BitWasp\Bitcoin\Crypto\Hash; -use BitWasp\Bitcoin\Key\Factory\PrivateKeyFactory; -use BitWasp\Buffertools\Buffer; +use ArkEcosystem\Crypto\Utils\Base58; +use ArkEcosystem\Crypto\Utils\Hash; +use ArkEcosystem\Crypto\Utils\Secp256k1; +use BN\BN; +use Elliptic\EC\KeyPair; +use InvalidArgumentException; /** * This is the private key class. @@ -28,57 +30,155 @@ */ class PrivateKey { + /** + * Marks a WIF as belonging to a compressed public key. + */ + private const COMPRESSED_SUFFIX = "\x01"; + + /** + * @var KeyPair + */ + private $keyPair; + + /** + * @param KeyPair $keyPair + */ + private function __construct(KeyPair $keyPair) + { + $this->keyPair = $keyPair; + } + /** * Derive the private key for the given passphrase. * * @param string $passphrase * - * @return EcPrivateKey + * @return self */ - public static function fromPassphrase(string $passphrase): EcPrivateKey + public static function fromPassphrase(string $passphrase): self { - $passphrase = Hash::sha256(new Buffer($passphrase)); - - return (new PrivateKeyFactory( - EcAdapterFactory::getPhpEcc( - Bitcoin::getMath(), - Bitcoin::getGenerator() - ) - ))->fromHexCompressed($passphrase->getHex()); + return static::fromHex(Hash::sha256($passphrase)); } /** * Create a private key instance from a hex string. * - * @param \BitWasp\Buffertools\BufferInterface|string $privateKey + * @param Bytes|string $privateKey * - * @return EcPrivateKey + * @return self */ - public static function fromHex($privateKey): EcPrivateKey + public static function fromHex($privateKey): self { - return (new PrivateKeyFactory( - EcAdapterFactory::getPhpEcc( - Bitcoin::getMath(), - Bitcoin::getGenerator() - ) - ))->fromHexCompressed($privateKey); + $privateKey = $privateKey instanceof Bytes ? $privateKey->getHex() : $privateKey; + + if (! ctype_xdigit($privateKey) || strlen($privateKey) !== 64) { + throw new InvalidArgumentException('The given value is not a valid private key.'); + } + + $scalar = new BN($privateKey, 16); + + if ($scalar->isZero() || $scalar->cmp(Secp256k1::curve()->n) >= 0) { + throw new InvalidArgumentException('The given value is not a valid private key.'); + } + + return new self(Secp256k1::curve()->keyFromPrivate($privateKey, 'hex')); } /** * Derive the private key for the given WIF. * - * @param string $wif + * @param string $wif * @param AbstractNetwork|null $network * - * @return EcPrivateKey + * @return self + */ + public static function fromWif(string $wif, ?AbstractNetwork $network = null): self + { + $network = $network ?? NetworkConfiguration::get(); + $payload = Base58::decodeCheck($wif); + + if (! in_array(strlen($payload), [33, 34], true)) { + throw new InvalidArgumentException('The given value is not a valid WIF.'); + } + + if (bin2hex($payload[0]) !== strtolower($network->getPrivByte())) { + throw new InvalidArgumentException('The given WIF does not belong to the network.'); + } + + if (strlen($payload) === 34 && $payload[33] !== self::COMPRESSED_SUFFIX) { + throw new InvalidArgumentException('The given value is not a valid WIF.'); + } + + return static::fromHex(bin2hex(substr($payload, 1, 32))); + } + + /** + * Get the private key as hex. + * + * @return string + */ + public function getHex(): string + { + return str_pad($this->keyPair->getPrivate('hex'), 64, '0', STR_PAD_LEFT); + } + + /** + * Get the private key as binary. + * + * @return string */ - public static function fromWif(string $wif, AbstractNetwork $network = null): EcPrivateKey + public function getBinary(): string { - return (new PrivateKeyFactory( - EcAdapterFactory::getPhpEcc( - Bitcoin::getMath(), - Bitcoin::getGenerator() - ) - ))->fromWif($wif, $network); + return (string) hex2bin($this->getHex()); + } + + /** + * Get the private key bytes. + * + * @return Bytes + */ + public function getBuffer(): Bytes + { + return new Bytes($this->getBinary()); + } + + /** + * Get the public key that belongs to this private key. + * + * @return PublicKey + */ + public function getPublicKey(): PublicKey + { + return PublicKey::fromKeyPair($this->keyPair); + } + + /** + * Sign the given 32-byte hash with deterministic (RFC 6979), low-S ECDSA. + * + * @param Bytes|string $hash + * + * @return Bytes the DER encoded signature + */ + public function sign($hash): Bytes + { + $hash = $hash instanceof Bytes ? $hash->getHex() : bin2hex($hash); + + $signature = $this->keyPair->sign($hash, ['canonical' => true]); + + return Bytes::fromHex($signature->toDER('hex')); + } + + /** + * Encode the private key as a compressed WIF. + * + * @param AbstractNetwork|null $network + * + * @return string + */ + public function toWif(?AbstractNetwork $network = null): string + { + $network = $network ?? NetworkConfiguration::get(); + + return Base58::encodeCheck(hex2bin($network->getPrivByte()).$this->getBinary().self::COMPRESSED_SUFFIX); } } diff --git a/src/Identities/PublicKey.php b/src/Identities/PublicKey.php index 9c4252cd..b014aafc 100644 --- a/src/Identities/PublicKey.php +++ b/src/Identities/PublicKey.php @@ -13,11 +13,11 @@ namespace ArkEcosystem\Crypto\Identities; -use BitWasp\Bitcoin\Bitcoin; -use BitWasp\Bitcoin\Crypto\EcAdapter\EcAdapterFactory; -use BitWasp\Bitcoin\Crypto\EcAdapter\Impl\PhpEcc\Key\PublicKey as EcPublicKey; -use BitWasp\Bitcoin\Key\Factory\PublicKeyFactory; -use Elliptic\EC; +use ArkEcosystem\Crypto\Binary\Bytes; +use ArkEcosystem\Crypto\Utils\Secp256k1; +use Elliptic\EC\KeyPair; +use InvalidArgumentException; +use Throwable; /** * This is the public key class. @@ -26,14 +26,27 @@ */ class PublicKey { + /** + * @var KeyPair + */ + private $keyPair; + + /** + * @param KeyPair $keyPair + */ + private function __construct(KeyPair $keyPair) + { + $this->keyPair = $keyPair; + } + /** * Derive the public from the given passphrase. * * @param string $passphrase * - * @return EcPublicKey + * @return self */ - public static function fromPassphrase(string $passphrase): EcPublicKey + public static function fromPassphrase(string $passphrase): self { return PrivateKey::fromPassphrase($passphrase)->getPublicKey(); } @@ -44,14 +57,14 @@ public static function fromPassphrase(string $passphrase): EcPublicKey * @param int $min * @param array $publicKeys * - * @return EcPublicKey + * @return self */ - public static function fromMultiSignatureAsset(int $min, array $publicKeys): EcPublicKey + public static function fromMultiSignatureAsset(int $min, array $publicKeys): self { $minKey = static::fromPassphrase('0'.dechex($min)); $keys = [$minKey->getHex(), ...$publicKeys]; - $curve = (new EC('secp256k1'))->curve; + $curve = Secp256k1::curve()->curve; $P = $curve->jpoint(null, null, null); foreach ($keys as $publicKey) { @@ -62,19 +75,97 @@ public static function fromMultiSignatureAsset(int $min, array $publicKeys): EcP } /** - * Create a public key instance from a hex string. + * Create a public key instance from a compressed or uncompressed hex string. + * + * @param Bytes|string $publicKey + * + * @return self + */ + public static function fromHex($publicKey): self + { + $publicKey = $publicKey instanceof Bytes ? $publicKey->getHex() : $publicKey; + + if (! ctype_xdigit($publicKey) || ! in_array(strlen($publicKey), [66, 130], true)) { + throw new InvalidArgumentException('The given value is not a valid public key.'); + } + + try { + $keyPair = Secp256k1::curve()->keyFromPublic($publicKey, 'hex'); + } catch (Throwable $e) { + throw new InvalidArgumentException('The given value is not a valid public key.', 0, $e); + } + + // secp256k1 has a cofactor of 1, so any point on the curve is in the prime-order group. + if (! $keyPair->getPublic()->validate()) { + throw new InvalidArgumentException('The given value is not a valid public key.'); + } + + return new self($keyPair); + } + + /** + * Create a public key instance from the public half of the given key pair. * - * @param \BitWasp\Buffertools\BufferInterface|string $publicKey + * @param KeyPair $keyPair * - * @return EcPublicKey + * @return self */ - public static function fromHex($publicKey): EcPublicKey + public static function fromKeyPair(KeyPair $keyPair): self { - return (new PublicKeyFactory( - EcAdapterFactory::getPhpEcc( - Bitcoin::getMath(), - Bitcoin::getGenerator() - ) - ))->fromHex($publicKey); + return static::fromHex($keyPair->getPublic(true, 'hex')); + } + + /** + * Get the compressed public key as hex. + * + * @return string + */ + public function getHex(): string + { + return $this->keyPair->getPublic(true, 'hex'); + } + + /** + * Get the compressed public key as binary. + * + * @return string + */ + public function getBinary(): string + { + return (string) hex2bin($this->getHex()); + } + + /** + * Get the compressed public key bytes. + * + * @return Bytes + */ + public function getBuffer(): Bytes + { + return new Bytes($this->getBinary()); + } + + /** + * Verify a DER encoded ECDSA signature over the given 32-byte hash. + * + * @param Bytes|string $hash + * @param Bytes|string $signature + * + * @return bool + */ + public function verify($hash, $signature): bool + { + $hash = $hash instanceof Bytes ? $hash->getHex() : bin2hex($hash); + $signature = $signature instanceof Bytes ? $signature->getHex() : $signature; + + if (! ctype_xdigit($signature)) { + return false; + } + + try { + return $this->keyPair->verify($hash, $signature); + } catch (Throwable $e) { + return false; + } } } diff --git a/src/Identities/WIF.php b/src/Identities/WIF.php index 5307cf84..98b84bb2 100644 --- a/src/Identities/WIF.php +++ b/src/Identities/WIF.php @@ -30,7 +30,7 @@ class WIF * * @return string */ - public static function fromPassphrase(string $passphrase, AbstractNetwork $network = null): string + public static function fromPassphrase(string $passphrase, ?AbstractNetwork $network = null): string { return PrivateKey::fromPassphrase($passphrase)->toWif($network); } diff --git a/src/Networks/AbstractNetwork.php b/src/Networks/AbstractNetwork.php index ee8ffcbe..c6e1cb0c 100644 --- a/src/Networks/AbstractNetwork.php +++ b/src/Networks/AbstractNetwork.php @@ -13,41 +13,41 @@ namespace ArkEcosystem\Crypto\Networks; -use BitWasp\Bitcoin\Network\Network; -use BitWasp\Bitcoin\Script\ScriptType; - /** * This is the abstract network class. * * @author Brian Faust */ -abstract class AbstractNetwork extends Network +abstract class AbstractNetwork { + public const BASE58_ADDRESS_P2PKH = 'p2pkh'; + + public const BASE58_ADDRESS_P2SH = 'p2sh'; + + public const BASE58_WIF = 'wif'; + + public const BIP32_PREFIX_XPUB = 'xpub'; + + public const BIP32_PREFIX_XPRV = 'xprv'; + /** - * {@inheritdoc} + * The hex encoded version bytes for Base58 encoded data. + * + * @var array */ - protected $bip32ScriptTypeMap = [ - self::BIP32_PREFIX_XPUB => ScriptType::P2PKH, - self::BIP32_PREFIX_XPRV => ScriptType::P2PKH, - ]; + protected $base58PrefixMap = []; /** - * Call a method on the network instance. - * - * @param string $method - * @param array $args + * The hex encoded version bytes for BIP32 extended keys. * - * @return mixed + * @var array */ - public static function __callStatic(string $method, array $args) - { - return static::factory()->{$method}(...$args); - } + protected $bip32PrefixMap = []; /** * Create a new network instance. * - * @return mixed + * @return static */ public static function new() { @@ -61,7 +61,57 @@ public static function new() */ public function version(): int { - return hexdec($this->getAddressByte()); + return (int) hexdec($this->getAddressByte()); + } + + /** + * Get the hex encoded version byte of pay-to-public-key-hash addresses. + * + * @return string + */ + public function getAddressByte(): string + { + return $this->base58PrefixMap[self::BASE58_ADDRESS_P2PKH]; + } + + /** + * Get the hex encoded version byte of pay-to-script-hash addresses. + * + * @return string + */ + public function getP2shByte(): string + { + return $this->base58PrefixMap[self::BASE58_ADDRESS_P2SH]; + } + + /** + * Get the hex encoded version byte of WIF private keys. + * + * @return string + */ + public function getPrivByte(): string + { + return $this->base58PrefixMap[self::BASE58_WIF]; + } + + /** + * Get the hex encoded BIP32 prefix of extended public keys. + * + * @return string + */ + public function getHDPubByte(): string + { + return $this->bip32PrefixMap[self::BIP32_PREFIX_XPUB]; + } + + /** + * Get the hex encoded BIP32 prefix of extended private keys. + * + * @return string + */ + public function getHDPrivByte(): string + { + return $this->bip32PrefixMap[self::BIP32_PREFIX_XPRV]; } abstract public function pubKeyHash(): int; diff --git a/src/Transactions/Deserializer.php b/src/Transactions/Deserializer.php index b5598a03..89f7f239 100644 --- a/src/Transactions/Deserializer.php +++ b/src/Transactions/Deserializer.php @@ -15,7 +15,7 @@ use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; use ArkEcosystem\Crypto\Transactions\Types\Transaction; -use BitWasp\Bitcoin\Crypto\Hash; +use ArkEcosystem\Crypto\Utils\Hash; /** * This is the deserializer class. diff --git a/src/Transactions/Serializer.php b/src/Transactions/Serializer.php index d5e78068..e1d36a87 100644 --- a/src/Transactions/Serializer.php +++ b/src/Transactions/Serializer.php @@ -13,11 +13,11 @@ namespace ArkEcosystem\Crypto\Transactions; +use ArkEcosystem\Crypto\Binary\Bytes; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; use ArkEcosystem\Crypto\Configuration\Network; use ArkEcosystem\Crypto\Enums\TypeGroup; use ArkEcosystem\Crypto\Transactions\Types\Transaction; -use BitWasp\Buffertools\Buffer; /** * This is the serializer class. @@ -48,7 +48,7 @@ public static function new($transaction) return new static($transaction); } - public static function getBytes(Transaction $transaction, array $options = []): Buffer + public static function getBytes(Transaction $transaction, array $options = []): Bytes { return self::new($transaction)->serialize($options); } @@ -56,9 +56,9 @@ public static function getBytes(Transaction $transaction, array $options = []): /** * Perform AIP11 compliant serialization. * - * @return Buffer + * @return Bytes */ - public function serialize(array $options = []): Buffer + public function serialize(array $options = []): Bytes { $buffer = ByteBuffer::new(1); // initialize with size 1, size will expand as we add bytes @@ -71,7 +71,7 @@ public function serialize(array $options = []): Buffer $this->serializeSignatures($buffer, $options); - return new Buffer($buffer->toString('binary')); + return new Bytes($buffer->toString('binary')); } /** diff --git a/src/Transactions/Types/HtlcLock.php b/src/Transactions/Types/HtlcLock.php index 4bb96280..ef667a16 100644 --- a/src/Transactions/Types/HtlcLock.php +++ b/src/Transactions/Types/HtlcLock.php @@ -14,8 +14,7 @@ namespace ArkEcosystem\Crypto\Transactions\Types; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use BitWasp\Bitcoin\Base58; -use BitWasp\Buffertools\Buffer; +use ArkEcosystem\Crypto\Utils\Base58; class HtlcLock extends Transaction { @@ -27,7 +26,7 @@ public function serialize(array $options = []): ByteBuffer $buffer->append(ByteBuffer::fromHex($this->data['asset']['lock']['secretHash'])); $buffer->writeUint8(+$this->data['asset']['lock']['expiration']['type']); $buffer->writeUint32(+$this->data['asset']['lock']['expiration']['value']); - $buffer->append(Base58::decodeCheck($this->data['recipientId'])->getBinary()); + $buffer->append(Base58::decodeCheck($this->data['recipientId'])); return $buffer; } @@ -38,7 +37,7 @@ public function deserialize(ByteBuffer $buffer): void $secretHash = $buffer->readHex(32 * 2); $expirationType = $buffer->readUint8(); $expirationValue = $buffer->readUint32(); - $recipientId = Base58::encodeCheck(new Buffer($buffer->readHexString(21 * 2))); + $recipientId = Base58::encodeCheck($buffer->readHexString(21 * 2)); $this->data['amount'] = $amount; $this->data['recipientId'] = $recipientId; diff --git a/src/Transactions/Types/IPFS.php b/src/Transactions/Types/IPFS.php index 3bd67420..0e257713 100644 --- a/src/Transactions/Types/IPFS.php +++ b/src/Transactions/Types/IPFS.php @@ -14,8 +14,7 @@ namespace ArkEcosystem\Crypto\Transactions\Types; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use BitWasp\Bitcoin\Base58; -use BitWasp\Buffertools\Buffer; +use ArkEcosystem\Crypto\Utils\Base58; /** * This is the serializer class. @@ -26,7 +25,7 @@ class IPFS extends Transaction { public function serialize(array $options = []): ByteBuffer { - $buffer = ByteBuffer::fromBinary(Base58::decode($this->data['asset']['ipfs'])->getBinary()); + $buffer = ByteBuffer::fromBinary(Base58::decode($this->data['asset']['ipfs'])); return $buffer; } @@ -43,7 +42,7 @@ public function deserialize(ByteBuffer $buffer): void $buffer->writeHex($ipfsHash); $this->data['asset'] = [ - 'ipfs' => Base58::encode(new Buffer($buffer->toBinary())), + 'ipfs' => Base58::encode($buffer->toBinary()), ]; } } diff --git a/src/Transactions/Types/MultiPayment.php b/src/Transactions/Types/MultiPayment.php index 6389852c..1acf5a9b 100644 --- a/src/Transactions/Types/MultiPayment.php +++ b/src/Transactions/Types/MultiPayment.php @@ -14,8 +14,7 @@ namespace ArkEcosystem\Crypto\Transactions\Types; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use BitWasp\Bitcoin\Base58; -use BitWasp\Buffertools\Buffer; +use ArkEcosystem\Crypto\Utils\Base58; /** * This is the serializer class. @@ -36,7 +35,7 @@ public function serialize(array $options = []): ByteBuffer foreach ($this->data['asset']['payments'] as $payment) { $buffer->writeUInt64(+$payment['amount']); - $buffer->append(Base58::decodeCheck($payment['recipientId'])->getBinary()); + $buffer->append(Base58::decodeCheck($payment['recipientId'])); } return $buffer; @@ -51,7 +50,7 @@ public function deserialize(ByteBuffer $buffer): void for ($i = 0; $i < $count; $i++) { $this->data['asset']['payments'][] = [ 'amount' => strval($buffer->readUInt64()), - 'recipientId' => Base58::encodeCheck(new Buffer(hex2bin($buffer->readHex(21 * 2)))), + 'recipientId' => Base58::encodeCheck(hex2bin($buffer->readHex(21 * 2))), ]; } diff --git a/src/Transactions/Types/Transaction.php b/src/Transactions/Types/Transaction.php index c651ad1d..1e2a379c 100644 --- a/src/Transactions/Types/Transaction.php +++ b/src/Transactions/Types/Transaction.php @@ -13,14 +13,13 @@ namespace ArkEcosystem\Crypto\Transactions\Types; +use ArkEcosystem\Crypto\Binary\Bytes; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; use ArkEcosystem\Crypto\Configuration\Network; +use ArkEcosystem\Crypto\Identities\PrivateKey; +use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Serializer; -use BitWasp\Bitcoin\Crypto\EcAdapter\Impl\PhpEcc\Key\PrivateKey; -use BitWasp\Bitcoin\Crypto\Hash; -use BitWasp\Bitcoin\Key\Factory\PublicKeyFactory; -use BitWasp\Bitcoin\Signature\SignatureFactory; -use BitWasp\Buffertools\Buffer; +use ArkEcosystem\Crypto\Utils\Hash; /** * This is the transaction class. @@ -44,7 +43,7 @@ public function getId(): string return Hash::sha256(Serializer::getBytes($this))->getHex(); } - public function getBytes($options = []): Buffer + public function getBytes($options = []): Bytes { return Serializer::getBytes($this, $options); } @@ -63,7 +62,7 @@ public function sign(PrivateKey $keys): self 'skipSecondSignature' => true, ]; $transaction = Hash::sha256($this->getBytes($options)); - $this->data['signature'] = $keys->sign($transaction)->getBuffer()->getHex(); + $this->data['signature'] = $keys->sign($transaction)->getHex(); return $this; } @@ -81,7 +80,7 @@ public function secondSign(PrivateKey $keys): self 'skipSecondSignature' => true, ]; $transaction = Hash::sha256($this->getBytes($options)); - $this->data['secondSignature'] = $keys->sign($transaction)->getBuffer()->getHex(); + $this->data['secondSignature'] = $keys->sign($transaction)->getHex(); return $this; } @@ -111,7 +110,7 @@ public function secondVerify(string $secondPublicKey): bool return $this->verifySchnorrOrECDSA($bytes, $secondPublicKey, $signature); } - public function verifySchnorrOrECDSA(Buffer $bytes, string $publicKey, string $signature): bool + public function verifySchnorrOrECDSA(Bytes $bytes, string $publicKey, string $signature): bool { return $this->isSchnorr($signature) ? $this->verifySchnorr($bytes, $publicKey, $signature) @@ -123,18 +122,12 @@ public function isSchnorr(string $signature): bool return ByteBuffer::fromHex($signature)->capacity() === 64; } - public function verifyECDSA(Buffer $bytes, string $publicKey, string $signature): bool + public function verifyECDSA(Bytes $bytes, string $publicKey, string $signature): bool { - $factory = new PublicKeyFactory(); - $publicKey = $factory->fromHex($publicKey); - - return $publicKey->verify( - Hash::sha256($bytes), - SignatureFactory::fromHex($signature) - ); + return PublicKey::fromHex($publicKey)->verify(Hash::sha256($bytes), $signature); } - public function verifySchnorr(Buffer $bytes, string $publicKey, string $signature): bool + public function verifySchnorr(Bytes $bytes, string $publicKey, string $signature): bool { //TODO return false; diff --git a/src/Transactions/Types/Transfer.php b/src/Transactions/Types/Transfer.php index 52d5f5e6..976f6206 100644 --- a/src/Transactions/Types/Transfer.php +++ b/src/Transactions/Types/Transfer.php @@ -14,8 +14,7 @@ namespace ArkEcosystem\Crypto\Transactions\Types; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use BitWasp\Bitcoin\Base58; -use BitWasp\Buffertools\Buffer; +use ArkEcosystem\Crypto\Utils\Base58; /** * This is the serializer class. @@ -30,7 +29,7 @@ public function serialize(array $options = []): ByteBuffer $buffer->writeUInt64(+$this->data['amount']); $buffer->writeUInt32($this->data['expiration'] ?? 0); - $buffer->writeHex(Base58::decodeCheck($this->data['recipientId'])->getHex()); + $buffer->writeHex(bin2hex(Base58::decodeCheck($this->data['recipientId']))); return $buffer; } @@ -39,7 +38,7 @@ public function deserialize(ByteBuffer $buffer): void { $this->data['amount'] = strval($buffer->readUInt64()); $this->data['expiration'] = $buffer->readUInt32(); - $this->data['recipientId'] = Base58::encodeCheck(new Buffer(hex2bin($buffer->readHex(21 * 2)))); + $this->data['recipientId'] = Base58::encodeCheck(hex2bin($buffer->readHex(21 * 2))); } public function hasVendorField(): bool diff --git a/src/Utils/Base58.php b/src/Utils/Base58.php new file mode 100644 index 00000000..f404b610 --- /dev/null +++ b/src/Utils/Base58.php @@ -0,0 +1,128 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Crypto\Utils; + +use InvalidArgumentException; + +/** + * Base58 and Base58Check encoding with the Bitcoin alphabet. + */ +class Base58 +{ + private const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; + + /** + * Encode the given binary string. + * + * @param string $binary + * + * @return string + */ + public static function encode(string $binary): string + { + if ($binary === '') { + return ''; + } + + $number = gmp_import($binary); + $encoded = ''; + + while (gmp_cmp($number, 0) > 0) { + [$number, $remainder] = gmp_div_qr($number, 58); + $encoded = self::ALPHABET[gmp_intval($remainder)].$encoded; + } + + $leadingZeros = strlen($binary) - strlen(ltrim($binary, "\0")); + + return str_repeat(self::ALPHABET[0], $leadingZeros).$encoded; + } + + /** + * Decode the given Base58 string into binary. + * + * @param string $encoded + * + * @return string + */ + public static function decode(string $encoded): string + { + if ($encoded === '') { + return ''; + } + + $number = gmp_init(0); + + foreach (str_split($encoded) as $character) { + $position = strpos(self::ALPHABET, $character); + + if ($position === false) { + throw new InvalidArgumentException('The given value contains invalid Base58 characters.'); + } + + $number = gmp_add(gmp_mul($number, 58), $position); + } + + $decoded = gmp_cmp($number, 0) > 0 ? gmp_export($number) : ''; + $leadingZeros = strlen($encoded) - strlen(ltrim($encoded, self::ALPHABET[0])); + + return str_repeat("\0", $leadingZeros).$decoded; + } + + /** + * Encode the given binary string with a 4-byte double SHA-256 checksum. + * + * @param string $binary + * + * @return string + */ + public static function encodeCheck(string $binary): string + { + return static::encode($binary.static::checksum($binary)); + } + + /** + * Decode the given Base58Check string and verify its checksum. + * + * @param string $encoded + * + * @return string + */ + public static function decodeCheck(string $encoded): string + { + $decoded = static::decode($encoded); + + if (strlen($decoded) < 4) { + throw new InvalidArgumentException('The given value is too short to contain a checksum.'); + } + + $payload = substr($decoded, 0, -4); + $checksum = substr($decoded, -4); + + if (! hash_equals(static::checksum($payload), $checksum)) { + throw new InvalidArgumentException('The given value has an invalid checksum.'); + } + + return $payload; + } + + /** + * @param string $binary + * + * @return string + */ + private static function checksum(string $binary): string + { + return substr(Hash::sha256d($binary)->getBinary(), 0, 4); + } +} diff --git a/src/Utils/Hash.php b/src/Utils/Hash.php new file mode 100644 index 00000000..30d52796 --- /dev/null +++ b/src/Utils/Hash.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Crypto\Utils; + +use ArkEcosystem\Crypto\Binary\Bytes; + +/** + * This is the hash class. + */ +class Hash +{ + /** + * Hash the given data with SHA-256. + * + * @param Bytes|string $data + * + * @return Bytes + */ + public static function sha256($data): Bytes + { + return new Bytes(hash('sha256', static::binary($data), true)); + } + + /** + * Hash the given data with SHA-256 twice. + * + * @param Bytes|string $data + * + * @return Bytes + */ + public static function sha256d($data): Bytes + { + return static::sha256(static::sha256($data)); + } + + /** + * Hash the given data with RIPEMD-160. + * + * @param Bytes|string $data + * + * @return Bytes + */ + public static function ripemd160($data): Bytes + { + return new Bytes(hash('ripemd160', static::binary($data), true)); + } + + /** + * @param Bytes|string $data + * + * @return string + */ + private static function binary($data): string + { + return $data instanceof Bytes ? $data->getBinary() : $data; + } +} diff --git a/src/Utils/Message.php b/src/Utils/Message.php index f406788b..983a88de 100644 --- a/src/Utils/Message.php +++ b/src/Utils/Message.php @@ -14,10 +14,7 @@ namespace ArkEcosystem\Crypto\Utils; use ArkEcosystem\Crypto\Identities\PrivateKey; -use BitWasp\Bitcoin\Crypto\Hash; -use BitWasp\Bitcoin\Key\Factory\PublicKeyFactory; -use BitWasp\Bitcoin\Signature\SignatureFactory; -use BitWasp\Buffertools\Buffer; +use ArkEcosystem\Crypto\Identities\PublicKey; use InvalidArgumentException; /** @@ -93,7 +90,7 @@ public static function new($message): self } if (is_array($message)) { - return new static(json_decode(json_encode($message))); + return new static((object) $message); } if (is_string($message)) { @@ -117,7 +114,7 @@ public static function sign(string $message, string $passphrase): self return static::new([ 'publickey' => $keys->getPublicKey()->getHex(), - 'signature' => $keys->sign(Hash::sha256(new Buffer($message)))->getBuffer()->getHex(), + 'signature' => $keys->sign(Hash::sha256($message))->getHex(), 'message' => $message, ]); } @@ -129,12 +126,7 @@ public static function sign(string $message, string $passphrase): self */ public function verify(): bool { - $factory = new PublicKeyFactory(); - - return $factory->fromHex($this->publicKey)->verify( - new Buffer(hash('sha256', $this->message, true)), - SignatureFactory::fromHex($this->signature) - ); + return PublicKey::fromHex($this->publicKey)->verify(Hash::sha256($this->message), $this->signature); } /** diff --git a/src/Utils/Secp256k1.php b/src/Utils/Secp256k1.php new file mode 100644 index 00000000..a744b7bf --- /dev/null +++ b/src/Utils/Secp256k1.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Crypto\Utils; + +use Elliptic\EC; + +/** + * Shared secp256k1 curve instance. + * + * Building the curve precomputes lookup tables, so a single instance is + * reused for every key and signature operation. + */ +class Secp256k1 +{ + /** + * @var EC|null + */ + private static $curve; + + /** + * Get the secp256k1 curve. + * + * @return EC + */ + public static function curve(): EC + { + return static::$curve ??= new EC('secp256k1'); + } +} diff --git a/tests/Analysis/AnalysisTest.php b/tests/Analysis/AnalysisTest.php deleted file mode 100644 index 77d81014..00000000 --- a/tests/Analysis/AnalysisTest.php +++ /dev/null @@ -1,29 +0,0 @@ -deserialize(); $data = $actual->data; @@ -30,19 +29,14 @@ protected function assertDeserialized(array $expected, array $keys, int $network return $actual; } - protected function object_to_array(object $value): array - { - return json_decode(json_encode($value), true); - } - - protected function assertSameTransactions(array $expected, array $actual, array $keys = []): void + public function assertSameTransactions(array $expected, array $actual, array $keys = []): void { if (empty($keys)) { $keys = array_keys($expected['data']); } - $expected = Arr::only($expected['data'], $keys); - $actual = Arr::only($actual, $keys); + $expected = array_intersect_key($expected['data'], array_flip($keys)); + $actual = array_intersect_key($actual, array_flip($keys)); ksort($expected); ksort($actual); @@ -63,16 +57,4 @@ protected function assertSameTransactions(array $expected, array $actual, array $this->assertSame($expected, $actual); } - - private function array_only(array $arr, array $keys): array - { - $returnArray = []; - foreach ($keys as $key) { - if (isset($arr[$key])) { - $returnArray[$key] = $arr[$key]; - } - } - - return $returnArray; - } } diff --git a/tests/Concerns/Fixtures.php b/tests/Concerns/Fixtures.php index 8fa48ac5..ba4eb0f7 100644 --- a/tests/Concerns/Fixtures.php +++ b/tests/Concerns/Fixtures.php @@ -22,7 +22,7 @@ trait Fixtures * * @return array */ - protected function getFixture(string $file): array + public function getFixture(string $file): array { $path = __DIR__."/../fixtures/{$file}.json"; @@ -37,7 +37,7 @@ protected function getFixture(string $file): array * * @return array|object */ - protected function getTransactionFixture(string $type, string $name): array + public function getTransactionFixture(string $type, string $name): array { return $this->getFixture("transactions/{$type}/{$name}"); } diff --git a/tests/Concerns/Serialize.php b/tests/Concerns/Serialize.php index 94236cad..eb43c99d 100644 --- a/tests/Concerns/Serialize.php +++ b/tests/Concerns/Serialize.php @@ -42,7 +42,7 @@ trait Serialize HtlcRefund::class, ]; - protected function assertSerialized(array $fixture): void + public function assertSerialized(array $fixture): void { $data = $fixture['data']; $transactionClass = $this->transactionsClasses[$fixture['data']['type']]; diff --git a/tests/Helpers.php b/tests/Helpers.php deleted file mode 100644 index f25183a4..00000000 --- a/tests/Helpers.php +++ /dev/null @@ -1,7 +0,0 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use ArkEcosystem\Tests\Crypto\TestCase; -uses(TestCase::class)->in(__DIR__); +pest()->extend(TestCase::class)->in(__DIR__); diff --git a/tests/Unit/Binary/BytesTest.php b/tests/Unit/Binary/BytesTest.php new file mode 100644 index 00000000..26f32d49 --- /dev/null +++ b/tests/Unit/Binary/BytesTest.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Tests\Crypto\Unit\Binary; + +use ArkEcosystem\Crypto\Binary\Bytes; +use InvalidArgumentException; + +it('should expose the bytes as binary hex and size', function () { + $bytes = new Bytes("\x00\xff"); + + $this->assertSame("\x00\xff", $bytes->getBinary()); + $this->assertSame('00ff', $bytes->getHex()); + $this->assertSame(2, $bytes->getSize()); +}); + +it('should create bytes from hex', function () { + $this->assertSame("\xab\xcd", Bytes::fromHex('ABCD')->getBinary()); + $this->assertSame('', Bytes::fromHex('')->getBinary()); +}); + +it('should reject invalid hex', function () { + $this->expectException(InvalidArgumentException::class); + + Bytes::fromHex('abc'); +}); + +it('should reject non hex characters', function () { + $this->expectException(InvalidArgumentException::class); + + Bytes::fromHex('zz'); +}); diff --git a/tests/Unit/ByteBuffer/ByteBufferTest.php b/tests/Unit/ByteBuffer/ByteBufferTest.php index a03a0a49..ea749fb6 100644 --- a/tests/Unit/ByteBuffer/ByteBufferTest.php +++ b/tests/Unit/ByteBuffer/ByteBufferTest.php @@ -14,324 +14,248 @@ namespace ArkEcosystem\Tests\Crypto; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the length map test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\ByteBuffer - */ -class ByteBufferTest extends TestCase -{ - /** @test */ - public function it_should_get_the_value_at_the_given_offset() - { - $buffer = ByteBuffer::new('Hello World'); - - $this->assertSame('e', $buffer->__get(1)); - } - - /** @test */ - public function it_should_set_the_value_at_the_given_offset() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->__set(1, 'X'); - - $this->assertSame('X', $buffer->__get(1)); - } - - /** @test */ - public function it_should_check_if_the_offset_exists() - { - $buffer = ByteBuffer::new('Hello World'); - - $this->assertTrue($buffer->__isset(1)); - } - - /** @test */ - public function it_should_unset_the_value_at_the_given_offset() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->__unset(1); - - $this->assertFalse($buffer->__isset(1)); - } - - /** @test */ - public function it_should_initialise_from_array() - { - $buffer = ByteBuffer::new(str_split('Hello World')); - - $this->assertInstanceOf(ByteBuffer::class, $buffer); - $this->assertSame(11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_initialise_from_integer() - { - $buffer = ByteBuffer::new(11); - - $this->assertInstanceOf(ByteBuffer::class, $buffer); - $this->assertSame(11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_initialise_from_string() - { - $buffer = ByteBuffer::new('Hello World'); - - $this->assertInstanceOf(ByteBuffer::class, $buffer); - $this->assertSame(11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_throw_for_invalid_type() - { - $this->expectException(\InvalidArgumentException::class); - - $buffer = ByteBuffer::new(123.456); - } - - /** @test */ - public function it_should_allocate_the_given_number_of_bytes() - { - $buffer = ByteBuffer::allocate(11); - - $this->assertInstanceOf(ByteBuffer::class, $buffer); - $this->assertSame(11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_fail_to_allocate_the_given_number_of_bytes() - { - $this->expectException(\InvalidArgumentException::class); - - ByteBuffer::allocate(-1); - } - - /** @test */ - public function it_should_initialise_the_buffer() - { - $buffer = ByteBuffer::allocate(11); - $buffer->initializeBuffer(11, 'Hello World'); - - $this->assertSame('Hello World', $buffer->toUTF8()); - $this->assertSame(11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_pack_the_given_value() - { - $buffer = ByteBuffer::allocate(11); - $buffer->pack('C', 255, 0); - - $this->assertSame(255, unpack('C', $buffer->offsetGet(0))[1]); - } - - /** @test */ - public function it_should_unpack_the_given_value() - { - $buffer = ByteBuffer::allocate(11); - $buffer->pack('C', 255, 0); - $buffer->position(0); - - $this->assertSame(255, $buffer->unpack('C')); - } - - /** @test */ - public function it_should_get_the_value() - { - $buffer = ByteBuffer::allocate(11); - $buffer->pack('C', 255, 0); - - $this->assertSame(255, unpack('C', $buffer->get(0))[1]); - } - - /** @test */ - public function it_should_concat_the_given_buffers() - { - $hello = ByteBuffer::new('Hello'); - $world = ByteBuffer::new('World'); - - $buffer = ByteBuffer::concat($hello, $world); - - $this->assertSame('HelloWorld', $buffer->toUTF8()); - } - - /** @test */ - public function it_should_append_the_given_buffer() - { - $buffer = ByteBuffer::new('Hello'); - $buffer->append(ByteBuffer::new('World')); - - $this->assertSame('HelloWorld', $buffer->toUTF8()); - $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer - } - - /** @test */ - public function it_should_append_the_given_string() - { - $buffer = ByteBuffer::new('Hello'); - $buffer->append('World'); - - $this->assertSame('HelloWorld', $buffer->toUTF8()); - $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer - } - - /** @test */ - public function it_should_append_the_given_buffer_to_another() - { - $buffer = ByteBuffer::new('Hello'); - - ByteBuffer::new('World')->appendTo($buffer); - - $this->assertSame('HelloWorld', $buffer->toUTF8()); - $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer - } - - /** @test */ - public function it_should_prepend_the_given_buffer() - { - $buffer = ByteBuffer::new('World'); - $buffer->prepend(ByteBuffer::new('Hello')); - - $this->assertSame('HelloWorld', $buffer->toUTF8()); - $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer - } - - /** @test */ - public function it_should_prepend_the_given_string() - { - $buffer = ByteBuffer::new('World'); - $buffer->prepend('Hello'); - - $this->assertSame('HelloWorld', $buffer->toUTF8()); - $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer - } - - /** @test */ - public function it_should_prepend_the_given_buffer_to_another() - { - $buffer = ByteBuffer::new('World'); - - ByteBuffer::new('Hello')->prependTo($buffer); - - $this->assertSame('HelloWorld', $buffer->toUTF8()); - $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer - } - - /** @test */ - public function it_should_fill_the_buffer_with_the_given_number_of_bytes() - { - $buffer = ByteBuffer::new(1); - $buffer->fill(11); - - $this->assertSame(11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_fill_the_buffer_starting_from_current_position() - { - $buffer = ByteBuffer::new('hello'); - $buffer->position(4); - $buffer->fill(11); - - $this->assertSame(4 + 11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_flip_the_buffer_contents() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->flip(); - - $this->assertSame(11, $buffer->internalSize()); - $this->assertSame(0, $buffer->current()); - $this->assertSame('dlroW olleH', $buffer->toUTF8()); - } - - /** @test */ - public function it_should_set_the_byte_order() - { - $buffer = ByteBuffer::new(1); - $buffer->order(0); - - $this->assertTrue($buffer->isBigEndian()); - } - - /** @test */ - public function it_should_reverse_the_buffer_contents() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->reverse(); - - $this->assertSame('dlroW olleH', $buffer->toUTF8()); - } - - /** @test */ - public function it_should_slice_the_buffer_contents() - { - $buffer = ByteBuffer::new('Hello World'); - - $this->assertSame(str_split('Hello'), $buffer->slice(0, 5)); - } - - /** @test */ - public function it_should_fail_to_slice_the_buffer_contents_if_offset_is_to_big() - { - $this->expectException(\InvalidArgumentException::class); - - ByteBuffer::new('Hello World')->slice(16, 5); - } - - /** @test */ - public function it_should_fail_to_slice_the_buffer_contents_if_length_is_to_big() - { - $this->expectException(\InvalidArgumentException::class); - - ByteBuffer::new('Hello World')->slice(0, 16); - } - - /** @test */ - public function it_should_compare_if_the_buffers_are_equal() - { - $buffer1 = ByteBuffer::allocate(11); - $buffer2 = ByteBuffer::allocate(11); - - $this->assertTrue($buffer1->equals($buffer2)); - } - - /** @test */ - public function it_should_test_if_the_given_value_is_a_byte_buffer() - { - $buffer = ByteBuffer::allocate(11); - - $this->assertTrue($buffer->isByteBuffer($buffer)); - } - - /** @test */ - public function it_should_test_if_the_buffer_is_big_endian() - { - $buffer = ByteBuffer::allocate(11); - $buffer->order(0); - - $this->assertTrue($buffer->isBigEndian()); - } - - /** @test */ - public function it_should_test_if_the_buffer_is_little_endian() - { - $buffer = ByteBuffer::allocate(11); - $buffer->order(1); - - $this->assertTrue($buffer->isLittleEndian()); - } - - /** @test */ - public function it_should_test_if_the_buffer_is_machine_byte() - { - $buffer = ByteBuffer::allocate(11); - $buffer->order(2); - - $this->assertTrue($buffer->isMachineByte()); - } -} +it('should get the value at the given offset', function () { + $buffer = ByteBuffer::new('Hello World'); + + $this->assertSame('e', $buffer->__get(1)); +}); + +it('should set the value at the given offset', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->__set(1, 'X'); + + $this->assertSame('X', $buffer->__get(1)); +}); + +it('should check if the offset exists', function () { + $buffer = ByteBuffer::new('Hello World'); + + $this->assertTrue($buffer->__isset(1)); +}); + +it('should unset the value at the given offset', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->__unset(1); + + $this->assertFalse($buffer->__isset(1)); +}); + +it('should initialise from array', function () { + $buffer = ByteBuffer::new(str_split('Hello World')); + + $this->assertInstanceOf(ByteBuffer::class, $buffer); + $this->assertSame(11, $buffer->internalSize()); +}); + +it('should initialise from integer', function () { + $buffer = ByteBuffer::new(11); + + $this->assertInstanceOf(ByteBuffer::class, $buffer); + $this->assertSame(11, $buffer->internalSize()); +}); + +it('should initialise from string', function () { + $buffer = ByteBuffer::new('Hello World'); + + $this->assertInstanceOf(ByteBuffer::class, $buffer); + $this->assertSame(11, $buffer->internalSize()); +}); + +it('should throw for invalid type', function () { + $this->expectException(\InvalidArgumentException::class); + + $buffer = ByteBuffer::new(123.456); +}); + +it('should allocate the given number of bytes', function () { + $buffer = ByteBuffer::allocate(11); + + $this->assertInstanceOf(ByteBuffer::class, $buffer); + $this->assertSame(11, $buffer->internalSize()); +}); + +it('should fail to allocate the given number of bytes', function () { + $this->expectException(\InvalidArgumentException::class); + + ByteBuffer::allocate(-1); +}); + +it('should initialise the buffer', function () { + $buffer = ByteBuffer::allocate(11); + $buffer->initializeBuffer(11, 'Hello World'); + + $this->assertSame('Hello World', $buffer->toUTF8()); + $this->assertSame(11, $buffer->internalSize()); +}); + +it('should pack the given value', function () { + $buffer = ByteBuffer::allocate(11); + $buffer->pack('C', 255, 0); + + $this->assertSame(255, unpack('C', $buffer->offsetGet(0))[1]); +}); + +it('should unpack the given value', function () { + $buffer = ByteBuffer::allocate(11); + $buffer->pack('C', 255, 0); + $buffer->position(0); + + $this->assertSame(255, $buffer->unpack('C')); +}); + +it('should get the value', function () { + $buffer = ByteBuffer::allocate(11); + $buffer->pack('C', 255, 0); + + $this->assertSame(255, unpack('C', $buffer->get(0))[1]); +}); + +it('should concat the given buffers', function () { + $hello = ByteBuffer::new('Hello'); + $world = ByteBuffer::new('World'); + + $buffer = ByteBuffer::concat($hello, $world); + + $this->assertSame('HelloWorld', $buffer->toUTF8()); +}); + +it('should append the given buffer', function () { + $buffer = ByteBuffer::new('Hello'); + $buffer->append(ByteBuffer::new('World')); + + $this->assertSame('HelloWorld', $buffer->toUTF8()); + $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer +}); + +it('should append the given string', function () { + $buffer = ByteBuffer::new('Hello'); + $buffer->append('World'); + + $this->assertSame('HelloWorld', $buffer->toUTF8()); + $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer +}); + +it('should append the given buffer to another', function () { + $buffer = ByteBuffer::new('Hello'); + + ByteBuffer::new('World')->appendTo($buffer); + + $this->assertSame('HelloWorld', $buffer->toUTF8()); + $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer +}); + +it('should prepend the given buffer', function () { + $buffer = ByteBuffer::new('World'); + $buffer->prepend(ByteBuffer::new('Hello')); + + $this->assertSame('HelloWorld', $buffer->toUTF8()); + $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer +}); + +it('should prepend the given string', function () { + $buffer = ByteBuffer::new('World'); + $buffer->prepend('Hello'); + + $this->assertSame('HelloWorld', $buffer->toUTF8()); + $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer +}); + +it('should prepend the given buffer to another', function () { + $buffer = ByteBuffer::new('World'); + + ByteBuffer::new('Hello')->prependTo($buffer); + + $this->assertSame('HelloWorld', $buffer->toUTF8()); + $this->assertSame($buffer->capacity(), $buffer->current()); // offset should be at the end of new buffer +}); + +it('should fill the buffer with the given number of bytes', function () { + $buffer = ByteBuffer::new(1); + $buffer->fill(11); + + $this->assertSame(11, $buffer->internalSize()); +}); + +it('should fill the buffer starting from current position', function () { + $buffer = ByteBuffer::new('hello'); + $buffer->position(4); + $buffer->fill(11); + + $this->assertSame(4 + 11, $buffer->internalSize()); +}); + +it('should flip the buffer contents', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->flip(); + + $this->assertSame(11, $buffer->internalSize()); + $this->assertSame(0, $buffer->current()); + $this->assertSame('dlroW olleH', $buffer->toUTF8()); +}); + +it('should set the byte order', function () { + $buffer = ByteBuffer::new(1); + $buffer->order(0); + + $this->assertTrue($buffer->isBigEndian()); +}); + +it('should reverse the buffer contents', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->reverse(); + + $this->assertSame('dlroW olleH', $buffer->toUTF8()); +}); + +it('should slice the buffer contents', function () { + $buffer = ByteBuffer::new('Hello World'); + + $this->assertSame(str_split('Hello'), $buffer->slice(0, 5)); +}); + +it('should fail to slice the buffer contents if offset is to big', function () { + $this->expectException(\InvalidArgumentException::class); + + ByteBuffer::new('Hello World')->slice(16, 5); +}); + +it('should fail to slice the buffer contents if length is to big', function () { + $this->expectException(\InvalidArgumentException::class); + + ByteBuffer::new('Hello World')->slice(0, 16); +}); + +it('should compare if the buffers are equal', function () { + $buffer1 = ByteBuffer::allocate(11); + $buffer2 = ByteBuffer::allocate(11); + + $this->assertTrue($buffer1->equals($buffer2)); +}); + +it('should test if the given value is a byte buffer', function () { + $buffer = ByteBuffer::allocate(11); + + $this->assertTrue($buffer->isByteBuffer($buffer)); +}); + +it('should test if the buffer is big endian', function () { + $buffer = ByteBuffer::allocate(11); + $buffer->order(0); + + $this->assertTrue($buffer->isBigEndian()); +}); + +it('should test if the buffer is little endian', function () { + $buffer = ByteBuffer::allocate(11); + $buffer->order(1); + + $this->assertTrue($buffer->isLittleEndian()); +}); + +it('should test if the buffer is machine byte', function () { + $buffer = ByteBuffer::allocate(11); + $buffer->order(2); + + $this->assertTrue($buffer->isMachineByte()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/InitialisableTest.php b/tests/Unit/ByteBuffer/Concerns/InitialisableTest.php index dbc6f668..d1e5262e 100644 --- a/tests/Unit/ByteBuffer/Concerns/InitialisableTest.php +++ b/tests/Unit/ByteBuffer/Concerns/InitialisableTest.php @@ -14,101 +14,73 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the initialisable test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Initialisable - */ -class InitialisableTest extends TestCase -{ - private $expected = '48656c6c6f20576f726c6420f09f9884'; - - /** @test */ - public function it_should_initialise_from_binary() - { - $buffer = ByteBuffer::fromBinary('Hello World 😄'); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_initialise_from_hex() - { - $buffer = ByteBuffer::fromHex('48656c6c6f20576f726c6420f09f9884'); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_fail_to_initialise_from_hex() - { - $this->expectException(\InvalidArgumentException::class); - - ByteBuffer::fromHex('😄'); - } - - /** @test */ - public function it_should_initialise_from_utf8() - { - $buffer = ByteBuffer::fromUTF8('Hello World 😄'); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_initialise_from_base64() - { - $buffer = ByteBuffer::fromBase64(base64_encode('Hello World 😄')); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_initialise_from_array() - { - $buffer = ByteBuffer::fromArray(str_split('Hello World 😄')); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_initialise_from_string_as_binary() - { - $buffer = ByteBuffer::fromString('Hello World 😄', 'binary'); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_initialise_from_string_as_hex() - { - $buffer = ByteBuffer::fromString('48656c6c6f20576f726c6420f09f9884', 'hex'); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_initialise_from_string_as_utf8() - { - $buffer = ByteBuffer::fromString('Hello World 😄', 'utf8'); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_initialise_from_string_as_base64() - { - $buffer = ByteBuffer::fromString(base64_encode('Hello World 😄'), 'base64'); - - $this->assertSame($this->expected, $buffer->toHex()); - } - - /** @test */ - public function it_should_throw_for_invalid_type() - { - $this->expectException(\InvalidArgumentException::class); - - ByteBuffer::fromString('Hello World 😄', '_INVALID_'); - } -} +beforeEach(function () { + $this->expected = '48656c6c6f20576f726c6420f09f9884'; +}); + +it('should initialise from binary', function () { + $buffer = ByteBuffer::fromBinary('Hello World 😄'); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should initialise from hex', function () { + $buffer = ByteBuffer::fromHex('48656c6c6f20576f726c6420f09f9884'); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should fail to initialise from hex', function () { + $this->expectException(\InvalidArgumentException::class); + + ByteBuffer::fromHex('😄'); +}); + +it('should initialise from utf8', function () { + $buffer = ByteBuffer::fromUTF8('Hello World 😄'); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should initialise from base64', function () { + $buffer = ByteBuffer::fromBase64(base64_encode('Hello World 😄')); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should initialise from array', function () { + $buffer = ByteBuffer::fromArray(str_split('Hello World 😄')); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should initialise from string as binary', function () { + $buffer = ByteBuffer::fromString('Hello World 😄', 'binary'); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should initialise from string as hex', function () { + $buffer = ByteBuffer::fromString('48656c6c6f20576f726c6420f09f9884', 'hex'); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should initialise from string as utf8', function () { + $buffer = ByteBuffer::fromString('Hello World 😄', 'utf8'); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should initialise from string as base64', function () { + $buffer = ByteBuffer::fromString(base64_encode('Hello World 😄'), 'base64'); + + $this->assertSame($this->expected, $buffer->toHex()); +}); + +it('should throw for invalid type', function () { + $this->expectException(\InvalidArgumentException::class); + + ByteBuffer::fromString('Hello World 😄', '_INVALID_'); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/OffsetableTest.php b/tests/Unit/ByteBuffer/Concerns/OffsetableTest.php index d484d45f..00cc604e 100644 --- a/tests/Unit/ByteBuffer/Concerns/OffsetableTest.php +++ b/tests/Unit/ByteBuffer/Concerns/OffsetableTest.php @@ -14,45 +14,29 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the offsetable test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Offsetable - */ -class OffsetableTest extends TestCase -{ - /** @test */ - public function it_should_get_the_value_at_the_given_offset() - { - $buffer = ByteBuffer::new('Hello World'); - - $this->assertSame('e', $buffer->offsetGet(1)); - } - - /** @test */ - public function it_should_set_the_value_at_the_given_offset() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->offsetSet(1, 'X'); - - $this->assertSame('X', $buffer->offsetGet(1)); - } - - /** @test */ - public function it_should_check_if_the_offset_exists() - { - $buffer = ByteBuffer::new('Hello World'); - - $this->assertTrue($buffer->offsetExists(1)); - } - - /** @test */ - public function it_should_unset_the_value_at_the_given_offset() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->offsetUnset(1); - - $this->assertFalse($buffer->offsetExists(1)); - } -} +it('should get the value at the given offset', function () { + $buffer = ByteBuffer::new('Hello World'); + + $this->assertSame('e', $buffer->offsetGet(1)); +}); + +it('should set the value at the given offset', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->offsetSet(1, 'X'); + + $this->assertSame('X', $buffer->offsetGet(1)); +}); + +it('should check if the offset exists', function () { + $buffer = ByteBuffer::new('Hello World'); + + $this->assertTrue($buffer->offsetExists(1)); +}); + +it('should unset the value at the given offset', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->offsetUnset(1); + + $this->assertFalse($buffer->offsetExists(1)); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/PositionableTest.php b/tests/Unit/ByteBuffer/Concerns/PositionableTest.php index 491028a8..21957262 100644 --- a/tests/Unit/ByteBuffer/Concerns/PositionableTest.php +++ b/tests/Unit/ByteBuffer/Concerns/PositionableTest.php @@ -14,75 +14,55 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the positionable test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Positionable - */ -class PositionableTest extends TestCase -{ - /** @test */ - public function it_should_current_the_offset() - { - $buffer = ByteBuffer::new(8); - $buffer->current(); - - $this->assertSame(0, $buffer->current()); - } - - /** @test */ - public function it_should_set_the_offset_to_the_given_value() - { - $buffer = ByteBuffer::new(8); - $buffer->position(5); - - $this->assertSame(5, $buffer->current()); - } - - /** @test */ - public function it_should_skip_the_given_number_of_bytes() - { - $buffer = ByteBuffer::new(8); - $buffer->skip(2); - $buffer->skip(3); - $buffer->skip(1); - - $this->assertSame(6, $buffer->current()); - } - - /** @test */ - public function it_should_rewind_the_given_number_of_bytes() - { - $buffer = ByteBuffer::new(8); - $buffer->position(5); - $buffer->rewind(3); - $buffer->rewind(1); - - $this->assertSame(1, $buffer->current()); - } - - /** @test */ - public function it_should_reset_the_offset() - { - $buffer = ByteBuffer::new(8); - $buffer->position(5); - $this->assertSame(5, $buffer->current()); - - $buffer->reset(); - $this->assertSame(0, $buffer->current()); - } - - /** @test */ - public function it_should_clear_the_offset() - { - $buffer = ByteBuffer::new(8); - $buffer->position(5); - $this->assertSame(5, $buffer->current()); - $this->assertSame(8, $buffer->capacity()); - - $buffer->clear(); - $this->assertSame(0, $buffer->current()); - $this->assertSame(8, $buffer->capacity()); - } -} +it('should current the offset', function () { + $buffer = ByteBuffer::new(8); + $buffer->current(); + + $this->assertSame(0, $buffer->current()); +}); + +it('should set the offset to the given value', function () { + $buffer = ByteBuffer::new(8); + $buffer->position(5); + + $this->assertSame(5, $buffer->current()); +}); + +it('should skip the given number of bytes', function () { + $buffer = ByteBuffer::new(8); + $buffer->skip(2); + $buffer->skip(3); + $buffer->skip(1); + + $this->assertSame(6, $buffer->current()); +}); + +it('should rewind the given number of bytes', function () { + $buffer = ByteBuffer::new(8); + $buffer->position(5); + $buffer->rewind(3); + $buffer->rewind(1); + + $this->assertSame(1, $buffer->current()); +}); + +it('should reset the offset', function () { + $buffer = ByteBuffer::new(8); + $buffer->position(5); + $this->assertSame(5, $buffer->current()); + + $buffer->reset(); + $this->assertSame(0, $buffer->current()); +}); + +it('should clear the offset', function () { + $buffer = ByteBuffer::new(8); + $buffer->position(5); + $this->assertSame(5, $buffer->current()); + $this->assertSame(8, $buffer->capacity()); + + $buffer->clear(); + $this->assertSame(0, $buffer->current()); + $this->assertSame(8, $buffer->capacity()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Reads/FloatsTest.php b/tests/Unit/ByteBuffer/Concerns/Reads/FloatsTest.php index 439496ca..cdffaa19 100644 --- a/tests/Unit/ByteBuffer/Concerns/Reads/FloatsTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Reads/FloatsTest.php @@ -14,41 +14,27 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the integer reader test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Reads\Floats - */ -class FloatsTest extends TestCase -{ - /** @test */ - public function it_should_read_float32() - { - $buffer = ByteBuffer::new(1); - $buffer->writeFloat32(8.0); - $buffer->position(0); - - $this->assertSame(8.0, $buffer->readFloat32()); - } - - /** @test */ - public function it_should_read_float64() - { - $buffer = ByteBuffer::new(1); - $buffer->writeFloat64(8.0); - $buffer->position(0); - - $this->assertSame(8.0, $buffer->readFloat64()); - } - - /** @test */ - public function it_should_read_double() - { - $buffer = ByteBuffer::new(1); - $buffer->writeDouble(8.0); - $buffer->position(0); - - $this->assertSame(8.0, $buffer->readDouble()); - } -} +it('should read float32', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeFloat32(8.0); + $buffer->position(0); + + $this->assertSame(8.0, $buffer->readFloat32()); +}); + +it('should read float64', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeFloat64(8.0); + $buffer->position(0); + + $this->assertSame(8.0, $buffer->readFloat64()); +}); + +it('should read double', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeDouble(8.0); + $buffer->position(0); + + $this->assertSame(8.0, $buffer->readDouble()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Reads/HexTest.php b/tests/Unit/ByteBuffer/Concerns/Reads/HexTest.php index 952cbb7b..39c8bbff 100644 --- a/tests/Unit/ByteBuffer/Concerns/Reads/HexTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Reads/HexTest.php @@ -14,33 +14,21 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the hex reader test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Reads\Hex - */ -class HexTest extends TestCase -{ - /** @test */ - public function it_should_read_hex() - { - $buffer = ByteBuffer::new(0); - $buffer->writeHex('48656c6c6f20576f726c64'); - $buffer->position(0); - - $this->assertSame(11, $buffer->internalSize()); - $this->assertSame('48656c6c6f20576f726c64', $buffer->readHex(22)); - } - - /** @test */ - public function it_should_read_hex_as_string() - { - $buffer = ByteBuffer::new(0); - $buffer->writeHex('48656c6c6f20576f726c64'); - $buffer->position(0); - - $this->assertSame(11, $buffer->internalSize()); - $this->assertSame('Hello World', $buffer->readHexString(22)); - } -} +it('should read hex', function () { + $buffer = ByteBuffer::new(0); + $buffer->writeHex('48656c6c6f20576f726c64'); + $buffer->position(0); + + $this->assertSame(11, $buffer->internalSize()); + $this->assertSame('48656c6c6f20576f726c64', $buffer->readHex(22)); +}); + +it('should read hex as string', function () { + $buffer = ByteBuffer::new(0); + $buffer->writeHex('48656c6c6f20576f726c64'); + $buffer->position(0); + + $this->assertSame(11, $buffer->internalSize()); + $this->assertSame('Hello World', $buffer->readHexString(22)); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Reads/IntegerTest.php b/tests/Unit/ByteBuffer/Concerns/Reads/IntegerTest.php index 2aacbd5e..bdce37dd 100644 --- a/tests/Unit/ByteBuffer/Concerns/Reads/IntegerTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Reads/IntegerTest.php @@ -14,91 +14,67 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the integer reader test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Reads\Integer - */ -class IntegerTest extends TestCase -{ - /** @test */ - public function it_should_read_int8() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt8(8); - $buffer->position(0); - - $this->assertSame(8, $buffer->readInt8()); - } - - /** @test */ - public function it_should_read_int16() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt16(16); - $buffer->position(0); - - $this->assertSame(16, $buffer->readInt16()); - } - - /** @test */ - public function it_should_read_int32() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt32(32); - $buffer->position(0); - - $this->assertSame(32, $buffer->readInt32()); - } - - /** @test */ - public function it_should_read_int64() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt64(64); - $buffer->position(0); - - $this->assertSame(64, $buffer->readInt64()); - } - - /** @test */ - public function it_should_read_byte() - { - $buffer = ByteBuffer::new(1); - $buffer->writeByte(8); - $buffer->position(0); - - $this->assertSame(8, $buffer->readByte()); - } - - /** @test */ - public function it_should_read_short() - { - $buffer = ByteBuffer::new(1); - $buffer->writeShort(16); - $buffer->position(0); - - $this->assertSame(16, $buffer->readShort()); - } - - /** @test */ - public function it_should_read_int() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt(32); - $buffer->position(0); - - $this->assertSame(32, $buffer->readInt()); - } - - /** @test */ - public function it_should_read_long() - { - $buffer = ByteBuffer::new(1); - $buffer->writeLong(64); - $buffer->position(0); - - $this->assertSame(64, $buffer->readLong()); - } -} +it('should read int8', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt8(8); + $buffer->position(0); + + $this->assertSame(8, $buffer->readInt8()); +}); + +it('should read int16', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt16(16); + $buffer->position(0); + + $this->assertSame(16, $buffer->readInt16()); +}); + +it('should read int32', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt32(32); + $buffer->position(0); + + $this->assertSame(32, $buffer->readInt32()); +}); + +it('should read int64', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt64(64); + $buffer->position(0); + + $this->assertSame(64, $buffer->readInt64()); +}); + +it('should read byte', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeByte(8); + $buffer->position(0); + + $this->assertSame(8, $buffer->readByte()); +}); + +it('should read short', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeShort(16); + $buffer->position(0); + + $this->assertSame(16, $buffer->readShort()); +}); + +it('should read int', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt(32); + $buffer->position(0); + + $this->assertSame(32, $buffer->readInt()); +}); + +it('should read long', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeLong(64); + $buffer->position(0); + + $this->assertSame(64, $buffer->readLong()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Reads/StringsTest.php b/tests/Unit/ByteBuffer/Concerns/Reads/StringsTest.php index dcf81c18..1bb66c8b 100644 --- a/tests/Unit/ByteBuffer/Concerns/Reads/StringsTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Reads/StringsTest.php @@ -14,61 +14,43 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the string reader test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Reads\Strings - */ -class StringsTest extends TestCase -{ - /** @test */ - public function it_should_read_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeString('Hello World'); - $buffer->position(0); +it('should read string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeString('Hello World'); + $buffer->position(0); - $this->assertSame('Hello World', $buffer->readString(11)); - } + $this->assertSame('Hello World', $buffer->readString(11)); +}); - /** @test */ - public function it_should_read_utf8_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUTF8String('Hello World 😄'); - $buffer->position(0); +it('should read utf8 string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUTF8String('Hello World 😄'); + $buffer->position(0); - $this->assertSame('Hello World 😄', $buffer->readUTF8String(20)); - } + $this->assertSame('Hello World 😄', $buffer->readUTF8String(20)); +}); - /** @test */ - public function it_should_read_c_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeCString('Hello World '); - $buffer->position(0); +it('should read c string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeCString('Hello World '); + $buffer->position(0); - $this->assertSame('Hello World', $buffer->readCString(11)); - } + $this->assertSame('Hello World', $buffer->readCString(11)); +}); - /** @test */ - public function it_should_read_i_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeIString('Hello World'); - $buffer->position(0); +it('should read i string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeIString('Hello World'); + $buffer->position(0); - $this->assertSame('Hello World', $buffer->readIString(11)); - } + $this->assertSame('Hello World', $buffer->readIString(11)); +}); - /** @test */ - public function it_should_write_v_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeVString('Hello World'); - $buffer->position(0); +it('should write v string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeVString('Hello World'); + $buffer->position(0); - $this->assertSame('Hello World', $buffer->readVString(11)); - } -} + $this->assertSame('Hello World', $buffer->readVString(11)); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Reads/UnsignedIntegerTest.php b/tests/Unit/ByteBuffer/Concerns/Reads/UnsignedIntegerTest.php index dd1b868c..5b9b507b 100644 --- a/tests/Unit/ByteBuffer/Concerns/Reads/UnsignedIntegerTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Reads/UnsignedIntegerTest.php @@ -14,91 +14,67 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the unsigned integer reader test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Reads\UnsignedInteger - */ -class UnsignedIntegerTest extends TestCase -{ - /** @test */ - public function it_should_read_uint8() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt8(8); - $buffer->position(0); - - $this->assertSame(8, $buffer->readUInt8()); - } - - /** @test */ - public function it_should_read_uint16() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt16(16); - $buffer->position(0); - - $this->assertSame(16, $buffer->readUInt16()); - } - - /** @test */ - public function it_should_read_uint32() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt32(32); - $buffer->position(0); - - $this->assertSame(32, $buffer->readUInt32()); - } - - /** @test */ - public function it_should_read_uint64() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt64(64); - $buffer->position(0); - - $this->assertSame(64, $buffer->readUInt64()); - } - - /** @test */ - public function it_should_read_ubyte() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUByte(8); - $buffer->position(0); - - $this->assertSame(8, $buffer->readUByte()); - } - - /** @test */ - public function it_should_read_ushort() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUShort(15); - $buffer->position(0); - - $this->assertSame(15, $buffer->readUShort()); - } - - /** @test */ - public function it_should_read_uint() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt(32); - $buffer->position(0); - - $this->assertSame(32, $buffer->readUInt()); - } - - /** @test */ - public function it_should_read_ulong() - { - $buffer = ByteBuffer::new(1); - $buffer->writeULong(64); - $buffer->position(0); - - $this->assertSame(64, $buffer->readULong()); - } -} +it('should read uint8', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt8(8); + $buffer->position(0); + + $this->assertSame(8, $buffer->readUInt8()); +}); + +it('should read uint16', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt16(16); + $buffer->position(0); + + $this->assertSame(16, $buffer->readUInt16()); +}); + +it('should read uint32', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt32(32); + $buffer->position(0); + + $this->assertSame(32, $buffer->readUInt32()); +}); + +it('should read uint64', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt64(64); + $buffer->position(0); + + $this->assertSame(64, $buffer->readUInt64()); +}); + +it('should read ubyte', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUByte(8); + $buffer->position(0); + + $this->assertSame(8, $buffer->readUByte()); +}); + +it('should read ushort', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUShort(15); + $buffer->position(0); + + $this->assertSame(15, $buffer->readUShort()); +}); + +it('should read uint', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt(32); + $buffer->position(0); + + $this->assertSame(32, $buffer->readUInt()); +}); + +it('should read ulong', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeULong(64); + $buffer->position(0); + + $this->assertSame(64, $buffer->readULong()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/SizeableTest.php b/tests/Unit/ByteBuffer/Concerns/SizeableTest.php index 133b12a5..b647a073 100644 --- a/tests/Unit/ByteBuffer/Concerns/SizeableTest.php +++ b/tests/Unit/ByteBuffer/Concerns/SizeableTest.php @@ -14,63 +14,43 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the sizeable test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Sizeable - */ -class SizeableTest extends TestCase -{ - /** @test */ - public function it_should_return_the_capacity() - { - $buffer = ByteBuffer::new(8); - - $this->assertSame(8, $buffer->capacity()); - } - - /** @test */ - public function it_should_return_the_internal_capacity() - { - $buffer = ByteBuffer::new(8); - - $this->assertSame(8, $buffer->internalSize()); - } - - /** @test */ - public function it_should_ensure_the_given_capacity() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->ensureCapacity(32); - - $this->assertSame(32, $buffer->capacity()); - } - - /** @test */ - public function it_should_keep_the_given_capacity() - { - $buffer = ByteBuffer::new('Hello World'); - - $this->assertInstanceOf(ByteBuffer::class, $buffer->ensureCapacity(5)); - $this->assertSame(11, $buffer->capacity()); - } - - /** @test */ - public function it_should_resize_the_buffer() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->resize(32); - - $this->assertSame(32, $buffer->capacity()); - } - - /** @test */ - public function it_should_return_the_remaining_bytes() - { - $buffer = ByteBuffer::new('Hello World'); - $buffer->remaining(); - - $this->assertSame(11, $buffer->remaining()); - } -} +it('should return the capacity', function () { + $buffer = ByteBuffer::new(8); + + $this->assertSame(8, $buffer->capacity()); +}); + +it('should return the internal capacity', function () { + $buffer = ByteBuffer::new(8); + + $this->assertSame(8, $buffer->internalSize()); +}); + +it('should ensure the given capacity', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->ensureCapacity(32); + + $this->assertSame(32, $buffer->capacity()); +}); + +it('should keep the given capacity', function () { + $buffer = ByteBuffer::new('Hello World'); + + $this->assertInstanceOf(ByteBuffer::class, $buffer->ensureCapacity(5)); + $this->assertSame(11, $buffer->capacity()); +}); + +it('should resize the buffer', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->resize(32); + + $this->assertSame(32, $buffer->capacity()); +}); + +it('should return the remaining bytes', function () { + $buffer = ByteBuffer::new('Hello World'); + $buffer->remaining(); + + $this->assertSame(11, $buffer->remaining()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/TransformableTest.php b/tests/Unit/ByteBuffer/Concerns/TransformableTest.php index 2223c50d..19bccc5e 100644 --- a/tests/Unit/ByteBuffer/Concerns/TransformableTest.php +++ b/tests/Unit/ByteBuffer/Concerns/TransformableTest.php @@ -14,115 +14,81 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Reads; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the transformable test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Transformable - */ -class TransformableTest extends TestCase -{ - /** @test */ - public function it_should_transform_to_binary() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('Hello World 😄', $buffer->toBinary()); - } - - /** @test */ - public function it_should_transform_to_hex() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('48656c6c6f20576f726c6420f09f9884', $buffer->toHex()); - } - - /** @test */ - public function it_should_transform_to_utf8() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('Hello World 😄', $buffer->toUTF8()); - } - - /** @test */ - public function it_should_transform_to_base64() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('SGVsbG8gV29ybGQg8J+YhA==', $buffer->toBase64()); - } - - /** @test */ - public function it_should_transform_to_array() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame(str_split('Hello World 😄'), $buffer->toArray()); - } - - /** @test */ - public function it_should_transform_to_gmp() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertInstanceOf(\GMP::class, $buffer->toGmp()); - } - - /** @test */ - public function it_should_transform_to_gmp_integer() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame(8245075110447257732, $buffer->toGmpInt()); - } - - /** @test */ - public function it_should_transform_to_gmp_string() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('96231036770496640978624582588703938692', $buffer->toGmpString()); - } - - /** @test */ - public function it_should_transform_to_string_as_binary() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('Hello World 😄', $buffer->toString('binary')); - } - - /** @test */ - public function it_should_transform_to_string_as_hex() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('48656c6c6f20576f726c6420f09f9884', $buffer->toString('hex')); - } - - /** @test */ - public function it_should_transform_to_string_as_utf8() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('Hello World 😄', $buffer->toString('utf8')); - } - - /** @test */ - public function it_should_transform_to_string_as_base64() - { - $buffer = ByteBuffer::new('Hello World 😄'); - - $this->assertSame('SGVsbG8gV29ybGQg8J+YhA==', $buffer->toString('base64')); - } - - /** @test */ - public function it_should_throw_for_invalid_type() - { - $this->expectException(\InvalidArgumentException::class); - - ByteBuffer::new('Hello World 😄')->toString('_INVALID_'); - } -} +it('should transform to binary', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('Hello World 😄', $buffer->toBinary()); +}); + +it('should transform to hex', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('48656c6c6f20576f726c6420f09f9884', $buffer->toHex()); +}); + +it('should transform to utf8', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('Hello World 😄', $buffer->toUTF8()); +}); + +it('should transform to base64', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('SGVsbG8gV29ybGQg8J+YhA==', $buffer->toBase64()); +}); + +it('should transform to array', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame(str_split('Hello World 😄'), $buffer->toArray()); +}); + +it('should transform to gmp', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertInstanceOf(\GMP::class, $buffer->toGmp()); +}); + +it('should transform to gmp integer', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame(8245075110447257732, $buffer->toGmpInt()); +}); + +it('should transform to gmp string', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('96231036770496640978624582588703938692', $buffer->toGmpString()); +}); + +it('should transform to string as binary', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('Hello World 😄', $buffer->toString('binary')); +}); + +it('should transform to string as hex', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('48656c6c6f20576f726c6420f09f9884', $buffer->toString('hex')); +}); + +it('should transform to string as utf8', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('Hello World 😄', $buffer->toString('utf8')); +}); + +it('should transform to string as base64', function () { + $buffer = ByteBuffer::new('Hello World 😄'); + + $this->assertSame('SGVsbG8gV29ybGQg8J+YhA==', $buffer->toString('base64')); +}); + +it('should throw for invalid type', function () { + $this->expectException(\InvalidArgumentException::class); + + ByteBuffer::new('Hello World 😄')->toString('_INVALID_'); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Writes/FloatsTest.php b/tests/Unit/ByteBuffer/Concerns/Writes/FloatsTest.php index c11274cc..0a405aab 100644 --- a/tests/Unit/ByteBuffer/Concerns/Writes/FloatsTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Writes/FloatsTest.php @@ -14,38 +14,24 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Writes; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the integer writer test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Writes\Floats - */ -class FloatsTest extends TestCase -{ - /** @test */ - public function it_should_write_float32() - { - $buffer = ByteBuffer::new(1); - $buffer->writeFloat32(8.0); - - $this->assertSame(4, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_float64() - { - $buffer = ByteBuffer::new(1); - $buffer->writeFloat64(8.0); - - $this->assertSame(8, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_double() - { - $buffer = ByteBuffer::new(1); - $buffer->writeDouble(8.0); - - $this->assertSame(8, $buffer->internalSize()); - } -} +it('should write float32', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeFloat32(8.0); + + $this->assertSame(4, $buffer->internalSize()); +}); + +it('should write float64', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeFloat64(8.0); + + $this->assertSame(8, $buffer->internalSize()); +}); + +it('should write double', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeDouble(8.0); + + $this->assertSame(8, $buffer->internalSize()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Writes/HexTest.php b/tests/Unit/ByteBuffer/Concerns/Writes/HexTest.php index bb396a06..dcb6be19 100644 --- a/tests/Unit/ByteBuffer/Concerns/Writes/HexTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Writes/HexTest.php @@ -14,22 +14,12 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Writes; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the hex writer test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Writes\Hex - */ -class HexTest extends TestCase -{ - /** @test */ - public function it_should_write_hex() - { - $buffer = ByteBuffer::new(0); - $buffer->writeHex('48656c6c6f20576f726c64'); - $buffer->position(0); +it('should write hex', function () { + $buffer = ByteBuffer::new(0); + $buffer->writeHex('48656c6c6f20576f726c64'); + $buffer->position(0); - $this->assertSame(11, $buffer->internalSize()); - $this->assertSame('Hello World', $buffer->readHexString(22)); - } -} + $this->assertSame(11, $buffer->internalSize()); + $this->assertSame('Hello World', $buffer->readHexString(22)); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Writes/IntegerTest.php b/tests/Unit/ByteBuffer/Concerns/Writes/IntegerTest.php index fcca0dd0..21a7d290 100644 --- a/tests/Unit/ByteBuffer/Concerns/Writes/IntegerTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Writes/IntegerTest.php @@ -14,83 +14,59 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Writes; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the integer writer test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Writes\Integer - */ -class IntegerTest extends TestCase -{ - /** @test */ - public function it_should_write_int8() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt8(8); - - $this->assertSame(1, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_int16() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt16(16); - - $this->assertSame(2, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_int32() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt32(32); - - $this->assertSame(4, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_int64() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt64(64); - - $this->assertSame(8, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_byte() - { - $buffer = ByteBuffer::new(1); - $buffer->writeByte(8); - - $this->assertSame(1, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_short() - { - $buffer = ByteBuffer::new(1); - $buffer->writeShort(16); - - $this->assertSame(2, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_int() - { - $buffer = ByteBuffer::new(1); - $buffer->writeInt(32); - - $this->assertSame(4, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_long() - { - $buffer = ByteBuffer::new(1); - $buffer->writeLong(64); - - $this->assertSame(8, $buffer->internalSize()); - } -} +it('should write int8', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt8(8); + + $this->assertSame(1, $buffer->internalSize()); +}); + +it('should write int16', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt16(16); + + $this->assertSame(2, $buffer->internalSize()); +}); + +it('should write int32', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt32(32); + + $this->assertSame(4, $buffer->internalSize()); +}); + +it('should write int64', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt64(64); + + $this->assertSame(8, $buffer->internalSize()); +}); + +it('should write byte', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeByte(8); + + $this->assertSame(1, $buffer->internalSize()); +}); + +it('should write short', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeShort(16); + + $this->assertSame(2, $buffer->internalSize()); +}); + +it('should write int', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeInt(32); + + $this->assertSame(4, $buffer->internalSize()); +}); + +it('should write long', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeLong(64); + + $this->assertSame(8, $buffer->internalSize()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Writes/StringsTest.php b/tests/Unit/ByteBuffer/Concerns/Writes/StringsTest.php index 27b037dd..7642c4e5 100644 --- a/tests/Unit/ByteBuffer/Concerns/Writes/StringsTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Writes/StringsTest.php @@ -14,68 +14,48 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Writes; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the string writer test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Writes\Strings - */ -class StringsTest extends TestCase -{ - /** @test */ - public function it_should_write_bytes() - { - $buffer = ByteBuffer::new(0); - $buffer->writeBytes('Hello World'); - - $this->assertSame(11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeString('Hello World'); - - $this->assertSame(11, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_utf8_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUTF8String('Hello World 😄'); - - $this->assertSame(20, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_c_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeCString('Hello World'); - - $this->assertSame(12, $buffer->internalSize()); - $this->assertSame('48656c6c6f20576f726c6400', $buffer->toHex()); - } - - /** @test */ - public function it_should_write_i_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeIString('Hello World'); - - $this->assertSame(15, $buffer->internalSize()); - $this->assertSame('0000000b48656c6c6f20576f726c64', $buffer->toHex()); - } - - /** @test */ - public function it_should_write_v_string() - { - $buffer = ByteBuffer::new(1); - $buffer->writeVString('Hello World'); - - $this->assertSame(12, $buffer->internalSize()); - $this->assertSame('0b48656c6c6f20576f726c64', $buffer->toHex()); - } -} +it('should write bytes', function () { + $buffer = ByteBuffer::new(0); + $buffer->writeBytes('Hello World'); + + $this->assertSame(11, $buffer->internalSize()); +}); + +it('should write string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeString('Hello World'); + + $this->assertSame(11, $buffer->internalSize()); +}); + +it('should write utf8 string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUTF8String('Hello World 😄'); + + $this->assertSame(20, $buffer->internalSize()); +}); + +it('should write c string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeCString('Hello World'); + + $this->assertSame(12, $buffer->internalSize()); + $this->assertSame('48656c6c6f20576f726c6400', $buffer->toHex()); +}); + +it('should write i string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeIString('Hello World'); + + $this->assertSame(15, $buffer->internalSize()); + $this->assertSame('0000000b48656c6c6f20576f726c64', $buffer->toHex()); +}); + +it('should write v string', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeVString('Hello World'); + + $this->assertSame(12, $buffer->internalSize()); + $this->assertSame('0b48656c6c6f20576f726c64', $buffer->toHex()); +}); diff --git a/tests/Unit/ByteBuffer/Concerns/Writes/UnsignedIntegerTest.php b/tests/Unit/ByteBuffer/Concerns/Writes/UnsignedIntegerTest.php index 9b14da16..95254153 100644 --- a/tests/Unit/ByteBuffer/Concerns/Writes/UnsignedIntegerTest.php +++ b/tests/Unit/ByteBuffer/Concerns/Writes/UnsignedIntegerTest.php @@ -14,83 +14,59 @@ namespace ArkEcosystem\Tests\Crypto\Concerns\Writes; use ArkEcosystem\Crypto\ByteBuffer\ByteBuffer; -use PHPUnit\Framework\TestCase; -/** - * This is the unsigned integer writer test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\Concerns\Writes\UnsignedInteger - */ -class UnsignedIntegerTest extends TestCase -{ - /** @test */ - public function it_should_write_uint8() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt8(8); - - $this->assertSame(1, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_uint16() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt16(16); - - $this->assertSame(2, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_uint32() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt32(32); - - $this->assertSame(4, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_uint64() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt64(64); - - $this->assertSame(8, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_ubyte() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUByte(8); - - $this->assertSame(1, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_ushort() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUShort(15); - - $this->assertSame(2, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_uint() - { - $buffer = ByteBuffer::new(1); - $buffer->writeUInt(32); - - $this->assertSame(4, $buffer->internalSize()); - } - - /** @test */ - public function it_should_write_ulong() - { - $buffer = ByteBuffer::new(1); - $buffer->writeULong(64); - - $this->assertSame(8, $buffer->internalSize()); - } -} +it('should write uint8', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt8(8); + + $this->assertSame(1, $buffer->internalSize()); +}); + +it('should write uint16', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt16(16); + + $this->assertSame(2, $buffer->internalSize()); +}); + +it('should write uint32', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt32(32); + + $this->assertSame(4, $buffer->internalSize()); +}); + +it('should write uint64', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt64(64); + + $this->assertSame(8, $buffer->internalSize()); +}); + +it('should write ubyte', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUByte(8); + + $this->assertSame(1, $buffer->internalSize()); +}); + +it('should write ushort', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUShort(15); + + $this->assertSame(2, $buffer->internalSize()); +}); + +it('should write uint', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeUInt(32); + + $this->assertSame(4, $buffer->internalSize()); +}); + +it('should write ulong', function () { + $buffer = ByteBuffer::new(1); + $buffer->writeULong(64); + + $this->assertSame(8, $buffer->internalSize()); +}); diff --git a/tests/Unit/ByteBuffer/LengthMapTest.php b/tests/Unit/ByteBuffer/LengthMapTest.php index 26aba393..4035ce69 100644 --- a/tests/Unit/ByteBuffer/LengthMapTest.php +++ b/tests/Unit/ByteBuffer/LengthMapTest.php @@ -14,55 +14,33 @@ namespace ArkEcosystem\Tests\Crypto; use ArkEcosystem\Crypto\ByteBuffer\LengthMap; -use PHPUnit\Framework\TestCase; -/** - * This is the length map test class. - * @covers \ArkEcosystem\Crypto\ByteBuffer\LengthMap - */ -class LengthMapTest extends TestCase -{ - /** @test */ - public function it_should_get_the_length_for_string() - { - $this->assertSame(33, LengthMap::get('a33')); - } +it('should get the length for string', function () { + $this->assertSame(33, LengthMap::get('a33')); +}); - /** @test */ - public function it_should_get_the_length_for_float() - { - $this->assertSame(33, LengthMap::get('f33')); - } +it('should get the length for float', function () { + $this->assertSame(33, LengthMap::get('f33')); +}); - /** @test */ - public function it_should_get_the_length_for_double() - { - $this->assertSame(33, LengthMap::get('d33')); - } +it('should get the length for double', function () { + $this->assertSame(33, LengthMap::get('d33')); +}); - /** @test */ - public function it_should_get_the_length_for_hex_with_low_nibble() - { - $this->assertSame(33, LengthMap::get('h66')); - } +it('should get the length for hex with low nibble', function () { + $this->assertSame(33, LengthMap::get('h66')); +}); - /** @test */ - public function it_should_get_the_length_for_hex_with_high_nibble() - { - $this->assertSame(33, LengthMap::get('H66')); - } +it('should get the length for hex with high nibble', function () { + $this->assertSame(33, LengthMap::get('H66')); +}); - /** @test */ - public function it_should_get_the_length_from_the_array() - { - $this->assertSame(1, LengthMap::get('C')); - } +it('should get the length from the array', function () { + $this->assertSame(1, LengthMap::get('C')); +}); - /** @test */ - public function it_should_throw_for_invalid_type() - { - $this->expectException(\InvalidArgumentException::class); +it('should throw for invalid type', function () { + $this->expectException(\InvalidArgumentException::class); - LengthMap::get('_INVALID_'); - } -} + LengthMap::get('_INVALID_'); +}); diff --git a/tests/Unit/Configuration/FeeTest.php b/tests/Unit/Configuration/FeeTest.php index c0eb1035..e5c4517b 100644 --- a/tests/Unit/Configuration/FeeTest.php +++ b/tests/Unit/Configuration/FeeTest.php @@ -14,33 +14,19 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Managers; use ArkEcosystem\Crypto\Configuration\Fee; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the fee configuration test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Configuration\Fee - */ -class FeeTest extends TestCase -{ - /** @test */ - public function it_should_get_the_fee() - { - $actual = Fee::get(0); - - $this->assertSame('10000000', $actual); - } - - /** @test */ - public function it_should_set_the_fee() - { - $actual = Fee::get(0); - $this->assertSame('10000000', $actual); - - Fee::set(0, '5'); - - $actual = Fee::get(0); - $this->assertSame('5', $actual); - } -} +it('should get the fee', function () { + $actual = Fee::get(0); + + $this->assertSame('10000000', $actual); +}); + +it('should set the fee', function () { + $actual = Fee::get(0); + $this->assertSame('10000000', $actual); + + Fee::set(0, '5'); + + $actual = Fee::get(0); + $this->assertSame('5', $actual); +}); diff --git a/tests/Unit/Configuration/NetworkTest.php b/tests/Unit/Configuration/NetworkTest.php index 602f3581..dc9e6ded 100644 --- a/tests/Unit/Configuration/NetworkTest.php +++ b/tests/Unit/Configuration/NetworkTest.php @@ -17,35 +17,21 @@ use ArkEcosystem\Crypto\Networks\AbstractNetwork; use ArkEcosystem\Crypto\Networks\Devnet; use ArkEcosystem\Crypto\Networks\Mainnet; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the network configuration test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Configuration\Network - */ -class NetworkTest extends TestCase -{ - /** @test */ - public function it_should_get_the_network() - { - $actual = Network::get(); - - $this->assertInstanceOf(AbstractNetwork::class, $actual); - } - - /** @test */ - public function it_should_set_the_network() - { - Network::set(Mainnet::new()); - - $actual = Network::get(); - $this->assertInstanceOf(Mainnet::class, $actual); - - Network::set(Devnet::new()); - - $actual = Network::get(); - $this->assertInstanceOf(Devnet::class, $actual); - } -} +it('should get the network', function () { + $actual = Network::get(); + + $this->assertInstanceOf(AbstractNetwork::class, $actual); +}); + +it('should set the network', function () { + Network::set(Mainnet::new()); + + $actual = Network::get(); + $this->assertInstanceOf(Mainnet::class, $actual); + + Network::set(Devnet::new()); + + $actual = Network::get(); + $this->assertInstanceOf(Devnet::class, $actual); +}); diff --git a/tests/Unit/CoreCompatibilityTest.php b/tests/Unit/CoreCompatibilityTest.php new file mode 100644 index 00000000..8e45b638 --- /dev/null +++ b/tests/Unit/CoreCompatibilityTest.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Tests\Crypto\Unit; + +use ArkEcosystem\Crypto\Identities\Address; +use ArkEcosystem\Crypto\Identities\PrivateKey; +use ArkEcosystem\Crypto\Identities\PublicKey; +use ArkEcosystem\Crypto\Networks\Mainnet; +use ArkEcosystem\Crypto\Networks\Testnet; +use ArkEcosystem\Crypto\Utils\Message; + +it('should derive the same identity as core', function (array $vector) { + $privateKey = PrivateKey::fromPassphrase($vector['passphrase']); + + $this->assertSame($vector['privateKey'], $privateKey->getHex()); + $this->assertSame($vector['publicKey'], $privateKey->getPublicKey()->getHex()); + $this->assertSame($vector['address']['mainnet'], Address::fromPublicKey($vector['publicKey'], Mainnet::new())); + $this->assertSame($vector['address']['devnet'], Address::fromPublicKey($vector['publicKey'], 30)); + $this->assertSame($vector['wif']['mainnet'], $privateKey->toWif(Mainnet::new())); + $this->assertSame($vector['wif']['testnet'], $privateKey->toWif(Testnet::new())); + $this->assertSame($vector['privateKey'], PrivateKey::fromWif($vector['wif']['testnet'], Testnet::new())->getHex()); +})->with('core vectors'); + +it('should sign messages exactly like core', function (array $vector) { + $signed = Message::sign($vector['message']['message'], $vector['passphrase']); + + $this->assertSame($vector['message']['signature'], $signed->signature); +})->with('core vectors'); + +it('should verify messages signed by core', function (array $vector) { + $message = Message::new([ + 'publicKey' => $vector['publicKey'], + 'signature' => $vector['message']['signature'], + 'message' => $vector['message']['message'], + ]); + + $this->assertTrue($message->verify()); + $this->assertFalse(PublicKey::fromHex($vector['publicKey'])->verify(hash('sha256', $vector['message']['message'].' ', true), $vector['message']['signature'])); +})->with('core vectors'); + +dataset('core vectors', function () { + $fixture = json_decode(file_get_contents(__DIR__.'/../fixtures/core-vectors.json'), true); + + return array_combine( + array_map(fn (int $index) => "vector {$index}", array_keys($fixture['vectors'])), + array_map(fn (array $vector) => [$vector], $fixture['vectors']), + ); +}); diff --git a/tests/Unit/Identities/AddressTest.php b/tests/Unit/Identities/AddressTest.php index b6edf6e0..bac44ab8 100644 --- a/tests/Unit/Identities/AddressTest.php +++ b/tests/Unit/Identities/AddressTest.php @@ -17,84 +17,77 @@ use ArkEcosystem\Crypto\Identities\Address as TestClass; use ArkEcosystem\Crypto\Identities\PrivateKey; use ArkEcosystem\Crypto\Networks\Devnet; -use ArkEcosystem\Tests\Crypto\TestCase; +use ArkEcosystem\Crypto\Networks\Mainnet; +use ArkEcosystem\Crypto\Utils\Base58; -/** - * This is the address test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Identities\Address - */ -class AddressTest extends TestCase -{ - protected function setUp(): void - { - parent::setUp(); +beforeEach(function () { + Network::set(Devnet::new()); +}); + +it('should get the address from passphrase', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromPassphrase($fixture['passphrase']); + + $this->assertSame($fixture['data']['address'], $actual); +}); - Network::set(Devnet::new()); - } +it('should get the address from a multi signature asset', function () { + $actual = TestClass::fromMultiSignatureAsset(3, [ + '02fb3def2593a00c5b84620addf28ff21bac452bd71a37d4d8e24f301683a81b56', + '02bc9f661fcc8abca65fe9aff4614036867b7fdcc5730085ccc5cb854664d0194b', + '03c44c6b6cc9893ae21ca606712fd0f6f03c41ce81c4f6ce5a640f4b0b82ec1ce0', + '020300039e973baf5e46b945777cfae330d6392cdb039b1cebc5c3382d421166c3', + '03b050073621b9b5caec9461d44d6bcf21a858c47dd88230ce723e25c1bc75c219', + ]); - /** @test */ - public function it_should_get_the_address_from_passphrase() - { - $fixture = $this->getFixture('identity'); + $this->assertSame('DMNBBtYt1teAKxA2BpiTW9PA3gX3Ad5dyk', $actual); +}); - $actual = TestClass::fromPassphrase($fixture['passphrase']); +it('should get the address from public key', function () { + $fixture = $this->getFixture('identity'); - $this->assertSame($fixture['data']['address'], $actual); - } + $actual = TestClass::fromPublicKey($fixture['data']['publicKey']); - /** @test */ - public function it_should_get_the_address_from_a_multi_signature_asset() - { - $actual = TestClass::fromMultiSignatureAsset(3, [ - '02fb3def2593a00c5b84620addf28ff21bac452bd71a37d4d8e24f301683a81b56', - '02bc9f661fcc8abca65fe9aff4614036867b7fdcc5730085ccc5cb854664d0194b', - '03c44c6b6cc9893ae21ca606712fd0f6f03c41ce81c4f6ce5a640f4b0b82ec1ce0', - '020300039e973baf5e46b945777cfae330d6392cdb039b1cebc5c3382d421166c3', - '03b050073621b9b5caec9461d44d6bcf21a858c47dd88230ce723e25c1bc75c219', - ]); + $this->assertSame($fixture['data']['address'], $actual); +}); - $this->assertSame('DMNBBtYt1teAKxA2BpiTW9PA3gX3Ad5dyk', $actual); - } +it('should get the address from private key', function () { + $fixture = $this->getFixture('identity'); - /** @test */ - public function it_should_get_the_address_from_public_key() - { - $fixture = $this->getFixture('identity'); + $privateKey = PrivateKey::fromPassphrase($fixture['passphrase']); - $actual = TestClass::fromPublicKey($fixture['data']['publicKey']); + $actual = TestClass::fromPrivateKey($privateKey); - $this->assertSame($fixture['data']['address'], $actual); - } + $this->assertSame($fixture['data']['address'], $actual); +}); - /** @test */ - public function it_should_get_the_address_from_private_key() - { - $fixture = $this->getFixture('identity'); +it('should validate the address', function () { + $fixture = $this->getFixture('identity'); - $privateKey = PrivateKey::fromPassphrase($fixture['passphrase']); + $actual = TestClass::validate($fixture['data']['address']); - $actual = TestClass::fromPrivateKey($privateKey); + $this->assertTrue($actual); +}); - $this->assertSame($fixture['data']['address'], $actual); - } +it('should fail to validate the address', function () { + $actual = TestClass::validate('invalid'); - /** @test */ - public function it_should_validate_the_address() - { - $fixture = $this->getFixture('identity'); + $this->assertFalse($actual); +}); - $actual = TestClass::validate($fixture['data']['address']); +it('should validate the address for a given network', function () { + $fixture = $this->getFixture('identity'); - $this->assertTrue($actual); - } + $this->assertTrue(TestClass::validate($fixture['data']['address'], Devnet::new())); + $this->assertTrue(TestClass::validate($fixture['data']['address'], 30)); + $this->assertFalse(TestClass::validate($fixture['data']['address'], Mainnet::new())); +}); - /** @test */ - public function it_should_fail_to_validate_the_address() - { - $actual = TestClass::validate('invalid'); +it('should fail to validate an address with an invalid checksum', function () { + $this->assertFalse(TestClass::validate('D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyic')); +}); - $this->assertFalse($actual); - } -} +it('should fail to validate an address with an invalid length', function () { + $this->assertFalse(TestClass::validate(Base58::encodeCheck("\x1e".str_repeat("\x01", 10)))); +}); diff --git a/tests/Unit/Identities/PrivateKeyTest.php b/tests/Unit/Identities/PrivateKeyTest.php index 8a60d49c..ede489fa 100644 --- a/tests/Unit/Identities/PrivateKeyTest.php +++ b/tests/Unit/Identities/PrivateKeyTest.php @@ -13,44 +13,115 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Identities; +use ArkEcosystem\Crypto\Binary\Bytes; use ArkEcosystem\Crypto\Identities\PrivateKey as TestClass; -use ArkEcosystem\Tests\Crypto\TestCase; +use ArkEcosystem\Crypto\Networks\Devnet; +use ArkEcosystem\Crypto\Networks\Testnet; +use InvalidArgumentException; -/** - * This is the address test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Identities\PrivateKey - */ -class PrivateKeyTest extends TestCase -{ - /** @test */ - public function it_should_get_the_private_key_from_passphrase() - { - $fixture = $this->getFixture('identity'); +it('should get the private key from passphrase', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromPassphrase($fixture['passphrase']); + + $this->assertSame($fixture['data']['privateKey'], $actual->getHex()); +}); + +it('should get the private key from hex', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromHex($fixture['data']['privateKey']); + + $this->assertSame($fixture['data']['privateKey'], $actual->getHex()); +}); + +it('should get the private key from wif', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromWif($fixture['data']['wif']); + + $this->assertSame($fixture['data']['privateKey'], $actual->getHex()); +}); + +it('should get the private key from bytes', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromHex(Bytes::fromHex($fixture['data']['privateKey'])); + + $this->assertSame($fixture['data']['privateKey'], $actual->getHex()); + $this->assertSame($fixture['data']['privateKey'], $actual->getBuffer()->getHex()); + $this->assertSame(hex2bin($fixture['data']['privateKey']), $actual->getBinary()); +}); + +it('should derive the public key', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromPassphrase($fixture['passphrase'])->getPublicKey(); + + $this->assertSame($fixture['data']['publicKey'], $actual->getHex()); +}); + +it('should encode the private key as wif', function () { + $fixture = $this->getFixture('identity'); + + $privateKey = TestClass::fromPassphrase($fixture['passphrase']); + + $this->assertSame($fixture['data']['wif'], $privateKey->toWif()); + $this->assertSame($fixture['data']['wif'], $privateKey->toWif(Devnet::new())); + $this->assertSame($privateKey->getHex(), TestClass::fromWif($privateKey->toWif(Testnet::new()), Testnet::new())->getHex()); +}); + +it('should read an uncompressed wif', function () { + $fixture = $this->getFixture('identity'); + + $uncompressed = \ArkEcosystem\Crypto\Utils\Base58::encodeCheck("\xaa".hex2bin($fixture['data']['privateKey'])); + + $this->assertSame($fixture['data']['privateKey'], TestClass::fromWif($uncompressed)->getHex()); +}); + +it('should reject a wif from another network', function () { + $this->expectException(InvalidArgumentException::class); + + TestClass::fromWif($this->getFixture('identity')['data']['wif'], Testnet::new()); +}); + +it('should reject a wif with an invalid length', function () { + $this->expectException(InvalidArgumentException::class); + + TestClass::fromWif(\ArkEcosystem\Crypto\Utils\Base58::encodeCheck("\xaa".str_repeat("\x01", 10))); +}); + +it('should reject a wif with an invalid compression flag', function () { + $this->expectException(InvalidArgumentException::class); + + TestClass::fromWif(\ArkEcosystem\Crypto\Utils\Base58::encodeCheck("\xaa".str_repeat("\x01", 32)."\x02")); +}); + +it('should reject a malformed private key', function () { + $this->expectException(InvalidArgumentException::class); - $actual = TestClass::fromPassphrase($fixture['passphrase']); + TestClass::fromHex('not-a-private-key'); +}); - $this->assertSame($fixture['data']['privateKey'], $actual->getHex()); - } +it('should reject a private key outside the curve order', function () { + $this->expectException(InvalidArgumentException::class); - /** @test */ - public function it_should_get_the_private_key_from_hex() - { - $fixture = $this->getFixture('identity'); + TestClass::fromHex(str_repeat('f', 64)); +}); - $actual = TestClass::fromHex($fixture['data']['privateKey']); +it('should reject a zero private key', function () { + $this->expectException(InvalidArgumentException::class); - $this->assertSame($fixture['data']['privateKey'], $actual->getHex()); - } + TestClass::fromHex(str_repeat('0', 64)); +}); - /** @test */ - public function it_should_get_the_private_key_from_wif() - { - $fixture = $this->getFixture('identity'); +it('should sign deterministically with a low s value', function () { + $privateKey = TestClass::fromPassphrase($this->passphrase); + $hash = hash('sha256', 'Hello World', true); - $actual = TestClass::fromWif($fixture['data']['wif']); + $signature = $privateKey->sign($hash); - $this->assertSame($fixture['data']['privateKey'], $actual->getHex()); - } -} + $this->assertSame($signature->getHex(), $privateKey->sign(new Bytes($hash))->getHex()); + $this->assertSame($this->getFixture('message-v2')['data']['signature'], $signature->getHex()); + $this->assertTrue($privateKey->getPublicKey()->verify($hash, $signature)); +}); diff --git a/tests/Unit/Identities/PublicKeyTest.php b/tests/Unit/Identities/PublicKeyTest.php index 19f0749e..661dcb73 100644 --- a/tests/Unit/Identities/PublicKeyTest.php +++ b/tests/Unit/Identities/PublicKeyTest.php @@ -13,51 +13,83 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Identities; +use ArkEcosystem\Crypto\Binary\Bytes; use ArkEcosystem\Crypto\Identities\PublicKey as TestClass; -use ArkEcosystem\Tests\Crypto\TestCase; +use InvalidArgumentException; -/** - * This is the address test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Identities\PublicKey - */ -class PublicKeyTest extends TestCase -{ - /** @test */ - public function it_should_get_the_public_key_from_passphrase() - { - $fixture = $this->getFixture('identity'); - - $actual = TestClass::fromPassphrase($fixture['passphrase']); - - $this->assertSame($fixture['data']['publicKey'], $actual->getHex()); - } - - /** @test */ - public function it_should_get_the_public_key_from_a_multi_signature_asset() - { - $actual = TestClass::fromMultiSignatureAsset(3, [ - '02fb3def2593a00c5b84620addf28ff21bac452bd71a37d4d8e24f301683a81b56', - '02bc9f661fcc8abca65fe9aff4614036867b7fdcc5730085ccc5cb854664d0194b', - '03c44c6b6cc9893ae21ca606712fd0f6f03c41ce81c4f6ce5a640f4b0b82ec1ce0', - '020300039e973baf5e46b945777cfae330d6392cdb039b1cebc5c3382d421166c3', - '03b050073621b9b5caec9461d44d6bcf21a858c47dd88230ce723e25c1bc75c219', - ]); - - $this->assertSame( - '03da05c1c1d4f9c6bda13695b2f29fbc65d9589edc070fc61fe97974be3e59c14e', - $actual->getHex() - ); - } - - /** @test */ - public function it_should_get_the_public_key_from_hex() - { - $fixture = $this->getFixture('identity'); - - $actual = TestClass::fromHex($fixture['data']['publicKey']); - - $this->assertSame($fixture['data']['publicKey'], $actual->getHex()); - } -} +it('should get the public key from passphrase', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromPassphrase($fixture['passphrase']); + + $this->assertSame($fixture['data']['publicKey'], $actual->getHex()); +}); + +it('should get the public key from a multi signature asset', function () { + $actual = TestClass::fromMultiSignatureAsset(3, [ + '02fb3def2593a00c5b84620addf28ff21bac452bd71a37d4d8e24f301683a81b56', + '02bc9f661fcc8abca65fe9aff4614036867b7fdcc5730085ccc5cb854664d0194b', + '03c44c6b6cc9893ae21ca606712fd0f6f03c41ce81c4f6ce5a640f4b0b82ec1ce0', + '020300039e973baf5e46b945777cfae330d6392cdb039b1cebc5c3382d421166c3', + '03b050073621b9b5caec9461d44d6bcf21a858c47dd88230ce723e25c1bc75c219', + ]); + + $this->assertSame( + '03da05c1c1d4f9c6bda13695b2f29fbc65d9589edc070fc61fe97974be3e59c14e', + $actual->getHex() + ); +}); + +it('should get the public key from hex', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromHex($fixture['data']['publicKey']); + + $this->assertSame($fixture['data']['publicKey'], $actual->getHex()); +}); + +it('should get the public key from bytes', function () { + $fixture = $this->getFixture('identity'); + + $actual = TestClass::fromHex(Bytes::fromHex($fixture['data']['publicKey'])); + + $this->assertSame($fixture['data']['publicKey'], $actual->getHex()); + $this->assertSame($fixture['data']['publicKey'], $actual->getBuffer()->getHex()); + $this->assertSame(hex2bin($fixture['data']['publicKey']), $actual->getBinary()); +}); + +it('should compress an uncompressed public key', function () { + $fixture = $this->getFixture('identity'); + + $uncompressed = TestClass::fromHex($fixture['data']['publicKey']); + $point = \ArkEcosystem\Crypto\Utils\Secp256k1::curve()->keyFromPublic($fixture['data']['publicKey'], 'hex')->getPublic(false, 'hex'); + + $this->assertSame($uncompressed->getHex(), TestClass::fromHex($point)->getHex()); +}); + +it('should reject a malformed public key', function () { + $this->expectException(InvalidArgumentException::class); + + TestClass::fromHex('not-a-public-key'); +}); + +it('should reject a public key that is not on the curve', function () { + $this->expectException(InvalidArgumentException::class); + + TestClass::fromHex('02'.str_pad('5', 64, '0', STR_PAD_LEFT)); +}); + +it('should reject a public key with an invalid prefix', function () { + $this->expectException(InvalidArgumentException::class); + + TestClass::fromHex('05'.str_repeat('1', 64)); +}); + +it('should not verify invalid signatures', function () { + $publicKey = TestClass::fromHex($this->getFixture('identity')['data']['publicKey']); + $hash = hash('sha256', 'Hello World', true); + + $this->assertFalse($publicKey->verify($hash, 'not-a-signature')); + $this->assertFalse($publicKey->verify($hash, 'deadbeef')); + $this->assertFalse($publicKey->verify(hash('sha256', 'Other', true), $this->getFixture('message-v2')['data']['signature'])); +}); diff --git a/tests/Unit/Identities/WIFTest.php b/tests/Unit/Identities/WIFTest.php index 00381c91..4f3d80fb 100644 --- a/tests/Unit/Identities/WIFTest.php +++ b/tests/Unit/Identities/WIFTest.php @@ -14,23 +14,11 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Identities; use ArkEcosystem\Crypto\Identities\WIF as TestClass; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the address test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Identities\WIF - */ -class WIFTest extends TestCase -{ - /** @test */ - public function it_should_get_the_wif_from_passphrase() - { - $fixture = $this->getFixture('identity'); +it('should get the wif from passphrase', function () { + $fixture = $this->getFixture('identity'); - $actual = TestClass::fromPassphrase($fixture['passphrase']); + $actual = TestClass::fromPassphrase($fixture['passphrase']); - $this->assertSame($fixture['data']['wif'], $actual); - } -} + $this->assertSame($fixture['data']['wif'], $actual); +}); diff --git a/tests/Unit/Networks/AbstractNetworkTest.php b/tests/Unit/Networks/AbstractNetworkTest.php new file mode 100644 index 00000000..4a2d7243 --- /dev/null +++ b/tests/Unit/Networks/AbstractNetworkTest.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Tests\Crypto\Unit\Networks; + +use ArkEcosystem\Crypto\Networks\AbstractNetwork; +use ArkEcosystem\Crypto\Networks\Devnet; +use ArkEcosystem\Crypto\Networks\Mainnet; +use ArkEcosystem\Crypto\Networks\Testnet; + +it('should expose the version bytes', function () { + $network = Mainnet::new(); + + $this->assertSame(23, $network->version()); + $this->assertSame('17', $network->getAddressByte()); + $this->assertSame('00', $network->getP2shByte()); + $this->assertSame('aa', $network->getPrivByte()); + $this->assertSame('46090600', $network->getHDPubByte()); + $this->assertSame('46089520', $network->getHDPrivByte()); +}); + +it('should create a new instance', function () { + $this->assertInstanceOf(Devnet::class, Devnet::new()); + $this->assertSame(30, Devnet::new()->version()); +}); + +it('should define the epoch and public key hash of each network', function (AbstractNetwork $network, string $epoch, int $pubKeyHash) { + $this->assertSame($epoch, $network->epoch()); + $this->assertSame($pubKeyHash, $network->pubKeyHash()); +})->with([ + 'mainnet' => [Mainnet::new(), '2017-03-21T13:00:00.000Z', 23], + 'devnet' => [Devnet::new(), '2017-03-21T13:00:00.000Z', 30], + 'testnet' => [Testnet::new(), '2017-03-21T13:00:00.000Z', 23], +]); diff --git a/tests/Unit/Networks/DevnetTest.php b/tests/Unit/Networks/DevnetTest.php deleted file mode 100644 index a95eef29..00000000 --- a/tests/Unit/Networks/DevnetTest.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ArkEcosystem\Tests\Crypto\Unit\Networks; - -use ArkEcosystem\Crypto\Networks\Devnet; - -/** - * This is the devnet network test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Networks\Devnet - */ -class DevnetTest extends NetworkTestCase -{ - protected $epoch = '2017-03-21T13:00:00.000Z'; - - protected $pubKeyHash = 30; - - public function getTestSubject() - { - return Devnet::new(); - } -} diff --git a/tests/Unit/Networks/MainnetTest.php b/tests/Unit/Networks/MainnetTest.php deleted file mode 100644 index e9bf169d..00000000 --- a/tests/Unit/Networks/MainnetTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ArkEcosystem\Tests\Crypto\Unit\Networks; - -use ArkEcosystem\Crypto\Networks\Mainnet; -use BitWasp\Bitcoin\Network\Network; - -/** - * This is the mainnet network test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Networks\Mainnet - */ -class MainnetTest extends NetworkTestCase -{ - protected $epoch = '2017-03-21T13:00:00.000Z'; - - protected $pubKeyHash = 23; - - public function getTestSubject() - { - return Mainnet::new(); - } -} diff --git a/tests/Unit/Networks/NetworkTestCase.php b/tests/Unit/Networks/NetworkTestCase.php deleted file mode 100644 index fdc45ceb..00000000 --- a/tests/Unit/Networks/NetworkTestCase.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ArkEcosystem\Tests\Crypto\Unit\Networks; - -use ArkEcosystem\Tests\Crypto\TestCase; - -/** - * This is the devnet network test class. - * - * @author Brian Faust - * @coversNothing - */ -class NetworkTestCase extends TestCase -{ - /** @test */ - public function it_should_get_epoch() - { - $actual = $this->getTestSubject()->epoch(); - - $this->assertSame($actual, $this->epoch); - } - - /** @test */ - public function it_should_get_public_key_hash() - { - $actual = $this->getTestSubject()->pubKeyHash(); - - $this->assertSame($actual, $this->pubKeyHash); - } -} diff --git a/tests/Unit/Networks/TestnetTest.php b/tests/Unit/Networks/TestnetTest.php deleted file mode 100644 index 7da0de9c..00000000 --- a/tests/Unit/Networks/TestnetTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace ArkEcosystem\Tests\Crypto\Unit\Networks; - -use ArkEcosystem\Crypto\Networks\Testnet; -use BitWasp\Bitcoin\Network\Network; - -/** - * This is the testnet network test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Networks\Testnet - */ -class TestnetTest extends NetworkTestCase -{ - protected $epoch = '2017-03-21T13:00:00.000Z'; - - protected $pubKeyHash = 23; - - public function getTestSubject() - { - return Testnet::new(); - } -} diff --git a/tests/Unit/Transactions/Builder/DelegateRegistrationTest.php b/tests/Unit/Transactions/Builder/DelegateRegistrationTest.php index e0d0871d..e4ce2353 100644 --- a/tests/Unit/Transactions/Builder/DelegateRegistrationTest.php +++ b/tests/Unit/Transactions/Builder/DelegateRegistrationTest.php @@ -16,64 +16,46 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\DelegateRegistrationBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the delegate registration builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\DelegateRegistrationBuilder - */ -class DelegateRegistrationTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = DelegateRegistrationBuilder::new() - ->username('polopolo') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; - - $transaction = DelegateRegistrationBuilder::new() - ->username('polopolo') - ->sign($this->passphrase) - ->secondSign($secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('delegate_registration', 'delegate-registration-sign'); - $builder = DelegateRegistrationBuilder::new() - ->username($fixture['data']['asset']['delegate']['username']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('delegate_registration', 'delegate-registration-secondSign'); - $builder = DelegateRegistrationBuilder::new() - ->username($fixture['data']['asset']['delegate']['username']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} +it('should sign it with a passphrase', function () { + $transaction = DelegateRegistrationBuilder::new() + ->username('polopolo') + ->sign($this->passphrase); + + $this->assertTrue($transaction->verify()); +}); + +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; + + $transaction = DelegateRegistrationBuilder::new() + ->username('polopolo') + ->sign($this->passphrase) + ->secondSign($secondPassphrase); + + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); + +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('delegate_registration', 'delegate-registration-sign'); + $builder = DelegateRegistrationBuilder::new() + ->username($fixture['data']['asset']['delegate']['username']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('delegate_registration', 'delegate-registration-secondSign'); + $builder = DelegateRegistrationBuilder::new() + ->username($fixture['data']['asset']['delegate']['username']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/DelegateResignationTest.php b/tests/Unit/Transactions/Builder/DelegateResignationTest.php index f6717d0b..0a5c0092 100644 --- a/tests/Unit/Transactions/Builder/DelegateResignationTest.php +++ b/tests/Unit/Transactions/Builder/DelegateResignationTest.php @@ -16,60 +16,42 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\DelegateResignationBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the delegate resignation builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\DelegateResignationBuilder - */ -class DelegateResignationTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = DelegateResignationBuilder::new() - ->sign($this->passphrase); +it('should sign it with a passphrase', function () { + $transaction = DelegateResignationBuilder::new() + ->sign($this->passphrase); - $this->assertTrue($transaction->verify()); - } + $this->assertTrue($transaction->verify()); +}); - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; - $transaction = DelegateResignationBuilder::new() - ->sign($this->passphrase) - ->secondSign($secondPassphrase); + $transaction = DelegateResignationBuilder::new() + ->sign($this->passphrase) + ->secondSign($secondPassphrase); - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('delegate_resignation', 'delegate-resignation-sign'); - $builder = DelegateResignationBuilder::new() - ->sign($this->passphrase); +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('delegate_resignation', 'delegate-resignation-sign'); + $builder = DelegateResignationBuilder::new() + ->sign($this->passphrase); - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('delegate_resignation', 'delegate-resignation-secondSign'); - $builder = DelegateResignationBuilder::new() - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('delegate_resignation', 'delegate-resignation-secondSign'); + $builder = DelegateResignationBuilder::new() + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/HtlcClaimTest.php b/tests/Unit/Transactions/Builder/HtlcClaimTest.php index 7c8c9838..ff241364 100644 --- a/tests/Unit/Transactions/Builder/HtlcClaimTest.php +++ b/tests/Unit/Transactions/Builder/HtlcClaimTest.php @@ -16,74 +16,56 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\HtlcClaimBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the delegate registration builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\HtlcClaimBuilder - */ -class HtlcClaimTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = HtlcClaimBuilder::new() - ->htlcClaimAsset( - 'fe1a1b3b117c28078c5d3c42ffb9492234afc01d15b08c047feccf0b6bee0f78', - 'my secret that should be 32bytes' - )->sign($this->passphrase); +it('should sign it with a passphrase', function () { + $transaction = HtlcClaimBuilder::new() + ->htlcClaimAsset( + 'fe1a1b3b117c28078c5d3c42ffb9492234afc01d15b08c047feccf0b6bee0f78', + 'my secret that should be 32bytes' + )->sign($this->passphrase); - $this->assertTrue($transaction->verify()); - } + $this->assertTrue($transaction->verify()); +}); - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; - $transaction = HtlcClaimBuilder::new() - ->htlcClaimAsset( - 'fe1a1b3b117c28078c5d3c42ffb9492234afc01d15b08c047feccf0b6bee0f78', - 'my secret that should be 32bytes' - )->sign($this->passphrase) - ->secondSign($secondPassphrase); + $transaction = HtlcClaimBuilder::new() + ->htlcClaimAsset( + 'fe1a1b3b117c28078c5d3c42ffb9492234afc01d15b08c047feccf0b6bee0f78', + 'my secret that should be 32bytes' + )->sign($this->passphrase) + ->secondSign($secondPassphrase); - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_claim', 'htlc-claim-sign'); - $builder = HtlcClaimBuilder::new() - ->htlcClaimAsset( - $fixture['data']['asset']['claim']['lockTransactionId'], - $fixture['data']['asset']['claim']['unlockSecret'] - ) - ->sign($this->passphrase); +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_claim', 'htlc-claim-sign'); + $builder = HtlcClaimBuilder::new() + ->htlcClaimAsset( + $fixture['data']['asset']['claim']['lockTransactionId'], + $fixture['data']['asset']['claim']['unlockSecret'] + ) + ->sign($this->passphrase); - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_claim', 'htlc-claim-secondSign'); - $builder = HtlcClaimBuilder::new() - ->htlcClaimAsset( - $fixture['data']['asset']['claim']['lockTransactionId'], - $fixture['data']['asset']['claim']['unlockSecret'] - ) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_claim', 'htlc-claim-secondSign'); + $builder = HtlcClaimBuilder::new() + ->htlcClaimAsset( + $fixture['data']['asset']['claim']['lockTransactionId'], + $fixture['data']['asset']['claim']['unlockSecret'] + ) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/HtlcLockTest.php b/tests/Unit/Transactions/Builder/HtlcLockTest.php index e1f55ba1..f0b22dbd 100644 --- a/tests/Unit/Transactions/Builder/HtlcLockTest.php +++ b/tests/Unit/Transactions/Builder/HtlcLockTest.php @@ -16,129 +16,107 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\HtlcLockBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the delegate registration builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\HtlcLockBuilder - */ -class HtlcLockTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = HtlcLockBuilder::new() - ->htlcLockAsset( - '0f128d401958b1b30ad0d10406f47f9489321017b4614e6cb993fc63913c5454', - 1, - 1 - ) - ->recipient('ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; - - $transaction = HtlcLockBuilder::new() - ->htlcLockAsset( - '0f128d401958b1b30ad0d10406f47f9489321017b4614e6cb993fc63913c5454', - 1, - 1 - ) - ->recipient('ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo') - ->sign($this->passphrase) - ->secondSign($secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-sign'); - $builder = HtlcLockBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->htlcLockAsset( - $fixture['data']['asset']['lock']['secretHash'], - $fixture['data']['asset']['lock']['expiration']['type'], - $fixture['data']['asset']['lock']['expiration']['value'] - ) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-secondSign'); - $builder = HtlcLockBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->htlcLockAsset( - $fixture['data']['asset']['lock']['secretHash'], - $fixture['data']['asset']['lock']['expiration']['type'], - $fixture['data']['asset']['lock']['expiration']['value'] - ) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_vendor_field_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-with-vendor-field-sign'); - unset($fixture['data']['vendorFieldHex']); - $builder = HtlcLockBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->htlcLockAsset( - $fixture['data']['asset']['lock']['secretHash'], - $fixture['data']['asset']['lock']['expiration']['type'], - $fixture['data']['asset']['lock']['expiration']['value'] - ) - ->vendorField($fixture['data']['vendorField']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_vendor_field_second_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-with-vendor-field-secondSign'); - unset($fixture['data']['vendorFieldHex']); - $builder = HtlcLockBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->htlcLockAsset( - $fixture['data']['asset']['lock']['secretHash'], - $fixture['data']['asset']['lock']['expiration']['type'], - $fixture['data']['asset']['lock']['expiration']['value'] - ) - ->vendorField($fixture['data']['vendorField']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} +it('should sign it with a passphrase', function () { + $transaction = HtlcLockBuilder::new() + ->htlcLockAsset( + '0f128d401958b1b30ad0d10406f47f9489321017b4614e6cb993fc63913c5454', + 1, + 1 + ) + ->recipient('ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo') + ->sign($this->passphrase); + + $this->assertTrue($transaction->verify()); +}); + +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; + + $transaction = HtlcLockBuilder::new() + ->htlcLockAsset( + '0f128d401958b1b30ad0d10406f47f9489321017b4614e6cb993fc63913c5454', + 1, + 1 + ) + ->recipient('ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo') + ->sign($this->passphrase) + ->secondSign($secondPassphrase); + + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); + +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-sign'); + $builder = HtlcLockBuilder::new() + ->recipient($fixture['data']['recipientId']) + ->amount($fixture['data']['amount']) + ->htlcLockAsset( + $fixture['data']['asset']['lock']['secretHash'], + $fixture['data']['asset']['lock']['expiration']['type'], + $fixture['data']['asset']['lock']['expiration']['value'] + ) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-secondSign'); + $builder = HtlcLockBuilder::new() + ->recipient($fixture['data']['recipientId']) + ->amount($fixture['data']['amount']) + ->htlcLockAsset( + $fixture['data']['asset']['lock']['secretHash'], + $fixture['data']['asset']['lock']['expiration']['type'], + $fixture['data']['asset']['lock']['expiration']['value'] + ) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture vendor field passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-with-vendor-field-sign'); + unset($fixture['data']['vendorFieldHex']); + $builder = HtlcLockBuilder::new() + ->recipient($fixture['data']['recipientId']) + ->amount($fixture['data']['amount']) + ->htlcLockAsset( + $fixture['data']['asset']['lock']['secretHash'], + $fixture['data']['asset']['lock']['expiration']['type'], + $fixture['data']['asset']['lock']['expiration']['value'] + ) + ->vendorField($fixture['data']['vendorField']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture vendor field second passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-with-vendor-field-secondSign'); + unset($fixture['data']['vendorFieldHex']); + $builder = HtlcLockBuilder::new() + ->recipient($fixture['data']['recipientId']) + ->amount($fixture['data']['amount']) + ->htlcLockAsset( + $fixture['data']['asset']['lock']['secretHash'], + $fixture['data']['asset']['lock']['expiration']['type'], + $fixture['data']['asset']['lock']['expiration']['value'] + ) + ->vendorField($fixture['data']['vendorField']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/HtlcRefundTest.php b/tests/Unit/Transactions/Builder/HtlcRefundTest.php index a8ff75f9..50cbe5bc 100644 --- a/tests/Unit/Transactions/Builder/HtlcRefundTest.php +++ b/tests/Unit/Transactions/Builder/HtlcRefundTest.php @@ -16,64 +16,46 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\HtlcRefundBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the delegate registration builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\HtlcRefundBuilder - */ -class HtlcRefundTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = HtlcRefundBuilder::new() - ->htlcRefundAsset('fe1a1b3b117c28078c5d3c42ffb9492234afc01d15b08c047feccf0b6bee0f78') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; - - $transaction = HtlcRefundBuilder::new() - ->htlcRefundAsset('fe1a1b3b117c28078c5d3c42ffb9492234afc01d15b08c047feccf0b6bee0f78') - ->sign($this->passphrase) - ->secondSign($secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_refund', 'htlc-refund-sign'); - $builder = HtlcRefundBuilder::new() - ->htlcRefundAsset($fixture['data']['asset']['refund']['lockTransactionId']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_refund', 'htlc-refund-secondSign'); - $builder = HtlcRefundBuilder::new() - ->htlcRefundAsset($fixture['data']['asset']['refund']['lockTransactionId']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} +it('should sign it with a passphrase', function () { + $transaction = HtlcRefundBuilder::new() + ->htlcRefundAsset('fe1a1b3b117c28078c5d3c42ffb9492234afc01d15b08c047feccf0b6bee0f78') + ->sign($this->passphrase); + + $this->assertTrue($transaction->verify()); +}); + +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; + + $transaction = HtlcRefundBuilder::new() + ->htlcRefundAsset('fe1a1b3b117c28078c5d3c42ffb9492234afc01d15b08c047feccf0b6bee0f78') + ->sign($this->passphrase) + ->secondSign($secondPassphrase); + + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); + +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_refund', 'htlc-refund-sign'); + $builder = HtlcRefundBuilder::new() + ->htlcRefundAsset($fixture['data']['asset']['refund']['lockTransactionId']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_refund', 'htlc-refund-secondSign'); + $builder = HtlcRefundBuilder::new() + ->htlcRefundAsset($fixture['data']['asset']['refund']['lockTransactionId']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/IPFSTest.php b/tests/Unit/Transactions/Builder/IPFSTest.php index 7af04b82..26e20145 100644 --- a/tests/Unit/Transactions/Builder/IPFSTest.php +++ b/tests/Unit/Transactions/Builder/IPFSTest.php @@ -16,64 +16,46 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\IPFSBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the ipfs builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\IPFSBuilder - */ -class IPFSTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = IPFSBuilder::new() - ->ipfsAsset('QmR45FmbVVrixReBwJkhEKde2qwHYaQzGxu4ZoDeswuF9w') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; - - $transaction = IPFSBuilder::new() - ->ipfsAsset('QmR45FmbVVrixReBwJkhEKde2qwHYaQzGxu4ZoDeswuF9w') - ->sign($this->passphrase) - ->secondSign($secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('ipfs', 'ipfs-sign'); - $builder = IPFSBuilder::new() - ->ipfsAsset($fixture['data']['asset']['ipfs']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('ipfs', 'ipfs-secondSign'); - $builder = IPFSBuilder::new() - ->ipfsAsset($fixture['data']['asset']['ipfs']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} +it('should sign it with a passphrase', function () { + $transaction = IPFSBuilder::new() + ->ipfsAsset('QmR45FmbVVrixReBwJkhEKde2qwHYaQzGxu4ZoDeswuF9w') + ->sign($this->passphrase); + + $this->assertTrue($transaction->verify()); +}); + +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; + + $transaction = IPFSBuilder::new() + ->ipfsAsset('QmR45FmbVVrixReBwJkhEKde2qwHYaQzGxu4ZoDeswuF9w') + ->sign($this->passphrase) + ->secondSign($secondPassphrase); + + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); + +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('ipfs', 'ipfs-sign'); + $builder = IPFSBuilder::new() + ->ipfsAsset($fixture['data']['asset']['ipfs']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('ipfs', 'ipfs-secondSign'); + $builder = IPFSBuilder::new() + ->ipfsAsset($fixture['data']['asset']['ipfs']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/MultiPaymentTest.php b/tests/Unit/Transactions/Builder/MultiPaymentTest.php index 38f89a5f..2f511aa2 100644 --- a/tests/Unit/Transactions/Builder/MultiPaymentTest.php +++ b/tests/Unit/Transactions/Builder/MultiPaymentTest.php @@ -16,99 +16,77 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\MultiPaymentBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the multi payment builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\MultiPaymentBuilder - */ -class MultiPaymentTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = MultiPaymentBuilder::new() - ->add('AXoXnFi4z1Z6aFvjEYkDVCtBGW2PaRiM25', '100000000') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; - - $transaction = MultiPaymentBuilder::new() - ->add('AXoXnFi4z1Z6aFvjEYkDVCtBGW2PaRiM25', '100000000') - ->sign($this->passphrase) - ->secondSign($secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-sign'); - $builder = MultiPaymentBuilder::new() - ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) - ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-secondSign'); - $builder = MultiPaymentBuilder::new() - ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) - ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_vendor_field_passphrase() - { - $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-with-vendor-field-sign'); - unset($fixture['data']['vendorFieldHex']); - $builder = MultiPaymentBuilder::new() - ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) - ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) - ->vendorField($fixture['data']['vendorField']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_vendor_field_second_passphrase() - { - $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-with-vendor-field-secondSign'); - unset($fixture['data']['vendorFieldHex']); - $builder = MultiPaymentBuilder::new() - ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) - ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) - ->vendorField($fixture['data']['vendorField']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} +it('should sign it with a passphrase', function () { + $transaction = MultiPaymentBuilder::new() + ->add('AXoXnFi4z1Z6aFvjEYkDVCtBGW2PaRiM25', '100000000') + ->sign($this->passphrase); + + $this->assertTrue($transaction->verify()); +}); + +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; + + $transaction = MultiPaymentBuilder::new() + ->add('AXoXnFi4z1Z6aFvjEYkDVCtBGW2PaRiM25', '100000000') + ->sign($this->passphrase) + ->secondSign($secondPassphrase); + + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); + +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-sign'); + $builder = MultiPaymentBuilder::new() + ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) + ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-secondSign'); + $builder = MultiPaymentBuilder::new() + ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) + ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture vendor field passphrase', function () { + $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-with-vendor-field-sign'); + unset($fixture['data']['vendorFieldHex']); + $builder = MultiPaymentBuilder::new() + ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) + ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) + ->vendorField($fixture['data']['vendorField']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture vendor field second passphrase', function () { + $fixture = $this->getTransactionFixture('multi_payment', 'multi-payment-with-vendor-field-secondSign'); + unset($fixture['data']['vendorFieldHex']); + $builder = MultiPaymentBuilder::new() + ->add($fixture['data']['asset']['payments'][0]['recipientId'], $fixture['data']['asset']['payments'][0]['amount']) + ->add($fixture['data']['asset']['payments'][1]['recipientId'], $fixture['data']['asset']['payments'][1]['amount']) + ->vendorField($fixture['data']['vendorField']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/MultiSignatureRegistrationTest.php b/tests/Unit/Transactions/Builder/MultiSignatureRegistrationTest.php index bbf1daf1..8132eaa7 100644 --- a/tests/Unit/Transactions/Builder/MultiSignatureRegistrationTest.php +++ b/tests/Unit/Transactions/Builder/MultiSignatureRegistrationTest.php @@ -15,57 +15,41 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\MultiSignatureRegistrationBuilder; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the multi signature registration builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\MultiSignatureRegistrationBuilder - */ -class MultiSignatureRegistrationTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = MultiSignatureRegistrationBuilder::new() - ->min(2) - ->lifetime(255) - ->keysgroup([ - '03a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', - '13a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', - '23a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', - ]) - ->sign('secret') - ->secondSign('second secret'); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; - - $transaction = MultiSignatureRegistrationBuilder::new() - ->min(2) - ->lifetime(255) - ->keysgroup([ - '03a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', - '13a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', - '23a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', - ]) - ->sign('this is a top secret passphrase') - ->secondSign($secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - // TODO with AIP 18 because fixture is schnorr - $this->markTestIncomplete('This test has not been implemented yet.'); - } -} +it('should sign it with a passphrase', function () { + $transaction = MultiSignatureRegistrationBuilder::new() + ->min(2) + ->lifetime(255) + ->keysgroup([ + '03a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', + '13a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', + '23a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', + ]) + ->sign('secret') + ->secondSign('second secret'); + + $this->assertTrue($transaction->verify()); +}); + +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; + + $transaction = MultiSignatureRegistrationBuilder::new() + ->min(2) + ->lifetime(255) + ->keysgroup([ + '03a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', + '13a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', + '23a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933', + ]) + ->sign('this is a top secret passphrase') + ->secondSign($secondPassphrase); + + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); + +it('should match fixture passphrase', function () { + // TODO with AIP 18 because fixture is schnorr + $this->markTestIncomplete('This test has not been implemented yet.'); +}); diff --git a/tests/Unit/Transactions/Builder/SecondSignatureRegistrationTest.php b/tests/Unit/Transactions/Builder/SecondSignatureRegistrationTest.php index 727fba44..d2ae5981 100644 --- a/tests/Unit/Transactions/Builder/SecondSignatureRegistrationTest.php +++ b/tests/Unit/Transactions/Builder/SecondSignatureRegistrationTest.php @@ -16,38 +16,24 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\SecondSignatureRegistrationBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the second signature registration builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\SecondSignatureRegistrationBuilder - */ -class SecondSignatureRegistrationTest extends TestCase -{ - /** @test */ - public function it_should_create_a_valid_transaction() - { - $transaction = SecondSignatureRegistrationBuilder::new() - ->signature('this is a top secret second passphrase') - ->sign('this is a top secret passphrase'); - - $this->assertTrue($transaction->verify()); - $this->assertFalse(isset($transaction->secondSignature)); - $this->assertSame($transaction->transaction->data['asset']['signature']['publicKey'], PublicKey::fromPassphrase('this is a top secret second passphrase')->getHex()); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('second_signature_registration', 'second-signature-registration'); - $builder = SecondSignatureRegistrationBuilder::new() - ->signature($this->secondPassphrase) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} +it('should create a valid transaction', function () { + $transaction = SecondSignatureRegistrationBuilder::new() + ->signature('this is a top secret second passphrase') + ->sign('this is a top secret passphrase'); + + $this->assertTrue($transaction->verify()); + $this->assertFalse(isset($transaction->secondSignature)); + $this->assertSame($transaction->transaction->data['asset']['signature']['publicKey'], PublicKey::fromPassphrase('this is a top secret second passphrase')->getHex()); +}); + +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('second_signature_registration', 'second-signature-registration'); + $builder = SecondSignatureRegistrationBuilder::new() + ->signature($this->secondPassphrase) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/TransferTest.php b/tests/Unit/Transactions/Builder/TransferTest.php index 9b8a2934..137e8c3c 100644 --- a/tests/Unit/Transactions/Builder/TransferTest.php +++ b/tests/Unit/Transactions/Builder/TransferTest.php @@ -16,109 +16,87 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\TransferBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the transfer builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\TransferBuilder - */ -class TransferTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = TransferBuilder::new() - ->recipient('AXoXnFi4z1Z6aFvjEYkDVCtBGW2PaRiM25') - ->amount('133380000000') - ->vendorField('This is a transaction from PHP') - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; - - $transaction = TransferBuilder::new() - ->recipient('AXoXnFi4z1Z6aFvjEYkDVCtBGW2PaRiM25') - ->amount('133380000000') - ->vendorField('This is a transaction from PHP') - ->sign($this->passphrase) - ->secondSign($secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-sign'); - $builder = TransferBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->withFee($fixture['data']['fee']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-secondSign'); - - $builder = TransferBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->withFee($fixture['data']['fee']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_vendor_field_passphrase() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign'); - unset($fixture['data']['vendorFieldHex']); - $builder = TransferBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->withFee($fixture['data']['fee']) - ->vendorField($fixture['data']['vendorField']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_vendor_field_second_passphrase() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-secondSign'); - unset($fixture['data']['vendorFieldHex']); - - $builder = TransferBuilder::new() - ->recipient($fixture['data']['recipientId']) - ->amount($fixture['data']['amount']) - ->withFee($fixture['data']['fee']) - ->vendorField($fixture['data']['vendorField']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} +it('should sign it with a passphrase', function () { + $transaction = TransferBuilder::new() + ->recipient('AXoXnFi4z1Z6aFvjEYkDVCtBGW2PaRiM25') + ->amount('133380000000') + ->vendorField('This is a transaction from PHP') + ->sign($this->passphrase); + + $this->assertTrue($transaction->verify()); +}); + +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; + + $transaction = TransferBuilder::new() + ->recipient('AXoXnFi4z1Z6aFvjEYkDVCtBGW2PaRiM25') + ->amount('133380000000') + ->vendorField('This is a transaction from PHP') + ->sign($this->passphrase) + ->secondSign($secondPassphrase); + + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); + +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('transfer', 'transfer-sign'); + $builder = TransferBuilder::new() + ->recipient($fixture['data']['recipientId']) + ->amount($fixture['data']['amount']) + ->withFee($fixture['data']['fee']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('transfer', 'transfer-secondSign'); + + $builder = TransferBuilder::new() + ->recipient($fixture['data']['recipientId']) + ->amount($fixture['data']['amount']) + ->withFee($fixture['data']['fee']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture vendor field passphrase', function () { + $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign'); + unset($fixture['data']['vendorFieldHex']); + $builder = TransferBuilder::new() + ->recipient($fixture['data']['recipientId']) + ->amount($fixture['data']['amount']) + ->withFee($fixture['data']['fee']) + ->vendorField($fixture['data']['vendorField']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture vendor field second passphrase', function () { + $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-secondSign'); + unset($fixture['data']['vendorFieldHex']); + + $builder = TransferBuilder::new() + ->recipient($fixture['data']['recipientId']) + ->amount($fixture['data']['amount']) + ->withFee($fixture['data']['fee']) + ->vendorField($fixture['data']['vendorField']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Builder/VoteTest.php b/tests/Unit/Transactions/Builder/VoteTest.php index cff60dc7..d991c628 100644 --- a/tests/Unit/Transactions/Builder/VoteTest.php +++ b/tests/Unit/Transactions/Builder/VoteTest.php @@ -16,64 +16,46 @@ use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Builder\VoteBuilder; use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the vote builder test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Builder\VoteBuilder - */ -class VoteTest extends TestCase -{ - /** @test */ - public function it_should_sign_it_with_a_passphrase() - { - $transaction = VoteBuilder::new() - ->votes(['+034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192']) - ->sign($this->passphrase); - - $this->assertTrue($transaction->verify()); - } - - /** @test */ - public function it_should_sign_it_with_a_second_passphrase() - { - $secondPassphrase = 'this is a top secret second passphrase'; - - $transaction = VoteBuilder::new() - ->votes(['+034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192']) - ->sign($this->passphrase) - ->secondSign($secondPassphrase); - - $this->assertTrue($transaction->verify()); - $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); - } - - /** @test */ - public function it_should_match_fixture_passphrase() - { - $fixture = $this->getTransactionFixture('vote', 'vote-sign'); - $builder = VoteBuilder::new() - ->votes($fixture['data']['asset']['votes']) - ->sign($this->passphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } - - /** @test */ - public function it_should_match_fixture_second_passphrase() - { - $fixture = $this->getTransactionFixture('vote', 'vote-secondSign'); - $builder = VoteBuilder::new() - ->votes($fixture['data']['asset']['votes']) - ->sign($this->passphrase) - ->secondSign($this->secondPassphrase); - - $this->assertTrue($builder->verify()); - $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); - $this->assertSameTransactions($fixture, $builder->transaction->data); - } -} +it('should sign it with a passphrase', function () { + $transaction = VoteBuilder::new() + ->votes(['+034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192']) + ->sign($this->passphrase); + + $this->assertTrue($transaction->verify()); +}); + +it('should sign it with a second passphrase', function () { + $secondPassphrase = 'this is a top secret second passphrase'; + + $transaction = VoteBuilder::new() + ->votes(['+034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192']) + ->sign($this->passphrase) + ->secondSign($secondPassphrase); + + $this->assertTrue($transaction->verify()); + $this->assertTrue($transaction->secondVerify(PublicKey::fromPassphrase($secondPassphrase)->getHex())); +}); + +it('should match fixture passphrase', function () { + $fixture = $this->getTransactionFixture('vote', 'vote-sign'); + $builder = VoteBuilder::new() + ->votes($fixture['data']['asset']['votes']) + ->sign($this->passphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); + +it('should match fixture second passphrase', function () { + $fixture = $this->getTransactionFixture('vote', 'vote-secondSign'); + $builder = VoteBuilder::new() + ->votes($fixture['data']['asset']['votes']) + ->sign($this->passphrase) + ->secondSign($this->secondPassphrase); + + $this->assertTrue($builder->verify()); + $this->assertSame($fixture['serialized'], Serializer::new($builder->transaction)->serialize()->getHex()); + $this->assertSameTransactions($fixture, $builder->transaction->data); +}); diff --git a/tests/Unit/Transactions/Deserializers/DelegateRegistrationTest.php b/tests/Unit/Transactions/Deserializers/DelegateRegistrationTest.php index da4199ad..98f00b96 100644 --- a/tests/Unit/Transactions/Deserializers/DelegateRegistrationTest.php +++ b/tests/Unit/Transactions/Deserializers/DelegateRegistrationTest.php @@ -13,54 +13,39 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; -use ArkEcosystem\Crypto\Transactions\Deserializer; use ArkEcosystem\Crypto\Transactions\Types\DelegateRegistration; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the delegate registration deserializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\DelegateRegistration - */ -class DelegateRegistrationTest extends TestCase -{ - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $fixture = $this->getTransactionFixture('delegate_registration', 'delegate-registration-sign'); +it('should deserialize the transaction signed with a passphrase', function () { + $fixture = $this->getTransactionFixture('delegate_registration', 'delegate-registration-sign'); - $this->assertTransaction($fixture); - } + assertTransactionForDelegateRegistration($fixture); +}); - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase() - { - $fixture = $this->getTransactionFixture('delegate_registration', 'delegate-registration-secondSign'); +it('should deserialize the transaction signed with a second passphrase', function () { + $fixture = $this->getTransactionFixture('delegate_registration', 'delegate-registration-secondSign'); - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); - } + $actual = assertTransactionForDelegateRegistration($fixture); + $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); +}); - private function assertTransaction(array $fixture): DelegateRegistration - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } +function assertTransactionForDelegateRegistration(array $fixture): DelegateRegistration +{ + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/DelegateResignationTest.php b/tests/Unit/Transactions/Deserializers/DelegateResignationTest.php index dcb6e163..11b0bc10 100644 --- a/tests/Unit/Transactions/Deserializers/DelegateResignationTest.php +++ b/tests/Unit/Transactions/Deserializers/DelegateResignationTest.php @@ -13,45 +13,32 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; -use ArkEcosystem\Crypto\Transactions\Deserializer; use ArkEcosystem\Crypto\Transactions\Types\DelegateResignation; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the delegate resignation deserializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\DelegateResignation - */ -class DelegateResignationTest extends TestCase +it('should deserialize the transaction signed with a passphrase', function () { + $transaction = $this->getTransactionFixture('delegate_resignation', 'delegate-resignation-sign'); + + assertTransactionForDelegateResignation($transaction); +}); + +function assertTransactionForDelegateResignation(array $fixture): DelegateResignation { - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $transaction = $this->getTransactionFixture('delegate_resignation', 'delegate-resignation-sign'); - - $this->assertTransaction($transaction); - } - - private function assertTransaction(array $fixture): DelegateResignation - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/HtlcClaimTest.php b/tests/Unit/Transactions/Deserializers/HtlcClaimTest.php index 3a21030b..e3d0d91a 100644 --- a/tests/Unit/Transactions/Deserializers/HtlcClaimTest.php +++ b/tests/Unit/Transactions/Deserializers/HtlcClaimTest.php @@ -14,49 +14,38 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; use ArkEcosystem\Crypto\Transactions\Types\HtlcClaim; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * @covers \ArkEcosystem\Crypto\Transactions\Types\HtlcClaim - */ -class HtlcClaimTest extends TestCase +it('should deserialize the transaction signed with a passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_claim', 'htlc-claim-sign'); + + assertTransactionForHtlcClaim($fixture); +}); + +it('should deserialize the transaction signed with a second passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_claim', 'htlc-claim-secondSign'); + + $actual = assertTransactionForHtlcClaim($fixture); + $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); +}); + +function assertTransactionForHtlcClaim(array $fixture): HtlcClaim { - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_claim', 'htlc-claim-sign'); - - $this->assertTransaction($fixture); - } - - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_claim', 'htlc-claim-secondSign'); - - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); - } - - private function assertTransaction(array $fixture): HtlcClaim - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/HtlcLockTest.php b/tests/Unit/Transactions/Deserializers/HtlcLockTest.php index def5780f..e4a67b7d 100644 --- a/tests/Unit/Transactions/Deserializers/HtlcLockTest.php +++ b/tests/Unit/Transactions/Deserializers/HtlcLockTest.php @@ -14,49 +14,38 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; use ArkEcosystem\Crypto\Transactions\Types\HtlcLock; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * @covers \ArkEcosystem\Crypto\Transactions\Types\HtlcLock - */ -class HtlcLockTest extends TestCase +it('should deserialize the transaction signed with a passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-sign'); + + assertTransactionForHtlcLock($fixture); +}); + +it('should deserialize the transaction signed with a second passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-secondSign'); + + $actual = assertTransactionForHtlcLock($fixture); + $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); +}); + +function assertTransactionForHtlcLock(array $fixture): HtlcLock { - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-sign'); - - $this->assertTransaction($fixture); - } - - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_lock', 'htlc-lock-secondSign'); - - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); - } - - private function assertTransaction(array $fixture): HtlcLock - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/HtlcRefundTest.php b/tests/Unit/Transactions/Deserializers/HtlcRefundTest.php index 99ff4b74..b51c1c8a 100644 --- a/tests/Unit/Transactions/Deserializers/HtlcRefundTest.php +++ b/tests/Unit/Transactions/Deserializers/HtlcRefundTest.php @@ -14,49 +14,38 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; use ArkEcosystem\Crypto\Transactions\Types\HtlcRefund; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * @covers \ArkEcosystem\Crypto\Transactions\Types\HtlcRefund - */ -class HtlcRefundTest extends TestCase +it('should deserialize the transaction signed with a passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_refund', 'htlc-refund-sign'); + + assertTransactionForHtlcRefund($fixture); +}); + +it('should deserialize the transaction signed with a second passphrase', function () { + $fixture = $this->getTransactionFixture('htlc_refund', 'htlc-refund-secondSign'); + + $actual = assertTransactionForHtlcRefund($fixture); + $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); +}); + +function assertTransactionForHtlcRefund(array $fixture): HtlcRefund { - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_refund', 'htlc-refund-sign'); - - $this->assertTransaction($fixture); - } - - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase() - { - $fixture = $this->getTransactionFixture('htlc_refund', 'htlc-refund-secondSign'); - - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); - } - - private function assertTransaction(array $fixture): HtlcRefund - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/IPFSTest.php b/tests/Unit/Transactions/Deserializers/IPFSTest.php index 36fe5479..d4032247 100644 --- a/tests/Unit/Transactions/Deserializers/IPFSTest.php +++ b/tests/Unit/Transactions/Deserializers/IPFSTest.php @@ -14,40 +14,31 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; use ArkEcosystem\Crypto\Transactions\Types\IPFS; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * @covers \ArkEcosystem\Crypto\Transactions\Types\IPFS - */ -class IPFSTest extends TestCase +it('should deserialize the transaction signed with a passphrase', function () { + $transaction = $this->getTransactionFixture('ipfs', 'ipfs-sign'); + + assertTransactionForIPFS($transaction); +}); + +function assertTransactionForIPFS(array $fixture): IPFS { - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $transaction = $this->getTransactionFixture('ipfs', 'ipfs-sign'); - - $this->assertTransaction($transaction); - } - - private function assertTransaction(array $fixture): IPFS - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/MultiPaymentTest.php b/tests/Unit/Transactions/Deserializers/MultiPaymentTest.php index 07c4215b..8cde7ec0 100644 --- a/tests/Unit/Transactions/Deserializers/MultiPaymentTest.php +++ b/tests/Unit/Transactions/Deserializers/MultiPaymentTest.php @@ -13,45 +13,32 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; -use ArkEcosystem\Crypto\Transactions\Deserializer; use ArkEcosystem\Crypto\Transactions\Types\MultiPayment; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the multi payment deserializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\MultiPayment - */ -class MultiPaymentTest extends TestCase +it('should deserialize the transaction signed with a passphrase', function () { + $transaction = $this->getTransactionFixture('multi_payment', 'multi-payment-sign'); + + assertTransactionForMultiPayment($transaction); +}); + +function assertTransactionForMultiPayment(array $fixture): MultiPayment { - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $transaction = $this->getTransactionFixture('multi_payment', 'multi-payment-sign'); - - $this->assertTransaction($transaction); - } - - private function assertTransaction(array $fixture): MultiPayment - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/MultiSignatureRegistrationTest.php b/tests/Unit/Transactions/Deserializers/MultiSignatureRegistrationTest.php index 31bddf05..1fd5cbd9 100644 --- a/tests/Unit/Transactions/Deserializers/MultiSignatureRegistrationTest.php +++ b/tests/Unit/Transactions/Deserializers/MultiSignatureRegistrationTest.php @@ -13,55 +13,40 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; -use ArkEcosystem\Crypto\Transactions\Deserializer; use ArkEcosystem\Crypto\Transactions\Types\MultiSignatureRegistration; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the multi signature registration deserializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\MultiSignatureRegistration - */ -class MultiSignatureRegistrationTest extends TestCase -{ - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - //TODO fail to verify : fixture is schnorr - $transaction = $this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration'); +it('should deserialize the transaction signed with a passphrase', function () { + //TODO fail to verify : fixture is schnorr + $transaction = $this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration'); - $this->assertTransaction($transaction); - } + assertTransactionForMultiSignatureRegistration($transaction); +}); - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase() - { - //TODO fixture - $this->markTestIncomplete('This test has not been implemented yet.'); - //$transaction = $this->getTransactionFixture('multi_signature_registration', 'multi-signature-secondSign'); -// - //$this->assertTransaction($transaction); - } +it('should deserialize the transaction signed with a second passphrase', function () { + //TODO fixture + $this->markTestIncomplete('This test has not been implemented yet.'); + //$transaction = $this->getTransactionFixture('multi_signature_registration', 'multi-signature-secondSign'); + // + //assertTransactionForMultiSignatureRegistration($transaction); +}); - private function assertTransaction(array $fixture): MultiSignatureRegistration - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - // TODO $this->assertTrue($actual->verify()); when AIP-18 with Schnorr implemented - return $actual; - } +function assertTransactionForMultiSignatureRegistration(array $fixture): MultiSignatureRegistration +{ + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + // TODO test()->assertTrue($actual->verify()); when AIP-18 with Schnorr implemented + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/SecondSignatureRegistrationTest.php b/tests/Unit/Transactions/Deserializers/SecondSignatureRegistrationTest.php index b68bb392..0cb70ba4 100644 --- a/tests/Unit/Transactions/Deserializers/SecondSignatureRegistrationTest.php +++ b/tests/Unit/Transactions/Deserializers/SecondSignatureRegistrationTest.php @@ -13,45 +13,32 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; -use ArkEcosystem\Crypto\Transactions\Deserializer; use ArkEcosystem\Crypto\Transactions\Types\SecondSignatureRegistration; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the second signature registration deserializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\SecondSignatureRegistration - */ -class SecondSignatureRegistrationTest extends TestCase +it('should deserialize the transaction signed with a second passphrase', function () { + $transaction = $this->getTransactionFixture('second_signature_registration', 'second-signature-registration'); + + $actual = assertTransactionForSecondSignatureRegistration($transaction); +}); + +function assertTransactionForSecondSignatureRegistration(array $fixture): SecondSignatureRegistration { - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase() - { - $transaction = $this->getTransactionFixture('second_signature_registration', 'second-signature-registration'); - - $actual = $this->assertTransaction($transaction); - } - - private function assertTransaction(array $fixture): SecondSignatureRegistration - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/TransferTest.php b/tests/Unit/Transactions/Deserializers/TransferTest.php index dda8ab1a..0db78790 100644 --- a/tests/Unit/Transactions/Deserializers/TransferTest.php +++ b/tests/Unit/Transactions/Deserializers/TransferTest.php @@ -13,73 +13,54 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; -use ArkEcosystem\Crypto\Transactions\Deserializer; use ArkEcosystem\Crypto\Transactions\Types\Transfer; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the transfer deserializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\Transfer - */ -class TransferTest extends TestCase -{ - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-sign'); +it('should deserialize the transaction signed with a passphrase', function () { + $fixture = $this->getTransactionFixture('transfer', 'transfer-sign'); - $actual = $this->assertTransaction($fixture); - $this->assertSame(0, $actual->data['expiration']); - } + $actual = assertTransactionForTransfer($fixture); + $this->assertSame(0, $actual->data['expiration']); +}); - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-secondSign'); +it('should deserialize the transaction signed with a second passphrase', function () { + $fixture = $this->getTransactionFixture('transfer', 'transfer-secondSign'); - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); - } + $actual = assertTransactionForTransfer($fixture); + $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); +}); - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase_and_vendor_field() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign'); +it('should deserialize the transaction signed with a passphrase and vendor field', function () { + $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign'); - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['vendorField'], $actual->data['vendorField']); - } + $actual = assertTransactionForTransfer($fixture); + $this->assertSame($fixture['data']['vendorField'], $actual->data['vendorField']); +}); - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase_and_vendor_field() - { - $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-secondSign'); +it('should deserialize the transaction signed with a second passphrase and vendor field', function () { + $fixture = $this->getTransactionFixture('transfer', 'transfer-with-vendor-field-secondSign'); - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['vendorField'], $actual->data['vendorField']); - } + $actual = assertTransactionForTransfer($fixture); + $this->assertSame($fixture['data']['vendorField'], $actual->data['vendorField']); +}); - private function assertTransaction(array $fixture): Transfer - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); +function assertTransactionForTransfer(array $fixture): Transfer +{ + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); - $this->assertTrue($actual->verify()); + test()->assertTrue($actual->verify()); - return $actual; - } + return $actual; } diff --git a/tests/Unit/Transactions/Deserializers/VoteTest.php b/tests/Unit/Transactions/Deserializers/VoteTest.php index 57070cde..c58e35ea 100644 --- a/tests/Unit/Transactions/Deserializers/VoteTest.php +++ b/tests/Unit/Transactions/Deserializers/VoteTest.php @@ -13,54 +13,39 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Deserializers; -use ArkEcosystem\Crypto\Transactions\Deserializer; use ArkEcosystem\Crypto\Transactions\Types\Vote; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the vote deserializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\Vote - */ -class VoteTest extends TestCase -{ - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_passphrase() - { - $fixture = $this->getTransactionFixture('vote', 'vote-sign'); +it('should deserialize the transaction signed with a passphrase', function () { + $fixture = $this->getTransactionFixture('vote', 'vote-sign'); - $this->assertTransaction($fixture); - } + assertTransactionForVote($fixture); +}); - /** @test */ - public function it_should_deserialize_the_transaction_signed_with_a_second_passphrase() - { - $fixture = $this->getTransactionFixture('vote', 'vote-secondSign'); +it('should deserialize the transaction signed with a second passphrase', function () { + $fixture = $this->getTransactionFixture('vote', 'vote-secondSign'); - $actual = $this->assertTransaction($fixture); - $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); - } + $actual = assertTransactionForVote($fixture); + $this->assertSame($fixture['data']['secondSignature'], $actual->data['secondSignature']); +}); - private function assertTransaction(array $fixture): Vote - { - $actual = $this->assertDeserialized($fixture, [ - 'version', - 'network', - 'type', - 'typeGroup', - 'nonce', - 'senderPublicKey', - 'fee', - 'asset', - 'signature', - 'secondSignature', - 'amount', - 'id', - ]); - - $this->assertTrue($actual->verify()); - - return $actual; - } +function assertTransactionForVote(array $fixture): Vote +{ + $actual = test()->assertDeserialized($fixture, [ + 'version', + 'network', + 'type', + 'typeGroup', + 'nonce', + 'senderPublicKey', + 'fee', + 'asset', + 'signature', + 'secondSignature', + 'amount', + 'id', + ]); + + test()->assertTrue($actual->verify()); + + return $actual; } diff --git a/tests/Unit/Transactions/Serializers/DelegateRegistrationTest.php b/tests/Unit/Transactions/Serializers/DelegateRegistrationTest.php index 1db383a2..1b80397c 100644 --- a/tests/Unit/Transactions/Serializers/DelegateRegistrationTest.php +++ b/tests/Unit/Transactions/Serializers/DelegateRegistrationTest.php @@ -13,26 +13,10 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('delegate_registration', 'delegate-registration-sign')); +}); -/** - * This is the delegate registration serializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\DelegateRegistration - */ -class DelegateRegistrationTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('delegate_registration', 'delegate-registration-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('delegate_registration', 'delegate-registration-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('delegate_registration', 'delegate-registration-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/DelegateResignationTest.php b/tests/Unit/Transactions/Serializers/DelegateResignationTest.php index a9d5b149..0a9efcda 100644 --- a/tests/Unit/Transactions/Serializers/DelegateResignationTest.php +++ b/tests/Unit/Transactions/Serializers/DelegateResignationTest.php @@ -13,26 +13,10 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('delegate_resignation', 'delegate-resignation-sign')); +}); -/** - * This is the delegate resignation serializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\DelegateResignation - */ -class DelegateResignationTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('delegate_resignation', 'delegate-resignation-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('delegate_resignation', 'delegate-resignation-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('delegate_resignation', 'delegate-resignation-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/HtlcClaimTest.php b/tests/Unit/Transactions/Serializers/HtlcClaimTest.php index 44091404..b9406575 100644 --- a/tests/Unit/Transactions/Serializers/HtlcClaimTest.php +++ b/tests/Unit/Transactions/Serializers/HtlcClaimTest.php @@ -13,22 +13,10 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('htlc_claim', 'htlc-claim-sign')); +}); -/** - * @covers \ArkEcosystem\Crypto\Transactions\Types\HtlcClaim - */ -class HtlcClaimTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('htlc_claim', 'htlc-claim-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('htlc_claim', 'htlc-claim-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('htlc_claim', 'htlc-claim-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/HtlcLockTest.php b/tests/Unit/Transactions/Serializers/HtlcLockTest.php index 2a8c4792..c2742610 100644 --- a/tests/Unit/Transactions/Serializers/HtlcLockTest.php +++ b/tests/Unit/Transactions/Serializers/HtlcLockTest.php @@ -13,22 +13,10 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('htlc_lock', 'htlc-lock-sign')); +}); -/** - * @covers \ArkEcosystem\Crypto\Transactions\Types\HtlcLock - */ -class HtlcLockTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('htlc_lock', 'htlc-lock-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('htlc_lock', 'htlc-lock-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('htlc_lock', 'htlc-lock-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/HtlcRefundTest.php b/tests/Unit/Transactions/Serializers/HtlcRefundTest.php index c9071d2f..a1c8706e 100644 --- a/tests/Unit/Transactions/Serializers/HtlcRefundTest.php +++ b/tests/Unit/Transactions/Serializers/HtlcRefundTest.php @@ -13,22 +13,10 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('htlc_refund', 'htlc-refund-sign')); +}); -/** - * @covers \ArkEcosystem\Crypto\Transactions\Types\HtlcRefund - */ -class HtlcRefundTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('htlc_refund', 'htlc-refund-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('htlc_refund', 'htlc-refund-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('htlc_refund', 'htlc-refund-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/IPFSTest.php b/tests/Unit/Transactions/Serializers/IPFSTest.php index 7369e146..d2ee0976 100644 --- a/tests/Unit/Transactions/Serializers/IPFSTest.php +++ b/tests/Unit/Transactions/Serializers/IPFSTest.php @@ -13,27 +13,10 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Crypto\Transactions\Types\IPFS; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('ipfs', 'ipfs-sign')); +}); -/** - * This is the ipfs serializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\IPFS - */ -class IPFSTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('ipfs', 'ipfs-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('ipfs', 'ipfs-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('ipfs', 'ipfs-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/MultiPaymentTest.php b/tests/Unit/Transactions/Serializers/MultiPaymentTest.php index 8688d4cb..da0ad4ae 100644 --- a/tests/Unit/Transactions/Serializers/MultiPaymentTest.php +++ b/tests/Unit/Transactions/Serializers/MultiPaymentTest.php @@ -13,26 +13,10 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('multi_payment', 'multi-payment-sign')); +}); -/** - * This is the multi payment serializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\MultiPayment - */ -class MultiPaymentTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('multi_payment', 'multi-payment-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('multi_payment', 'multi-payment-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('multi_payment', 'multi-payment-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/MultiSignatureRegistrationTest.php b/tests/Unit/Transactions/Serializers/MultiSignatureRegistrationTest.php index dc98652d..f030d340 100644 --- a/tests/Unit/Transactions/Serializers/MultiSignatureRegistrationTest.php +++ b/tests/Unit/Transactions/Serializers/MultiSignatureRegistrationTest.php @@ -13,28 +13,12 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration')); +}); -/** - * This is the multi signature registration serializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\MultiSignatureRegistration - */ -class MultiSignatureRegistrationTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - //TODO fixture? - $this->markTestIncomplete('This test has not been implemented yet.'); - //$this->assertSerialized($this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + //TODO fixture? + $this->markTestIncomplete('This test has not been implemented yet.'); + //$this->assertSerialized($this->getTransactionFixture('multi_signature_registration', 'multi-signature-registration-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/SecondSignatureRegistrationTest.php b/tests/Unit/Transactions/Serializers/SecondSignatureRegistrationTest.php index 7f738b9c..811f7a17 100644 --- a/tests/Unit/Transactions/Serializers/SecondSignatureRegistrationTest.php +++ b/tests/Unit/Transactions/Serializers/SecondSignatureRegistrationTest.php @@ -13,20 +13,6 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Tests\Crypto\TestCase; - -/** - * This is the second signature registration serializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\SecondSignatureRegistration - */ -class SecondSignatureRegistrationTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('second_signature_registration', 'second-signature-registration')); - } -} +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('second_signature_registration', 'second-signature-registration')); +}); diff --git a/tests/Unit/Transactions/Serializers/TransferTest.php b/tests/Unit/Transactions/Serializers/TransferTest.php index 6b80fe89..f0d64728 100644 --- a/tests/Unit/Transactions/Serializers/TransferTest.php +++ b/tests/Unit/Transactions/Serializers/TransferTest.php @@ -13,39 +13,18 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Crypto\Transactions\Types\Transfer; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-sign')); +}); -/** - * This is the transfer serializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\Transfer - */ -class TransferTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-secondSign')); - } +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-secondSign')); +}); - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase_and_vendor_field() - { - $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign')); - } +it('should serialize the transaction with a passphrase and vendor field', function () { + $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-with-vendor-field-sign')); +}); - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase_and_vendor_field() - { - $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-with-vendor-field-secondSign')); - } -} +it('should serialize the transaction with a second passphrase and vendor field', function () { + $this->assertSerialized($this->getTransactionFixture('transfer', 'transfer-with-vendor-field-secondSign')); +}); diff --git a/tests/Unit/Transactions/Serializers/VoteTest.php b/tests/Unit/Transactions/Serializers/VoteTest.php index c4d65c50..f899f8ab 100644 --- a/tests/Unit/Transactions/Serializers/VoteTest.php +++ b/tests/Unit/Transactions/Serializers/VoteTest.php @@ -13,27 +13,10 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; -use ArkEcosystem\Crypto\Transactions\Serializer; -use ArkEcosystem\Crypto\Transactions\Types\Vote; -use ArkEcosystem\Tests\Crypto\TestCase; +it('should serialize the transaction with a passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('vote', 'vote-sign')); +}); -/** - * This is the vote serializer test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\Vote - */ -class VoteTest extends TestCase -{ - /** @test */ - public function it_should_serialize_the_transaction_with_a_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('vote', 'vote-sign')); - } - - /** @test */ - public function it_should_serialize_the_transaction_with_a_second_passphrase() - { - $this->assertSerialized($this->getTransactionFixture('vote', 'vote-secondSign')); - } -} +it('should serialize the transaction with a second passphrase', function () { + $this->assertSerialized($this->getTransactionFixture('vote', 'vote-secondSign')); +}); diff --git a/tests/Unit/Transactions/TransactionTest.php b/tests/Unit/Transactions/TransactionTest.php index 2498bef0..5d182d2d 100644 --- a/tests/Unit/Transactions/TransactionTest.php +++ b/tests/Unit/Transactions/TransactionTest.php @@ -13,104 +13,77 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Transactions\Serializers; +use ArkEcosystem\Crypto\Binary\Bytes; use ArkEcosystem\Crypto\Identities\PrivateKey; use ArkEcosystem\Crypto\Identities\PublicKey; use ArkEcosystem\Crypto\Transactions\Deserializer; -use ArkEcosystem\Crypto\Transactions\Types\Transaction; use ArkEcosystem\Crypto\Transactions\Types\Transfer; -use ArkEcosystem\Tests\Crypto\TestCase; -use BitWasp\Buffertools\Buffer; -/** - * This is the transaction test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Transactions\Types\Transaction - */ -class TransactionTest extends TestCase -{ - /** @test */ - public function should_compute_the_id_of_the_transaction() - { - $actual = $this->getTransaction()->getId(); +it('should compute the id of the transaction', function () { + $actual = getTransactionForTransaction()->getId(); - $this->assertSame('8fd1cf0490276edb9b3cba40bcbf9a7b0ce04b90e40ffe4704fc776b2bf8aabe', $actual); - } + $this->assertSame('8fd1cf0490276edb9b3cba40bcbf9a7b0ce04b90e40ffe4704fc776b2bf8aabe', $actual); +}); - /** @test */ - public function should_sign_the_transaction_using_a_passphrase() - { - $privateKey = PrivateKey::fromPassphrase('this is a top secret passphrase'); +it('should sign the transaction using a passphrase', function () { + $privateKey = PrivateKey::fromPassphrase('this is a top secret passphrase'); - $transaction = $this->getTransaction(); - $transaction->data['signature'] = null; + $transaction = getTransactionForTransaction(); + $transaction->data['signature'] = null; - $this->assertEmpty($transaction->data['signature']); - $transaction->sign($privateKey); - $this->assertNotEmpty($transaction->data['signature']); - } + $this->assertEmpty($transaction->data['signature']); + $transaction->sign($privateKey); + $this->assertNotEmpty($transaction->data['signature']); +}); - /** @test */ - public function should_sign_the_transaction_using_a_second_passphrase() - { - $privateKey = PrivateKey::fromPassphrase('this is a top secret second passphrase'); +it('should sign the transaction using a second passphrase', function () { + $privateKey = PrivateKey::fromPassphrase('this is a top secret second passphrase'); - $transaction = $this->getTransaction(); - $transaction->data['secondSignature'] = null; + $transaction = getTransactionForTransaction(); + $transaction->data['secondSignature'] = null; - $this->assertEmpty($transaction->data['secondSignature']); - $transaction->secondSign($privateKey); - $this->assertNotEmpty($transaction->data['secondSignature']); - } + $this->assertEmpty($transaction->data['secondSignature']); + $transaction->secondSign($privateKey); + $this->assertNotEmpty($transaction->data['secondSignature']); +}); - /** @test */ - public function should_verify_the_transaction() - { - $actual = $this->getTransaction()->verify(); +it('should verify the transaction', function () { + $actual = getTransactionForTransaction()->verify(); - $this->assertTrue($actual); - } + $this->assertTrue($actual); +}); - /** @test */ - public function should_verify_the_transaction_using_a_second_public_key() - { - $secondPassphrase = 'this is a top secret second passphrase'; +it('should verify the transaction using a second public key', function () { + $secondPassphrase = 'this is a top secret second passphrase'; - $secondPublicKey = PublicKey::fromPassphrase($secondPassphrase)->getHex(); + $secondPublicKey = PublicKey::fromPassphrase($secondPassphrase)->getHex(); - $actual = $this->getTransaction('transfer-secondSign')->secondVerify($secondPublicKey); + $actual = getTransactionForTransaction('transfer-secondSign')->secondVerify($secondPublicKey); - $this->assertTrue($actual); - } + $this->assertTrue($actual); +}); - /** @test */ - public function should_turn_the_transaction_to_bytes() - { - $actual = $this->getTransaction()->getBytes(); +it('should turn the transaction to bytes', function () { + $actual = getTransactionForTransaction()->getBytes(); - $this->assertInstanceOf(Buffer::class, $actual); - } + $this->assertInstanceOf(Bytes::class, $actual); +}); - /** @test */ - public function should_turn_the_transaction_to_an_array() - { - $actual = $this->getTransaction()->toArray(); +it('should turn the transaction to an array', function () { + $actual = getTransactionForTransaction()->toArray(); - $this->assertIsArray($actual); - } + $this->assertIsArray($actual); +}); - /** @test */ - public function should_turn_the_transaction_to_json() - { - $actual = $this->getTransaction()->toJson(); +it('should turn the transaction to json', function () { + $actual = getTransactionForTransaction()->toJson(); - $this->assertIsString($actual); - } + $this->assertIsString($actual); +}); - private function getTransaction($file = 'transfer-sign'): Transfer - { - $fixture = $this->getTransactionFixture('transfer', $file); +function getTransactionForTransaction($file = 'transfer-sign'): Transfer +{ + $fixture = test()->getTransactionFixture('transfer', $file); - return Deserializer::new($fixture['serialized'])->deserialize(); - } + return Deserializer::new($fixture['serialized'])->deserialize(); } diff --git a/tests/Unit/Utils/Base58Test.php b/tests/Unit/Utils/Base58Test.php new file mode 100644 index 00000000..e84cfca0 --- /dev/null +++ b/tests/Unit/Utils/Base58Test.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Tests\Crypto\Unit\Utils; + +use ArkEcosystem\Crypto\Utils\Base58; +use InvalidArgumentException; + +it('should encode and decode binary', function () { + $this->assertSame('StV1DL6CwTryKyV', Base58::encode('hello world')); + $this->assertSame('hello world', Base58::decode('StV1DL6CwTryKyV')); +}); + +it('should keep leading zero bytes', function () { + $this->assertSame('11', Base58::encode("\0\0")); + $this->assertSame("\0\0", Base58::decode('11')); + $this->assertSame('112', Base58::encode("\0\0\x01")); + $this->assertSame("\0\0\x01", Base58::decode('112')); +}); + +it('should handle empty values', function () { + $this->assertSame('', Base58::encode('')); + $this->assertSame('', Base58::decode('')); +}); + +it('should reject invalid characters', function () { + $this->expectException(InvalidArgumentException::class); + + Base58::decode('0OIl'); +}); + +it('should round trip with a checksum', function () { + $this->assertSame("\x1e".str_repeat("\xab", 20), Base58::decodeCheck(Base58::encodeCheck("\x1e".str_repeat("\xab", 20)))); +}); + +it('should decode an address with a checksum', function () { + $this->assertSame( + '1e'.bin2hex(hash('ripemd160', hex2bin('034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192'), true)), + bin2hex(Base58::decodeCheck('D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib')) + ); +}); + +it('should reject an invalid checksum', function () { + $this->expectException(InvalidArgumentException::class); + + Base58::decodeCheck('D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyic'); +}); + +it('should reject values too short for a checksum', function () { + $this->expectException(InvalidArgumentException::class); + + Base58::decodeCheck('2'); +}); diff --git a/tests/Unit/Utils/HashTest.php b/tests/Unit/Utils/HashTest.php new file mode 100644 index 00000000..4db6d73b --- /dev/null +++ b/tests/Unit/Utils/HashTest.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace ArkEcosystem\Tests\Crypto\Unit\Utils; + +use ArkEcosystem\Crypto\Binary\Bytes; +use ArkEcosystem\Crypto\Utils\Hash; + +it('should hash with sha256', function () { + $this->assertSame('b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9', Hash::sha256('hello world')->getHex()); + $this->assertSame(Hash::sha256('hello world')->getHex(), Hash::sha256(new Bytes('hello world'))->getHex()); +}); + +it('should hash with double sha256', function () { + $this->assertSame('bc62d4b80d9e36da29c16c5d4d9f11731f36052c72401a76c23c0fb5a9b74423', Hash::sha256d('hello world')->getHex()); +}); + +it('should hash with ripemd160', function () { + $this->assertSame('98c615784ccb5fe5936fbc0cbe9dfdb408d92f0f', Hash::ripemd160('hello world')->getHex()); +}); diff --git a/tests/Unit/Utils/MessageTest.php b/tests/Unit/Utils/MessageTest.php index 5fd0e4e5..f3f58096 100644 --- a/tests/Unit/Utils/MessageTest.php +++ b/tests/Unit/Utils/MessageTest.php @@ -14,117 +14,99 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Utils; use ArkEcosystem\Crypto\Utils\Message; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the message test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Utils\Message - */ -class MessageTest extends TestCase -{ - /** @test */ - public function it_should_sign_a_valid_message() - { - $fixture = $this->getFixture('message-v1'); - - $message = Message::sign($fixture['data']['message'], $fixture['passphrase']); - - $this->assertSame($message->publicKey, $fixture['data']['publickey']); - $this->assertSame($message->signature, $fixture['data']['signature']); - $this->assertSame($message->message, $fixture['data']['message']); - } - - /** @test */ - public function it_should_create_a_message_from_an_object() - { - $fixture = json_decode(json_encode($this->getFixture('message-v1')['data'])); - - $message = Message::new($fixture); - - $this->assertSame($message->publicKey, $fixture->publickey); - $this->assertSame($message->signature, $fixture->signature); - $this->assertSame($message->message, $fixture->message); - } - - /** @test */ - public function it_should_create_a_message_from_an_array() - { - $fixture = $this->getFixture('message-v1')['data']; - - $message = Message::new($fixture); - - $this->assertSame($message->publicKey, $fixture['publickey']); - $this->assertSame($message->signature, $fixture['signature']); - $this->assertSame($message->message, $fixture['message']); - } - - /** @test */ - public function it_should_create_a_message_from_a_string() - { - $fixture = $this->getFixture('message-v1')['data']; - - $message = Message::new(json_encode($fixture)); - - $this->assertSame($message->publicKey, $fixture['publickey']); - $this->assertSame($message->signature, $fixture['signature']); - $this->assertSame($message->message, $fixture['message']); - } - - /** @test */ - public function it_should_not_create_a_message_from_an_invalid_Type() - { - $this->expectException(\InvalidArgumentException::class); - - Message::new(false); - } - - /** @test */ - public function it_should_sign_a_message() - { - $message = Message::sign('Hello World', 'passphrase'); - - $this->assertInstanceOf(Message::class, $message); - } - - /** @test */ - public function it_should_verify_a_message_from_v1() - { - $message = Message::new($this->getFixture('message-v1')['data']); - - $this->assertTrue($message->verify()); - } - - /** @test */ - public function it_should_verify_a_message_from_v2() - { - $message = Message::new($this->getFixture('message-v2')['data']); - - $this->assertTrue($message->verify()); - } - - /** @test */ - public function it_should_turn_a_message_into_an_array() - { - $message = Message::new($this->getFixture('message-v1')['data']); - - $this->assertIsArray($message->toArray()); - } - - /** @test */ - public function it_should_turn_a_message_into_json() - { - $message = Message::new($this->getFixture('message-v1')['data']); - - $this->assertIsString($message->toJSON()); - } - - /** @test */ - public function it_should_turn_a_message_into_a_string() - { - $message = Message::new($this->getFixture('message-v1')['data']); - - $this->assertIsString($message->__toString()); - } -} +it('should sign a valid message', function () { + $fixture = $this->getFixture('message-v1'); + + $message = Message::sign($fixture['data']['message'], $fixture['passphrase']); + + $this->assertSame($message->publicKey, $fixture['data']['publickey']); + $this->assertSame($message->signature, $fixture['data']['signature']); + $this->assertSame($message->message, $fixture['data']['message']); +}); + +it('should create a message from an object', function () { + $fixture = json_decode(json_encode($this->getFixture('message-v1')['data'])); + + $message = Message::new($fixture); + + $this->assertSame($message->publicKey, $fixture->publickey); + $this->assertSame($message->signature, $fixture->signature); + $this->assertSame($message->message, $fixture->message); +}); + +it('should create a message from an array', function () { + $fixture = $this->getFixture('message-v1')['data']; + + $message = Message::new($fixture); + + $this->assertSame($message->publicKey, $fixture['publickey']); + $this->assertSame($message->signature, $fixture['signature']); + $this->assertSame($message->message, $fixture['message']); +}); + +it('should create a message from a string', function () { + $fixture = $this->getFixture('message-v1')['data']; + + $message = Message::new(json_encode($fixture)); + + $this->assertSame($message->publicKey, $fixture['publickey']); + $this->assertSame($message->signature, $fixture['signature']); + $this->assertSame($message->message, $fixture['message']); +}); + +it('should not create a message from an invalid Type', function () { + $this->expectException(\InvalidArgumentException::class); + + Message::new(false); +}); + +it('should sign a message', function () { + $message = Message::sign('Hello World', 'passphrase'); + + $this->assertInstanceOf(Message::class, $message); +}); + +it('should verify a message from v1', function () { + $message = Message::new($this->getFixture('message-v1')['data']); + + $this->assertTrue($message->verify()); +}); + +it('should verify a message from v2', function () { + $message = Message::new($this->getFixture('message-v2')['data']); + + $this->assertTrue($message->verify()); +}); + +it('should turn a message into an array', function () { + $message = Message::new($this->getFixture('message-v1')['data']); + + $this->assertIsArray($message->toArray()); +}); + +it('should turn a message into json', function () { + $message = Message::new($this->getFixture('message-v1')['data']); + + $this->assertIsString($message->toJSON()); +}); + +it('should turn a message into a string', function () { + $message = Message::new($this->getFixture('message-v1')['data']); + + $this->assertIsString($message->__toString()); +}); + +it('should sign and verify a message that is not valid utf8', function () { + $message = Message::sign("\xff\xfe binary", 'passphrase'); + + $this->assertSame("\xff\xfe binary", $message->message); + $this->assertTrue($message->verify()); +}); + +it('should not verify a tampered message', function () { + $message = Message::new($this->getFixture('message-v2')['data']); + $message->message .= '!'; + + $this->assertFalse($message->verify()); +}); diff --git a/tests/Unit/Utils/SlotTest.php b/tests/Unit/Utils/SlotTest.php index 6a7ff833..4997c58a 100644 --- a/tests/Unit/Utils/SlotTest.php +++ b/tests/Unit/Utils/SlotTest.php @@ -14,29 +14,15 @@ namespace ArkEcosystem\Tests\Crypto\Unit\Utils; use ArkEcosystem\Crypto\Utils\Slot; -use ArkEcosystem\Tests\Crypto\TestCase; -/** - * This is the slot test class. - * - * @author Brian Faust - * @covers \ArkEcosystem\Crypto\Utils\Slot - */ -class SlotTest extends TestCase -{ - /** @test */ - public function it_should_get_the_time() - { - $actual = Slot::time(); - - $this->assertIsInt($actual); - } - - /** @test */ - public function it_should_get_the_epoch() - { - $actual = Slot::epoch(); - - $this->assertIsInt($actual); - } -} +it('should get the time', function () { + $actual = Slot::time(); + + $this->assertIsInt($actual); +}); + +it('should get the epoch', function () { + $actual = Slot::epoch(); + + $this->assertIsInt($actual); +}); diff --git a/tests/fixtures/core-vectors.json b/tests/fixtures/core-vectors.json new file mode 100644 index 00000000..d67932b7 --- /dev/null +++ b/tests/fixtures/core-vectors.json @@ -0,0 +1,209 @@ +{ + "source": "@arkecosystem/crypto@3.13.0 (ARK Core)", + "vectors": [ + { + "passphrase": "this is a top secret passphrase", + "privateKey": "d8839c2432bfd0a67ef10a804ba991eabba19f154a3d707917681d45822a5712", + "publicKey": "034151a3ec46b5670a682b0a63394f863587d1bc97483b1b6c70eb58e7f0aed192", + "address": { + "mainnet": "AGeYmgbg2LgGxRW2vNNJvQ88PknEJsYizC", + "devnet": "D61mfSggzbvQgTUe6JhYKH2doHaqJ3Dyib" + }, + "wif": { + "mainnet": "SGq4xLgZKCGxs7bjmwnBrWcT4C1ADFEermj846KC97FSv1WFD1dA", + "testnet": "Ue7A6vSx7ewATPp2dA6UbJ8F39DbZwaHTqhD1MrhzmJqRJmvfZ6C" + }, + "message": { + "message": "", + "signature": "304402205b285ad467fd032b0ef9e6406f192eb2edc367a7fbe9ff9e33431b9a6f4ee76102203f3bd03796f2578cedb5139783d4e47675f6f90f740572a415d940550f36c9e2" + } + }, + { + "passphrase": "a", + "privateKey": "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb", + "publicKey": "034da006f958beba78ec54443df4a3f52237253f7ae8cbdb17dccf3feaa57f3126", + "address": { + "mainnet": "Ae4QhpPV5AAGiJ6ao7vpeRb5EkvEhQchUV", + "devnet": "DTRdbaUW3RQQSL5By4G43JVaeHiqfVp9oh" + }, + "wif": { + "mainnet": "SGN1J3RwRrzpy8yXGRpSpuofXRzL2fuVKWzdrRhn2iwBu9ur1zB5", + "testnet": "Ude6SdCLEKf2ZRBp7e8jZhKTWPCmPNF7vaxiohFHtNzaQT8U5Vbp" + }, + "message": { + "message": "Hello World", + "signature": "30450221009a23b27787b23b9308b2ef8e3d5e768c7ff8e8b5de80b20d5289d4f7ad881286022011faf6f400f800fee2e582c30248b469be534dc2dd76feb13215d6d245160095" + } + }, + { + "passphrase": "ünïcödé passphrase ✓", + "privateKey": "dbc8b13235e2897d9e29df1257435f74192e3c1afe863ddd876e0b83ae6805ee", + "publicKey": "0238e2650914ae6e1480c549e537cfed67bda818682901a2cb0ca960dcf0630c53", + "address": { + "mainnet": "AL2pmqKooeUBieU2wfiiZB9aH7cKkhYj8P", + "devnet": "D9Q3fbQpmuiKSgSe7c3wx445geQvmykkTX" + }, + "wif": { + "mainnet": "SGwRcUwpJqUyFkBNqxULsCScxfab5pj9w9SV2TrkTAUBP6VhFC5X", + "testnet": "UeDWm4iD7J9Ar2PfhAndbyxQwco2SX4nYDQZyjQGJpXZtPgZVLXn" + }, + "message": { + "message": "ark-claim:boldninja:ARMy9u1XvrZ124JzQq3oeJpjmBEnYkyU7D:1792155604", + "signature": "3044022034a3e423587f4c92a3bc4e696f8604c4d89d1feab42907bbd0f16f224b72449202201dcda8786d06a834098c0edff7e608509b81889df3b5064b8629e59089f2f5e9" + } + }, + { + "passphrase": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "privateKey": "0d4e2ca9e9cbced7a7a5380eb29e1a3783b9b6d0db72de36a1051038e1c1fbc7", + "publicKey": "03b483f4ffcc76a307d78ac6b86f72674817883ddb7acf23493f03677e925d6116", + "address": { + "mainnet": "ARcXG4ZaoD75LWFguBLro67eoSHhRuBMdC", + "devnet": "DEyk9pebmUMD4YEJ57g6By2ACy6JP4bicv" + }, + "wif": { + "mainnet": "SA24JbG3Wa4RBqDt33dozbfZppR15p5yUYDbUEKHAmxGhVqxTxnW", + "testnet": "UXJ9TB2SK2icn7SAtFx6jPBMomdSSWRc5cBgRVro2S1fCnwH6Ah5" + }, + "message": { + "message": "ünïcödé ✓ 🚀", + "signature": "3045022100d95f5a84b9d754293e7de8df07259801bc6872737305be0cff779f4bad318a490220687334e3faf48df2562e860ef3c8dd8034e57544852f9f1bd0d77ab1865f7e5a" + } + }, + { + "passphrase": "zero 481", + "privateKey": "00850ccca8b6ac5f8a7a901fcbc2c7bfeb46d7385a6ad27e28b7ab69be0cc34c", + "publicKey": "025d1792614549487dfe33aac137513a5b3768ff9311c78ee29f4a41fcf9079e98", + "address": { + "mainnet": "Af2Dk1R8rivpzsUc7BfQeDq4PQbYLf19N5", + "devnet": "DUPSdmW9pzAxiuTDH7ze36jZnwQ9NViA5v" + }, + "wif": { + "mainnet": "S9bCo27EdHT9gmUZKeWv3981MXGkvzGEENZF77d2xTsxp6bSx3uF", + "testnet": "UWsHwbsdRk7MH3grArqCmvdoLUVCHgbrqSXL4PAYp7wMKPiwCg8k" + }, + "message": { + "message": "line\nbreak", + "signature": "3044022035e806622839fcc1bd0037a64c125b4f2433ec44de30ae684e7cdfef9509f0ae022013d21f74b649c900946399ed3fd97dd69be53d3351a8ac7a87eb038d75de0167" + } + }, + { + "passphrase": "passphrase 0 cfcd208495d565ef66e7dff9f98764da", + "privateKey": "5f4643a0ebeacbe23bbc0a47a181e8686c18b667f8b6a1bd98ec45673aa2fc3a", + "publicKey": "0355e1244f09233e29c8f2340be8b71fa3cc6c5868d0ab5f3b3b908cf0ff56affc", + "address": { + "mainnet": "AYAurtDHG8jsn92QR8p6cGZ5MjmooWzMqa", + "devnet": "DMY8keJJEPz1WB11b59L19TamGaQnRq8je" + }, + "wif": { + "mainnet": "SCmPrzvJu1PH9joPyhtbivwNJBPhSvwm5NeBN8DVLXBJ34nCtDSb", + "testnet": "Ua3V1aghhU3Uk21gpvCtTiTAH8c8odHPgScGKPm1CBEgYN1YMy8g" + }, + "message": { + "message": "", + "signature": "30450221008b55d9fb41a5fd0a076ef7c4fbefb36a961cafd8e4be00bcbcfd874e6827642402207d8438db15dbc7da0bda1e82e58434053e946d51a88906e9a9f89484831b93f4" + } + }, + { + "passphrase": "passphrase 1 c4ca4238a0b923820dcc509a6f75849b", + "privateKey": "8c3085890bdb759abca8db83d5d4f0b1060c49b4f5c980cf11d9fc20c1da2adb", + "publicKey": "03de904cc4daba19bce64364ee41a72795c40b83a71bb1bda34bcb771cadd18280", + "address": { + "mainnet": "AeTyYkMLYkDPpory4Sb1d67NM7sJfVnQwN", + "devnet": "DTqCSWSMX1TXYqqaENvF1y1skefuiURbKy" + }, + "wif": { + "mainnet": "SEGhnZ4hx29vztC1JKedLKP8tBwcPWyFPhtSbu9L6Ly1NU9EX3oy", + "testnet": "UbYnw8q6kUp8bAQJ9Xxv56tvs9A3kDJszmrXZAgqx12PsmG8tWb8" + }, + "message": { + "message": "Hello World", + "signature": "304402201e6983b40b24f6f9dfc830adae58e2aa914cf5feaf84912196af1432f8ecf4db022064e8dc87204e97bc4b3f6e3f4a57dea143c48d90fbdc89dadd0f25b5d22eda92" + } + }, + { + "passphrase": "passphrase 2 c81e728d9d4c2f636f067f89cc14862c", + "privateKey": "ea26ea71592aff236c2c29c4351953adef7101eed47ceacae3575e92a14eb339", + "publicKey": "03d77b94ec6fc52e561485a67eddf36e1c0d1328ec0a0e45696a56c812cb2fb9be", + "address": { + "mainnet": "AMrAo6gikJFRWjX6qeutQTxHuEZkqCA2pN", + "devnet": "DBDPgrmjiZVZEmVi1bF7oLroJmNMrJug28" + }, + "wif": { + "mainnet": "SHRMXmWo9wcLkycayAPQj12HWBnXKppn6NdchBFxYoZVdgc88gw8", + "testnet": "UehSgMHBxQGYMFpspNhhTnY5V8zxgXAQhSbheSoUQTct8ynJUYeK" + }, + "message": { + "message": "ark-claim:boldninja:ARMy9u1XvrZ124JzQq3oeJpjmBEnYkyU7D:1792155604", + "signature": "30450221008d67df32ff7dcbf03c516c1ab3013f69b90a87425db3bc20cc562d85c0b745c602207d39e12f24a62d682778d283092eebbea7b42cbfae9fda9e871c16fa4df48ea3" + } + }, + { + "passphrase": "passphrase 3 eccbc87e4b5ce2fe28308fd9f2a7baf3", + "privateKey": "1493d497b3fff06c0ab910fa7be4f21383ee1dbf7291c7e837e9d30198ff3bd4", + "publicKey": "028b3c39dd6a29ffeec95d947ec6653fe01622f33489950998cfae36945d5b9ead", + "address": { + "mainnet": "AaLjxwAC21vVVg57XAfL8EiTpFxge8eEBv", + "devnet": "DPhxrhFCzHAdDi3ih6zZX7cyDnmHckTb39" + }, + "wif": { + "mainnet": "SAGCC6SpBfmfABRBcASGbsmXqh14wuEdJy1VpCWeMfWLobS7bsMG", + "testnet": "UXYHLgDCz8RrkTdUTNkZLfHKpeDWJbaFv2yamU4ADKZjJtYVqGaz" + }, + "message": { + "message": "ünïcödé ✓ 🚀", + "signature": "3045022100c2919b4b4f1a1780bd1afdacad63a610154952ec946049aae5d6d0923d64b32002201517fd512c0e2bc1455ae9e628128fd0e57fa5714264ba4a36aa000c75b94402" + } + }, + { + "passphrase": "passphrase 4 a87ff679a2f3e71d9181a67b7542122c", + "privateKey": "14b948d360a25b2a80314d4d407ecfe12fffa4aef6cf47aa04165e55c69f6b0c", + "publicKey": "02a75d37648e3534196899f5e190b2f919eb97b3d09d65627088380482b76175e2", + "address": { + "mainnet": "Ac2vrZn6oGawzoSqgXs7tciFVCFReE6MB1", + "devnet": "DRQ9kKs7mXq5iqRSrUCMHVcktj42d8Rvze" + }, + "wif": { + "mainnet": "SAGUgooae9VUgA7C2GyVA3tgZHbYATs2xJuChLXUXngLUyxWxZDQ", + "testnet": "UXYZqPZySc9gGSKUsVHmtqQUYEoyXACfZNsHec4zPSjizH7JeQug" + }, + "message": { + "message": "line\nbreak", + "signature": "304402201fc87138473cdd6ca2e738cbd0acd0d7b6bfd21582162672c631c6c062e4e3ee02201968842936cc142f40d9fabf5757e5a9580ad4ea620e38c63e2f04fcde4ad6fa" + } + }, + { + "passphrase": "passphrase 5 e4da3b7fbbce2345d7772b0674a318d5", + "privateKey": "e637de786e7ab4abc4dd1707c2332e831d2f496b7ff8ac6d4db566ec39ff1f17", + "publicKey": "024fedb2b30ff0e451124294414362b6150673e0a9caec5ba7b1401255cf20a0ea", + "address": { + "mainnet": "AVyYD4RTZWfzp2m7VHMjjKbLrUZJYtXDKN", + "devnet": "DKLm6pWUXmv8Y4jifDgy8CVrG1MuaEBqTi" + }, + "wif": { + "mainnet": "SHHi27M5Wr88c3rzgqGZbjW64MEjRCRU6tMKPaHv8AZymyPqXbzB", + "testnet": "UeZoAh7UKJnLCL5HY3arLX1t3JTAmtm6hxKQLqqRypdNHGZXexgY" + }, + "message": { + "message": "", + "signature": "3045022100a92f4b286875f419fccbecb2a298c344b1c3ad1ae9606c78e2ef8156e8547d8302206f2de0e3515a71b10ba291978ff7bb3a995ba45332362ed6246868e93c0f6649" + } + }, + { + "passphrase": "passphrase 6 1679091c5a880faf6fb5e6087eb1b2dc", + "privateKey": "83943fba03012e0a87ebe18aa94d2520543b06125965deca798dfecefeb5912d", + "publicKey": "02ac75fda6369ef1d25ec197f53baecdd68265562ed0475701837003f17f621f61", + "address": { + "mainnet": "AUXdhzRKGmGmQocEBHfQs1cXBx7JcZMYRD", + "devnet": "DHtrbkWLF2Wu8qaqMDzeFtX2bUuuboUCJ5" + }, + "wif": { + "mainnet": "SDyy1NCCV4ezNN34r3qffUD2MJZcfdnC8ZZ1faCcjNRyoM8AMXQW", + "testnet": "UbG49wxbHXKBxeFMhG9xQFipLFn42L7pjdX6cqk8b2VNJeEv5abd" + }, + "message": { + "message": "Hello World", + "signature": "3044022051ce8d97d116e903fbe4df52cd0d3b459468cd91e87d3231774882863afd87e502202e1aa9563dcd2c6fab88155583e6fc2fabfa3a1388b9be1678439e7dc6ce9109" + } + } + ] +}