Skip to content

Commit fa6ab0d

Browse files
author
MarcoFalke
committed
rpc: Reword SighashFromStr error message
1 parent 0de63b8 commit fa6ab0d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/core_read.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,6 @@ util::Result<int> SighashFromStr(const std::string& sighash)
256256
if (it != map_sighash_values.end()) {
257257
return it->second;
258258
} else {
259-
return util::Error{Untranslated(sighash + " is not a valid sighash parameter.")};
259+
return util::Error{Untranslated("'" + sighash + "' is not a valid sighash parameter.")};
260260
}
261261
}

test/functional/rpc_psbt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ def test_psbt_input_keys(psbt_input, keys):
886886
assert_equal(comb_psbt, psbt)
887887

888888
self.log.info("Test walletprocesspsbt raises if an invalid sighashtype is passed")
889-
assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].walletprocesspsbt, psbt, sighashtype="all")
889+
assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].walletprocesspsbt, psbt, sighashtype="all")
890890

891891
self.log.info("Test decoding PSBT with per-input preimage types")
892892
# note that the decodepsbt RPC doesn't check whether preimages and hashes match
@@ -992,7 +992,7 @@ def test_psbt_input_keys(psbt_input, keys):
992992
self.nodes[2].sendrawtransaction(processed_psbt['hex'])
993993

994994
self.log.info("Test descriptorprocesspsbt raises if an invalid sighashtype is passed")
995-
assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[2].descriptorprocesspsbt, psbt, [descriptor], sighashtype="all")
995+
assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[2].descriptorprocesspsbt, psbt, [descriptor], sighashtype="all")
996996

997997

998998
if __name__ == '__main__':

test/functional/rpc_signrawtransactionwithkey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def invalid_sighashtype_test(self):
124124
self.log.info("Test signing transaction with invalid sighashtype")
125125
tx = self.nodes[0].createrawtransaction(INPUTS, OUTPUTS)
126126
privkeys = [self.nodes[0].get_deterministic_priv_key().key]
127-
assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithkey, tx, privkeys, sighashtype="all")
127+
assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithkey, tx, privkeys, sighashtype="all")
128128

129129
def run_test(self):
130130
self.successful_signing_test()

test/functional/wallet_signrawtransactionwithwallet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_with_lock_outputs(self):
5555

5656
def test_with_invalid_sighashtype(self):
5757
self.log.info("Test signrawtransactionwithwallet raises if an invalid sighashtype is passed")
58-
assert_raises_rpc_error(-8, "all is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithwallet, hexstring=RAW_TX, sighashtype="all")
58+
assert_raises_rpc_error(-8, "'all' is not a valid sighash parameter.", self.nodes[0].signrawtransactionwithwallet, hexstring=RAW_TX, sighashtype="all")
5959

6060
def script_verification_error_test(self):
6161
"""Create and sign a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script.

0 commit comments

Comments
 (0)