diff --git a/apps/shared/wallet/src/LogosWalletProvider.cpp b/apps/shared/wallet/src/LogosWalletProvider.cpp index 03220af..fb47ada 100644 --- a/apps/shared/wallet/src/LogosWalletProvider.cpp +++ b/apps/shared/wallet/src/LogosWalletProvider.cpp @@ -499,8 +499,6 @@ WalletSnapshot LogosWalletProvider::loadSnapshot() result.accounts.append(account); } - if (!save()) - result.failure = WalletFailure::SaveFailed; return result; } @@ -590,18 +588,11 @@ void LogosWalletProvider::loadSnapshotAsync(quint64 generation, SnapshotCallback state->snapshot.publicAccountReads.append( state->publicReads.at(index)); } - m_impl->logos->logos_execution_zone.saveAsync( - [this, generation, state](int result) mutable { - if (generation != m_generation) - return; - if (result != WALLET_FFI_SUCCESS) - state->snapshot.failure = WalletFailure::SaveFailed; - if (state->snapshot.ok()) { - m_snapshot = state->snapshot; - m_snapshotReady = true; - } - state->callback(std::move(state->snapshot)); - }); + if (state->snapshot.ok()) { + m_snapshot = state->snapshot; + m_snapshotReady = true; + } + state->callback(std::move(state->snapshot)); }; if (entries.isEmpty()) { diff --git a/apps/shared/wallet/tests/cpp/LogosWalletProviderTest.cpp b/apps/shared/wallet/tests/cpp/LogosWalletProviderTest.cpp index e0d686c..7a10de1 100644 --- a/apps/shared/wallet/tests/cpp/LogosWalletProviderTest.cpp +++ b/apps/shared/wallet/tests/cpp/LogosWalletProviderTest.cpp @@ -100,6 +100,7 @@ void LogosWalletProviderTest::adoptsOpenWalletAndCachesSnapshots() const int listCalls = modules.logos_execution_zone.listCalls; const int readCalls = modules.logos_execution_zone.publicReadCalls; + const int saveCalls = modules.logos_execution_zone.saveCalls; QVERIFY(provider.snapshot().ok()); QCOMPARE(modules.logos_execution_zone.listCalls, listCalls); QCOMPARE(modules.logos_execution_zone.publicReadCalls, readCalls); @@ -107,6 +108,7 @@ void LogosWalletProviderTest::adoptsOpenWalletAndCachesSnapshots() QVERIFY(provider.snapshot(true).ok()); QVERIFY(modules.logos_execution_zone.listCalls > listCalls); QVERIFY(modules.logos_execution_zone.publicReadCalls > readCalls); + QCOMPARE(modules.logos_execution_zone.saveCalls, saveCalls); modules.logos_execution_zone.publicAccounts[ACCOUNT_A] = publicAccountJson( PROGRAM_ID, QString(32, QLatin1Char('f'))); @@ -511,6 +513,7 @@ void LogosWalletProviderTest::completedAsyncSnapshotReleasesCallback() QVERIFY(completed); QVERIFY(callbackLifetime.expired()); + QCOMPARE(modules.logos_execution_zone.saveCalls, 0); } void LogosWalletProviderTest::deferredCallbacksIgnoreDestroyedController()