ts: Use env variable for local wallet (#718)
This commit is contained in:
parent
2ff6ae09a2
commit
bf5cf80c11
|
@ -1355,6 +1355,7 @@ fn test(
|
|||
std::process::Command::new(program)
|
||||
.args(args)
|
||||
.env("ANCHOR_PROVIDER_URL", cfg.provider.cluster.url())
|
||||
.env("ANCHOR_WALLET", cfg.provider.wallet.to_string())
|
||||
.stdout(Stdio::inherit())
|
||||
.stderr(Stdio::inherit())
|
||||
.output()
|
||||
|
|
|
@ -230,11 +230,12 @@ export class NodeWallet implements Wallet {
|
|||
constructor(readonly payer: Keypair) {}
|
||||
|
||||
static local(): NodeWallet {
|
||||
const process = require("process");
|
||||
const payer = Keypair.fromSecretKey(
|
||||
Buffer.from(
|
||||
JSON.parse(
|
||||
require("fs").readFileSync(
|
||||
require("os").homedir() + "/.config/solana/id.json",
|
||||
process.env.ANCHOR_WALLET,
|
||||
{
|
||||
encoding: "utf-8",
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue