Skip to content

Commit e07fd64

Browse files
committed
Release 0.89.4
2 parents b5b264c + 8dee54d commit e07fd64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+841
-713
lines changed

BlockSettleHW/ledger/ledgerDevice.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,12 @@ QPointer<LedgerCommandThread> LedgerDevice::blankCommand(AsyncCallBackCall&& cb
257257
return;
258258
}
259259

260-
caller->isBlocked_ = (info == HWInfoStatus::kPressButton);
260+
if (info == HWInfoStatus::kTransaction)
261+
caller->isBlocked_ = true;
262+
else if (info == HWInfoStatus::kReceiveSignedTx)
263+
caller->isBlocked_ = true;
261264
caller->deviceTxStatusChanged(info);
262-
});
265+
}, Qt::BlockingQueuedConnection);
263266
connect(commandThread_, &LedgerCommandThread::error, this, [caller = QPointer<LedgerDevice>(this)](qint32 errorCode) {
264267
if (!caller) {
265268
return;
@@ -292,7 +295,7 @@ QPointer<LedgerCommandThread> LedgerDevice::blankCommand(AsyncCallBackCall&& cb
292295

293296
caller->lastError_ = error;
294297
caller->operationFailed(error);
295-
});
298+
}, Qt::BlockingQueuedConnection);
296299
connect(commandThread_, &LedgerCommandThread::finished, commandThread_, &QObject::deleteLater);
297300

298301
return commandThread_;

BlockSettleSigner/Bip39EntryValidator.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,11 @@ QValidator::State Bip39EntryValidator::validate(QString &input, int &pos) const
3333
return State::Intermediate;
3434
}
3535

36-
std::vector<std::string> words;
37-
words.reserve(qWordsList.size());
38-
for (auto qWord : qWordsList) {
39-
words.push_back(qWord.toStdString());
40-
}
41-
42-
for (const auto& dict : dictionaries_) {
43-
if (validate_mnemonic(words, dict)) {
44-
return State::Acceptable;
45-
}
36+
if (!validateMnemonic(input.toStdString(), dictionaries_)) {
37+
return State::Invalid;
4638
}
4739

48-
return State::Invalid;
40+
return State::Acceptable;
4941
}
5042

5143
bool Bip39EntryValidator::validate(QString input)

BlockSettleSigner/SignerAdapterContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class SignAdapterContainer : public WalletSignerContainer
6565
, const UTXO &, const bs::Address &bsAddr, const SignTxCb &cb = nullptr) override { return 0; }
6666

6767
bs::signer::RequestId resolvePublicSpenders(const bs::core::wallet::TXSignRequest &
68-
, const SignTxCb &) override { return 0; }
68+
, const SignerStateCb &) override { return 0; }
6969

7070
bs::signer::RequestId updateDialogData(const bs::sync::PasswordDialogData &, uint32_t = 0) override { return 0; }
7171
bs::signer::RequestId CancelSignTx(const BinaryData &tx) override { return 0; }

BlockSettleSigner/TXInfo.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ TXInfo::TXInfo(const TXInfo &src)
4343

4444
void TXInfo::init()
4545
{
46-
txId_ = QString::fromStdString(txReq_.serializeState().toBinStr());
46+
txId_ = QString::fromStdString(txReq_.serializeState().SerializeAsString());
4747
}
4848

4949
bool TXInfo::containsAddressImpl(const bs::Address &address, bs::core::wallet::Type walletType) const
@@ -134,7 +134,7 @@ bool TXInfo::loadSignedTx(const QString &fileName)
134134
}
135135

