@@ -579,7 +579,6 @@ def make_bundle_spends_map_and_fee(
579
579
bundle_coin_spends [coin_id ] = BundleCoinSpend (
580
580
coin_spend = coin_spend ,
581
581
eligible_for_dedup = bool (spend_conds .flags & ELIGIBLE_FOR_DEDUP ),
582
- eligible_for_fast_forward = bool (spend_conds .flags & ELIGIBLE_FOR_FF ),
583
582
additions = additions ,
584
583
cost = uint64 (spend_conds .condition_cost + spend_conds .execution_cost ),
585
584
latest_singleton_lineage = UnspentLineageInfo (coin_id , coin_spend .coin .parent_coin_info , bytes32 ([0 ] * 32 ))
@@ -890,9 +889,13 @@ def mk_bcs(coin_spend: CoinSpend, flags: int = 0) -> BundleCoinSpend:
890
889
return BundleCoinSpend (
891
890
coin_spend = coin_spend ,
892
891
eligible_for_dedup = bool (flags & ELIGIBLE_FOR_DEDUP ),
893
- eligible_for_fast_forward = bool (flags & ELIGIBLE_FOR_FF ),
894
892
additions = [],
895
893
cost = uint64 (0 ),
894
+ latest_singleton_lineage = UnspentLineageInfo (
895
+ coin_spend .coin .name (), coin_spend .coin .parent_coin_info , bytes32 ([0 ] * 32 )
896
+ )
897
+ if flags & ELIGIBLE_FOR_FF
898
+ else None ,
896
899
)
897
900
898
901
@@ -1119,8 +1122,7 @@ def make_test_coins() -> list[Coin]:
1119
1122
],
1120
1123
)
1121
1124
def test_can_replace (existing_items : list [MempoolItem ], new_item : MempoolItem , expected : bool ) -> None :
1122
- removals = {c .name () for c in new_item .spend_bundle .removals ()}
1123
- assert can_replace (existing_items , removals , new_item ) == expected
1125
+ assert can_replace (existing_items , new_item ) == expected
1124
1126
1125
1127
1126
1128
@pytest .mark .anyio
@@ -1802,16 +1804,16 @@ async def test_bundle_coin_spends() -> None:
1802
1804
assert mi123e .bundle_coin_spends [coins [i ].name ()] == BundleCoinSpend (
1803
1805
coin_spend = sb123 .coin_spends [i ],
1804
1806
eligible_for_dedup = False ,
1805
- eligible_for_fast_forward = False ,
1806
1807
additions = [Coin (coins [i ].name (), IDENTITY_PUZZLE_HASH , coins [i ].amount )],
1807
1808
cost = uint64 (ConditionCost .CREATE_COIN .value + ConditionCost .AGG_SIG .value + execution_cost ),
1809
+ latest_singleton_lineage = None ,
1808
1810
)
1809
1811
assert mi123e .bundle_coin_spends [coins [3 ].name ()] == BundleCoinSpend (
1810
1812
coin_spend = eligible_sb .coin_spends [0 ],
1811
1813
eligible_for_dedup = True ,
1812
- eligible_for_fast_forward = False ,
1813
1814
additions = [Coin (coins [3 ].name (), IDENTITY_PUZZLE_HASH , coins [3 ].amount )],
1814
1815
cost = uint64 (ConditionCost .CREATE_COIN .value + execution_cost ),
1816
+ latest_singleton_lineage = None ,
1815
1817
)
1816
1818
1817
1819
@@ -2463,7 +2465,7 @@ async def test_new_peak_ff_eviction(
2463
2465
item = mempool_manager .get_mempool_item (bundle .name ())
2464
2466
assert item is not None
2465
2467
singleton_name = singleton_spend .coin .name ()
2466
- assert item .bundle_coin_spends [singleton_name ].eligible_for_fast_forward
2468
+ assert item .bundle_coin_spends [singleton_name ].supports_fast_forward
2467
2469
latest_singleton_lineage = item .bundle_coin_spends [singleton_name ].latest_singleton_lineage
2468
2470
assert latest_singleton_lineage is not None
2469
2471
assert latest_singleton_lineage .coin_id == singleton_name
@@ -2495,7 +2497,7 @@ async def test_new_peak_ff_eviction(
2495
2497
else :
2496
2498
item = mempool_manager .get_mempool_item (bundle .name ())
2497
2499
assert item is not None
2498
- assert item .bundle_coin_spends [singleton_spend .coin .name ()].eligible_for_fast_forward
2500
+ assert item .bundle_coin_spends [singleton_spend .coin .name ()].supports_fast_forward
2499
2501
latest_singleton_lineage = item .bundle_coin_spends [singleton_spend .coin .name ()].latest_singleton_lineage
2500
2502
assert latest_singleton_lineage is not None
2501
2503
assert latest_singleton_lineage .coin_id == singleton_spend .coin .name ()
@@ -2552,9 +2554,9 @@ async def test_multiple_ff(use_optimization: bool) -> None:
2552
2554
2553
2555
item = mempool_manager .get_mempool_item (bundle .name ())
2554
2556
assert item is not None
2555
- assert item .bundle_coin_spends [singleton_spend1 .coin .name ()].eligible_for_fast_forward
2556
- assert item .bundle_coin_spends [singleton_spend2 .coin .name ()].eligible_for_fast_forward
2557
- assert not item .bundle_coin_spends [coin_spend .coin .name ()].eligible_for_fast_forward
2557
+ assert item .bundle_coin_spends [singleton_spend1 .coin .name ()].supports_fast_forward
2558
+ assert item .bundle_coin_spends [singleton_spend2 .coin .name ()].supports_fast_forward
2559
+ assert not item .bundle_coin_spends [coin_spend .coin .name ()].supports_fast_forward
2558
2560
2559
2561
# spend the singleton coin2 and make coin3 the latest version
2560
2562
coins .update_lineage (singleton_ph , singleton_spend3 .coin )
@@ -2616,7 +2618,7 @@ async def test_advancing_ff(use_optimization: bool) -> None:
2616
2618
item = mempool_manager .get_mempool_item (bundle .name ())
2617
2619
assert item is not None
2618
2620
spend = item .bundle_coin_spends [spend_a .coin .name ()]
2619
- assert spend .eligible_for_fast_forward
2621
+ assert spend .supports_fast_forward
2620
2622
assert spend .latest_singleton_lineage is not None
2621
2623
assert spend .latest_singleton_lineage .coin_id == spend_a .coin .name ()
2622
2624
@@ -2628,7 +2630,7 @@ async def test_advancing_ff(use_optimization: bool) -> None:
2628
2630
item = mempool_manager .get_mempool_item (bundle .name ())
2629
2631
assert item is not None
2630
2632
spend = item .bundle_coin_spends [spend_a .coin .name ()]
2631
- assert spend .eligible_for_fast_forward
2633
+ assert spend .supports_fast_forward
2632
2634
assert spend .latest_singleton_lineage is not None
2633
2635
assert spend .latest_singleton_lineage .coin_id == spend_b .coin .name ()
2634
2636
@@ -2640,7 +2642,7 @@ async def test_advancing_ff(use_optimization: bool) -> None:
2640
2642
item = mempool_manager .get_mempool_item (bundle .name ())
2641
2643
assert item is not None
2642
2644
spend = item .bundle_coin_spends [spend_a .coin .name ()]
2643
- assert spend .eligible_for_fast_forward
2645
+ assert spend .supports_fast_forward
2644
2646
assert spend .latest_singleton_lineage is not None
2645
2647
assert spend .latest_singleton_lineage .coin_id == spend_c .coin .name ()
2646
2648
0 commit comments