mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 03:33:32 +01:00
Merge bitcoin/bitcoin#21786: wallet: ensure sat/vB feerates are in range (mantissa of 3)
847288df07test: fee rate values that cannot be represented as sat/vB (Jon Atack)06a90fa038rpc: for sat/vB fee rates, limit ParseFixedPoint decimals to 3 (Jon Atack)0742c7840frpc: enable passing decimals to AmountFromValue, add doxygen (Jon Atack)8ce3ef57a3test: ParseFixedPoint with 3 decimals for sat/vB fee rates (Jon Atack)b503327597test: type error and out of range fee rates where missing (Jon Atack)c5fd4344f7test: explicit fee rates with invalid amounts (Jon Atack)ea6f76b66etest: improve zero-value explicit fee rate coverage (Jon Atack) Pull request description: - Improve/close gaps in existing test coverage before making the change - Enable passing `decimals` to `ParseFixedPoint()` when calling `AmountFromValue()` - Limit explicit fee rates in sat/vB passed in by users to 3 decimals, and raise otherwise - Add regression test coverage Closes #20534. ACKs for top commit: MarcoFalke: review ACK847288df07🔷 Tree-SHA512: c539d07ae9b21c0d6c8ea460beb9c8dad5559445518aace560abc3c05c588907bae189b6fd7602b3b397de4a42356136c3ec6f960d3dcf2d5d16377aef4ab5a2
This commit is contained in:
@@ -77,7 +77,14 @@ extern uint256 ParseHashO(const UniValue& o, std::string strKey);
|
||||
extern std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strName);
|
||||
extern std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey);
|
||||
|
||||
extern CAmount AmountFromValue(const UniValue& value);
|
||||
/**
|
||||
* Validate and return a CAmount from a UniValue number or string.
|
||||
*
|
||||
* @param[in] value UniValue number or string to parse.
|
||||
* @param[in] decimals Number of significant digits (default: 8).
|
||||
* @returns a CAmount if the various checks pass.
|
||||
*/
|
||||
extern CAmount AmountFromValue(const UniValue& value, int decimals = 8);
|
||||
|
||||
using RPCArgList = std::vector<std::pair<std::string, UniValue>>;
|
||||
extern std::string HelpExampleCli(const std::string& methodname, const std::string& args);
|
||||
|
||||
Reference in New Issue
Block a user