refactor: Return optional of Coin in GetCoin

Leaving the parameter as well for now.

Co-authored-by: TheCharlatan <seb.kung@gmail.com>
This commit is contained in:
Lőrinc
2024-09-08 21:57:18 +02:00
parent e31bfb26c2
commit 46dfbf169b
9 changed files with 41 additions and 38 deletions

View File

@@ -163,7 +163,7 @@ FUZZ_TARGET(coins_view, .init = initialize_coins_view)
const bool exists_using_have_coin = coins_view_cache.HaveCoin(random_out_point);
const bool exists_using_have_coin_in_cache = coins_view_cache.HaveCoinInCache(random_out_point);
Coin coin_using_get_coin;
const bool exists_using_get_coin = coins_view_cache.GetCoin(random_out_point, coin_using_get_coin);
const bool exists_using_get_coin = coins_view_cache.GetCoin(random_out_point, coin_using_get_coin).has_value();
if (exists_using_get_coin) {
assert(coin_using_get_coin == coin_using_access_coin);
}