Skip to content

Commit

Permalink
Properly construct uint64 objects for LineageProof amounts in WalletS…
Browse files Browse the repository at this point in the history
…ingletonStore's add_spend.
  • Loading branch information
AmineKhaldi committed Mar 20, 2024
1 parent 1cee7f1 commit 6ca3406
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chia/wallet/wallet_singleton_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from chia.types.condition_opcodes import ConditionOpcode
from chia.util.condition_tools import conditions_dict_for_solution
from chia.util.db_wrapper import DBWrapper2, execute_fetchone
from chia.util.ints import uint32
from chia.util.ints import uint32, uint64
from chia.wallet import singleton
from chia.wallet.lineage_proof import LineageProof
from chia.wallet.singleton import get_inner_puzzle_from_singleton, get_singleton_id_from_puzzle
Expand Down Expand Up @@ -111,10 +111,10 @@ async def add_spend(

lineage_bytes = [x.as_atom() for x in coin_state.solution.to_program().first().as_iter()]
if len(lineage_bytes) == 2:
lineage_proof = LineageProof(bytes32(lineage_bytes[0]), None, int_from_bytes(lineage_bytes[1]))
lineage_proof = LineageProof(bytes32(lineage_bytes[0]), None, uint64(int_from_bytes(lineage_bytes[1])))
else:
lineage_proof = LineageProof(
bytes32(lineage_bytes[0]), bytes32(lineage_bytes[1]), int_from_bytes(lineage_bytes[2])
bytes32(lineage_bytes[0]), bytes32(lineage_bytes[1]), uint64(int_from_bytes(lineage_bytes[2]))
)
# Create and save the new singleton record
new_record = SingletonRecord(
Expand Down

0 comments on commit 6ca3406

Please sign in to comment.