Commit Graph

4 Commits

Author SHA1 Message Date
Tobin Harding 3f5caa501f Clean up module level rustdocs
Docs can always do with a bit of love.

Clean up the module level (`//!`) rustdocs for all public modules.

I claim uniform is better than any specific method/style. I tried to fit
in with what ever was either most sane of most prevalent, therefore
attaining uniformity without unnecessary code churn (one exception being
the changes to headings described below).

Notes:

* Headings - use heading as a regular sentence for all modules e.g.,

```
//! Bitcoin network messages.
```

as opposed to
```
//! # Bitcoin Network Messages
```

It was not clear which style to use so I picked a 'random' mature
project and copied their style.

* Added 'This module' in _most_ places as the start of the module
description, however I was not religious about this one.

* Fixed line length if necessary since most of our code seems to follow
short (80 char) line lengths for comments anyways.

* Added periods and fixed obvious (and sometimes not so obvious)
grammatically errors.

* Added a trailing `//!` to every block since this was almost universal
already. I don't really like this one but I'm guessing it is Andrew's
preferred style since its on the copyright notices as well.
2021-11-06 10:59:53 +11:00
Devrandom 95aa3bf153 std -> core 2021-06-11 17:28:04 +02:00
Antoine Poinsot 7345aa60d9 policy: add a function to get the virtual transaction size
It's very useful to Bitcoin applications, and especially "L2" ones, to
effectively compute feerates. Currently (and this is very unlikely to
change) bitcoind nodes compute the virtual size as a rounded-up division
of the size in witness units by 4, with a penalty for transactions that
are essentially >5% full of sigops.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-05-18 14:53:45 +02:00
Antoine Poinsot 2b777485fa policy: introduce p2p constants from the reference implementation
This introduces some constants defined by Bitcoin Core which as a
consequence define some network rules in a new 'policy' module.

Only some were picked, which are very unlikely to change. Nonetheless a
Warning has been put in the module documentation.

Script-level constants are left into rust-miniscript where they are
already defined (src/miniscript/limits.rs).
2021-05-18 14:52:56 +02:00