136136
// check signed tx
137-
if (!txReq_.isSourceOfTx(Tx(loadedTxs.front().prevStates.front()))) {
137+
if (!txReq_.isSourceOfTx(Tx(loadedTxs.front().serializedTx))) {
138138
SPDLOG_LOGGER_ERROR(logger_, "sign request not equal to signed tx in '{}'", fileName.toStdString());
139139
return false;
140140
}
@@ -154,11 +154,10 @@ QString TXInfo::getSaveOfflineTxFileName()
154154

155155
SecureBinaryData TXInfo::getSignedTx()
156156
{
157-
if (txReqSigned_.prevStates.empty()) {
158-
SPDLOG_LOGGER_ERROR(logger_, "missing signed offline request prevStates[1]");
159-
return {};
157+
if (txReqSigned_.serializedTx.empty()) {
158+
SPDLOG_LOGGER_ERROR(logger_, "missing signed offline TX in request");
160159
}
161-
return txReqSigned_.prevStates.front();
160+
return txReqSigned_.serializedTx;
162161
}
163162

164163
QStringList TXInfo::inputs(bs::core::wallet::Type leafType) const

BlockSettleSigner/interfaces/GUI_QML/QMLApp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ QString QMLAppObj::getUrlPath(const QUrl &url)
304304
return path;
305305
}
306306

307+
QString QMLAppObj::getUrlPathWithoutExtention(const QUrl &url)
308+
{
309+
QString filePath = getUrlPath(url);
310+
QFileInfo fileInfo(filePath);
311+
312+
return QDir(fileInfo.path()).absoluteFilePath(fileInfo.baseName());
313+
}
314+
307315
void QMLAppObj::onSysTrayMsgClicked()
308316
{
309317
logger_->debug("Systray message clicked");

BlockSettleSigner/interfaces/GUI_QML/QMLApp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class QMLAppObj : public QObject
6161
void hideQmlWindow();
6262

6363
Q_INVOKABLE QString getUrlPath(const QUrl &url);
64+
Q_INVOKABLE QString getUrlPathWithoutExtention(const QUrl &url);
6465

6566
signals:
6667
void cancelSignTx(const QString &txId);

BlockSettleSigner/qml/BsDialogs/TxSignSettlementBaseDialog.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ CustomTitleDialogWindowWithExpander {
8484
property string validationTitle
8585

8686
id: root
87-
title: isExpanded ? passwordDialogData.Title : ""
87+
title: passwordDialogData.Title
8888
rejectable: true
8989
width: 500
9090

BlockSettleSigner/qml/BsDialogs/WalletBackupDialog.qml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ CustomTitleDialogWindow {
3030
property AuthSignWalletObject authSign: AuthSignWalletObject {}
3131
property WalletInfo walletInfo: WalletInfo {}
3232

33-
property string targetFile: qmlAppObj.getUrlPath(StandardPaths.writableLocation(StandardPaths.DocumentsLocation) + "/" + backupFileName)
33+
property string userSelection: ""
34+
property string targetFile: userSelection.length === 0
35+
? qmlAppObj.getUrlPath(StandardPaths.writableLocation(StandardPaths.DocumentsLocation) + "/" + backupFileName)
36+
: userSelection + backupFileExt
3437

35-
property string backupFileExt: "." + (isPrintable ? "pdf" : "wdb")
38+
property string backupFileExt: "." + (fullBackupMode ? (isPrintable ? "pdf" : "wdb") : "lmdb")
3639
property string netTypeStr: signerSettings.testNet ? "testnet" : "mainnet";
3740

3841
// suggested new file names
3942
property string backupFileName: fullBackupMode
4043
? "BlockSettle_" + netTypeStr + "_" + walletInfo.walletId + backupFileExt
41-
: "BlockSettle_" + netTypeStr + "_" + walletInfo.walletId + "_WatchingOnly.lmdb"
44+
: "BlockSettle_" + netTypeStr + "_" + walletInfo.walletId + "_WatchingOnly" + backupFileExt
4245

4346
property bool isPrintable: false
4447
property bool acceptable: (walletInfo.encType === QPasswordData.Unencrypted)
@@ -193,7 +196,7 @@ CustomTitleDialogWindow {
193196
fileMode: FileDialog.SaveFile
194197

195198
onAccepted: {
196-
targetFile = qmlAppObj.getUrlPath(file)
199+
userSelection = qmlAppObj.getUrlPathWithoutExtention(file)
197200
}
198201
}
199202

BlockSettleSigner/qml/BsDialogs/WalletImportDialog.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ CustomTitleDialogWindow {
6565
property bool authNoticeShown: false
6666

6767
title: qsTr("Import Wallet")
68-
width: 460
68+
width: 540
6969
abortConfirmation: true
7070
abortBoxType: BSAbortBox.AbortType.WalletImport
7171

@@ -158,7 +158,7 @@ CustomTitleDialogWindow {
158158

159159
ColumnLayout {
160160
id: fullImportLayout
161-
161+
Layout.fillWidth: true
162162
RowLayout {
163163
id: radioButtonsParent
164164

BlockSettleSigner/qml/BsStyles/BSStyle.qml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,8 @@ QtObject {
6969
readonly property color comboBoxItemTextColor: textColor
7070
readonly property color comboBoxItemTextHighlightedColor: textColor
7171

72-
readonly property color testNetColor: "#fe9727"
72+
readonly property color mainnetColor: "#fe9727"
73+
readonly property color testnetColor: "#22c064"
74+
readonly property color mainnetTextColor: "white"
75+
readonly property color testnetTextColor: "black"
7376
}

0 commit comments

Comments
 (0)