|
23 | 23 | ConditionValidTimes, |
24 | 24 | CreateCoin, |
25 | 25 | CreateCoinAnnouncement, |
26 | | - parse_timelock_info, |
27 | 26 | ) |
28 | 27 | from chia.wallet.derivation_record import DerivationRecord |
29 | 28 | from chia.wallet.did_wallet import did_wallet_puzzles |
|
44 | 43 | ) |
45 | 44 | from chia.wallet.transaction_record import TransactionRecord |
46 | 45 | from chia.wallet.uncurried_puzzle import uncurry_puzzle |
47 | | -from chia.wallet.util.compute_memos import compute_memos |
48 | 46 | from chia.wallet.util.curry_and_treehash import NIL_TREEHASH, shatree_int, shatree_pair |
49 | 47 | from chia.wallet.util.transaction_type import TransactionType |
50 | 48 | from chia.wallet.util.tx_config import DEFAULT_TX_CONFIG |
@@ -647,25 +645,16 @@ async def create_update_spend( |
647 | 645 | extra_conditions=(AssertCoinAnnouncement(asserted_id=coin_name, asserted_msg=coin_name),), |
648 | 646 | ) |
649 | 647 | to_ph = await action_scope.get_puzzle_hash(self.wallet_state_manager, override_reuse_puzhash_with=True) |
650 | | - did_record = TransactionRecord( |
651 | | - confirmed_at_height=uint32(0), |
652 | | - created_at_time=uint64(time.time()), |
653 | | - to_puzzle_hash=to_ph, |
654 | | - to_address=self.wallet_state_manager.encode_puzzle_hash(to_ph), |
| 648 | + did_record = self.wallet_state_manager.new_outgoing_transaction( |
| 649 | + wallet_id=self.id(), |
| 650 | + puzzle_hash=to_ph, |
655 | 651 | amount=uint64(coin.amount), |
656 | | - fee_amount=uint64(0), |
657 | | - confirmed=False, |
658 | | - sent=uint32(0), |
| 652 | + fee=uint64(0), |
659 | 653 | spend_bundle=spend_bundle, |
660 | 654 | additions=spend_bundle.additions(), |
661 | 655 | removals=spend_bundle.removals(), |
662 | | - wallet_id=self.wallet_info.id, |
663 | | - sent_to=[], |
664 | | - trade_id=None, |
665 | | - type=uint32(TransactionType.OUTGOING_TX.value), |
666 | | - name=bytes32.secret(), |
667 | | - memos=compute_memos(spend_bundle), |
668 | | - valid_times=parse_timelock_info(extra_conditions), |
| 656 | + name=spend_bundle.name(), |
| 657 | + extra_conditions=extra_conditions, |
669 | 658 | ) |
670 | 659 |
|
671 | 660 | async with action_scope.use() as interface: |
@@ -733,25 +722,16 @@ async def transfer_did( |
733 | 722 | extra_conditions=(AssertCoinAnnouncement(asserted_id=coin_name, asserted_msg=coin_name),), |
734 | 723 | ) |
735 | 724 | to_ph = await action_scope.get_puzzle_hash(self.wallet_state_manager, override_reuse_puzhash_with=True) |
736 | | - did_record = TransactionRecord( |
737 | | - confirmed_at_height=uint32(0), |
738 | | - created_at_time=uint64(time.time()), |
739 | | - to_puzzle_hash=to_ph, |
740 | | - to_address=self.wallet_state_manager.encode_puzzle_hash(to_ph), |
| 725 | + did_record = self.wallet_state_manager.new_outgoing_transaction( |
| 726 | + wallet_id=self.id(), |
| 727 | + puzzle_hash=to_ph, |
741 | 728 | amount=uint64(coin.amount), |
742 | | - fee_amount=fee, |
743 | | - confirmed=False, |
744 | | - sent=uint32(0), |
| 729 | + fee=fee, |
745 | 730 | spend_bundle=spend_bundle, |
746 | 731 | additions=spend_bundle.additions(), |
747 | 732 | removals=spend_bundle.removals(), |
748 | | - wallet_id=self.wallet_info.id, |
749 | | - sent_to=[], |
750 | | - trade_id=None, |
751 | | - type=uint32(TransactionType.OUTGOING_TX.value), |
752 | 733 | name=spend_bundle.name(), |
753 | | - memos=compute_memos(spend_bundle), |
754 | | - valid_times=parse_timelock_info(extra_conditions), |
| 734 | + extra_conditions=extra_conditions, |
755 | 735 | ) |
756 | 736 |
|
757 | 737 | async with action_scope.use() as interface: |
@@ -813,25 +793,16 @@ async def create_message_spend( |
813 | 793 | ) |
814 | 794 | list_of_coinspends = [make_spend(coin, full_puzzle, fullsol)] |
815 | 795 | unsigned_spend_bundle = WalletSpendBundle(list_of_coinspends, G2Element()) |
816 | | - tx = TransactionRecord( |
817 | | - confirmed_at_height=uint32(0), |
818 | | - created_at_time=uint64(time.time()), |
819 | | - to_puzzle_hash=p2_ph, |
820 | | - to_address=self.wallet_state_manager.encode_puzzle_hash(p2_ph), |
| 796 | + tx = self.wallet_state_manager.new_outgoing_transaction( |
| 797 | + wallet_id=self.id(), |
| 798 | + puzzle_hash=p2_ph, |
821 | 799 | amount=uint64(coin.amount), |
822 | | - fee_amount=uint64(0), |
823 | | - confirmed=False, |
824 | | - sent=uint32(0), |
| 800 | + fee=uint64(0), |
825 | 801 | spend_bundle=unsigned_spend_bundle, |
826 | 802 | additions=unsigned_spend_bundle.additions(), |
827 | 803 | removals=[coin], |
828 | | - wallet_id=self.id(), |
829 | | - sent_to=[], |
830 | | - trade_id=None, |
831 | | - type=uint32(TransactionType.OUTGOING_TX.value), |
832 | 804 | name=unsigned_spend_bundle.name(), |
833 | | - memos=compute_memos(unsigned_spend_bundle), |
834 | | - valid_times=parse_timelock_info(extra_conditions), |
| 805 | + extra_conditions=extra_conditions, |
835 | 806 | ) |
836 | 807 | async with action_scope.use() as interface: |
837 | 808 | interface.side_effects.transactions.append(tx) |
|
0 commit comments