File tree Expand file tree Collapse file tree 6 files changed +18
-98
lines changed Expand file tree Collapse file tree 6 files changed +18
-98
lines changed Original file line number Diff line number Diff line change 10
10
from chia_rs .sized_ints import uint32 , uint64
11
11
12
12
from chia ._tests .util .get_name_puzzle_conditions import get_name_puzzle_conditions
13
- from chia . consensus . check_time_locks import check_time_locks
13
+ from chia_rs import check_time_locks
14
14
from chia .consensus .cost_calculator import NPCResult
15
15
from chia .full_node .bundle_tools import simple_solution_generator
16
16
from chia .types .blockchain_format .coin import Coin
Original file line number Diff line number Diff line change 27
27
from chia ._tests .conftest import ConsensusMode
28
28
from chia ._tests .util .misc import Marks , datacases , invariant_check_mempool
29
29
from chia ._tests .util .setup_nodes import OldSimulatorsAndWallets , setup_simulators_and_wallets
30
- from chia . consensus . check_time_locks import check_time_locks
30
+ from chia_rs import check_time_locks
31
31
from chia .consensus .condition_costs import ConditionCost
32
32
from chia .consensus .default_constants import DEFAULT_CONSTANTS
33
33
from chia .full_node .eligible_coin_spends import (
Original file line number Diff line number Diff line change 21
21
22
22
from chia .consensus .block_rewards import calculate_base_farmer_reward , calculate_pool_reward
23
23
from chia .consensus .blockchain_interface import BlockRecordsProtocol
24
- from chia . consensus . check_time_locks import check_time_locks
24
+ from chia_rs import check_time_locks
25
25
from chia .consensus .coinbase import create_farmer_coin , create_pool_coin
26
26
from chia .types .blockchain_format .coin import Coin , hash_coin_ids
27
27
from chia .types .coin_record import CoinRecord
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 25
25
from chiabip158 import PyBIP158
26
26
27
27
from chia .consensus .block_record import BlockRecordProtocol
28
- from chia . consensus . check_time_locks import check_time_locks
28
+ from chia_rs import check_time_locks
29
29
from chia .consensus .cost_calculator import NPCResult
30
30
from chia .full_node .bitcoin_fee_estimator import create_bitcoin_fee_estimator
31
31
from chia .full_node .fee_estimation import FeeBlockInfo , MempoolInfo , MempoolItemInfo
@@ -719,12 +719,18 @@ async def validate_spend_bundle(
719
719
# point-of-view of the next block to be farmed. Therefore we pass in the
720
720
# current peak's height and timestamp
721
721
assert self .peak .timestamp is not None
722
- tl_error : Optional [Err ] = check_time_locks (
723
- removal_record_dict ,
724
- conds ,
725
- self .peak .height ,
726
- self .peak .timestamp ,
727
- )
722
+ try :
723
+ tl_error : Optional [Err ] = check_time_locks (
724
+ removal_record_dict ,
725
+ conds ,
726
+ self .peak .height ,
727
+ self .peak .timestamp ,
728
+ )
729
+ except Exception as e :
730
+ breakpoint ()
731
+
732
+ if tl_error is not None :
733
+ breakpoint ()
728
734
729
735
timelocks : TimelockConditions = compute_assert_height (removal_record_dict , conds )
730
736
Original file line number Diff line number Diff line change 10
10
from chia .types .blockchain_format .coin import Coin
11
11
from chia .util .streamable import Streamable , streamable
12
12
13
+ from chia_rs import CoinRecord as RustCoinRecord
13
14
14
- @streamable
15
- @dataclass (frozen = True )
16
- class CoinRecord (Streamable ):
17
- """
18
- These are values that correspond to a CoinName that are used
19
- in keeping track of the unspent database.
20
- """
21
-
22
- coin : Coin
23
- confirmed_block_index : uint32
24
- spent_block_index : uint32
25
- coinbase : bool
26
- timestamp : uint64 # Timestamp of the block at height confirmed_block_index
27
-
28
- @property
29
- def spent (self ) -> bool :
30
- return self .spent_block_index > 0
31
-
32
- @property
33
- def name (self ) -> bytes32 :
34
- return self .coin .name ()
35
-
36
- @property
37
- def coin_state (self ) -> CoinState :
38
- spent_h = None
39
- if self .spent :
40
- spent_h = self .spent_block_index
41
- confirmed_height : Optional [uint32 ] = self .confirmed_block_index
42
- if self .confirmed_block_index == 0 and self .timestamp == 0 :
43
- confirmed_height = None
44
- return CoinState (self .coin , spent_h , confirmed_height )
15
+ CoinRecord = RustCoinRecord
You can’t perform that action at this time.
0 commit comments