Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson committed Jan 15, 2025
1 parent 796392c commit c6d900c
Show file tree
Hide file tree
Showing 6 changed files with 613 additions and 424 deletions.
3 changes: 2 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ TEST_FILES = $(TESTDATA_DIR)/stellar-core_example.cfg $(TESTDATA_DIR)/stellar-co
$(TESTDATA_DIR)/stellar-core_testnet.cfg $(TESTDATA_DIR)/stellar-core_testnet_legacy.cfg \
$(TESTDATA_DIR)/stellar-history.testnet.6714239.json $(TESTDATA_DIR)/stellar-history.livenet.15686975.json \
$(TESTDATA_DIR)/stellar-core_testnet_validator.cfg $(TESTDATA_DIR)/stellar-core_example_validators.cfg \
$(TESTDATA_DIR)/stellar-history.testnet.6714239.networkPassphrase.json
$(TESTDATA_DIR)/stellar-history.testnet.6714239.networkPassphrase.json \
$(TESTDATA_DIR)/stellar-history.testnet.6714239.networkPassphrase.v2.json

BUILT_SOURCES = $(SRC_X_FILES:.x=.h) main/StellarCoreVersion.cpp main/XDRFilesSha256.cpp $(TEST_FILES)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"version": 2,
"server": "v9.0.1-dirty",
"currentLedger": 6714239,
"networkPassphrase": "(V) (;,,;) (V)",
"currentBuckets": [
{
"curr": "0000000000000000000000000000000000000000000000000000000000000000",
"next": {
"state": 0
},
"snap": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"curr": "c3131b946b5cadf713ca88d299505fe16572ffeefa083b2858a674452fd8ba76",
"next": {
"state": 1,
"output": "0000000000000000000000000000000000000000000000000000000000000000"
},
"snap": "e08d65b07ca3cb0999a340247afcf0fedbe1d1e1df6ada0c34422e2d3b905735"
},
{
"curr": "b767206bf07e3dbbe14cff681234b7ccfd4dab5957ce6d440f692409498ff909",
"next": {
"state": 1,
"output": "e08d65b07ca3cb0999a340247afcf0fedbe1d1e1df6ada0c34422e2d3b905735"
},
"snap": "0bdeee425d0b4c3458353b7b20901e60eb8b5289dd8a714e59f910a47b49d66e"
},
{
"curr": "7a1132e7566dea51a35f6981181ad3f108256bb5f9470f0e9df3222c138c6446",
"next": {
"state": 1,
"output": "0bdeee425d0b4c3458353b7b20901e60eb8b5289dd8a714e59f910a47b49d66e"
},
"snap": "1863067ae6d91218c589b2ccc40a983edc144196ca3a2cd43c7426275a8a3f40"
},
{
"curr": "f4e99dd7c25206f6766911dc812502f0ec2cd5469f4742b7848523aa6e0da03e",
"next": {
"state": 1,
"output": "dd9bcfba61bf17be7093f56eb6e1392d5f25981282d4331cb51961852c11ee16"
},
"snap": "04a5699bb688ef82e8a352b2ccfa134458c794a0365dddfac00f2e6fc7c159f9"
},
{
"curr": "f9de28d23c53d1affe871a97a5c9747bbc9a208754388dc88cdea96852977471",
"next": {
"state": 1,
"output": "b6d012ce7af5624c24d4ff386ae172516ff0cd13f70cd030edbb503b87ad196b"
},
"snap": "1fd4b80ec5278fc08269f96728206fcfbf5d3f5efe1bf7f93d4a3d79a75eeca8"
},
{
"curr": "71f4453669ec84632afcdd1f2a97685121cef52a01db58c8d4c810310c07c0d8",
"next": {
"state": 1,
"output": "c0992883bd5f4631f736c5287538342c08e00f80be16b36a5a794772114a3db9"
},
"snap": "b8913fa01d3b58b763fc04ee1528317c0ec71f250500758e09d0a839ca405be4"
},
{
"curr": "a113930757a7ff48a8898dad74c1446a942b5e5b5f443626a8f943768432ec41",
"next": {
"state": 1,
"output": "9b6feec6e7e366b898a59ad562b31ce3305d7e1545f92bf5fda5c13e032bc0f9"
},
"snap": "d3b1a36290f39d4cd09e7ef80b7cb871df9a3a5b1e40d8e5cfd26c754914ca84"
},
{
"curr": "e57d1c6342f6e47c2ac0305cd5251bb0fb2cdd40923af87c4657e896e33acdc5",
"next": {
"state": 1,
"output": "de8805e4232fe81c04f5536487e586ab6d3ef38eff93bad5bf6872a3e53ced6b"
},
"snap": "fcddef737957961d828023a081b84449dc0ab20524e5155837bae12a3b18ac64"
},
{
"curr": "5c3387bcaad3139bb48ff2a99010d6f075cc9b20ba2f22c194fcda2a97926f55",
"next": {
"state": 1,
"output": "3373185b0eb537b909c56e6e16e76e33d966dc7ee1e7168123cfe1114d444e88"
},
"snap": "2958d66f083ca13ca97a184a5be3a03b3c2e494f832b1ac1a3e16d7b02e9f50c"
},
{
"curr": "ae7e4814b50e176d8e3532e462e2e9db02f218adebd74603d7e349cc19f489e1",
"next": {
"state": 1,
"output": "50abed8a9d86c072cfe8388246b7a378dc355fe996fd7384a5ee57e8da2ad51d"
},
"snap": "0000000000000000000000000000000000000000000000000000000000000000"
}
],
"hotArchiveBuckets": [
{
"curr": "0000000000000000000000000000000000000000000000000000000000000000",
"next": {
"state": 0
},
"snap": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"curr": "c3131b946b5cadf713ca88d299505fe16572ffeefa083b2858a674452fd8ba74",
"next": {
"state": 1,
"output": "0000000000000000000000000000000000000000000000000000000000000000"
},
"snap": "e08d65b07ca3cb0999a340247afcf0fedbe1d1e1df6ada0c34422e2d3b905732"
},
{
"curr": "b767206bf07e3dbbe14cff681234b7ccfd4dab5957ce6d440f692409498ff901",
"next": {
"state": 1,
"output": "e08d65b07ca3cb0999a340247afcf0fedbe1d1e1df6ada0c34422e2d3b905732"
},
"snap": "0bdeee425d0b4c3458353b7b20901e60eb8b5289dd8a714e59f910a47b49d661"
},
{
"curr": "7a1132e7566dea51a35f6981181ad3f108256bb5f9470f0e9df3222c138c6442",
"next": {
"state": 1,
"output": "0bdeee425d0b4c3458353b7b20901e60eb8b5289dd8a714e59f910a47b49d661"
},
"snap": "1863067ae6d91218c589b2ccc40a983edc144196ca3a2cd43c7426275a8a3f42"
},
{
"curr": "f4e99dd7c25206f6766911dc812502f0ec2cd5469f4742b7848523aa6e0da031",
"next": {
"state": 1,
"output": "dd9bcfba61bf17be7093f56eb6e1392d5f25981282d4331cb51961852c11ee12"
},
"snap": "04a5699bb688ef82e8a352b2ccfa134458c794a0365dddfac00f2e6fc7c159f1"
},
{
"curr": "f9de28d23c53d1affe871a97a5c9747bbc9a208754388dc88cdea96852977472",
"next": {
"state": 1,
"output": "b6d012ce7af5624c24d4ff386ae172516ff0cd13f70cd030edbb503b87ad1961"
},
"snap": "1fd4b80ec5278fc08269f96728206fcfbf5d3f5efe1bf7f93d4a3d79a75eeca2"
},
{
"curr": "71f4453669ec84632afcdd1f2a97685121cef52a01db58c8d4c810310c07c0d1",
"next": {
"state": 1,
"output": "c0992883bd5f4631f736c5287538342c08e00f80be16b36a5a794772114a3db2"
},
"snap": "b8913fa01d3b58b763fc04ee1528317c0ec71f250500758e09d0a839ca405be1"
},
{
"curr": "a113930757a7ff48a8898dad74c1446a942b5e5b5f443626a8f943768432ec42",
"next": {
"state": 1,
"output": "9b6feec6e7e366b898a59ad562b31ce3305d7e1545f92bf5fda5c13e032bc0f1"
},
"snap": "d3b1a36290f39d4cd09e7ef80b7cb871df9a3a5b1e40d8e5cfd26c754914ca24"
},
{
"curr": "e57d1c6342f6e47c2ac0305cd5251bb0fb2cdd40923af87c4657e896e33acdc1",
"next": {
"state": 1,
"output": "de8805e4232fe81c04f5536487e586ab6d3ef38eff93bad5bf6872a3e53ced62"
},
"snap": "fcddef737957961d828023a081b84449dc0ab20524e5155837bae12a3b18ac61"
},
{
"curr": "5c3387bcaad3139bb48ff2a99010d6f075cc9b20ba2f22c194fcda2a97926f52",
"next": {
"state": 1,
"output": "3373185b0eb537b909c56e6e16e76e33d966dc7ee1e7168123cfe1114d444e81"
},
"snap": "2958d66f083ca13ca97a184a5be3a03b3c2e494f832b1ac1a3e16d7b02e9f502"
},
{
"curr": "ae7e4814b50e176d8e3532e462e2e9db02f218adebd74603d7e349cc19f489e2",
"next": {
"state": 1,
"output": "50abed8a9d86c072cfe8388246b7a378dc355fe996fd7384a5ee57e8da2ad52"
},
"snap": "0000000000000000000000000000000000000000000000000000000000000000"
}
]
}
12 changes: 8 additions & 4 deletions src/history/test/HistoryTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,9 @@ TEST_CASE_VERSIONS(

BucketTestUtils::for_versions_with_differing_bucket_logic(
cfg, [&](Config const& cfg) {
Application::pointer app = createTestApplication(clock, cfg);
auto app =
createTestApplication<BucketTestUtils::BucketTestApplication>(
clock, cfg);
auto& hm = app->getHistoryManager();
auto& lm = app->getLedgerManager();
auto& bl = app->getBucketManager().getLiveBucketList();
Expand All @@ -1470,9 +1472,11 @@ TEST_CASE_VERSIONS(
{
auto lcl = lm.getLastClosedLedgerHeader();
lcl.header.ledgerSeq += 1;
BucketTestUtils::addLiveBatchAndUpdateSnapshot(
*app, lcl.header, {},
LedgerTestUtils::generateValidUniqueLedgerEntries(8), {});
lm.setNextLedgerEntryBatchForBucketTesting(
{},
LedgerTestUtils::generateValidLedgerEntriesWithExclusions(
{LedgerEntryType::CONFIG_SETTING}, 8),
{});
clock.crank(true);
}

Expand Down
8 changes: 4 additions & 4 deletions src/history/test/HistoryTestsUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,11 @@ CatchupSimulation::generateRandomLedger(uint32_t version)
uint32_t inclusion = 100;

sorobanTxs.push_back(createUploadWasmTx(
getApp(), stroopy, inclusion, DEFAULT_TEST_RESOURCE_FEE, res,
{}, 0, rand_uniform(101, 1'000)));
getApp(), stroopy, inclusion, DEFAULT_TEST_RESOURCE_FEE * 5,
res, {}, 0, rand_uniform(101, 2'000)));
sorobanTxs.push_back(createUploadWasmTx(
getApp(), eve, inclusion * 5, DEFAULT_TEST_RESOURCE_FEE, res,
{}, 0, rand_uniform(101, 1'000)));
getApp(), eve, inclusion * 5, DEFAULT_TEST_RESOURCE_FEE * 5,
res, {}, 0, rand_uniform(101, 2'000)));
check = true;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/testdata/ledger-close-meta-v1-protocol-23-soroban.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
"v": 0
},
"ledgerHeader": {
"hash": "a6fbcc8f60da431ed4fb4ced5b84b54489b0e331b8a9a2b1e85c9c22a19551fa",
"hash": "ecdec1018a374931b9093f17859605bd5bc224b5871ac4c73fa700b3cd56d974",
"header": {
"ledgerVersion": 23,
"previousLedgerHash": "6994ce5b967538e38ef4e55d3d98fda420a10a323736a85ec02decae70faac8e",
"previousLedgerHash": "29e09c18ed9748b5acaabe34318b1725e4c48522fdec2bd8ad86b6e2cb4f7430",
"scpValue": {
"txSetHash": "79dc76ffd553e86f2cb9b63042a8f89a706f3cc55fec8cac7865c2363725abb7",
"txSetHash": "2ca34974f03b8f3a517ab05cb13c0a1653a249bf05f0ad2371881b31c14fbc2c",
"closeTime": 1451692800,
"upgrades": [],
"ext": {
"v": "STELLAR_VALUE_SIGNED",
"lcValueSignature": {
"nodeID": "GDDOUW25MRFLNXQMN3OODP6JQEXSGLMHAFZV4XPQ2D3GA4QFIDMEJG2O",
"signature": "13eb24d05caeb4e721fbbe96bd6170d90da02f42567e519528177c4efae238365a87425cef90db445ba2bc28585022435fa17545f9bed1051510a940ab23c600"
"signature": "412ad459feccc9446a2a9f89f6a2b86ef31814deab3284f94bb46dc3f889062d9603bcaf8964be714dbcd1aa6cf5de33f816515c3fd8bc7c035eec23161d0906"
}
}
},
"txSetResultHash": "65b6fe91abfe43ed98fa2163f08fdf3f2f3231101bba05102521186c25a1cc4b",
"bucketListHash": "d71ea87f579389c8c976fca3cf1b755de14330d7aaa35e6544411ec2bd1cf443",
"bucketListHash": "e0d3d2574896aa7e5349ea7ac29ebc63b460365278af3c5ab78a72b1b362be19",
"ledgerSeq": 28,
"totalCoins": 1000000000000000000,
"feePool": 804520,
Expand All @@ -49,7 +49,7 @@
"txSet": {
"v": 1,
"v1TxSet": {
"previousLedgerHash": "6994ce5b967538e38ef4e55d3d98fda420a10a323736a85ec02decae70faac8e",
"previousLedgerHash": "29e09c18ed9748b5acaabe34318b1725e4c48522fdec2bd8ad86b6e2cb4f7430",
"phases": [
{
"v": 0,
Expand Down
Loading

0 comments on commit c6d900c

Please sign in to comment.