Skip to content

Commit fd5d71e

Browse files
committed
Update developer notes after params.size() cleanup
1 parent e067673 commit fd5d71e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

doc/developer-notes.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,16 +570,14 @@ A few guidelines for introducing and reviewing new RPC interfaces:
570570
is specified as-is in BIP22.
571571

572572
- Missing arguments and 'null' should be treated the same: as default values. If there is no
573-
default value, both cases should fail in the same way.
573+
default value, both cases should fail in the same way. The easiest way to follow this
574+
guideline is detect unspecified arguments with `params[x].isNull()` instead of
575+
`params.size() <= x`. The former returns true if the argument is either null or missing,
576+
while the latter returns true if is missing, and false if it is null.
574577

575578
- *Rationale*: Avoids surprises when switching to name-based arguments. Missing name-based arguments
576579
are passed as 'null'.
577580

578-
- *Exception*: Many legacy exceptions to this exist, one of the worst ones is
579-
`getbalance` which follows a completely different code path based on the
580-
number of arguments. We are still in the process of cleaning these up. Do not introduce
581-
new ones.
582-
583581
- Try not to overload methods on argument type. E.g. don't make `getblock(true)` and `getblock("hash")`
584582
do different things.
585583

0 commit comments

Comments
 (0)