Skip to content

Rename script_pub_key to script_pubkey #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/client_sync/v17/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ pub struct ImportMultiRequest {
pub desc: Option<String>, // from core v18 onwards.
/// Type of scriptPubKey (string for script, json for address). Should not be provided if using descriptor.
#[serde(rename = "scriptPubKey", skip_serializing_if = "Option::is_none")]
pub script_pub_key: Option<ImportMultiScriptPubKey>,
pub script_pubkey: Option<ImportMultiScriptPubKey>,
/// Creation time of the key expressed in UNIX epoch time, or the string "now" to substitute the current synced blockchain time.
pub timestamp: ImportMultiTimestamp,
}
Expand Down
6 changes: 3 additions & 3 deletions integration_test/tests/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,14 @@ fn wallet__import_multi() {
// to ensure import succeeds, since the wallet already knows the key.
let req1 = ImportMultiRequest {
desc: None,
script_pub_key: Some(ImportMultiScriptPubKey::Script(dummy_script_hex.to_string())),
script_pubkey: Some(ImportMultiScriptPubKey::Script(dummy_script_hex.to_string())),
timestamp: ImportMultiTimestamp::Now,
};

// Uses an address (valid): success - false, with JSON-RPC error.
let req2 = ImportMultiRequest {
desc: None,
script_pub_key: Some(ImportMultiScriptPubKey::Address {
script_pubkey: Some(ImportMultiScriptPubKey::Address {
address: addr.to_string(),
}),
timestamp: ImportMultiTimestamp::Now,
Expand All @@ -383,7 +383,7 @@ fn wallet__import_multi() {
// NOTE: Works only for v18 onwards, as v17 doesn't support descriptors.
let req3 = ImportMultiRequest {
desc: Some(dummy_desc.to_string()),
script_pub_key: None,
script_pubkey: None,
timestamp: ImportMultiTimestamp::Time(1_700_000_000),
};

Expand Down
4 changes: 2 additions & 2 deletions types/src/v17/util/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl std::error::Error for CreateMultisigError {
pub enum ValidateAddressError {
/// Conversion of the `address` field failed.
Address(address::ParseError),
/// Conversion of the `script_pub_key` field failed.
/// Conversion of the `script_pubkey` field failed.
ScriptPubkey(hex::HexToBytesError),
/// The `witness_version` field's value was too big for a u8.
WitnessVersionValue(i64),
Expand All @@ -62,7 +62,7 @@ impl fmt::Display for ValidateAddressError {
match *self {
E::Address(ref e) => write!(f, "conversion of the `address` field failed: {}", e),
E::ScriptPubkey(ref e) =>
write!(f, "conversion of the `script_pub_key` field failed: {}", e),
write!(f, "conversion of the `script_pubkey` field failed: {}", e),
E::WitnessVersionValue(v) => write!(f, "invalid witness version number: {}", v),
E::WitnessVersion(ref e) =>
write!(f, "conversion of the `witness_version` field failed: {}", e),
Expand Down