Skip to content

Commit

Permalink
implement configure balance tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
mayconamaroCW committed Mar 14, 2024
1 parent fac06a5 commit 4b9fa21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion e2e-contracts/integration/test/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ async function deployBalanceTracker() {
}

async function configureBalanceTracker() {
//TODO: Set hooks
const REVERT_POLICY = BigInt(1);
const toHookStruct = (hook : IERC20Hookable.HookStructOutput) => ({account: hook.account, policy: hook.policy});
const hooksOutput = await brlCoin.getAfterTokenTransferHooks();
const hooks: IERC20Hookable.HookStruct[] = hooksOutput.map(toHookStruct);
const newHook = {account: await balanceTracker.getAddress(), policy: REVERT_POLICY};
hooks.push(newHook);
}

async function deployYieldStreamer() {
Expand Down Expand Up @@ -145,6 +150,7 @@ describe("Integration Test", function () {

it("Configure BalanceTracker", async function () {
await configureBalanceTracker();
console.log(await brlCoin.getAfterTokenTransferHooks());
});

it("Deploy YieldStreamer", async function () {
Expand Down

0 comments on commit 4b9fa21

Please sign in to comment.