@@ -243,6 +243,7 @@ func TestGenerateConfig(t *testing.T) {
243243 useDB bool
244244 enforceSorobanDiagnosticEvents bool
245245 enforceEmitMetaV1 bool
246+ coreVersion string
246247 }{
247248 {
248249 name : "offline config with no appendix" ,
@@ -253,6 +254,7 @@ func TestGenerateConfig(t *testing.T) {
253254 peerPort : newUint (12345 ),
254255 logPath : nil ,
255256 useDB : true ,
257+ coreVersion : "v22.2.0-124-ga50f3f919" ,
256258 },
257259 {
258260 name : "offline config with no peer port" ,
@@ -262,6 +264,7 @@ func TestGenerateConfig(t *testing.T) {
262264 httpPort : newUint (6789 ),
263265 peerPort : nil ,
264266 logPath : newString ("/var/stellar-core/test.log" ),
267+ coreVersion : "v22.2.0-124-ga50f3f919" ,
265268 },
266269 {
267270 name : "online config with appendix" ,
@@ -271,6 +274,7 @@ func TestGenerateConfig(t *testing.T) {
271274 httpPort : newUint (6789 ),
272275 peerPort : newUint (12345 ),
273276 logPath : nil ,
277+ coreVersion : "v22.2.0-124-ga50f3f919" ,
274278 },
275279 {
276280 name : "online config with unsupported field in appendix" ,
@@ -280,6 +284,7 @@ func TestGenerateConfig(t *testing.T) {
280284 httpPort : newUint (6789 ),
281285 peerPort : newUint (12345 ),
282286 logPath : nil ,
287+ coreVersion : "v22.2.0-124-ga50f3f919" ,
283288 },
284289 {
285290 name : "online config with no peer port" ,
@@ -289,6 +294,7 @@ func TestGenerateConfig(t *testing.T) {
289294 httpPort : newUint (6789 ),
290295 peerPort : nil ,
291296 logPath : newString ("/var/stellar-core/test.log" ),
297+ coreVersion : "v22.2.0-124-ga50f3f919" ,
292298 },
293299 {
294300 name : "online config with no http port" ,
@@ -298,6 +304,7 @@ func TestGenerateConfig(t *testing.T) {
298304 httpPort : nil ,
299305 peerPort : newUint (12345 ),
300306 logPath : nil ,
307+ coreVersion : "v22.2.0-124-ga50f3f919" ,
301308 },
302309 {
303310 name : "offline config with appendix" ,
@@ -307,6 +314,7 @@ func TestGenerateConfig(t *testing.T) {
307314 httpPort : newUint (6789 ),
308315 peerPort : newUint (12345 ),
309316 logPath : nil ,
317+ coreVersion : "v22.2.0-124-ga50f3f919" ,
310318 },
311319 {
312320 name : "offline config with extra fields in appendix" ,
@@ -316,6 +324,7 @@ func TestGenerateConfig(t *testing.T) {
316324 httpPort : newUint (6789 ),
317325 peerPort : newUint (12345 ),
318326 logPath : nil ,
327+ coreVersion : "v22.2.0-124-ga50f3f919" ,
319328 },
320329 {
321330 name : "offline config with enforce diagnostic events and metav1" ,
@@ -324,6 +333,7 @@ func TestGenerateConfig(t *testing.T) {
324333 logPath : nil ,
325334 enforceSorobanDiagnosticEvents : true ,
326335 enforceEmitMetaV1 : true ,
336+ coreVersion : "v22.2.0-124-ga50f3f919" ,
327337 },
328338 {
329339 name : "offline config disabling enforced diagnostic events and metav1" ,
@@ -333,6 +343,7 @@ func TestGenerateConfig(t *testing.T) {
333343 logPath : nil ,
334344 enforceSorobanDiagnosticEvents : true ,
335345 enforceEmitMetaV1 : true ,
346+ coreVersion : "v22.2.0-124-ga50f3f919" ,
336347 },
337348 {
338349 name : "online config with enforce diagnostic events and meta v1" ,
@@ -344,13 +355,15 @@ func TestGenerateConfig(t *testing.T) {
344355 logPath : nil ,
345356 enforceSorobanDiagnosticEvents : true ,
346357 enforceEmitMetaV1 : true ,
358+ coreVersion : "v22.2.0-124-ga50f3f919" ,
347359 },
348360 {
349361 name : "offline config with minimum persistent entry in appendix" ,
350362 mode : stellarCoreRunnerModeOnline ,
351363 appendPath : filepath .Join ("testdata" , "appendix-with-minimum-persistent-entry.cfg" ),
352364 expectedPath : filepath .Join ("testdata" , "expected-online-with-appendix-minimum-persistent-entry.cfg" ),
353365 logPath : nil ,
366+ coreVersion : "v22.2.0-124-ga50f3f919" ,
354367 },
355368 {
356369 name : "default BucketlistDB config" ,
@@ -359,6 +372,16 @@ func TestGenerateConfig(t *testing.T) {
359372 expectedPath : filepath .Join ("testdata" , "expected-default-bucketlistdb-core.cfg" ),
360373 useDB : true ,
361374 logPath : nil ,
375+ coreVersion : "v23.0.0-127-jb50f3f919" ,
376+ },
377+ {
378+ name : "default BucketlistDB config with older version" ,
379+ mode : stellarCoreRunnerModeOnline ,
380+ appendPath : filepath .Join ("testdata" , "sample-appendix.cfg" ),
381+ expectedPath : filepath .Join ("testdata" , "expected-default-bucketlistdb-core-old-version.cfg" ),
382+ useDB : true ,
383+ logPath : nil ,
384+ coreVersion : "v22.1.0-123-hb50f3f219" ,
362385 },
363386 {
364387 name : "BucketlistDB config in appendix" ,
@@ -367,6 +390,7 @@ func TestGenerateConfig(t *testing.T) {
367390 expectedPath : filepath .Join ("testdata" , "expected-bucketlistdb-core.cfg" ),
368391 useDB : true ,
369392 logPath : nil ,
393+ coreVersion : "v22.2.0-124-ga50f3f919" ,
370394 },
371395 {
372396 name : "Query parameters in appendix" ,
@@ -375,6 +399,7 @@ func TestGenerateConfig(t *testing.T) {
375399 expectedPath : filepath .Join ("testdata" , "expected-query-params.cfg" ),
376400 useDB : true ,
377401 logPath : nil ,
402+ coreVersion : "v22.2.0-124-ga50f3f919" ,
378403 },
379404 {
380405 name : "BUCKETLIST_DB_MEMORY_FOR_CACHING in appendix" ,
@@ -383,6 +408,7 @@ func TestGenerateConfig(t *testing.T) {
383408 expectedPath : filepath .Join ("testdata" , "expected-with-memory-for-bucketlist-caching.cfg" ),
384409 useDB : true ,
385410 logPath : nil ,
411+ coreVersion : "v22.2.0-124-ga50f3f919" ,
386412 },
387413 } {
388414 t .Run (testCase .name , func (t * testing.T ) {
@@ -398,6 +424,10 @@ func TestGenerateConfig(t *testing.T) {
398424 UseDB : testCase .useDB ,
399425 EnforceSorobanDiagnosticEvents : testCase .enforceSorobanDiagnosticEvents ,
400426 EnforceSorobanTransactionMetaExtV1 : testCase .enforceEmitMetaV1 ,
427+ CoreBinaryPath : "stellar-core" ,
428+ CoreBuildVersionFn : func (string ) (string , error ) {
429+ return testCase .coreVersion , nil
430+ },
401431 }
402432 if testCase .appendPath != "" {
403433 captiveCoreToml , err = NewCaptiveCoreTomlFromFile (testCase .appendPath , params )
@@ -427,6 +457,10 @@ func TestGenerateCoreConfigInMemory(t *testing.T) {
427457 HistoryArchiveURLs : []string {"http://localhost:1170" },
428458 Strict : false ,
429459 UseDB : false ,
460+ CoreBinaryPath : "stellar-core" ,
461+ CoreBuildVersionFn : func (string ) (string , error ) {
462+ return "v21.9.0-124-ga50f3f919" , nil
463+ },
430464 }
431465 captiveCoreToml , err = NewCaptiveCoreTomlFromFile (appendPath , params )
432466 assert .NoError (t , err )
0 commit comments