Skip to content

Commit 65e67d5

Browse files
committed
Add required signers to fake witness set
This will make fee estimate more accurate.
1 parent 22b529e commit 65e67d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pycardano/txbuilder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,9 @@ def _pack_tokens_for_change(
629629
# items at the beginning of next policy to previous policy MultiAssets
630630
return multi_asset_arr
631631

632+
def _required_signer_vkey_hashes(self) -> Set[VerificationKeyHash]:
633+
return set(self.required_signers) if self.required_signers else set()
634+
632635
def _input_vkey_hashes(self) -> Set[VerificationKeyHash]:
633636
results = set()
634637
for i in self.inputs + self.collaterals:
@@ -747,6 +750,7 @@ def _build_tx_body(self) -> TransactionBody:
747750

748751
def _build_fake_vkey_witnesses(self) -> List[VerificationKeyWitness]:
749752
vkey_hashes = self._input_vkey_hashes()
753+
vkey_hashes.update(self._required_signer_vkey_hashes())
750754
vkey_hashes.update(self._native_scripts_vkey_hashes())
751755
vkey_hashes.update(self._certificate_vkey_hashes())
752756
vkey_hashes.update(self._withdrawal_vkey_hashes())

0 commit comments

Comments
 (0)