Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi committed Aug 8, 2023
1 parent d8156ad commit 1d3c7bf
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions test/core/accounts/AccountsStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,36 +89,20 @@ describe("AccountsStrategy", function () {
admin = proxyAdmin;
user = apTeam1;

gasFwd = await smock.fake<GasFwd>(new GasFwd__factory());
gasService = await smock.fake<IAxelarGasService>(IAxelarGasService__factory.createInterface());
gateway = await smock.fake<IAxelarGateway>(IAxelarGateway__factory.createInterface());
registrar = await smock.fake<Registrar>(new Registrar__factory());
router = await smock.fake<Router>(new Router__factory());
token = await smock.fake<IERC20>(IERC20__factory.createInterface());
vault = await smock.fake<IVault>(IVault__factory.createInterface());

const Facet = new AccountsStrategy__factory(owner);
facetImpl = await Facet.deploy();

gateway.tokenAddresses.returns(token.address);

netInfoThis = {
...DEFAULT_NETWORK_INFO,
chainId: await getChainId(hre),
axelarGateway: gateway.address,
gasReceiver: gasService.address,
router: router.address,
};
netInfoThat = {
...DEFAULT_NETWORK_INFO,
chainId: 42,
router: genWallet().address,
};
registrar.queryNetworkConnection.whenCalledWith(NET_NAME_THIS).returns(netInfoThis);
registrar.queryNetworkConnection.whenCalledWith(NET_NAME_THAT).returns(netInfoThat);
});

beforeEach(async function () {
gasFwd = await smock.fake<GasFwd>(new GasFwd__factory());
registrar = await smock.fake<Registrar>(new Registrar__factory());
router = await smock.fake<Router>(new Router__factory());
token = await smock.fake<IERC20>(IERC20__factory.createInterface());

state = await deployFacetAsProxy(hre, owner, admin, facetImpl.address);
facet = AccountsStrategy__factory.connect(state.address, owner);

Expand All @@ -136,7 +120,24 @@ describe("AccountsStrategy", function () {
INITIAL_LIQ_BAL
);

netInfoThis = {
...DEFAULT_NETWORK_INFO,
chainId: await getChainId(hre),
axelarGateway: gateway.address,
gasReceiver: gasService.address,
router: router.address,
};
netInfoThat = {
...DEFAULT_NETWORK_INFO,
chainId: 42,
router: genWallet().address,
};
registrar.queryNetworkConnection.whenCalledWith(NET_NAME_THIS).returns(netInfoThis);
registrar.queryNetworkConnection.whenCalledWith(NET_NAME_THAT).returns(netInfoThat);

registrar.isTokenAccepted.returns(true);

gateway.tokenAddresses.returns(token.address);
});

describe("upon strategyInvest", async function () {
Expand Down

0 comments on commit 1d3c7bf

Please sign in to comment.