diff --git a/types/src/model/blockchain.rs b/types/src/model/blockchain.rs index ef78a6891..d994f4421 100644 --- a/types/src/model/blockchain.rs +++ b/types/src/model/blockchain.rs @@ -426,7 +426,7 @@ pub struct GetBlockStats { pub subsidy: Option, /// Total size of all segwit transactions. pub segwit_total_size: Option, - /// Total weight of all segwit transactions divided by segwit scale factor (4). + /// Total weight of all segwit transactions. pub segwit_total_weight: Option, /// The number of segwit transactions. pub segwit_txs: Option, @@ -436,11 +436,11 @@ pub struct GetBlockStats { pub total_out: Option, /// Total size of all non-coinbase transactions. pub total_size: Option, - /// Total weight of all non-coinbase transactions divided by segwit scale factor (4). + /// Total weight of all non-coinbase transactions. pub total_weight: Option, /// The fee total. pub total_fee: Option, - /// The number of transactions (excluding coinbase). + /// The number of transactions (including coinbase). pub txs: Option, /// The increase/decrease in the number of unspent outputs. pub utxo_increase: Option, diff --git a/types/src/v21/blockchain/into.rs b/types/src/v21/blockchain/into.rs index d76169cd2..88c69c352 100644 --- a/types/src/v21/blockchain/into.rs +++ b/types/src/v21/blockchain/into.rs @@ -2,15 +2,83 @@ use alloc::collections::BTreeMap; -use bitcoin::{hex, BlockHash, Network, Txid, Work, Wtxid}; +use bitcoin::{hex, Amount, BlockHash, FeeRate, Network, Txid, Weight, Work, Wtxid}; use super::{ - GetBlockchainInfo, GetBlockchainInfoError, GetMempoolAncestors, GetMempoolAncestorsVerbose, - GetMempoolDescendants, GetMempoolDescendantsVerbose, GetMempoolEntry, GetMempoolInfo, - GetMempoolInfoError, GetRawMempool, GetRawMempoolSequence, GetRawMempoolVerbose, - MapMempoolEntryError, MempoolEntry, MempoolEntryError, + GetBlockStats, GetBlockchainInfo, GetBlockchainInfoError, GetMempoolAncestors, + GetMempoolAncestorsVerbose, GetMempoolDescendants, GetMempoolDescendantsVerbose, + GetMempoolEntry, GetMempoolInfo, GetMempoolInfoError, GetRawMempool, GetRawMempoolSequence, + GetRawMempoolVerbose, MapMempoolEntryError, MempoolEntry, MempoolEntryError, }; use crate::model; +use crate::v17::GetBlockStatsError; + +impl GetBlockStats { + /// Converts version specific type to a version nonspecific, more strongly typed type. + pub fn into_model(self) -> Result { + use GetBlockStatsError as E; + + // `FeeRate::sat_per_vb` returns an option if value overflows. + let average_fee_rate = self.average_fee_rate.and_then(FeeRate::from_sat_per_vb); + let block_hash = + self.block_hash.map(|h| h.parse::()).transpose().map_err(E::BlockHash)?; + let fee_rate_percentiles = self + .fee_rate_percentiles + .map(|arr| arr.iter().map(|vb| FeeRate::from_sat_per_vb(*vb)).collect()); + let max_fee_rate = self.max_fee_rate.and_then(FeeRate::from_sat_per_vb); + let minimum_fee_rate = self.minimum_fee_rate.and_then(FeeRate::from_sat_per_vb); + + // FIXME: Double check that these values are virtual bytes and not weight units. + let segwit_total_weight = self.segwit_total_weight.and_then(Weight::from_vb); + let total_weight = self.total_weight.and_then(Weight::from_vb); + + Ok(model::GetBlockStats { + average_fee: self.average_fee.map(Amount::from_sat), + average_fee_rate, + average_tx_size: self + .average_tx_size + .map(|v| crate::to_u32(v, "average_tx_size")) + .transpose()?, + block_hash, + fee_rate_percentiles, + height: self.height.map(|v| crate::to_u32(v, "height")).transpose()?, + inputs: self.inputs.map(|v| crate::to_u32(v, "inputs")).transpose()?, + max_fee: self.max_fee.map(Amount::from_sat), + max_fee_rate, + max_tx_size: self.max_tx_size.map(|v| crate::to_u32(v, "max_tx_size")).transpose()?, + median_fee: self.median_fee.map(Amount::from_sat), + median_time: self.median_time.map(|v| crate::to_u32(v, "median_time")).transpose()?, + median_tx_size: self + .median_tx_size + .map(|v| crate::to_u32(v, "median_tx_size")) + .transpose()?, + minimum_fee: self.minimum_fee.map(Amount::from_sat), + minimum_fee_rate, + minimum_tx_size: self + .minimum_tx_size + .map(|v| crate::to_u32(v, "minimum_tx_size")) + .transpose()?, + outputs: self.outputs.map(|v| crate::to_u32(v, "outputs")).transpose()?, + subsidy: self.subsidy.map(Amount::from_sat), + segwit_total_size: self + .segwit_total_size + .map(|v| crate::to_u32(v, "segwit_total_size")) + .transpose()?, + segwit_total_weight, + segwit_txs: self.segwit_txs.map(|v| crate::to_u32(v, "segwit_txs")).transpose()?, + time: self.time.map(|v| crate::to_u32(v, "time")).transpose()?, + total_out: self.total_out.map(Amount::from_sat), + total_size: self.total_size.map(|v| crate::to_u32(v, "total_size")).transpose()?, + total_weight, + total_fee: self.total_fee.map(Amount::from_sat), + txs: self.txs.map(|v| crate::to_u32(v, "txs")).transpose()?, + utxo_increase: self.utxo_increase, + utxo_size_increase: self.utxo_size_increase, + utxo_increase_actual: None, // v25 and later only. + utxo_size_increase_actual: None, // v25 and later only. + }) + } +} impl GetBlockchainInfo { /// Converts version specific type to a version nonspecific, more strongly typed type. diff --git a/types/src/v21/blockchain/mod.rs b/types/src/v21/blockchain/mod.rs index b276e88bc..4399956b5 100644 --- a/types/src/v21/blockchain/mod.rs +++ b/types/src/v21/blockchain/mod.rs @@ -14,6 +14,108 @@ pub use super::{ Bip9SoftforkStatistics, Bip9SoftforkStatus, GetBlockchainInfoError, GetMempoolInfoError, MapMempoolEntryError, MempoolEntryError, MempoolEntryFees, }; +pub use crate::v17::GetBlockStatsError; + +/// Result of JSON-RPC method `getblockstats`. +/// +/// > getblockstats hash_or_height ( stats ) +/// > +/// > Compute per block statistics for a given window. All amounts are in satoshis. +/// > It won't work for some heights with pruning. +/// > +/// > Arguments: +/// > 1. hash_or_height (string or numeric, required) The block hash or height of the target block +/// > 2. stats (json array, optional, default=all values) Values to plot (see result below) +/// > [ +/// > "height", (string) Selected statistic +/// > "time", (string) Selected statistic +/// > ... +/// > ] +#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] +#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))] +pub struct GetBlockStats { + /// Average fee in the block. + #[serde(rename = "avgfee")] + pub average_fee: Option, + // FIXME: Remember these docs will become silently stale when unit changes in a later version of Core. + /// Average feerate (in satoshis per virtual byte). + #[serde(rename = "avgfeerate")] + pub average_fee_rate: Option, + /// Average transaction size. + #[serde(rename = "avgtxsize")] + pub average_tx_size: Option, + /// The block hash (to check for potential reorgs). + #[serde(rename = "blockhash")] + pub block_hash: Option, + /// Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per + /// virtual byte). + #[serde(rename = "feerate_percentiles")] + pub fee_rate_percentiles: Option<[u64; 5]>, + /// The height of the block. + pub height: Option, + /// The number of inputs (excluding coinbase). + #[serde(rename = "ins")] + pub inputs: Option, + /// Maximum fee in the block. + #[serde(rename = "maxfee")] + pub max_fee: Option, + /// Maximum feerate (in satoshis per virtual byte). + #[serde(rename = "maxfeerate")] + pub max_fee_rate: Option, + /// Maximum transaction size. + #[serde(rename = "maxtxsize")] + pub max_tx_size: Option, + /// Truncated median fee in the block. + #[serde(rename = "medianfee")] + pub median_fee: Option, + /// The block median time past. + #[serde(rename = "mediantime")] + pub median_time: Option, + /// Truncated median transaction size. + #[serde(rename = "mediantxsize")] + pub median_tx_size: Option, + /// Minimum fee in the block. + #[serde(rename = "minfee")] + pub minimum_fee: Option, + /// Minimum feerate (in satoshis per virtual byte). + #[serde(rename = "minfeerate")] + pub minimum_fee_rate: Option, + /// Minimum transaction size. + #[serde(rename = "mintxsize")] + pub minimum_tx_size: Option, + /// The number of outputs. + #[serde(rename = "outs")] + pub outputs: Option, + /// The block subsidy. + pub subsidy: Option, + /// Total size of all segwit transactions. + #[serde(rename = "swtotal_size")] + pub segwit_total_size: Option, + /// Total weight of all segwit transactions. + #[serde(rename = "swtotal_weight")] + pub segwit_total_weight: Option, + /// The number of segwit transactions. + #[serde(rename = "swtxs")] + pub segwit_txs: Option, + /// The block time. + pub time: Option, + /// Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee]). + pub total_out: Option, + /// Total size of all non-coinbase transactions. + pub total_size: Option, + /// Total weight of all non-coinbase transactions. + pub total_weight: Option, + /// The fee total. + #[serde(rename = "totalfee")] + pub total_fee: Option, + /// The number of transactions (including coinbase). + pub txs: Option, + /// The increase/decrease in the number of unspent outputs. + pub utxo_increase: Option, + /// The increase/decrease in size for the utxo index (not discounting op_return and similar). + #[serde(rename = "utxo_size_inc")] + pub utxo_size_increase: Option, +} /// Result of JSON-RPC method `getblockchaininfo`. /// diff --git a/types/src/v21/mod.rs b/types/src/v21/mod.rs index 24fcf8095..79211f88f 100644 --- a/types/src/v21/mod.rs +++ b/types/src/v21/mod.rs @@ -243,10 +243,10 @@ mod wallet; #[doc(inline)] pub use self::{ blockchain::{ - Bip9SoftforkInfo, GetBlockchainInfo, GetMempoolAncestors, GetMempoolAncestorsVerbose, - GetMempoolDescendants, GetMempoolDescendantsVerbose, GetMempoolEntry, GetMempoolInfo, - GetRawMempool, GetRawMempoolSequence, GetRawMempoolVerbose, MempoolEntry, Softfork, - SoftforkType, + Bip9SoftforkInfo, GetBlockStats, GetBlockStatsError, GetBlockchainInfo, + GetMempoolAncestors, GetMempoolAncestorsVerbose, GetMempoolDescendants, + GetMempoolDescendantsVerbose, GetMempoolEntry, GetMempoolInfo, GetRawMempool, + GetRawMempoolSequence, GetRawMempoolVerbose, MempoolEntry, Softfork, SoftforkType, }, generating::GenerateBlock, hidden::AddPeerAddress, @@ -275,15 +275,15 @@ pub use crate::{ FinalizePsbt, FinalizePsbtError, FundRawTransaction, FundRawTransactionError, Generate, GenerateToAddress, GetAddedNodeInfo, GetAddressInfoEmbeddedError, GetAddressesByLabel, GetBalance, GetBestBlockHash, GetBlockCount, GetBlockHash, GetBlockHeader, - GetBlockHeaderError, GetBlockHeaderVerbose, GetBlockHeaderVerboseError, GetBlockStats, - GetBlockStatsError, GetBlockTemplate, GetBlockTemplateError, GetBlockVerboseOne, - GetBlockVerboseOneError, GetBlockVerboseZero, GetChainTips, GetChainTxStatsError, - GetConnectionCount, GetDifficulty, GetMemoryInfoStats, GetMempoolInfoError, GetMiningInfo, - GetNetTotals, GetNetworkInfoAddress, GetNetworkInfoError, GetNetworkInfoNetwork, - GetNewAddress, GetRawChangeAddress, GetRawTransaction, GetRawTransactionVerbose, - GetRawTransactionVerboseError, GetReceivedByAddress, GetTransactionDetailError, - GetTransactionError, GetTxOut, GetTxOutError, GetTxOutSetInfo, GetTxOutSetInfoError, - GetUnconfirmedBalance, GetWalletInfoError, ListAddressGroupings, ListAddressGroupingsError, + GetBlockHeaderError, GetBlockHeaderVerbose, GetBlockHeaderVerboseError, GetBlockTemplate, + GetBlockTemplateError, GetBlockVerboseOne, GetBlockVerboseOneError, GetBlockVerboseZero, + GetChainTips, GetChainTxStatsError, GetConnectionCount, GetDifficulty, GetMemoryInfoStats, + GetMempoolInfoError, GetMiningInfo, GetNetTotals, GetNetworkInfoAddress, + GetNetworkInfoError, GetNetworkInfoNetwork, GetNewAddress, GetRawChangeAddress, + GetRawTransaction, GetRawTransactionVerbose, GetRawTransactionVerboseError, + GetReceivedByAddress, GetTransactionDetailError, GetTransactionError, GetTxOut, + GetTxOutError, GetTxOutSetInfo, GetTxOutSetInfoError, GetUnconfirmedBalance, + GetWalletInfoError, ListAddressGroupings, ListAddressGroupingsError, ListAddressGroupingsItem, ListLabels, ListLockUnspent, ListLockUnspentItem, ListLockUnspentItemError, ListReceivedByAddressError, ListUnspentItemError, ListWallets, LoadWallet, LockUnspent, Locked, NumericError, PartialSignatureError, PruneBlockchain, diff --git a/types/src/v22/mod.rs b/types/src/v22/mod.rs index bbf776ba3..82888e89a 100644 --- a/types/src/v22/mod.rs +++ b/types/src/v22/mod.rs @@ -280,15 +280,14 @@ pub use crate::{ FundRawTransactionError, Generate, GenerateToAddress, GetAddedNodeInfo, GetAddressInfoEmbeddedError, GetAddressesByLabel, GetBalance, GetBestBlockHash, GetBlockCount, GetBlockHash, GetBlockHeader, GetBlockHeaderError, GetBlockHeaderVerbose, - GetBlockHeaderVerboseError, GetBlockStats, GetBlockStatsError, GetBlockTemplate, - GetBlockTemplateError, GetBlockVerboseOne, GetBlockVerboseOneError, GetBlockVerboseZero, - GetChainTips, GetChainTxStatsError, GetConnectionCount, GetDifficulty, GetMemoryInfoStats, - GetMempoolInfoError, GetMiningInfo, GetNetTotals, GetNetworkInfoAddress, - GetNetworkInfoError, GetNetworkInfoNetwork, GetNewAddress, GetRawChangeAddress, - GetRawTransaction, GetRawTransactionVerbose, GetRawTransactionVerboseError, - GetReceivedByAddress, GetTransactionDetailError, GetTransactionError, GetTxOut, - GetTxOutError, GetTxOutSetInfo, GetTxOutSetInfoError, GetUnconfirmedBalance, - GetWalletInfoError, ListAddressGroupings, ListAddressGroupingsError, + GetBlockHeaderVerboseError, GetBlockTemplate, GetBlockTemplateError, GetBlockVerboseOne, + GetBlockVerboseOneError, GetBlockVerboseZero, GetChainTips, GetChainTxStatsError, + GetConnectionCount, GetDifficulty, GetMemoryInfoStats, GetMempoolInfoError, GetMiningInfo, + GetNetTotals, GetNetworkInfoAddress, GetNetworkInfoError, GetNetworkInfoNetwork, + GetNewAddress, GetRawChangeAddress, GetRawTransaction, GetRawTransactionVerbose, + GetRawTransactionVerboseError, GetReceivedByAddress, GetTransactionDetailError, + GetTransactionError, GetTxOut, GetTxOutError, GetTxOutSetInfo, GetTxOutSetInfoError, + GetUnconfirmedBalance, GetWalletInfoError, ListAddressGroupings, ListAddressGroupingsError, ListAddressGroupingsItem, ListLabels, ListLockUnspent, ListLockUnspentItem, ListLockUnspentItemError, ListReceivedByAddressError, ListUnspentItemError, ListWallets, LoadWallet, LockUnspent, Locked, NumericError, PartialSignatureError, PruneBlockchain, @@ -323,13 +322,13 @@ pub use crate::{ ScanTxOutSetStart, ScanTxOutSetUnspent, TransactionItem, TransactionItemError, }, v21::{ - AddPeerAddress, Bip9SoftforkInfo, GenerateBlock, GetBlockchainInfo, GetIndexInfo, - GetIndexInfoName, GetMempoolAncestors, GetMempoolAncestorsVerbose, GetMempoolDescendants, - GetMempoolDescendantsVerbose, GetMempoolEntry, GetNetworkInfo, GetRawMempool, - GetRawMempoolSequence, GetRawMempoolVerbose, GetWalletInfo, GetWalletInfoScanning, - ImportDescriptors, ImportDescriptorsResult, MempoolEntry, PsbtBumpFee, PsbtBumpFeeError, - Send, SendError, SendMany, SendManyVerbose, Softfork, SoftforkType, UnloadWallet, - UpgradeWallet, + AddPeerAddress, Bip9SoftforkInfo, GenerateBlock, GetBlockStats, GetBlockStatsError, + GetBlockchainInfo, GetIndexInfo, GetIndexInfoName, GetMempoolAncestors, + GetMempoolAncestorsVerbose, GetMempoolDescendants, GetMempoolDescendantsVerbose, + GetMempoolEntry, GetNetworkInfo, GetRawMempool, GetRawMempoolSequence, + GetRawMempoolVerbose, GetWalletInfo, GetWalletInfoScanning, ImportDescriptors, + ImportDescriptorsResult, MempoolEntry, PsbtBumpFee, PsbtBumpFeeError, Send, SendError, + SendMany, SendManyVerbose, Softfork, SoftforkType, UnloadWallet, UpgradeWallet, }, ScriptPubKey, }; diff --git a/types/src/v23/mod.rs b/types/src/v23/mod.rs index b8e21fa3d..1ae8d21ab 100644 --- a/types/src/v23/mod.rs +++ b/types/src/v23/mod.rs @@ -277,27 +277,27 @@ pub use crate::{ FinalizePsbt, FinalizePsbtError, FundRawTransaction, FundRawTransactionError, Generate, GenerateToAddress, GetAddedNodeInfo, GetAddressInfoEmbeddedError, GetAddressesByLabel, GetBalance, GetBestBlockHash, GetBlockCount, GetBlockHash, GetBlockHeader, - GetBlockHeaderError, GetBlockHeaderVerbose, GetBlockHeaderVerboseError, GetBlockStats, - GetBlockStatsError, GetBlockTemplate, GetBlockTemplateError, GetBlockVerboseOne, - GetBlockVerboseOneError, GetBlockVerboseZero, GetChainTips, GetChainTxStatsError, - GetConnectionCount, GetDifficulty, GetMemoryInfoStats, GetMempoolInfoError, GetMiningInfo, - GetNetTotals, GetNetworkInfoAddress, GetNetworkInfoError, GetNetworkInfoNetwork, - GetNewAddress, GetRawChangeAddress, GetRawTransaction, GetRawTransactionVerbose, - GetRawTransactionVerboseError, GetReceivedByAddress, GetTransactionDetailError, GetTxOut, - GetTxOutError, GetTxOutSetInfo, GetTxOutSetInfoError, GetUnconfirmedBalance, - GetWalletInfoError, ListAddressGroupings, ListAddressGroupingsError, - ListAddressGroupingsItem, ListLabels, ListLockUnspent, ListLockUnspentItem, - ListLockUnspentItemError, ListReceivedByAddressError, ListUnspentItemError, ListWallets, - LoadWallet, LockUnspent, Locked, NumericError, PartialSignatureError, PruneBlockchain, - RawFeeDetail, RawFeeRange, RawTransactionError, RawTransactionInput, RawTransactionOutput, - RescanBlockchain, ScanTxOutSetAbort, ScanTxOutSetError, ScanTxOutSetStatus, ScriptType, - SendRawTransaction, SendToAddress, SetNetworkActive, SetTxFee, SignFail, SignFailError, - SignMessage, SignMessageWithPrivKey, SignRawTransaction, SignRawTransactionError, - SignRawTransactionWithKey, SignRawTransactionWithWallet, SoftforkReject, - TransactionCategory, UploadTarget, ValidateAddress, ValidateAddressError, VerifyChain, - VerifyMessage, VerifyTxOutProof, WaitForBlock, WaitForBlockError, WaitForBlockHeight, - WaitForBlockHeightError, WaitForNewBlock, WaitForNewBlockError, WalletCreateFundedPsbt, - WalletCreateFundedPsbtError, WalletProcessPsbt, WitnessUtxo, WitnessUtxoError, + GetBlockHeaderError, GetBlockHeaderVerbose, GetBlockHeaderVerboseError, GetBlockTemplate, + GetBlockTemplateError, GetBlockVerboseOne, GetBlockVerboseOneError, GetBlockVerboseZero, + GetChainTips, GetChainTxStatsError, GetConnectionCount, GetDifficulty, GetMemoryInfoStats, + GetMempoolInfoError, GetMiningInfo, GetNetTotals, GetNetworkInfoAddress, + GetNetworkInfoError, GetNetworkInfoNetwork, GetNewAddress, GetRawChangeAddress, + GetRawTransaction, GetRawTransactionVerbose, GetRawTransactionVerboseError, + GetReceivedByAddress, GetTransactionDetailError, GetTxOut, GetTxOutError, GetTxOutSetInfo, + GetTxOutSetInfoError, GetUnconfirmedBalance, GetWalletInfoError, ListAddressGroupings, + ListAddressGroupingsError, ListAddressGroupingsItem, ListLabels, ListLockUnspent, + ListLockUnspentItem, ListLockUnspentItemError, ListReceivedByAddressError, + ListUnspentItemError, ListWallets, LoadWallet, LockUnspent, Locked, NumericError, + PartialSignatureError, PruneBlockchain, RawFeeDetail, RawFeeRange, RawTransactionError, + RawTransactionInput, RawTransactionOutput, RescanBlockchain, ScanTxOutSetAbort, + ScanTxOutSetError, ScanTxOutSetStatus, ScriptType, SendRawTransaction, SendToAddress, + SetNetworkActive, SetTxFee, SignFail, SignFailError, SignMessage, SignMessageWithPrivKey, + SignRawTransaction, SignRawTransactionError, SignRawTransactionWithKey, + SignRawTransactionWithWallet, SoftforkReject, TransactionCategory, UploadTarget, + ValidateAddress, ValidateAddressError, VerifyChain, VerifyMessage, VerifyTxOutProof, + WaitForBlock, WaitForBlockError, WaitForBlockHeight, WaitForBlockHeightError, + WaitForNewBlock, WaitForNewBlockError, WalletCreateFundedPsbt, WalletCreateFundedPsbtError, + WalletProcessPsbt, WitnessUtxo, WitnessUtxoError, }, v18::{ ActiveCommand, AnalyzePsbt, AnalyzePsbtError, AnalyzePsbtInput, AnalyzePsbtInputMissing, @@ -317,9 +317,10 @@ pub use crate::{ }, v20::{GenerateToDescriptor, GetTransactionDetail}, v21::{ - AddPeerAddress, GenerateBlock, GetIndexInfo, GetIndexInfoName, GetNetworkInfo, - GetRawMempoolSequence, ImportDescriptors, ImportDescriptorsResult, PsbtBumpFee, - PsbtBumpFeeError, Send, SendError, SendMany, SendManyVerbose, UnloadWallet, UpgradeWallet, + AddPeerAddress, GenerateBlock, GetBlockStats, GetBlockStatsError, GetIndexInfo, + GetIndexInfoName, GetNetworkInfo, GetRawMempoolSequence, ImportDescriptors, + ImportDescriptorsResult, PsbtBumpFee, PsbtBumpFeeError, Send, SendError, SendMany, + SendManyVerbose, UnloadWallet, UpgradeWallet, }, v22::{ AddConnection, Banned, DescriptorInfo, EnumerateSigners, GetAddressInfo, diff --git a/types/src/v24/mod.rs b/types/src/v24/mod.rs index 0cad29550..65c463d64 100644 --- a/types/src/v24/mod.rs +++ b/types/src/v24/mod.rs @@ -277,27 +277,27 @@ pub use crate::{ FinalizePsbt, FinalizePsbtError, FundRawTransaction, FundRawTransactionError, Generate, GenerateToAddress, GetAddedNodeInfo, GetAddressInfoEmbeddedError, GetAddressesByLabel, GetBalance, GetBestBlockHash, GetBlockCount, GetBlockHash, GetBlockHeader, - GetBlockHeaderError, GetBlockHeaderVerbose, GetBlockHeaderVerboseError, GetBlockStats, - GetBlockStatsError, GetBlockTemplate, GetBlockTemplateError, GetBlockVerboseOne, - GetBlockVerboseOneError, GetBlockVerboseZero, GetChainTips, GetChainTxStatsError, - GetConnectionCount, GetDifficulty, GetMemoryInfoStats, GetMempoolInfoError, GetMiningInfo, - GetNetTotals, GetNetworkInfoAddress, GetNetworkInfoError, GetNetworkInfoNetwork, - GetNewAddress, GetRawChangeAddress, GetRawMempool, GetRawTransaction, - GetRawTransactionVerbose, GetRawTransactionVerboseError, GetReceivedByAddress, - GetTransactionDetailError, GetTxOut, GetTxOutError, GetTxOutSetInfo, GetTxOutSetInfoError, - GetUnconfirmedBalance, GetWalletInfoError, ListAddressGroupings, ListAddressGroupingsError, - ListAddressGroupingsItem, ListLabels, ListLockUnspent, ListLockUnspentItem, - ListLockUnspentItemError, ListReceivedByAddressError, ListUnspentItemError, ListWallets, - LoadWallet, LockUnspent, Locked, NumericError, PartialSignatureError, PruneBlockchain, - RawFeeDetail, RawFeeRange, RawTransactionError, RawTransactionInput, RawTransactionOutput, - RescanBlockchain, ScanTxOutSetAbort, ScanTxOutSetError, ScanTxOutSetStatus, ScriptType, - SendRawTransaction, SendToAddress, SetNetworkActive, SetTxFee, SignFail, SignFailError, - SignMessage, SignMessageWithPrivKey, SignRawTransaction, SignRawTransactionError, - SignRawTransactionWithKey, SignRawTransactionWithWallet, SoftforkReject, - TransactionCategory, UploadTarget, ValidateAddress, ValidateAddressError, VerifyChain, - VerifyMessage, VerifyTxOutProof, WaitForBlock, WaitForBlockError, WaitForBlockHeight, - WaitForBlockHeightError, WaitForNewBlock, WaitForNewBlockError, WalletCreateFundedPsbt, - WalletCreateFundedPsbtError, WalletProcessPsbt, WitnessUtxo, WitnessUtxoError, + GetBlockHeaderError, GetBlockHeaderVerbose, GetBlockHeaderVerboseError, GetBlockTemplate, + GetBlockTemplateError, GetBlockVerboseOne, GetBlockVerboseOneError, GetBlockVerboseZero, + GetChainTips, GetChainTxStatsError, GetConnectionCount, GetDifficulty, GetMemoryInfoStats, + GetMempoolInfoError, GetMiningInfo, GetNetTotals, GetNetworkInfoAddress, + GetNetworkInfoError, GetNetworkInfoNetwork, GetNewAddress, GetRawChangeAddress, + GetRawMempool, GetRawTransaction, GetRawTransactionVerbose, GetRawTransactionVerboseError, + GetReceivedByAddress, GetTransactionDetailError, GetTxOut, GetTxOutError, GetTxOutSetInfo, + GetTxOutSetInfoError, GetUnconfirmedBalance, GetWalletInfoError, ListAddressGroupings, + ListAddressGroupingsError, ListAddressGroupingsItem, ListLabels, ListLockUnspent, + ListLockUnspentItem, ListLockUnspentItemError, ListReceivedByAddressError, + ListUnspentItemError, ListWallets, LoadWallet, LockUnspent, Locked, NumericError, + PartialSignatureError, PruneBlockchain, RawFeeDetail, RawFeeRange, RawTransactionError, + RawTransactionInput, RawTransactionOutput, RescanBlockchain, ScanTxOutSetAbort, + ScanTxOutSetError, ScanTxOutSetStatus, ScriptType, SendRawTransaction, SendToAddress, + SetNetworkActive, SetTxFee, SignFail, SignFailError, SignMessage, SignMessageWithPrivKey, + SignRawTransaction, SignRawTransactionError, SignRawTransactionWithKey, + SignRawTransactionWithWallet, SoftforkReject, TransactionCategory, UploadTarget, + ValidateAddress, ValidateAddressError, VerifyChain, VerifyMessage, VerifyTxOutProof, + WaitForBlock, WaitForBlockError, WaitForBlockHeight, WaitForBlockHeightError, + WaitForNewBlock, WaitForNewBlockError, WalletCreateFundedPsbt, WalletCreateFundedPsbtError, + WalletProcessPsbt, WitnessUtxo, WitnessUtxoError, }, v18::{ ActiveCommand, AnalyzePsbt, AnalyzePsbtError, AnalyzePsbtInput, AnalyzePsbtInputMissing, @@ -317,9 +317,10 @@ pub use crate::{ }, v20::GenerateToDescriptor, v21::{ - AddPeerAddress, GenerateBlock, GetIndexInfo, GetIndexInfoName, GetNetworkInfo, - GetRawMempoolSequence, ImportDescriptors, ImportDescriptorsResult, PsbtBumpFee, - PsbtBumpFeeError, Send, SendError, SendMany, SendManyVerbose, UnloadWallet, UpgradeWallet, + AddPeerAddress, GenerateBlock, GetBlockStats, GetBlockStatsError, GetIndexInfo, + GetIndexInfoName, GetNetworkInfo, GetRawMempoolSequence, ImportDescriptors, + ImportDescriptorsResult, PsbtBumpFee, PsbtBumpFeeError, Send, SendError, SendMany, + SendManyVerbose, UnloadWallet, UpgradeWallet, }, v22::{ AddConnection, Banned, DescriptorInfo, EnumerateSigners, GetAddressInfo, diff --git a/types/src/v25/blockchain/mod.rs b/types/src/v25/blockchain/mod.rs index bd0f27d9f..931b8f729 100644 --- a/types/src/v25/blockchain/mod.rs +++ b/types/src/v25/blockchain/mod.rs @@ -88,7 +88,7 @@ pub struct GetBlockStats { /// Total size of all segwit transactions. #[serde(rename = "swtotal_size")] pub segwit_total_size: Option, - /// Total weight of all segwit transactions divided by segwit scale factor (4). + /// Total weight of all segwit transactions. #[serde(rename = "swtotal_weight")] pub segwit_total_weight: Option, /// The number of segwit transactions. @@ -100,12 +100,12 @@ pub struct GetBlockStats { pub total_out: Option, /// Total size of all non-coinbase transactions. pub total_size: Option, - /// Total weight of all non-coinbase transactions divided by segwit scale factor (4). + /// Total weight of all non-coinbase transactions. pub total_weight: Option, /// The fee total. #[serde(rename = "totalfee")] pub total_fee: Option, - /// The number of transactions (excluding coinbase). + /// The number of transactions (including coinbase). pub txs: Option, /// The increase/decrease in the number of unspent outputs. pub utxo_increase: Option,