Skip to content

Commit

Permalink
For multiKey simulation - use signature of same type (#645)
Browse files Browse the repository at this point in the history
* For multi simulation use signature of same type

* update CL
  • Loading branch information
heliuchuan authored Feb 21, 2025
1 parent 6621bec commit 7bb7939
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to the Aptos TypeScript SDK will be captured in this file. T

# Unreleased

- Update simulation for MultiKeyAccount to use signatures of the same type as the corresponding public key.
- Add `truncateAddress` helper function to truncate an address at the middle with an ellipsis.

# 1.35.0 (2025-02-11)
Expand Down
7 changes: 6 additions & 1 deletion src/transactions/transactionBuilder/transactionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,12 @@ export function getAuthenticatorForSimulation(publicKey?: PublicKey) {
return new AccountAuthenticatorMultiKey(
accountPublicKey,
new MultiKeySignature({
signatures: accountPublicKey.publicKeys.map(() => new AnySignature(invalidSignature)),
signatures: accountPublicKey.publicKeys.map((pubKey) => {
if (KeylessPublicKey.isInstance(pubKey.publicKey) || FederatedKeylessPublicKey.isInstance(pubKey.publicKey)) {
return new AnySignature(KeylessSignature.getSimulationSignature());
}
return new AnySignature(invalidSignature);
}),
bitmap: accountPublicKey.createBitmap({
bits: Array(accountPublicKey.publicKeys.length)
.fill(0)
Expand Down

0 comments on commit 7bb7939

Please sign in to comment.