mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Merge ElementsProject/elements#984: Address problems raised in #935 (0.21 rebase)
f2a0050f31primitives: do not de/serialize asset issuance in bitcoin mode (Andrew Poelstra)9c1de4d85fci: give more memory to a couple Cirrus jobs (Andrew Poelstra)40c09f637crpc: fix error message accidentally changed in5e62edc(Andrew Poelstra)adbd9f163aqt: fix PSBT/PSET change from4839db857d(Andrew Poelstra)057237bd02qt: fix double-scoping of enum introduced inc3b6bbb(Andrew Poelstra)5819f25975bitcoin-tx: add ASSET to the help text of some option (Andrew Poelstra)1f3cfb451achainparamsbase: fix bool-vs-enum mistake in9c3480fea9(Andrew Poelstra)2573747447fix test code duplication from3a0de44d90(Andrew Poelstra)0045cafd75rpc/mining: restore code erroneously dropped in0e2c963dbf(Andrew Poelstra)39112e1eaacorrect copy/paste error in error message (Andrew Poelstra) Pull request description: ACKs for top commit: stevenroose: utACKf2a0050Tree-SHA512: 5ce831ef24e51e76b93cd4d8e345a382dbd716e38c99565a7c2f25b5eeb8bac1e36c623491c5763ceb7b47444024b5821a878942df150bb01b33eeae33f292b1
This commit is contained in:
commit
108e1ba7bb
10 changed files with 15 additions and 15 deletions
|
|
@ -103,7 +103,8 @@ task:
|
|||
<< : *GLOBAL_TASK_TEMPLATE
|
||||
container:
|
||||
image: ubuntu:focal
|
||||
memory: 12G # ELEMENTS: need more memory
|
||||
memory: 16G # ELEMENTS: need more memory
|
||||
cpu: 4 # ELEMENTS: cirrus wants more CPUs if you want more memory
|
||||
env:
|
||||
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
|
||||
|
||||
|
|
@ -112,6 +113,8 @@ task:
|
|||
<< : *GLOBAL_TASK_TEMPLATE
|
||||
container:
|
||||
image: ubuntu:focal
|
||||
memory: 16G # ELEMENTS: need more memory
|
||||
cpu: 4 # ELEMENTS: cirrus wants more CPUs if you want more memory
|
||||
env:
|
||||
FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh"
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static void SetupBitcoinTxArgs(ArgsManager &argsman)
|
|||
argsman.AddArg("in=TXID:VOUT(:SEQUENCE_NUMBER)", "Add input to TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
|
||||
argsman.AddArg("locktime=N", "Set TX lock time to N", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
|
||||
argsman.AddArg("nversion=N", "Set TX version to N", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
|
||||
argsman.AddArg("outaddr=VALUE:ADDRESS", "Add address-based output to TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
|
||||
argsman.AddArg("outaddr=VALUE:ADDRESS(:ASSET)", "Add address-based output to TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
|
||||
argsman.AddArg("outdata=[VALUE:]DATA", "Add data-based output to TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
|
||||
argsman.AddArg("outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", "Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS. "
|
||||
"Optionally add the \"W\" flag to produce a pay-to-witness-script-hash output. "
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
|
|||
argsman.AddArg("-con_connect_genesis_outputs", "Connect outputs in genesis block to utxo database.", ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS);
|
||||
argsman.AddArg("-con_elementsmode", "Use Elements-like instead of Core-like witness encoding. This is required for CA/CT. (default: true)", ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS);
|
||||
argsman.AddArg("-con_blockheightinheader", "Whether the chain includes the block height directly in the header, for easier validation of block height in low-resource environments. (default: true)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
|
||||
argsman.AddArg("-con_genesis_style=<style>", "Use genesis style <style> (default: elements). Results in genesis block compatibility with various networks. Allowed values: elements, bitcoin", true, OptionsCategory::ELEMENTS);
|
||||
argsman.AddArg("-con_genesis_style=<style>", "Use genesis style <style> (default: elements). Results in genesis block compatibility with various networks. Allowed values: elements, bitcoin", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::ELEMENTS);
|
||||
argsman.AddArg("-con_signed_blocks", "Signed blockchain. Uses input of `-signblockscript` to define what signatures are necessary to solve it.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
|
||||
argsman.AddArg("-signblockscript", "Signed blockchain enumberance. Only active when `-con_signed_blocks` set to true.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
|
||||
argsman.AddArg("-con_max_block_sig_size", "Max allowed witness data for the signed block header.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ public:
|
|||
inline void Serialize(Stream& s) const {
|
||||
bool fHasAssetIssuance;
|
||||
COutPoint outpoint;
|
||||
if (prevout.n == (uint32_t) -1) {
|
||||
if (!g_con_elementsmode || prevout.n == (uint32_t) -1) {
|
||||
// Coinbase inputs do not have asset issuances attached
|
||||
// to them.
|
||||
fHasAssetIssuance = false;
|
||||
|
|
@ -189,7 +189,7 @@ public:
|
|||
COutPoint outpoint;
|
||||
s >> outpoint;
|
||||
|
||||
if (outpoint.n == (uint32_t) -1) {
|
||||
if (!g_con_elementsmode || outpoint.n == (uint32_t) -1) {
|
||||
// No asset issuance for Coinbase inputs.
|
||||
fHasAssetIssuance = false;
|
||||
prevout = outpoint;
|
||||
|
|
|
|||
|
|
@ -323,9 +323,9 @@ void BitcoinGUI::createActions()
|
|||
signMessageAction->setStatusTip(tr("Sign messages with your %1 addresses to prove you own them").arg("Liquid"));
|
||||
verifyMessageAction = new QAction(tr("&Verify message..."), this);
|
||||
verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified %1 addresses").arg("Liquid"));
|
||||
m_load_psbt_action = new QAction(tr("&Load PSBT from file..."), this);
|
||||
m_load_psbt_action = new QAction(tr("&Load PSET from file..."), this);
|
||||
m_load_psbt_action->setStatusTip(tr("Load Partially Signed Elements Transaction"));
|
||||
m_load_psbt_clipboard_action = new QAction(tr("Load PSBT from clipboard..."), this);
|
||||
m_load_psbt_clipboard_action = new QAction(tr("Load PSET from clipboard..."), this);
|
||||
m_load_psbt_clipboard_action->setStatusTip(tr("Load Partially Signed Elements Transaction from clipboard"));
|
||||
|
||||
openRPCConsoleAction = new QAction(tr("Node window"), this);
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@ void SendCoinsDialog::on_sendButton_clicked()
|
|||
fileNameSuggestion.append(" - ");
|
||||
}
|
||||
QString labelOrAddress = rcp.label.isEmpty() ? rcp.address : rcp.label;
|
||||
QString amount = GUIUtil::formatAssetAmount(rcp.asset, rcp.asset_amount, bitcoin_unit, BitcoinUnits::BitcoinUnits::SeparatorStyle::STANDARD, true);
|
||||
QString amount = GUIUtil::formatAssetAmount(rcp.asset, rcp.asset_amount, bitcoin_unit, BitcoinUnits::SeparatorStyle::STANDARD, true);
|
||||
fileNameSuggestion.append(labelOrAddress + "-" + amount);
|
||||
first = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ static bool GenerateBlock(ChainstateManager& chainman, CBlock& block, uint64_t&
|
|||
++block.nNonce;
|
||||
--max_tries;
|
||||
}
|
||||
if (max_tries == 0) {
|
||||
if (max_tries == 0 || ShutdownRequested()) {
|
||||
return false;
|
||||
}
|
||||
if (block.nNonce == std::numeric_limits<uint32_t>::max()) {
|
||||
|
|
|
|||
|
|
@ -3760,7 +3760,7 @@ static bool ContextualCheckDynaFedHeader(const CBlockHeader& block, BlockValidat
|
|||
int fedpeg_version = 0;
|
||||
std::vector<unsigned char> fedpeg_program;
|
||||
if (!proposed.m_fedpeg_program.IsWitnessProgram(fedpeg_version, fedpeg_program)) {
|
||||
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "invalid-dyna-fed", "proposed signblockscript must be native segwit scriptPubkey");
|
||||
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "invalid-dyna-fed", "proposed fedpeg program must be native segwit scriptPubkey");
|
||||
}
|
||||
|
||||
// for v0, fedpegscript's scriptPubKey must match. v1+ is unencumbered.
|
||||
|
|
|
|||
|
|
@ -3340,7 +3340,7 @@ void FundTransaction(CWallet* const pwallet, CMutableTransaction& tx, CAmount& f
|
|||
destinations[asset] = dest;
|
||||
}
|
||||
} else {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Change address must be a valid address");
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Change address must be either a map or a string");
|
||||
}
|
||||
|
||||
coinControl.destChange = destinations;
|
||||
|
|
|
|||
|
|
@ -502,12 +502,9 @@ def gen_return_txouts():
|
|||
txouts = []
|
||||
from .messages import CTxOut, CTxOutValue
|
||||
txout = CTxOut()
|
||||
txout.nValue = 0
|
||||
txout.nValue = CTxOutValue(0)
|
||||
txout.scriptPubKey = hex_str_to_bytes(script_pubkey)
|
||||
for _ in range(128):
|
||||
txout = CTxOut()
|
||||
txout.nValue = CTxOutValue(0)
|
||||
txout.scriptPubKey = hex_str_to_bytes(script_pubkey)
|
||||
txouts.append(txout)
|
||||
return txouts
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue