dsa-connectors/scripts/tests/impersonate.ts

15 lines
355 B
TypeScript
Raw Normal View History

2021-11-28 19:04:32 +00:00
import { ethers, network } from "hardhat";
2021-11-28 19:04:32 +00:00
export const impersonateAccounts = async (accounts: any) => {
const signers = [];
for (const account of accounts) {
await network.provider.request({
method: "hardhat_impersonateAccount",
params: [account],
});
signers.push(await ethers.getSigner(account));
}
return signers;
};