Skip to content

Commit 857cfb6

Browse files
committed
Merge #275: Rename script_pub_key to script_pubkey
303d8e4 Rename script_pub_key to script_pubkey (GideonBature) Pull request description: This is a follow up PR, that implements the suggestion given in this [comment](#263 (comment)) for PR #263 to rename `script_pub_key` to `script_pubkey` for readability purpose. ACKs for top commit: tcharding: ACK 303d8e4 Tree-SHA512: b6f5f0def9947f8dcfbe2464ffdff295a084dfe634d5e081276ca79b84c31a7569a45db5ba6c8386372ab35ae33cf6154439832fa809b31ee0ba4d7c1aad2568
2 parents 6c3bb60 + 303d8e4 commit 857cfb6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ pub struct ImportMultiRequest {
258258
pub desc: Option<String>, // from core v18 onwards.
259259
/// Type of scriptPubKey (string for script, json for address). Should not be provided if using descriptor.
260260
#[serde(rename = "scriptPubKey", skip_serializing_if = "Option::is_none")]
261-
pub script_pub_key: Option<ImportMultiScriptPubKey>,
261+
pub script_pubkey: Option<ImportMultiScriptPubKey>,
262262
/// Creation time of the key expressed in UNIX epoch time, or the string "now" to substitute the current synced blockchain time.
263263
pub timestamp: ImportMultiTimestamp,
264264
}

integration_test/tests/wallet.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,14 @@ fn wallet__import_multi() {
387387
// to ensure import succeeds, since the wallet already knows the key.
388388
let req1 = ImportMultiRequest {
389389
desc: None,
390-
script_pub_key: Some(ImportMultiScriptPubKey::Script(dummy_script_hex.to_string())),
390+
script_pubkey: Some(ImportMultiScriptPubKey::Script(dummy_script_hex.to_string())),
391391
timestamp: ImportMultiTimestamp::Now,
392392
};
393393

394394
// Uses an address (valid): success - false, with JSON-RPC error.
395395
let req2 = ImportMultiRequest {
396396
desc: None,
397-
script_pub_key: Some(ImportMultiScriptPubKey::Address {
397+
script_pubkey: Some(ImportMultiScriptPubKey::Address {
398398
address: addr.to_string(),
399399
}),
400400
timestamp: ImportMultiTimestamp::Now,
@@ -405,7 +405,7 @@ fn wallet__import_multi() {
405405
// NOTE: Works only for v18 onwards, as v17 doesn't support descriptors.
406406
let req3 = ImportMultiRequest {
407407
desc: Some(dummy_desc.to_string()),
408-
script_pub_key: None,
408+
script_pubkey: None,
409409
timestamp: ImportMultiTimestamp::Time(1_700_000_000),
410410
};
411411

types/src/v17/util/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl std::error::Error for CreateMultisigError {
4343
pub enum ValidateAddressError {
4444
/// Conversion of the `address` field failed.
4545
Address(address::ParseError),
46-
/// Conversion of the `script_pub_key` field failed.
46+
/// Conversion of the `script_pubkey` field failed.
4747
ScriptPubkey(hex::HexToBytesError),
4848
/// The `witness_version` field's value was too big for a u8.
4949
WitnessVersionValue(i64),
@@ -62,7 +62,7 @@ impl fmt::Display for ValidateAddressError {
6262
match *self {
6363
E::Address(ref e) => write!(f, "conversion of the `address` field failed: {}", e),
6464
E::ScriptPubkey(ref e) =>
65-
write!(f, "conversion of the `script_pub_key` field failed: {}", e),
65+
write!(f, "conversion of the `script_pubkey` field failed: {}", e),
6666
E::WitnessVersionValue(v) => write!(f, "invalid witness version number: {}", v),
6767
E::WitnessVersion(ref e) =>
6868
write!(f, "conversion of the `witness_version` field failed: {}", e),

0 commit comments

Comments
 (0)