Skip to content

Commit e41dd9a

Browse files
committedOct 18, 2023
ed25519 auth key doesnt work
1 parent e9633c9 commit e41dd9a

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed
 

‎src/core/authentication_key.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,7 @@ export class AuthenticationKey {
5959

6060
// TODO - check for single key or multi key
6161
if (scheme === SigningScheme.SingleKey) {
62-
let newBytes: Uint8Array = new Uint8Array();
63-
if (publicKey instanceof AnyPublicKey) {
64-
newBytes = publicKey.bcsToBytes();
65-
} else {
66-
newBytes = new AnyPublicKey(publicKey).bcsToBytes();
67-
}
68-
62+
let newBytes = publicKey.bcsToBytes();
6963
const authKeyBytes = new Uint8Array([...newBytes, scheme]);
7064
console.log("authKeyBytes", authKeyBytes);
7165
const hash = sha3Hash.create();

‎src/internal/faucet.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ export async function fundAccount(args: {
3535

3636
const txnHash = data.txn_hashes[0];
3737

38-
await waitForTransaction({ aptosConfig, transactionHash: txnHash, options: { timeoutSecs } });
38+
await waitForTransaction({
39+
aptosConfig,
40+
transactionHash: txnHash,
41+
options: { timeoutSecs, indexerVersionCheck: false },
42+
});
3943

4044
return txnHash;
4145
}

‎tests/e2e/transaction/transaction_submission.test.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ describe("transaction submission", () => {
9797
await waitForTransaction({ aptosConfig: config, transactionHash: response.hash });
9898
});
9999
test.only("it submits an entry function transaction Secp256k1", async () => {
100-
const config = new AptosConfig({ network: Network.DEVNET });
100+
const config = new AptosConfig({ network: Network.LOCAL });
101101
const aptos = new Aptos(config);
102-
const alice = Account.fromPrivateKey(new Secp256k1PrivateKey(secp256k1TestObject.privateKey), false);
103-
//await aptos.fundAccount({ accountAddress: alice.accountAddress.toString(), amount: FUND_AMOUNT });
102+
const alice = Account.generate();
103+
await aptos.fundAccount({ accountAddress: alice.accountAddress.toString(), amount: FUND_AMOUNT });
104104
const bob = Account.generate();
105105
const rawTxn = await aptos.generateTransaction({
106106
sender: alice.accountAddress.toString(),
@@ -119,6 +119,7 @@ describe("transaction submission", () => {
119119
senderAuthenticator: authenticator,
120120
});
121121
console.log(response.hash);
122+
// console.log(response.hash);
122123
// await waitForTransaction({
123124
// aptosConfig: config,
124125
// transactionHash: response.hash,

0 commit comments

Comments
 (0)