From d79894a1ac98766c2c2ad477dfcc30f4e9535530 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:20:33 +0900 Subject: [PATCH 01/26] add CMutableTransaction size test --- src/Makefile.test.include | 1 + src/test/blsct/external_api/blsct_tests.cpp | 38 +++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/test/blsct/external_api/blsct_tests.cpp diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 7d2d6bc49ac18..9fc63d118ffd6 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -95,6 +95,7 @@ BITCOIN_TESTS =\ test/blsct/building_block/lazy_points_tests.cpp \ test/blsct/common_tests.cpp \ test/blsct/eip_2333/bls12_381_keygen_tests.cpp \ + test/blsct/external_api/blsct_tests.cpp \ test/blsct/keys_tests.cpp \ test/blsct/range_proof/range_proof_common_tests.cpp \ test/blsct/range_proof/generators_tests.cpp \ diff --git a/src/test/blsct/external_api/blsct_tests.cpp b/src/test/blsct/external_api/blsct_tests.cpp new file mode 100644 index 0000000000000..06cf2bc7a3537 --- /dev/null +++ b/src/test/blsct/external_api/blsct_tests.cpp @@ -0,0 +1,38 @@ +// Copyright (c) 2024 The Navio developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include +#include +#include + +#define ASSERT_SIZE_EQ(type, size) BOOST_CHECK_EQUAL(sizeof(type), size) + +BOOST_FIXTURE_TEST_SUITE(external_api_tests, BasicTestingSetup) + +// This test verifies the sizes of CMutableTransaction and +// all user-defined types within it to detect any structural +// changes in the CMutableTransaction class +BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) +{ + ASSERT_SIZE_EQ(Txid, 32); + + ASSERT_SIZE_EQ(CTxIn, 104); + ASSERT_SIZE_EQ(COutPoint, 36); + ASSERT_SIZE_EQ(CScript, 32); + ASSERT_SIZE_EQ(CScriptWitness, 24); + + ASSERT_SIZE_EQ(CTxOutBLSCTData, 1248); + ASSERT_SIZE_EQ(MclG1Point, 144); + ASSERT_SIZE_EQ(bulletproofs::RangeProof, 808); + + ASSERT_SIZE_EQ(CTxOut, 1328); + ASSERT_SIZE_EQ(CAmount, 8); + ASSERT_SIZE_EQ(TokenId, 40); + + ASSERT_SIZE_EQ(CMutableTransaction, 344); + ASSERT_SIZE_EQ(blsct::Signature, 288); +} + +BOOST_AUTO_TEST_SUITE_END() + From fdf6c0b233f91f60456b0de62fbb711d0cb9fab5 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Thu, 24 Oct 2024 08:54:36 +0900 Subject: [PATCH 02/26] remove duplicate blsct object. rename external api test --- src/Makefile.am | 2 -- src/Makefile.test.include | 2 +- .../external_api/{blsct_tests.cpp => external_api_tests.cpp} | 0 3 files changed, 1 insertion(+), 3 deletions(-) rename src/test/blsct/external_api/{blsct_tests.cpp => external_api_tests.cpp} (100%) diff --git a/src/Makefile.am b/src/Makefile.am index 70c4b5c896a78..49b1b80cc213c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -168,7 +168,6 @@ BLSCT_H = \ blsct/common.h \ blsct/double_public_key.h \ blsct/eip_2333/bls12_381_keygen.h \ - blsct/external_api/blsct.h \ blsct/key_io.h \ blsct/private_key.h \ blsct/public_key.h \ @@ -223,7 +222,6 @@ BLSCT_CPP = \ blsct/common.cpp \ blsct/double_public_key.cpp \ blsct/eip_2333/bls12_381_keygen.cpp \ - blsct/external_api/blsct.cpp \ blsct/key_io.cpp \ blsct/pos/helpers.cpp \ blsct/pos/pos.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 9fc63d118ffd6..2244cb30f9be7 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -95,7 +95,7 @@ BITCOIN_TESTS =\ test/blsct/building_block/lazy_points_tests.cpp \ test/blsct/common_tests.cpp \ test/blsct/eip_2333/bls12_381_keygen_tests.cpp \ - test/blsct/external_api/blsct_tests.cpp \ + test/blsct/external_api/external_api_tests.cpp \ test/blsct/keys_tests.cpp \ test/blsct/range_proof/range_proof_common_tests.cpp \ test/blsct/range_proof/generators_tests.cpp \ diff --git a/src/test/blsct/external_api/blsct_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp similarity index 100% rename from src/test/blsct/external_api/blsct_tests.cpp rename to src/test/blsct/external_api/external_api_tests.cpp From 76eaef7ad0c7bb6ea4874092ebbc005d2e6b6d1b Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Fri, 25 Oct 2024 08:32:24 +0900 Subject: [PATCH 03/26] fix CMutableTransaction strcture check test --- .../blsct/external_api/external_api_tests.cpp | 98 +++++++++++++++---- 1 file changed, 79 insertions(+), 19 deletions(-) diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index 06cf2bc7a3537..7c49c7e8a0806 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -2,36 +2,96 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +#include + +#include +#include +#include #include -#include +#include +#include +#include +#include -#define ASSERT_SIZE_EQ(type, size) BOOST_CHECK_EQUAL(sizeof(type), size) +#include BOOST_FIXTURE_TEST_SUITE(external_api_tests, BasicTestingSetup) -// This test verifies the sizes of CMutableTransaction and -// all user-defined types within it to detect any structural -// changes in the CMutableTransaction class +// This test checks if there is any structural change in +// CMutableTransaction and its dependencies BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) { - ASSERT_SIZE_EQ(Txid, 32); + /* + CCoinsViewDB base{{.path = "test", .cache_bytes = 1 << 23, .memory_only = true}, {}}; + + auto wallet = std::make_unique(m_node.chain.get(), "", wallet::CreateMockableWalletDatabase()); + wallet->InitWalletFlags(wallet::WALLET_FLAG_BLSCT); + + auto blsct_km = wallet->GetOrCreateBLSCTKeyMan(); + BOOST_CHECK(blsct_km->SetupGeneration({}, blsct::IMPORT_MASTER_KEY, true)); + + auto recvAddress = std::get(blsct_km->GetNewDestination(0).value()); + + const auto txid = Txid::FromUint256(uint256::ONE); + COutPoint outpoint{txid, 0}; + + Coin coin; + auto out = blsct::CreateOutput(recvAddress, 1000 * COIN, "test"); + coin.nHeight = 1; + coin.out = out.out; + + auto txf_tx = blsct::TxFactory(blsct_km); + + { + CCoinsViewCache coins_view_cache{&base, true}; + coins_view_cache.SetBestBlock(uint256::ONE); + coins_view_cache.AddCoin(outpoint, std::move(coin), true); + BOOST_CHECK(coins_view_cache.Flush()); + } + + CCoinsViewCache coins_view_cache{&base, true}; + BOOST_CHECK(txf_tx.AddInput(coins_view_cache, outpoint)); + + txf_tx.AddOutput(recvAddress, 900 * COIN, "test"); + + auto tx = txf_tx.BuildTx(); + + DataStream st{}; + TransactionSerParams params { .allow_witness = true }; + ParamsStream ps {params, st}; + tx->Serialize(ps); + auto hex = HexStr(st); + + printf("%s\n", hex.c_str()); + */ - ASSERT_SIZE_EQ(CTxIn, 104); - ASSERT_SIZE_EQ(COutPoint, 36); - ASSERT_SIZE_EQ(CScript, 32); - ASSERT_SIZE_EQ(CScriptWitness, 24); + // in case there is a structural change in CMutableTransaction, + // regenerate tx_hex with the commented-out code above + std::string tx_hex = "220000000101000000000000000000000000000000000000000000000000000000000000000000000000ffffffff03ffffffffffffff7f010000000000000001510190de49f3c13fa8a012d7faf19a6be7ec7ef001fa450987a21a817f5b0b1fcb2183375e240429f43fd8c4ef86042a1e3c06808194ecf1d168e898aeb4a9d97c88c9f0ef9b786ec98f39b6f98f01b89c40e1b02f1f52a6a1dfd94a700523b629ea09b3b16d53caab0a5f952ecb03caa6031bedde1ddbaaba3ff25408010029a387fa824547093f8a475bb5c4838ae7e72e80b3c12f52568de311cbbe64abf318ed3e18de98b14db957e4f8ca77515339febd3b4eb637d154eddbb8c54efe6bb653b491fa0535a0ed277b7ff38d50f76e55e60ce1cdf4929455c50677cb9891216b06cd1bff58066fe7b2052d9d5b6aca088bb5e545b6ce4ff4a2a340cf2cc261331584de326c1ca8f678f88004f62b7d78449b13bcf29d0eed57610396e0de20dcf6a414de58b97a23d13b3f0e22782a0860ffb7290e18676e9b451a14a9ea98fbbaa7ba035fd169637250b443b13332473506ac9598352c3cbd70ec756f9d473047555df7560372ec66a1e7b4a5a5983f0f35fff0d5626e2ed9294e591aa8ba641cf2ab315680c96842a6816776228d977013bed24085d9901e018a9d0c40b3ad92d8306b6eace181342a5e047c0e368892158c6c38c7cfb32c014b05d7441ab40a4db2ee8ae8c0f76cc7bb4974d3ae8775debae7a1e00fe93d4bf48bfaed052a1287ae006c4a02138ade80a095765d53205573b7425a8fd28b229c8d9c066e90dc50cbb3672f917f557cb8f99fa435796ac098d617ce387cd50c131cf62c3c40ac6a01284ee824ba5a5cc72a5a1f50176cde96678baad1cd3fdc2826d196b2c2ff00ad6575ab7f42e1b45a27fcf6a3cfce7cb21fd616709efacc90ca8d2f0f1d43a6f05cfb88a2dbc879d2ae524d75ce4d12942fa9c778124df131e096a6e65430915613c3713d2ee95936f68013b42f2f3c2416d2094fbd58ae755ee1b85a632fd4853f308e4d4972d30739cce32d8b8962bd6f43f3c20f9e39347bc00f4cabeaa658114145b57c5f65efb3ac59b101a9bfb074c7908df4002a07386c10dcc94b7c274fce51d83ac76da715df1218c60b1b840761382b13528b573fe2ca87fde505b1835738390b644d1acfcb0e4f9b1c16fbe085f638d697a05d29888fa33cde007d75195ca96da004788dd1369d0a46413252d691f1a8f40f0c10db8b12f4ef2c7378ecc376d029e1f7acb42b64f5d1175fc9db80394eae6131635955e8b3363d0163d984edcb774b9548bb1fad05a1b5470795bf8b333089ee8361991695b45652b31044b6f1a3bfad8d2a1342d658a70293b97638a9dfeddfafa0a980b869872ac01de1a0b80675c7a5296862c630a8636cd29af02b82e9465dafb405211f97c85ec76e9009ec080d47e26b701aca978bb1864632e06f4c462726b7b73da4f0cd49bc5ab4d9a0d3788688c1ef1e79a404d64c8e282fe8e1f1303ea443b021ccab4cbfced6aa3f575178e651cd48acaf045cea22288893dac50499d80c6bf3cf954c1a79c52cad8be5c30b9701ee62d1acffe1dda5a7c45b89c3d933bc84d66adb1732a5c4b5a85faa44c93c080980345430be78b3bfd155d05da1ffc4f296515015ffffffffffffff7f0100000000000000015101873f9c1cef19d74c20ca6f27cbded9113506f91eaf3ec5f2462a5e2bcb3c0323c4e2608048932f0c91ffa9b6c4b889f506a20b25057ee37536fa465e9bf4b9e2dc2e998df423d7ad4957afe2a6e1003fd60444ba76bb73bcc2acc980e191328b0191a1c67a9fa3684b538d972a4e504f87beb4447e36c5c1ec70535462abf529425e365fac2448add9bb858afbb8c0351ca40f9afff677f9bdb6c1a645f554501b98f7377a79831eb944456be128fb4cab0c9731c910fa9ac795b4edaa56f80354b8040c0ecc42bbc4f9714bd2f0610bbdf9610eed33fe817375cf9aed86b6b7fd6ef375bbfbed567560157718fb03157ea38ee28c5f2902982dddfbe0db2dce848c68b3b5d6181e86a6ca111957e0e9222a22702665c757d55cc87bd69b7eb9c7818c49d1d47bfbbf210b8e44216f828a2f4193186053dfe422183df548a4ef6dbe5b86e73f77b45ea5df243b49fc9ae006ad52ae4849763ec182d0a357126493e7304fcaae4509ec2da11e2693b75c9fcacdcaa1b6d44352b5ba30ac018e817a9fb2351ae9cfc9f11e35c7f64329b991f8b99ec48b8f0045f3496603d728a4f33fa773fe98f728945bef8ba7bdde41110bb14cd4dfe5a58e0840e5595ad134be8d35de5fa988b675957200f018d7304ef7626486060d4be741a28e1f6464cf997c96ecfa7eaacaa2a4a94ada3eaeda8519b1beb7a9da5ae3a5072d76f1de388097e0011aefc2530562aa74c5d9ea3b6780845442286534513503d58f692d33a864b608b9e7f15cfdf66abab1b860818800493b92e187bfa82ed2a8e8f74b25e827b769f91143a5117a82dbd975b44975541b2c97d02e0401edff6b061f77ba53533a646674bb328a27bcd2eb65e739a765a2e3bad16094ae87f4e0ffeb7b4720edc7fa90247c12ffcccc539a87e787d87bfa2c01405f3cdbcbb843b60f6797e1f787e948ea251d662b58d3b8bd78b29df1e2f262b4f06893dcd739d20d6290f86dc19ce0800c2ca685d402f9377872d8b88de6c5e24842beb91d7bae549cd7273c55b1bf14a01c04a0825e81383b12a74e81e0a79fa10a8d70ad1aa928f7addf02ad0cca82c2df283530ef31bb623cf102fca444034c6e84cbc04a0ba75a15ff1f51cee6fbf7180bb85f61876600d3ed9a583d97018dd81aefc47a18ed8999362db8b48773fcc46924d7fab1a0893bc919674dc09dca7db6eafe4bf97c755f9015ee48fccf3d1dd5789cb99289c102b145308bfceea30990cf85bb9ee1a6587dd8a25f34bc20b136e89603469878d7ef122d82020d99a8d0d67ae6a199b5cc740262204136df29e00d92a2a94c67795ab663a3ad5aea4b923607088343f649f09de0a73deea66d19a42f4f35dbf03d536e8229062b3a4fb7a07225a32f6d4c5d4a139c978f337215da105fb085419352d20c23dc33aea84671c03ac2bbfc725271b81f75f8b326069fc264c798a10d32c21982990724fc46cdf0c25502351e0b908582a57e045b5be8628e8f87d6a1ede5a0a0d551b3896809b25345108f55f7ba74c225c65006692d67485d4cc5ee81eb2e1af8643dfb43d9a628d117edcbfa827404fda3040000000000016a00000000a61c9bbb11507a1c71fde1028f08e150e4f7efc69b69ff45f6e0afdfee105e85d2b9006e394dde9d648627d21934cfe0161be58bb288ff9c6e1d3d1285034b8d4106a5b653ea38d3cc672ab4eb943642f567819813169db474eff1f539ed494e"; - ASSERT_SIZE_EQ(CTxOutBLSCTData, 1248); - ASSERT_SIZE_EQ(MclG1Point, 144); - ASSERT_SIZE_EQ(bulletproofs::RangeProof, 808); + DataStream st{}; + TransactionSerParams params { .allow_witness = true }; + ParamsStream ps {params, st}; - ASSERT_SIZE_EQ(CTxOut, 1328); - ASSERT_SIZE_EQ(CAmount, 8); - ASSERT_SIZE_EQ(TokenId, 40); + for (size_t i = 0; i < tx_hex.length(); i += 2) { + std::string byte_str = tx_hex.substr(i, 2); + ps << static_cast(std::stoi(byte_str, nullptr, 16)); + } - ASSERT_SIZE_EQ(CMutableTransaction, 344); - ASSERT_SIZE_EQ(blsct::Signature, 288); + CMutableTransaction tx; + try { + tx.Unserialize(ps); // should not throw an exception + } catch(...) { + BOOST_CHECK(false); + } } BOOST_AUTO_TEST_SUITE_END() From df778fdba31e30fa319287c0e3edf59c60a31a90 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:31:22 +0900 Subject: [PATCH 04/26] remove unnecessary header --- src/test/blsct/keys_tests.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/blsct/keys_tests.cpp b/src/test/blsct/keys_tests.cpp index 3101e9a77de99..ff34bd2e145b6 100644 --- a/src/test/blsct/keys_tests.cpp +++ b/src/test/blsct/keys_tests.cpp @@ -13,7 +13,6 @@ #include #include #include -#include BOOST_FIXTURE_TEST_SUITE(keys_tests, BasicTestingSetup) From 963264d9add1b42da7b4a5088a8cb2b2aa938dff Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Fri, 25 Oct 2024 11:43:37 +0900 Subject: [PATCH 05/26] fix lint issue --- src/Makefile.am | 1 + .../blsct/external_api/external_api_tests.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 49b1b80cc213c..fadc861cbaa7a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -168,6 +168,7 @@ BLSCT_H = \ blsct/common.h \ blsct/double_public_key.h \ blsct/eip_2333/bls12_381_keygen.h \ + blsct/external_api/blsct.h \ blsct/key_io.h \ blsct/private_key.h \ blsct/public_key.h \ diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index 7c49c7e8a0806..f070e9970a538 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -25,6 +25,16 @@ BOOST_FIXTURE_TEST_SUITE(external_api_tests, BasicTestingSetup) +uint8_t hex_to_uint(char c) { + if (c >= '0' && c <= '9') { + return c - '0'; + } else if (c >= 'a' && c <= 'f') { + return 10 + (c - 'a'); + } else { + throw std::invalid_argument("Unexpected hex char found"); + } +} + // This test checks if there is any structural change in // CMutableTransaction and its dependencies BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) @@ -82,8 +92,9 @@ BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) ParamsStream ps {params, st}; for (size_t i = 0; i < tx_hex.length(); i += 2) { - std::string byte_str = tx_hex.substr(i, 2); - ps << static_cast(std::stoi(byte_str, nullptr, 16)); + auto high = hex_to_uint(tx_hex[i]); + auto low = hex_to_uint(tx_hex[i + 1]); + ps << ((high << 4) | low); } CMutableTransaction tx; From c75a23de61d53471d021af3e318c45584f3c0591 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 05:02:11 +0900 Subject: [PATCH 06/26] kick off ci --- src/test/blsct/external_api/external_api_tests.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index f070e9970a538..8361c6915b2d0 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -79,7 +79,6 @@ BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) ParamsStream ps {params, st}; tx->Serialize(ps); auto hex = HexStr(st); - printf("%s\n", hex.c_str()); */ From 68c66f58e2f9c44915975361986f80a42d2deb44 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 08:37:44 +0900 Subject: [PATCH 07/26] add dependency --- src/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile.am b/src/Makefile.am index fadc861cbaa7a..9c4a68e33b939 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1452,6 +1452,7 @@ libblsct_a_SOURCES = \ script/interpreter.cpp \ script/miniscript.cpp \ script/script.cpp \ + script/script_error.cpp \ script/sign.cpp \ script/signingprovider.cpp \ support/cleanse.cpp \ From 79d8b37a78120ca94c5777a6d1114a0762abe12c Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 08:44:05 +0900 Subject: [PATCH 08/26] fix macos missing symbol issue --- src/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Makefile.am b/src/Makefile.am index 9c4a68e33b939..f7d26a3e29bcd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1455,6 +1455,7 @@ libblsct_a_SOURCES = \ script/script_error.cpp \ script/sign.cpp \ script/signingprovider.cpp \ + sync.cpp \ support/cleanse.cpp \ support/lockedpool.cpp \ uint256.cpp \ From 9dc13b6e592a40c10986e58bdf7cdbdf3f307297 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 09:20:45 +0900 Subject: [PATCH 09/26] wip --- src/test/blsct/external_api/external_api_tests.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index 8361c6915b2d0..f070e9970a538 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -79,6 +79,7 @@ BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) ParamsStream ps {params, st}; tx->Serialize(ps); auto hex = HexStr(st); + printf("%s\n", hex.c_str()); */ From 507de7b6793cca0d95348e1a2c87ffe342a8cb89 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 09:24:13 +0900 Subject: [PATCH 10/26] replace tabs with spaces --- src/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index f7d26a3e29bcd..83d4d3c969dd3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -213,7 +213,7 @@ BLSCT_CPP = \ blsct/arith/elements.cpp \ blsct/arith/mcl/mcl_g1point.cpp \ blsct/arith/mcl/mcl_scalar.cpp \ - blsct/bech32_mod.cpp \ + blsct/bech32_mod.cpp \ blsct/building_block/g_h_gi_hi_zero_verifier.cpp \ blsct/building_block/generator_deriver.cpp \ blsct/building_block/imp_inner_prod_arg.cpp \ @@ -223,7 +223,7 @@ BLSCT_CPP = \ blsct/common.cpp \ blsct/double_public_key.cpp \ blsct/eip_2333/bls12_381_keygen.cpp \ - blsct/key_io.cpp \ + blsct/key_io.cpp \ blsct/pos/helpers.cpp \ blsct/pos/pos.cpp \ blsct/pos/proof_logic.cpp \ @@ -1455,7 +1455,7 @@ libblsct_a_SOURCES = \ script/script_error.cpp \ script/sign.cpp \ script/signingprovider.cpp \ - sync.cpp \ + sync.cpp \ support/cleanse.cpp \ support/lockedpool.cpp \ uint256.cpp \ From 37019de44693ed7dcc7ca6ed5bc8db2a952ca8b8 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 17:35:35 +0900 Subject: [PATCH 11/26] kick off ci --- src/test/blsct/external_api/external_api_tests.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index f070e9970a538..8361c6915b2d0 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -79,7 +79,6 @@ BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) ParamsStream ps {params, st}; tx->Serialize(ps); auto hex = HexStr(st); - printf("%s\n", hex.c_str()); */ From ec5744ec3a51093689fc176ebacb594a12149a09 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 17:42:35 +0900 Subject: [PATCH 12/26] replace printf with cout --- src/test/blsct/external_api/external_api_tests.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index 8361c6915b2d0..d3c1c1e6f882d 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -2,16 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -// #include -// #include -// #include -// #include -// #include -// #include -// #include -// #include #include - #include #include #include @@ -20,6 +11,7 @@ #include #include #include +#include #include @@ -79,7 +71,7 @@ BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) ParamsStream ps {params, st}; tx->Serialize(ps); auto hex = HexStr(st); - printf("%s\n", hex.c_str()); + std::cout << hex << std::endl; */ // in case there is a structural change in CMutableTransaction, From 49090eadc98e7e5eaa55f86a3fc9da8432ba1d18 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 20:40:04 +0900 Subject: [PATCH 13/26] make headers and cpps for test util symmetric --- src/Makefile.test_util.include | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Makefile.test_util.include b/src/Makefile.test_util.include index 0610e6487c4d0..ba3217d1ced53 100644 --- a/src/Makefile.test_util.include +++ b/src/Makefile.test_util.include @@ -19,6 +19,7 @@ TEST_UTIL_H = \ blsct/public_key.h \ blsct/public_keys.h \ blsct/signature.h \ + blsct/wallet/txfactory_global.h \ test/util/blockfilter.h \ test/util/chainstate.h \ test/util/coins.h \ @@ -27,8 +28,8 @@ TEST_UTIL_H = \ test/util/logging.h \ test/util/mining.h \ test/util/net.h \ - test/util/poolresourcetester.h \ test/util/random.h \ + test/util/poolresourcetester.h \ test/util/script.h \ test/util/setup_common.h \ test/util/str.h \ @@ -52,7 +53,7 @@ libtest_util_a_SOURCES = \ blsct/private_key.cpp \ blsct/public_key.cpp \ blsct/public_keys.cpp \ - blsct/signature.h \ + blsct/signature.cpp \ blsct/wallet/txfactory_global.cpp \ test/util/blockfilter.cpp \ test/util/coins.cpp \ From 9d2690e3a18445195a52a0c0e81bb45ca10e87b3 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 21:11:50 +0900 Subject: [PATCH 14/26] disable pdb generation in navio-util win build --- build_msvc/navio-util/navio-util.vcxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index 2e460dc70bd8e..fbec08793a186 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -3,6 +3,7 @@ {57A04EC9-542A-4E40-83D0-AC3BE1F36805} + false Application From 5f9994b87955a62d9746c03799aac02a696c2184 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sat, 26 Oct 2024 23:42:34 +0900 Subject: [PATCH 15/26] add comment to explain the reason to disable pdb generation --- build_msvc/navio-util/navio-util.vcxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index fbec08793a186..436dd54c6587f 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -3,6 +3,7 @@ {57A04EC9-542A-4E40-83D0-AC3BE1F36805} + false From 4fda8ddd0052024fa08a03af885912d9027578e9 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:45:49 +0900 Subject: [PATCH 16/26] remove commented out code and use existing function and macro to parse tx hex --- .../blsct/external_api/external_api_tests.cpp | 58 ++----------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index d3c1c1e6f882d..f57f0fbf3079f 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -31,64 +31,14 @@ uint8_t hex_to_uint(char c) { // CMutableTransaction and its dependencies BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) { - /* - CCoinsViewDB base{{.path = "test", .cache_bytes = 1 << 23, .memory_only = true}, {}}; - - auto wallet = std::make_unique(m_node.chain.get(), "", wallet::CreateMockableWalletDatabase()); - wallet->InitWalletFlags(wallet::WALLET_FLAG_BLSCT); - - auto blsct_km = wallet->GetOrCreateBLSCTKeyMan(); - BOOST_CHECK(blsct_km->SetupGeneration({}, blsct::IMPORT_MASTER_KEY, true)); - - auto recvAddress = std::get(blsct_km->GetNewDestination(0).value()); - - const auto txid = Txid::FromUint256(uint256::ONE); - COutPoint outpoint{txid, 0}; - - Coin coin; - auto out = blsct::CreateOutput(recvAddress, 1000 * COIN, "test"); - coin.nHeight = 1; - coin.out = out.out; - - auto txf_tx = blsct::TxFactory(blsct_km); - - { - CCoinsViewCache coins_view_cache{&base, true}; - coins_view_cache.SetBestBlock(uint256::ONE); - coins_view_cache.AddCoin(outpoint, std::move(coin), true); - BOOST_CHECK(coins_view_cache.Flush()); - } - - CCoinsViewCache coins_view_cache{&base, true}; - BOOST_CHECK(txf_tx.AddInput(coins_view_cache, outpoint)); - - txf_tx.AddOutput(recvAddress, 900 * COIN, "test"); - - auto tx = txf_tx.BuildTx(); - - DataStream st{}; - TransactionSerParams params { .allow_witness = true }; - ParamsStream ps {params, st}; - tx->Serialize(ps); - auto hex = HexStr(st); - std::cout << hex << std::endl; - */ - // in case there is a structural change in CMutableTransaction, - // regenerate tx_hex with the commented-out code above + // tx_hex needs to be regenerated to reflect the new structure std::string tx_hex = "220000000101000000000000000000000000000000000000000000000000000000000000000000000000ffffffff03ffffffffffffff7f010000000000000001510190de49f3c13fa8a012d7faf19a6be7ec7ef001fa450987a21a817f5b0b1fcb2183375e240429f43fd8c4ef86042a1e3c06808194ecf1d168e898aeb4a9d97c88c9f0ef9b786ec98f39b6f98f01b89c40e1b02f1f52a6a1dfd94a700523b629ea09b3b16d53caab0a5f952ecb03caa6031bedde1ddbaaba3ff25408010029a387fa824547093f8a475bb5c4838ae7e72e80b3c12f52568de311cbbe64abf318ed3e18de98b14db957e4f8ca77515339febd3b4eb637d154eddbb8c54efe6bb653b491fa0535a0ed277b7ff38d50f76e55e60ce1cdf4929455c50677cb9891216b06cd1bff58066fe7b2052d9d5b6aca088bb5e545b6ce4ff4a2a340cf2cc261331584de326c1ca8f678f88004f62b7d78449b13bcf29d0eed57610396e0de20dcf6a414de58b97a23d13b3f0e22782a0860ffb7290e18676e9b451a14a9ea98fbbaa7ba035fd169637250b443b13332473506ac9598352c3cbd70ec756f9d473047555df7560372ec66a1e7b4a5a5983f0f35fff0d5626e2ed9294e591aa8ba641cf2ab315680c96842a6816776228d977013bed24085d9901e018a9d0c40b3ad92d8306b6eace181342a5e047c0e368892158c6c38c7cfb32c014b05d7441ab40a4db2ee8ae8c0f76cc7bb4974d3ae8775debae7a1e00fe93d4bf48bfaed052a1287ae006c4a02138ade80a095765d53205573b7425a8fd28b229c8d9c066e90dc50cbb3672f917f557cb8f99fa435796ac098d617ce387cd50c131cf62c3c40ac6a01284ee824ba5a5cc72a5a1f50176cde96678baad1cd3fdc2826d196b2c2ff00ad6575ab7f42e1b45a27fcf6a3cfce7cb21fd616709efacc90ca8d2f0f1d43a6f05cfb88a2dbc879d2ae524d75ce4d12942fa9c778124df131e096a6e65430915613c3713d2ee95936f68013b42f2f3c2416d2094fbd58ae755ee1b85a632fd4853f308e4d4972d30739cce32d8b8962bd6f43f3c20f9e39347bc00f4cabeaa658114145b57c5f65efb3ac59b101a9bfb074c7908df4002a07386c10dcc94b7c274fce51d83ac76da715df1218c60b1b840761382b13528b573fe2ca87fde505b1835738390b644d1acfcb0e4f9b1c16fbe085f638d697a05d29888fa33cde007d75195ca96da004788dd1369d0a46413252d691f1a8f40f0c10db8b12f4ef2c7378ecc376d029e1f7acb42b64f5d1175fc9db80394eae6131635955e8b3363d0163d984edcb774b9548bb1fad05a1b5470795bf8b333089ee8361991695b45652b31044b6f1a3bfad8d2a1342d658a70293b97638a9dfeddfafa0a980b869872ac01de1a0b80675c7a5296862c630a8636cd29af02b82e9465dafb405211f97c85ec76e9009ec080d47e26b701aca978bb1864632e06f4c462726b7b73da4f0cd49bc5ab4d9a0d3788688c1ef1e79a404d64c8e282fe8e1f1303ea443b021ccab4cbfced6aa3f575178e651cd48acaf045cea22288893dac50499d80c6bf3cf954c1a79c52cad8be5c30b9701ee62d1acffe1dda5a7c45b89c3d933bc84d66adb1732a5c4b5a85faa44c93c080980345430be78b3bfd155d05da1ffc4f296515015ffffffffffffff7f0100000000000000015101873f9c1cef19d74c20ca6f27cbded9113506f91eaf3ec5f2462a5e2bcb3c0323c4e2608048932f0c91ffa9b6c4b889f506a20b25057ee37536fa465e9bf4b9e2dc2e998df423d7ad4957afe2a6e1003fd60444ba76bb73bcc2acc980e191328b0191a1c67a9fa3684b538d972a4e504f87beb4447e36c5c1ec70535462abf529425e365fac2448add9bb858afbb8c0351ca40f9afff677f9bdb6c1a645f554501b98f7377a79831eb944456be128fb4cab0c9731c910fa9ac795b4edaa56f80354b8040c0ecc42bbc4f9714bd2f0610bbdf9610eed33fe817375cf9aed86b6b7fd6ef375bbfbed567560157718fb03157ea38ee28c5f2902982dddfbe0db2dce848c68b3b5d6181e86a6ca111957e0e9222a22702665c757d55cc87bd69b7eb9c7818c49d1d47bfbbf210b8e44216f828a2f4193186053dfe422183df548a4ef6dbe5b86e73f77b45ea5df243b49fc9ae006ad52ae4849763ec182d0a357126493e7304fcaae4509ec2da11e2693b75c9fcacdcaa1b6d44352b5ba30ac018e817a9fb2351ae9cfc9f11e35c7f64329b991f8b99ec48b8f0045f3496603d728a4f33fa773fe98f728945bef8ba7bdde41110bb14cd4dfe5a58e0840e5595ad134be8d35de5fa988b675957200f018d7304ef7626486060d4be741a28e1f6464cf997c96ecfa7eaacaa2a4a94ada3eaeda8519b1beb7a9da5ae3a5072d76f1de388097e0011aefc2530562aa74c5d9ea3b6780845442286534513503d58f692d33a864b608b9e7f15cfdf66abab1b860818800493b92e187bfa82ed2a8e8f74b25e827b769f91143a5117a82dbd975b44975541b2c97d02e0401edff6b061f77ba53533a646674bb328a27bcd2eb65e739a765a2e3bad16094ae87f4e0ffeb7b4720edc7fa90247c12ffcccc539a87e787d87bfa2c01405f3cdbcbb843b60f6797e1f787e948ea251d662b58d3b8bd78b29df1e2f262b4f06893dcd739d20d6290f86dc19ce0800c2ca685d402f9377872d8b88de6c5e24842beb91d7bae549cd7273c55b1bf14a01c04a0825e81383b12a74e81e0a79fa10a8d70ad1aa928f7addf02ad0cca82c2df283530ef31bb623cf102fca444034c6e84cbc04a0ba75a15ff1f51cee6fbf7180bb85f61876600d3ed9a583d97018dd81aefc47a18ed8999362db8b48773fcc46924d7fab1a0893bc919674dc09dca7db6eafe4bf97c755f9015ee48fccf3d1dd5789cb99289c102b145308bfceea30990cf85bb9ee1a6587dd8a25f34bc20b136e89603469878d7ef122d82020d99a8d0d67ae6a199b5cc740262204136df29e00d92a2a94c67795ab663a3ad5aea4b923607088343f649f09de0a73deea66d19a42f4f35dbf03d536e8229062b3a4fb7a07225a32f6d4c5d4a139c978f337215da105fb085419352d20c23dc33aea84671c03ac2bbfc725271b81f75f8b326069fc264c798a10d32c21982990724fc46cdf0c25502351e0b908582a57e045b5be8628e8f87d6a1ede5a0a0d551b3896809b25345108f55f7ba74c225c65006692d67485d4cc5ee81eb2e1af8643dfb43d9a628d117edcbfa827404fda3040000000000016a00000000a61c9bbb11507a1c71fde1028f08e150e4f7efc69b69ff45f6e0afdfee105e85d2b9006e394dde9d648627d21934cfe0161be58bb288ff9c6e1d3d1285034b8d4106a5b653ea38d3cc672ab4eb943642f567819813169db474eff1f539ed494e"; - DataStream st{}; - TransactionSerParams params { .allow_witness = true }; - ParamsStream ps {params, st}; - - for (size_t i = 0; i < tx_hex.length(); i += 2) { - auto high = hex_to_uint(tx_hex[i]); - auto low = hex_to_uint(tx_hex[i + 1]); - ps << ((high << 4) | low); - } - CMutableTransaction tx; + DataStream ss{ParseHex(tx_hex)}; + ss >> TX_WITH_WITNESS(tx); + try { tx.Unserialize(ps); // should not throw an exception } catch(...) { From 076bd40d20bf7de89e136e5512a9b2b8795f9f2d Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sun, 27 Oct 2024 16:02:56 +0900 Subject: [PATCH 17/26] use ParseHex to parse hex string --- src/test/blsct/external_api/external_api_tests.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index f57f0fbf3079f..76b9fc9a25a69 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -32,12 +32,13 @@ uint8_t hex_to_uint(char c) { BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) { // in case there is a structural change in CMutableTransaction, - // tx_hex needs to be regenerated to reflect the new structure + // tx_hex needs to be regenerated to reflect the structure change std::string tx_hex = "220000000101000000000000000000000000000000000000000000000000000000000000000000000000ffffffff03ffffffffffffff7f010000000000000001510190de49f3c13fa8a012d7faf19a6be7ec7ef001fa450987a21a817f5b0b1fcb2183375e240429f43fd8c4ef86042a1e3c06808194ecf1d168e898aeb4a9d97c88c9f0ef9b786ec98f39b6f98f01b89c40e1b02f1f52a6a1dfd94a700523b629ea09b3b16d53caab0a5f952ecb03caa6031bedde1ddbaaba3ff25408010029a387fa824547093f8a475bb5c4838ae7e72e80b3c12f52568de311cbbe64abf318ed3e18de98b14db957e4f8ca77515339febd3b4eb637d154eddbb8c54efe6bb653b491fa0535a0ed277b7ff38d50f76e55e60ce1cdf4929455c50677cb9891216b06cd1bff58066fe7b2052d9d5b6aca088bb5e545b6ce4ff4a2a340cf2cc261331584de326c1ca8f678f88004f62b7d78449b13bcf29d0eed57610396e0de20dcf6a414de58b97a23d13b3f0e22782a0860ffb7290e18676e9b451a14a9ea98fbbaa7ba035fd169637250b443b13332473506ac9598352c3cbd70ec756f9d473047555df7560372ec66a1e7b4a5a5983f0f35fff0d5626e2ed9294e591aa8ba641cf2ab315680c96842a6816776228d977013bed24085d9901e018a9d0c40b3ad92d8306b6eace181342a5e047c0e368892158c6c38c7cfb32c014b05d7441ab40a4db2ee8ae8c0f76cc7bb4974d3ae8775debae7a1e00fe93d4bf48bfaed052a1287ae006c4a02138ade80a095765d53205573b7425a8fd28b229c8d9c066e90dc50cbb3672f917f557cb8f99fa435796ac098d617ce387cd50c131cf62c3c40ac6a01284ee824ba5a5cc72a5a1f50176cde96678baad1cd3fdc2826d196b2c2ff00ad6575ab7f42e1b45a27fcf6a3cfce7cb21fd616709efacc90ca8d2f0f1d43a6f05cfb88a2dbc879d2ae524d75ce4d12942fa9c778124df131e096a6e65430915613c3713d2ee95936f68013b42f2f3c2416d2094fbd58ae755ee1b85a632fd4853f308e4d4972d30739cce32d8b8962bd6f43f3c20f9e39347bc00f4cabeaa658114145b57c5f65efb3ac59b101a9bfb074c7908df4002a07386c10dcc94b7c274fce51d83ac76da715df1218c60b1b840761382b13528b573fe2ca87fde505b1835738390b644d1acfcb0e4f9b1c16fbe085f638d697a05d29888fa33cde007d75195ca96da004788dd1369d0a46413252d691f1a8f40f0c10db8b12f4ef2c7378ecc376d029e1f7acb42b64f5d1175fc9db80394eae6131635955e8b3363d0163d984edcb774b9548bb1fad05a1b5470795bf8b333089ee8361991695b45652b31044b6f1a3bfad8d2a1342d658a70293b97638a9dfeddfafa0a980b869872ac01de1a0b80675c7a5296862c630a8636cd29af02b82e9465dafb405211f97c85ec76e9009ec080d47e26b701aca978bb1864632e06f4c462726b7b73da4f0cd49bc5ab4d9a0d3788688c1ef1e79a404d64c8e282fe8e1f1303ea443b021ccab4cbfced6aa3f575178e651cd48acaf045cea22288893dac50499d80c6bf3cf954c1a79c52cad8be5c30b9701ee62d1acffe1dda5a7c45b89c3d933bc84d66adb1732a5c4b5a85faa44c93c080980345430be78b3bfd155d05da1ffc4f296515015ffffffffffffff7f0100000000000000015101873f9c1cef19d74c20ca6f27cbded9113506f91eaf3ec5f2462a5e2bcb3c0323c4e2608048932f0c91ffa9b6c4b889f506a20b25057ee37536fa465e9bf4b9e2dc2e998df423d7ad4957afe2a6e1003fd60444ba76bb73bcc2acc980e191328b0191a1c67a9fa3684b538d972a4e504f87beb4447e36c5c1ec70535462abf529425e365fac2448add9bb858afbb8c0351ca40f9afff677f9bdb6c1a645f554501b98f7377a79831eb944456be128fb4cab0c9731c910fa9ac795b4edaa56f80354b8040c0ecc42bbc4f9714bd2f0610bbdf9610eed33fe817375cf9aed86b6b7fd6ef375bbfbed567560157718fb03157ea38ee28c5f2902982dddfbe0db2dce848c68b3b5d6181e86a6ca111957e0e9222a22702665c757d55cc87bd69b7eb9c7818c49d1d47bfbbf210b8e44216f828a2f4193186053dfe422183df548a4ef6dbe5b86e73f77b45ea5df243b49fc9ae006ad52ae4849763ec182d0a357126493e7304fcaae4509ec2da11e2693b75c9fcacdcaa1b6d44352b5ba30ac018e817a9fb2351ae9cfc9f11e35c7f64329b991f8b99ec48b8f0045f3496603d728a4f33fa773fe98f728945bef8ba7bdde41110bb14cd4dfe5a58e0840e5595ad134be8d35de5fa988b675957200f018d7304ef7626486060d4be741a28e1f6464cf997c96ecfa7eaacaa2a4a94ada3eaeda8519b1beb7a9da5ae3a5072d76f1de388097e0011aefc2530562aa74c5d9ea3b6780845442286534513503d58f692d33a864b608b9e7f15cfdf66abab1b860818800493b92e187bfa82ed2a8e8f74b25e827b769f91143a5117a82dbd975b44975541b2c97d02e0401edff6b061f77ba53533a646674bb328a27bcd2eb65e739a765a2e3bad16094ae87f4e0ffeb7b4720edc7fa90247c12ffcccc539a87e787d87bfa2c01405f3cdbcbb843b60f6797e1f787e948ea251d662b58d3b8bd78b29df1e2f262b4f06893dcd739d20d6290f86dc19ce0800c2ca685d402f9377872d8b88de6c5e24842beb91d7bae549cd7273c55b1bf14a01c04a0825e81383b12a74e81e0a79fa10a8d70ad1aa928f7addf02ad0cca82c2df283530ef31bb623cf102fca444034c6e84cbc04a0ba75a15ff1f51cee6fbf7180bb85f61876600d3ed9a583d97018dd81aefc47a18ed8999362db8b48773fcc46924d7fab1a0893bc919674dc09dca7db6eafe4bf97c755f9015ee48fccf3d1dd5789cb99289c102b145308bfceea30990cf85bb9ee1a6587dd8a25f34bc20b136e89603469878d7ef122d82020d99a8d0d67ae6a199b5cc740262204136df29e00d92a2a94c67795ab663a3ad5aea4b923607088343f649f09de0a73deea66d19a42f4f35dbf03d536e8229062b3a4fb7a07225a32f6d4c5d4a139c978f337215da105fb085419352d20c23dc33aea84671c03ac2bbfc725271b81f75f8b326069fc264c798a10d32c21982990724fc46cdf0c25502351e0b908582a57e045b5be8628e8f87d6a1ede5a0a0d551b3896809b25345108f55f7ba74c225c65006692d67485d4cc5ee81eb2e1af8643dfb43d9a628d117edcbfa827404fda3040000000000016a00000000a61c9bbb11507a1c71fde1028f08e150e4f7efc69b69ff45f6e0afdfee105e85d2b9006e394dde9d648627d21934cfe0161be58bb288ff9c6e1d3d1285034b8d4106a5b653ea38d3cc672ab4eb943642f567819813169db474eff1f539ed494e"; + DataStream st{ParseHex(tx_hex)}; + TransactionSerParams params { .allow_witness = true }; + ParamsStream ps {params, st}; CMutableTransaction tx; - DataStream ss{ParseHex(tx_hex)}; - ss >> TX_WITH_WITNESS(tx); try { tx.Unserialize(ps); // should not throw an exception From 81d3bb66d5a2797090149ff3291f25e66bf3b9c5 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Sun, 27 Oct 2024 16:24:46 +0900 Subject: [PATCH 18/26] kick off ci --- src/test/blsct/external_api/external_api_tests.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/blsct/external_api/external_api_tests.cpp b/src/test/blsct/external_api/external_api_tests.cpp index 76b9fc9a25a69..165bcc31c0c87 100644 --- a/src/test/blsct/external_api/external_api_tests.cpp +++ b/src/test/blsct/external_api/external_api_tests.cpp @@ -38,6 +38,7 @@ BOOST_AUTO_TEST_CASE(test_cmutable_transaction_sizes) DataStream st{ParseHex(tx_hex)}; TransactionSerParams params { .allow_witness = true }; ParamsStream ps {params, st}; + CMutableTransaction tx; try { From ada265d87f3185fddbe813a84a703efd7c9af038 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Mon, 28 Oct 2024 05:59:58 +0900 Subject: [PATCH 19/26] use different flag to suppress pdb generation --- build_msvc/navio-util/navio-util.vcxproj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index 436dd54c6587f..b124f0fbb00b5 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -3,8 +3,6 @@ {57A04EC9-542A-4E40-83D0-AC3BE1F36805} - - false Application @@ -12,7 +10,10 @@ - + + + None + {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} From 78127ebc7fe1cac8c73c2a0c3d939fee99f1d835 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Mon, 28 Oct 2024 06:46:46 +0900 Subject: [PATCH 20/26] add mistakenly deleted closing tag --- build_msvc/navio-util/navio-util.vcxproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index b124f0fbb00b5..8f07ca363bbae 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -13,7 +13,8 @@ None - + + {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} From 9a786abcb9aab20372fbc1e0692617b6e6c37a0d Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Mon, 28 Oct 2024 07:26:07 +0900 Subject: [PATCH 21/26] try to disable pdb generation differently --- build_msvc/navio-util/navio-util.vcxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index 8f07ca363bbae..b4d4fc3b122da 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -8,12 +8,12 @@ Application $(SolutionDir)$(Platform)\$(Configuration)\ + + + None + - - - None - From 271afe27f2409d76fde69114525a2f67c9e849f3 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:32:53 +0900 Subject: [PATCH 22/26] try /Zf option --- build_msvc/navio-util/navio-util.vcxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index b4d4fc3b122da..3039d6b96d202 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -12,6 +12,12 @@ None + + + + true + + From 3a13983dbb390add9a4ee93691aa144f6edf1f4b Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:25:05 +0900 Subject: [PATCH 23/26] try to remove bitcon_util from navio-util --- build_msvc/navio-util/navio-util.vcxproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index 3039d6b96d202..9c800a113ddf5 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -31,9 +31,6 @@ {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} From 371715b52d451bed5391d0760eb772e575d3b1a7 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Tue, 29 Oct 2024 07:02:04 +0900 Subject: [PATCH 24/26] remove minimal build and no debug info --- build_msvc/navio-util/navio-util.vcxproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index 9c800a113ddf5..02858c19fa4ef 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -8,14 +8,8 @@ Application $(SolutionDir)$(Platform)\$(Configuration)\ - - - None - - - true From aa59490d0363f11bd976c37dd265e73211a690e1 Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:08:11 +0900 Subject: [PATCH 25/26] remove duplicated bitcoin-uti.cpp clcompile --- build_msvc/navio-util/navio-util.vcxproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index 02858c19fa4ef..023aa2473f49c 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -8,10 +8,6 @@ Application $(SolutionDir)$(Platform)\$(Configuration)\ - - - - From 05d99d7aa8d96cbc215e861a6048fbc82d090f8e Mon Sep 17 00:00:00 2001 From: gogoex <110195520+gogoex@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:10:10 +0900 Subject: [PATCH 26/26] add back libbitcoin_util --- build_msvc/navio-util/navio-util.vcxproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build_msvc/navio-util/navio-util.vcxproj b/build_msvc/navio-util/navio-util.vcxproj index 023aa2473f49c..2e460dc70bd8e 100644 --- a/build_msvc/navio-util/navio-util.vcxproj +++ b/build_msvc/navio-util/navio-util.vcxproj @@ -21,6 +21,9 @@ {6190199c-6cf4-4dad-bfbd-93fa72a760c1} + + {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} + {5724ba7d-a09a-4ba8-800b-c4c1561b3d69}