MCPcopy Create free account
hub / github.com/ElementsProject/lightning / main

Function main

common/test/run-marginal_feerate.c:113–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111/* AUTOGENERATED MOCKS END */
112
113int main(int argc, char *argv[])
114{
115 common_setup(argv[0]);
116
117 /* At minimum, it's 100% */
118 assert(marginal_feerate(253) == 253 * 2);
119
120 /* At maximum, it's 10% */
121 assert(marginal_feerate(45000) == (u32)(45000 * 1.1));
122
123 /* Above maximum, still 10% */
124 assert(marginal_feerate(500000) == (u32)(500000 * 1.1));
125
126 /* Half way, it's 55% */
127 u32 half = (45000 + 253)/2;
128 assert(marginal_feerate(half) == (u32)(half * 1.55));
129
130 common_shutdown();
131}

Callers

nothing calls this directly

Calls 3

common_setupFunction · 0.85
marginal_feerateFunction · 0.85
common_shutdownFunction · 0.85

Tested by

no test coverage detected