mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-25 14:11:09 +00:00
fix(amm): cancel cached reads on endpoint change
This commit is contained in:
@@ -531,6 +531,13 @@ int main(int argc, char** argv)
|
||||
"forced-refresh sequencer should listen"))
|
||||
return 1;
|
||||
forcedRefreshServer.holdResponses();
|
||||
bool staleCachedCompleted = false;
|
||||
QVector<WalletAccountRead> staleCachedRead;
|
||||
sequencer.readAccounts({ holding.address }, false,
|
||||
[&](QVector<WalletAccountRead> reads) {
|
||||
staleCachedRead = std::move(reads);
|
||||
staleCachedCompleted = true;
|
||||
});
|
||||
if (!expect(sequencerConfig.resize(0) && sequencerConfig.seek(0),
|
||||
"forced-refresh config should rewind"))
|
||||
return 1;
|
||||
@@ -541,6 +548,12 @@ int main(int argc, char** argv)
|
||||
if (!expect(sequencer.configure(sequencerConfig.fileName()),
|
||||
"forced-refresh sequencer should configure"))
|
||||
return 1;
|
||||
QCoreApplication::processEvents(QEventLoop::AllEvents, 10);
|
||||
if (!expect(staleCachedCompleted
|
||||
&& staleCachedRead.size() == 1
|
||||
&& !staleCachedRead.constFirst().ok(),
|
||||
"cached read should fail after sequencer reconfiguration"))
|
||||
return 1;
|
||||
|
||||
bool ordinaryCompleted = false;
|
||||
bool forcedCompleted = false;
|
||||
|
||||
Reference in New Issue
Block a user