|
| 1 | +import { RelayData } from "../src/interfaces"; |
1 | 2 | import { |
2 | 3 | expect, |
3 | 4 | toBNWei, |
@@ -28,7 +29,7 @@ import { |
28 | 29 |
|
29 | 30 | import { SpokePoolClient } from "../src/clients"; |
30 | 31 | import { MockConfigStoreClient, MockHubPoolClient, MockSpokePoolClient } from "./mocks"; |
31 | | -import { validateFillForDeposit, queryHistoricalDepositForFill } from "../src/utils"; |
| 32 | +import { relayFilledAmount, validateFillForDeposit, queryHistoricalDepositForFill } from "../src/utils"; |
32 | 33 | import { CHAIN_ID_TEST_LIST, repaymentChainId } from "./constants"; |
33 | 34 |
|
34 | 35 | let spokePool_1: Contract, erc20_1: Contract, spokePool_2: Contract, erc20_2: Contract, hubPool: Contract; |
@@ -103,6 +104,17 @@ describe("SpokePoolClient: Fill Validation", function () { |
103 | 104 | await spokePool_1.setCurrentTime(await getLastBlockTime(spokePool_1.provider)); |
104 | 105 | }); |
105 | 106 |
|
| 107 | + it("Tracks fill status", async function () { |
| 108 | + const deposit = await buildDeposit(hubPoolClient, spokePool_1, erc20_1, depositor, destinationChainId); |
| 109 | + |
| 110 | + let filled = await relayFilledAmount(spokePool_2, deposit as RelayData); |
| 111 | + expect(filled.eq(0)).is.true; |
| 112 | + |
| 113 | + await buildFill(spokePool_2, erc20_2, depositor, relayer, deposit, 1); |
| 114 | + filled = await relayFilledAmount(spokePool_2, deposit as RelayData); |
| 115 | + expect(filled.eq(deposit.amount)).is.true; |
| 116 | + }); |
| 117 | + |
106 | 118 | it("Accepts valid fills", async function () { |
107 | 119 | const deposit = await buildDeposit(hubPoolClient, spokePool_1, erc20_1, depositor, destinationChainId); |
108 | 120 | await buildFill(spokePool_2, erc20_2, depositor, relayer, deposit, 1); |
|
0 commit comments