MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_empty_db_migrate

Function test_empty_db_migrate

wallet/test/run-db.c:414–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414static bool test_empty_db_migrate(struct lightningd *ld)
415{
416 struct db *db = create_test_db();
417 const struct ext_key *bip32_base = NULL;
418 CHECK(db);
419 db_begin_transaction(db);
420 CHECK(db_get_version(db) == -1);
421 db_migrate(ld, db, bip32_base);
422 db_commit_transaction(db);
423
424 db_begin_transaction(db);
425 CHECK(db_get_version(db) == ARRAY_SIZE(dbmigrations) - 1);
426 db_commit_transaction(db);
427
428 tal_free(db);
429 return true;
430}
431
432static bool test_primitives(void)
433{

Callers 1

mainFunction · 0.85

Calls 5

create_test_dbFunction · 0.85
db_get_versionFunction · 0.85
tal_freeFunction · 0.85
db_migrateFunction · 0.50
db_commit_transactionFunction · 0.50

Tested by

no test coverage detected