Skip to content

Commit

Permalink
Merge #1147: [backport] Backport fixes from master to elements-22.x f…
Browse files Browse the repository at this point in the history
…or rc4

85c25b1 Bump version to -rc4 (Pablo Greco)
bb684f2 Update manpages (Pablo Greco)
38e9490 Elements-qt: Fix arrows to increase/decrease Amount (Andrea Bonel)
5954b10 Fixing issuance cases and half blinded cases in PSET (Allen Piscitello)
707cf20 Fix tapscript comment (roconnor-blockstream)
7fb99ff Fix Icon position in dmg (Pablo Greco)

Pull request description:

  Backport #1140 #1141 #1145 and #1146  from master.
  Fix manpages
  Bump to -rc4

ACKs for top commit:
  delta1:
    utACK 85c25b1

Tree-SHA512: 78a30bec870530275d103b6cab630ebf96b2df39fd03fc426bb16b6743ce9311f7e7128e43bf7a6452d261377e6ac017d61b77cd9ad4e4c20040629ae20e13b4
  • Loading branch information
apoelstra committed Aug 18, 2022
2 parents 3e44c1f + 85c25b1 commit 580230f
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 21 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 22)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 3)
define(_CLIENT_VERSION_RC, 4)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2022)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
2 changes: 1 addition & 1 deletion contrib/macdeploy/macdeployqtplus
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ ds['.']['icvp'] = icvp
ds['.']['vSrn'] = ('long', 1)

ds['Applications']['Iloc'] = (370, 156)
ds['Bitcoin-Qt.app']['Iloc'] = (128, 156)
ds['Elements-Qt.app']['Iloc'] = (128, 156)

