Skip to content

Commit 48e8926

Browse files
committed
Fix LUT account address loading for CI
Read MXE LUT account address from artifacts/mxe_lut_acc.json at runtime instead of hardcoding it. This ensures the correct address is used across different environments (local vs CI) where genesis accounts are regenerated with different addresses. Fixes "Invalid account owner" error in GitHub Actions CI.
1 parent bc5f583 commit 48e8926

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/arcium-solana-kit/helpers.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,21 @@ export const getMXELutAccountAddress = async (
105105
): Promise<Address> => {
106106
// The LUT account address is loaded from artifacts/mxe_lut_acc.json as a genesis account
107107
// It's owned by the AddressLookupTable program, not derived as a PDA
108-
return "7tYnP9JHWdZhsC1vPWpMiVCGu6StRFJJvLuN71GUFYYe" as Address;
108+
// We read it from the artifact file since it changes between environments
109+
const artifactPath = join(currentDir, "..", "..", "artifacts", "mxe_lut_acc.json");
110+
111+
try {
112+
const artifactContent = await readFile(artifactPath, "utf-8");
113+
const artifact = JSON.parse(artifactContent);
114+
return artifact.pubkey as Address;
115+
} catch (error) {
116+
// If the artifact file doesn't exist yet, throw an error with a helpful message
117+
throw new Error(
118+
`Failed to read MXE LUT account from ${artifactPath}. ` +
119+
`Ensure Arcium nodes have been initialized and genesis accounts created. ` +
120+
`Original error: ${error instanceof Error ? error.message : String(error)}`
121+
);
122+
}
109123
};
110124

111125
/**

0 commit comments

Comments
 (0)