feat(wallet): humanize shared wallet experience

Consolidate wallet account decoding and portfolio handling around the shared Rust IDL decoder. Simplify AMM wallet integration, remove obsolete caches and network plumbing, and cover account selection and live flows.
This commit is contained in:
Ricardo Guilherme Schmidt
2026-08-21 17:38:45 -03:00
parent 62d133e909
commit 8c3e6fccfe
64 changed files with 6268 additions and 27501 deletions
@@ -0,0 +1,66 @@
#include "SequencerNetworkSettings.h"
#include <QJsonDocument>
#include <QJsonObject>
#include <QTemporaryFile>
#include <QtTest>
class SequencerNetworkSettingsTest : public QObject {
Q_OBJECT
private slots:
void loadsBundledTestnetIdentity();
void loadsDevnetChannelIdentity();
void rejectsInvalidDevnetIdentity();
};
void SequencerNetworkSettingsTest::loadsBundledTestnetIdentity()
{
const auto settings = SequencerNetworkSettingsLoader::load(
QStringLiteral("testnet"), {});
QVERIFY(settings);
QCOMPARE(settings->context.id, QStringLiteral("testnet"));
QCOMPARE(settings->context.expectedIdentity,
QStringLiteral("0d25d71fca70d7008a892f6b3f768a4c66badbcd64e67d79ca595b92f1db544a"));
QCOMPARE(settings->context.fingerprintPrefix, QStringLiteral("block10:"));
QCOMPARE(settings->identityMethod, SequencerIdentityMethod::CheckpointBlock);
}
void SequencerNetworkSettingsTest::loadsDevnetChannelIdentity()
{
const QString identity(64, QLatin1Char('a'));
QTemporaryFile config;
QVERIFY(config.open());
const QByteArray contents = QJsonDocument(QJsonObject {
{ QStringLiteral("channelId"), identity },
}).toJson(QJsonDocument::Compact);
QCOMPARE(config.write(contents), qint64(contents.size()));
config.flush();
const auto settings = SequencerNetworkSettingsLoader::load(
QStringLiteral("devnet"), config.fileName());
QVERIFY(settings);
QCOMPARE(settings->context.id, QStringLiteral("devnet"));
QCOMPARE(settings->context.expectedIdentity, identity);
QCOMPARE(settings->context.fingerprintPrefix, QStringLiteral("channel:"));
QCOMPARE(settings->identityMethod, SequencerIdentityMethod::ChannelId);
}
void SequencerNetworkSettingsTest::rejectsInvalidDevnetIdentity()
{
QTemporaryFile config;
QVERIFY(config.open());
const QByteArray contents = QJsonDocument(QJsonObject {
{ QStringLiteral("channelId"), QStringLiteral("not-an-identity") },
}).toJson(QJsonDocument::Compact);
QCOMPARE(config.write(contents), qint64(contents.size()));
config.flush();
QVERIFY(!SequencerNetworkSettingsLoader::load(
QStringLiteral("devnet"), config.fileName()));
}
QTEST_GUILESS_MAIN(SequencerNetworkSettingsTest)
#include "SequencerNetworkSettingsTest.moc"