Skip to content

Renaming fields in model types or not #526

@jamillambert

Description

@jamillambert

There are some of the RPC fields that have a different name in the model type and versioned type (Core names in snake case). Is this correct in all cases? If so are there equivalent fields that are not renamed? First mentioned here: #522 (comment)

An LLM search of all into.rs files found the below list:

RPC Version Type Model Type Rename Versions
getblocktemplate BlockTemplateTransaction BlockTemplateTransaction hashwtxid v17
gettxout GetTxOut GetTxOut script_pubkeyaddress v17
decodescript DecodeScript DecodeScript hexscript_pubkey v17
finalizepsbt FinalizePsbt FinalizePsbt hextx v17
descriptorprocesspsbt DescriptorProcessPsbt DescriptorProcessPsbt hextx v26
gettransaction GetTransaction GetTransaction hextx v17, v19, v20, v23, v24, v26, v28
createwallet CreateWallet CreateWallet warningwarnings v17
loadwallet LoadWallet LoadWallet warningwarnings v17
unloadwallet UnloadWallet UnloadWallet warningwarnings v21

There are also cases where they are not renamed e.g. in the model types below:

pub struct BlockTemplateTransaction {
   /// The transaction.
   pub data: Transaction,

and

pub struct GetAddressInfo {
...
    /// The redeemscript for the p2sh address.
    // TODO: Should we rename this to redeem_script?
    pub hex: Option<ScriptBuf>,

If they should be renamed it should be done consistently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions