Skip to content

Commit

Permalink
Stabilize forked tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lastperson committed Sep 11, 2024
1 parent 37d6af8 commit b3b5afb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 32 deletions.
34 changes: 16 additions & 18 deletions testUnderForked/collectFeeERC20EVM.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,22 @@ contract("TwapNativeTokenFeeHandler - [collectFee]", async (accounts) => {
await DynamicFeeHandlerInstance.setWrapTokenAddress(destinationDomainID, MATIC_ADDRESS);
await DynamicFeeHandlerInstance.setFeeProperties(gasUsed);

await Promise.all([
BridgeInstance.adminSetResource(
ERC20HandlerInstance.address,
resourceID,
ERC20MintableInstance.address,
emptySetResourceData
),
ERC20MintableInstance.mint(depositorAddress, tokenAmount),
ERC20MintableInstance.approve(ERC20HandlerInstance.address, tokenAmount, {
from: depositorAddress,
}),
BridgeInstance.adminChangeFeeHandler(FeeHandlerRouterInstance.address),
FeeHandlerRouterInstance.adminSetResourceHandler(
destinationDomainID,
resourceID,
DynamicFeeHandlerInstance.address
),
]);
await BridgeInstance.adminSetResource(
ERC20HandlerInstance.address,
resourceID,
ERC20MintableInstance.address,
emptySetResourceData
);
await ERC20MintableInstance.mint(depositorAddress, tokenAmount);
await ERC20MintableInstance.approve(ERC20HandlerInstance.address, tokenAmount, {
from: depositorAddress,
});
await BridgeInstance.adminChangeFeeHandler(FeeHandlerRouterInstance.address);
await FeeHandlerRouterInstance.adminSetResourceHandler(
destinationDomainID,
resourceID,
DynamicFeeHandlerInstance.address
);

depositData = Helpers.createERCDepositData(
tokenAmount,
Expand Down
26 changes: 12 additions & 14 deletions testUnderForked/collectFeeGenericEVM.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,18 @@ contract("TwapGenericFeeHandler - [collectFee]", async (accounts) => {
);
await DynamicFeeHandlerInstance.setWrapTokenAddress(destinationDomainID, MATIC_ADDRESS);

await Promise.all([
BridgeInstance.adminSetResource(
GmpHandlerInstance.address,
resourceID,
TestStoreInstance.address,
emptySetResourceData
),
BridgeInstance.adminChangeFeeHandler(FeeHandlerRouterInstance.address),
FeeHandlerRouterInstance.adminSetResourceHandler(
destinationDomainID,
resourceID,
DynamicFeeHandlerInstance.address
),
]);
await BridgeInstance.adminSetResource(
GmpHandlerInstance.address,
resourceID,
TestStoreInstance.address,
emptySetResourceData
);
await BridgeInstance.adminChangeFeeHandler(FeeHandlerRouterInstance.address);
await FeeHandlerRouterInstance.adminSetResourceHandler(
destinationDomainID,
resourceID,
DynamicFeeHandlerInstance.address
);

depositData = Helpers.createGmpDepositData(
depositFunctionSignature,
Expand Down

0 comments on commit b3b5afb

Please sign in to comment.