mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-28 11:38:38 +03:00
parent
6d1898ce12
commit
d317b47575
@ -1123,27 +1123,20 @@ class DIDWallet:
|
|||||||
async def get_new_p2_inner_puzzle(self) -> Program:
|
async def get_new_p2_inner_puzzle(self) -> Program:
|
||||||
return await self.standard_wallet.get_new_puzzle()
|
return await self.standard_wallet.get_new_puzzle()
|
||||||
|
|
||||||
async def get_new_did_innerpuz(self, origin_id=None) -> Program:
|
async def get_new_did_innerpuz(self, origin_id: Optional[bytes32] = None) -> Program:
|
||||||
if self.did_info.origin_coin is not None:
|
if self.did_info.origin_coin is not None:
|
||||||
innerpuz = did_wallet_puzzles.create_innerpuz(
|
launcher_id = self.did_info.origin_coin.name()
|
||||||
p2_puzzle_or_hash=await self.get_new_p2_inner_puzzle(),
|
|
||||||
recovery_list=self.did_info.backup_ids,
|
|
||||||
num_of_backup_ids_needed=uint64(self.did_info.num_of_backup_ids_needed),
|
|
||||||
launcher_id=self.did_info.origin_coin.name(),
|
|
||||||
metadata=did_wallet_puzzles.metadata_to_program(json.loads(self.did_info.metadata)),
|
|
||||||
)
|
|
||||||
elif origin_id is not None:
|
elif origin_id is not None:
|
||||||
innerpuz = did_wallet_puzzles.create_innerpuz(
|
launcher_id = origin_id
|
||||||
p2_puzzle_or_hash=await self.get_new_p2_inner_puzzle(),
|
|
||||||
recovery_list=self.did_info.backup_ids,
|
|
||||||
num_of_backup_ids_needed=uint64(self.did_info.num_of_backup_ids_needed),
|
|
||||||
launcher_id=origin_id,
|
|
||||||
metadata=did_wallet_puzzles.metadata_to_program(json.loads(self.did_info.metadata)),
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
raise ValueError("must have origin coin")
|
raise ValueError("must have origin coin")
|
||||||
|
return did_wallet_puzzles.create_innerpuz(
|
||||||
return innerpuz
|
p2_puzzle_or_hash=await self.get_new_p2_inner_puzzle(),
|
||||||
|
recovery_list=self.did_info.backup_ids,
|
||||||
|
num_of_backup_ids_needed=self.did_info.num_of_backup_ids_needed,
|
||||||
|
launcher_id=launcher_id,
|
||||||
|
metadata=did_wallet_puzzles.metadata_to_program(json.loads(self.did_info.metadata)),
|
||||||
|
)
|
||||||
|
|
||||||
async def get_new_did_inner_hash(self) -> bytes32:
|
async def get_new_did_inner_hash(self) -> bytes32:
|
||||||
innerpuz = await self.get_new_did_innerpuz()
|
innerpuz = await self.get_new_did_innerpuz()
|
||||||
|
Loading…
Reference in New Issue
Block a user