Skip to content

Commit

Permalink
fix multisign so tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadari committed Oct 10, 2024
1 parent 2443f4c commit 3fa2294
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions xrpl/asyncio/transaction/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def sign(
Returns:
The signed transaction blob.
"""
transaction_json = _prepare_transaction(transaction, wallet)
transaction_json = _prepare_transaction(transaction)
if multisign:
signature = keypairs_sign(
bytes.fromhex(
Expand All @@ -108,6 +108,7 @@ def sign(
]
return Transaction.from_dict(tx_dict)

transaction_json["SigningPubKey"] = wallet.public_key
serialized_for_signing = encode_for_signing(transaction_json)
serialized_bytes = bytes.fromhex(serialized_for_signing)
signature = keypairs_sign(serialized_bytes, wallet.private_key)
Expand Down Expand Up @@ -176,10 +177,7 @@ async def submit(
raise XRPLRequestFailureException(response.result)


def _prepare_transaction(
transaction: Transaction,
wallet: Wallet,
) -> Dict[str, Any]:
def _prepare_transaction(transaction: Transaction) -> Dict[str, Any]:
"""
Prepares a Transaction by converting it to a JSON-like dictionary, converting the
field names to CamelCase. If a Client is provided, then it also autofills any
Expand All @@ -201,7 +199,6 @@ def _prepare_transaction(
raise XRPLException("Cannot directly sign a batch inner transaction.")

transaction_json = transaction.to_xrpl()
transaction_json["SigningPubKey"] = wallet.public_key

_validate_account_xaddress(transaction_json, "Account", "SourceTag")
if "Destination" in transaction_json:
Expand Down

0 comments on commit 3fa2294

Please sign in to comment.