Skip to content

Commit

Permalink
Fix keyless transaction simulation (#419)
Browse files Browse the repository at this point in the history
* Fix keyless txn simulation

* add changlog statement
  • Loading branch information
heliuchuan authored Jun 5, 2024
1 parent b6abcf4 commit 6763145
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to the Aptos TypeScript SDK will be captured in this file. T

# Unreleased

- [`Fix`] Keyless transaction simulation now reports gas correctly

# 1.18.0 (2024-06-03)

- Adds Keyless Account support
Expand Down
5 changes: 2 additions & 3 deletions src/transactions/transactionBuilder/transactionBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
AnyPublicKey,
AnySignature,
KeylessPublicKey,
KeylessSignature,
Secp256k1PublicKey,
Secp256k1Signature,
} from "../../core/crypto";
Expand Down Expand Up @@ -465,9 +466,7 @@ export function getAuthenticatorForSimulation(publicKey: PublicKey) {
return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Secp256k1Signature(new Uint8Array(64))));
}
if (publicKey.publicKey instanceof KeylessPublicKey) {
// TODO: Replace with the line below one simulation works properly for Keyless
// return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(KeylessSignature.getSimulationSignature()));
return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(new Ed25519Signature(new Uint8Array(64))));
return new AccountAuthenticatorSingleKey(publicKey, new AnySignature(KeylessSignature.getSimulationSignature()));
}
}

Expand Down

0 comments on commit 6763145

Please sign in to comment.