Skip to content

Commit 9fe8f3a

Browse files
committed
build: suppress amount checking in fuzzing tests.
``` tests/fuzz/fuzz-funder-policy.c:32: amt.satoshis %= (MAX_SATS + 1); tests/fuzz/fuzz-funder-policy.c:132: total.satoshis, tcase->max_channel_size.satoshis); tests/fuzz/fuzz-funder-policy.c:140: our_funds.satoshis, tcase->policy.per_channel_min.satoshis); tests/fuzz/fuzz-funder-policy.c:145: our_funds.satoshis, tcase->policy.per_channel_max.satoshis); tests/fuzz/fuzz-funder-policy.c:155: our_funds.satoshis, tcase->available_funds.satoshis, tests/fuzz/fuzz-funder-policy.c:156: tcase->policy.reserve_tank.satoshis); tests/fuzz/fuzz-funder-policy.c:161: tcase->policy.reserve_tank.satoshis, tcase->available_funds.satoshis, tests/fuzz/fuzz-funder-policy.c:162: our_funds.satoshis); make: *** [Makefile:577: check-amount-access] Error 1 ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent cedf2f9 commit 9fe8f3a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/fuzz/fuzz-funder-policy.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct test_case {
2929
static struct amount_sat fromwire_amount_sat_bounded(const u8 **cursor, size_t *max)
3030
{
3131
struct amount_sat amt = fromwire_amount_sat(cursor, max);
32-
amt.satoshis %= (MAX_SATS + 1);
32+
amt.satoshis %= (MAX_SATS + 1); /* Raw: fuzzing */
3333
return amt;
3434
}
3535

@@ -129,20 +129,20 @@ void run(const u8 *data, size_t size)
129129
}
130130
if (amount_sat_greater(total, tcase->max_channel_size)) {
131131
fprintf(stderr, "Total channel capacity %"PRIu64" exceeds size %"PRIu64"\n",
132-
total.satoshis, tcase->max_channel_size.satoshis);
132+
total.satoshis, tcase->max_channel_size.satoshis); /* Raw: fuzzing */
133133
abort();
134134
}
135135

136136
/* Check our_funds is within per-channel limits */
137137
if (amount_sat_less(our_funds, tcase->policy.per_channel_min) &&
138138
!amount_sat_is_zero(our_funds)) {
139139
fprintf(stderr, "our_funds %"PRIu64" < per_channel_min %"PRIu64"\n",
140-
our_funds.satoshis, tcase->policy.per_channel_min.satoshis);
140+
our_funds.satoshis, tcase->policy.per_channel_min.satoshis); /* Raw: fuzzing */
141141
abort();
142142
}
143143
if (amount_sat_greater(our_funds, tcase->policy.per_channel_max)) {
144144
fprintf(stderr, "our_funds %"PRIu64" > per_max_channel_size %"PRIu64"\n",
145-
our_funds.satoshis, tcase->policy.per_channel_max.satoshis);
145+
our_funds.satoshis, tcase->policy.per_channel_max.satoshis); /* Raw: fuzzing */
146146
abort();
147147
}
148148
}
@@ -152,14 +152,14 @@ void run(const u8 *data, size_t size)
152152
if (amount_sat_sub(&available_minus_reserve, tcase->available_funds, tcase->policy.reserve_tank)) {
153153
if (amount_sat_greater(our_funds, available_minus_reserve)) {
154154
fprintf(stderr, "our_funds %"PRIu64" > available %"PRIu64" - reserve %"PRIu64"\n",
155-
our_funds.satoshis, tcase->available_funds.satoshis,
156-
tcase->policy.reserve_tank.satoshis);
155+
our_funds.satoshis, tcase->available_funds.satoshis, /* Raw: fuzzing */
156+
tcase->policy.reserve_tank.satoshis); /* Raw: fuzzing */
157157
abort();
158158
}
159159
} else if (!amount_sat_eq(our_funds, AMOUNT_SAT(0))) {
160160
fprintf(stderr, "Reserve %"PRIu64" >= available %"PRIu64" but our_funds %"PRIu64" != 0\n",
161-
tcase->policy.reserve_tank.satoshis, tcase->available_funds.satoshis,
162-
our_funds.satoshis);
161+
tcase->policy.reserve_tank.satoshis, tcase->available_funds.satoshis, /* Raw: fuzzing */
162+
our_funds.satoshis); /* Raw: fuzzing */
163163
abort();
164164
}
165165

0 commit comments

Comments
 (0)