ds.flush()
ds.close()
Expand Down
2 changes: 1 addition & 1 deletion doc/man/elements-cli.1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ elements-cli \- manual page for elements-cli v22.0.0
.B elements-cli
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
.SH DESCRIPTION
Elements Core RPC client version elements\-22.0.0
Elements Core RPC client version v22.0.0
.SH OPTIONS
.HP
\-?
Expand Down
2 changes: 1 addition & 1 deletion doc/man/elements-qt.1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ elements-qt \- manual page for elements-qt v22.0.0
.B elements-qt
[\fI\,command-line options\/\fR]
.SH DESCRIPTION
Elements Core version elements\-22.0.0
Elements Core version v22.0.0
.SH OPTIONS
.HP
\-?
Expand Down
2 changes: 1 addition & 1 deletion doc/man/elements-tx.1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ elements-tx \- manual page for elements-tx v22.0.0
.B elements-tx
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded Elements transaction\/\fR
.SH DESCRIPTION
Elements Core elements\-tx utility version elements\-22.0.0
Elements Core elements\-tx utility version v22.0.0
.SH OPTIONS
.HP
\-?
Expand Down
2 changes: 1 addition & 1 deletion doc/man/elements-util.1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ elements-util \- manual page for elements-util v22.0.0
.B elements-util
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
.SH DESCRIPTION
Elements Core elements\-util utility version elements\-22.0.0
Elements Core elements\-util utility version v22.0.0
.SH OPTIONS
.HP
\-?
Expand Down
2 changes: 1 addition & 1 deletion doc/man/elements-wallet.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.SH NAME
elements-wallet \- manual page for elements-wallet v22.0.0
.SH DESCRIPTION
Elements Core elements\-wallet version elements\-22.0.0
Elements Core elements\-wallet version v22.0.0
.PP
elements\-wallet is an offline tool for creating and interacting with Elements Core wallet files.
By default elements\-wallet will act on wallets in the default mainnet wallet directory in the datadir.
Expand Down
6 changes: 3 additions & 3 deletions doc/man/elementsd.1
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ elementsd \- manual page for elementsd v22.0.0
.B elementsd
[\fI\,options\/\fR] \fI\,Start Elements Core\/\fR
.SH DESCRIPTION
Elements Core version elements\-22.0.0
Copyright \(co 2009\-2021 The Elements Project developers
Copyright \(co 2009\-2021 The Bitcoin Core developers
Elements Core version v22.0.0
Copyright \(co 2009\-2022 The Elements Project developers
Copyright \(co 2009\-2022 The Bitcoin Core developers
.PP
Please contribute if you find Elements Core useful. Visit
<https://elementsproject.org/> for further information about the software.
Expand Down
3 changes: 3 additions & 0 deletions src/blindpsbt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ BlindingStatus BlindPSBT(PartiallySignedTransaction& psbt, std::map<uint32_t, st
}
}
}
else {
input_asset_blinders.emplace_back();
}
}
}
}
Expand Down
28 changes: 19 additions & 9 deletions src/psbt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,26 @@ CMutableTransaction PartiallySignedTransaction::GetUnsignedTx(bool force_unblind
txin.nSequence = input.sequence.value_or(max_sequence);
txin.assetIssuance.assetBlindingNonce = input.m_issuance_blinding_nonce;
txin.assetIssuance.assetEntropy = input.m_issuance_asset_entropy;
if (input.m_issuance_value != std::nullopt && input.m_issuance_inflation_keys_amount != std::nullopt && force_unblinded) {
// If there is a commitment we should set the value to the commitment unless we are forcing unblinded.
// If we are forcing unblinded but there is no value, we just use the commitment.
if (input.m_issuance_value != std::nullopt && (input.m_issuance_value_commitment.IsNull() || force_unblinded)) {
txin.assetIssuance.nAmount.SetToAmount(*input.m_issuance_value);
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_inflation_keys_amount);
} else {
}
else if(!input.m_issuance_value_commitment.IsNull()) {
txin.assetIssuance.nAmount = input.m_issuance_value_commitment;
}
else {
txin.assetIssuance.nAmount.SetNull();
}
if (input.m_issuance_inflation_keys_amount != std::nullopt && (input.m_issuance_inflation_keys_commitment.IsNull() || force_unblinded)) {
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_value);
}
else if(!input.m_issuance_inflation_keys_commitment.IsNull()) {
txin.assetIssuance.nInflationKeys = input.m_issuance_inflation_keys_commitment;
}
else {
txin.assetIssuance.nInflationKeys.SetNull();
}
mtx.vin.push_back(txin);
}
for (const PSBTOutput& output : outputs) {
Expand Down Expand Up @@ -531,12 +544,9 @@ bool PSBTOutput::Merge(const PSBTOutput& output)
CTxOut PSBTOutput::GetTxOut() const
{
assert(script != std::nullopt);
if (!m_value_commitment.IsNull() && !m_asset_commitment.IsNull()) {
return CTxOut(m_asset_commitment, m_value_commitment, *script);
}
assert(amount != std::nullopt);
assert(!m_asset.IsNull());
return CTxOut(CConfidentialAsset(CAsset(m_asset)), CConfidentialValue(*amount), *script);
assert(amount != std::nullopt || !m_value_commitment.IsNull());
assert(!m_asset.IsNull() || !m_asset_commitment.IsNull());
return CTxOut(!m_asset_commitment.IsNull() ? m_asset_commitment : CAsset(m_asset), !m_value_commitment.IsNull() ? m_value_commitment : CConfidentialValue(*amount), *script);
}

bool PSBTOutput::IsBlinded() const
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoinamountfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class AmountSpinBox: public QAbstractSpinBox
currentSingleStep = 100000000; // a whole asset
}
}
val.second = val.second + steps * singleStep;
val.second = val.second + steps * currentSingleStep;
val.second = qMax(val.second, CAmount(0));
val.second = qBound(m_min_amount, val.second, m_max_amount);
// FIXME: Add this back in when assets can have > MAX_MONEY
Expand Down
2 changes: 1 addition & 1 deletion src/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3173,7 +3173,7 @@ static bool VerifyWitnessProgram(const CScriptWitness& witness, int witversion,
}
execdata.m_tapleaf_hash_init = true;
if ((control[0] & TAPROOT_LEAF_MASK) == TAPROOT_LEAF_TAPSCRIPT) {
// Tapscript (leaf version 0xc0)
// Tapscript (leaf version 0xc4)
execdata.m_validation_weight_left = ::GetSerializeSize(witness.stack, PROTOCOL_VERSION) + VALIDATION_WEIGHT_OFFSET;
execdata.m_validation_weight_left_init = true;
return ExecuteWitnessScript(stack, exec_script, flags, SigVersion::TAPSCRIPT, checker, execdata, serror);
Expand Down
4 changes: 4 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2048,11 +2048,15 @@ TransactionError CWallet::SignPSBT(PartiallySignedTransaction& psbtx, bool& comp
txin.assetIssuance.nAmount = input.m_issuance_value_commitment;
} else if (input.m_issuance_value) {
txin.assetIssuance.nAmount.SetToAmount(*input.m_issuance_value);
} else {
txin.assetIssuance.nAmount.SetNull();
}
if (!input.m_issuance_inflation_keys_commitment.IsNull()) {
txin.assetIssuance.nInflationKeys = input.m_issuance_inflation_keys_commitment;
} else if (input.m_issuance_inflation_keys_amount) {
txin.assetIssuance.nInflationKeys.SetToAmount(*input.m_issuance_inflation_keys_amount);
} else {
txin.assetIssuance.nInflationKeys.SetNull();
}
if (!input.m_issuance_rangeproof.empty()) {
txinwit.vchIssuanceAmountRangeproof = input.m_issuance_rangeproof;
Expand Down

0 comments on commit 580230f

Please sign in to comment.