Skip to content

Commit a91b6cf

Browse files
mikemaccanaclaude
andcommitted
Use connection.createWallet() instead of loading keypair from file
Replace loadWalletFromFile() with connection.createWallet() which creates and funds a wallet automatically, eliminating the need for a pre-existing keypair file in the test environment. Also remove the unused 'os' import and the keypair generation step from GitHub Actions workflow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent de695af commit a91b6cf

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ jobs:
3535
3636
- run: solana --version
3737

38-
- name: Generate Solana keypair
39-
run: |
40-
mkdir -p ~/.config/solana
41-
solana-keygen new --no-bip39-passphrase --silent --outfile ~/.config/solana/id.json
42-
4338
- run: npm i
4439

4540
- run: npm test

tests/election.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
deserializeLE,
2323
buildFinalizeCompDefInstruction,
2424
} from "./arcium-solana-kit/helpers.js";
25-
import * as os from "os";
2625
import { describe, test, before } from "node:test";
2726
import assert from "node:assert";
2827
import {
@@ -77,9 +76,7 @@ describe("Election", () => {
7776
// Initialize Solana Kit connection
7877
connection = connect("localnet");
7978

80-
pollAuthority = await connection.loadWalletFromFile(
81-
`${os.homedir()}/.config/solana/id.json`
82-
);
79+
pollAuthority = await connection.createWallet();
8380

8481
// Computation definitions are persistent onchain PDAs that register encrypted instruction handlers
8582
// (like "vote", "create_poll", "reveal_result"). They must be initialized ONCE per

0 commit comments

Comments
 (0)