Skip to content

Commit

Permalink
move mock functions into new mock-contract-calls file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike committed Aug 19, 2023
1 parent a73326e commit c1fffee
Show file tree
Hide file tree
Showing 8 changed files with 423 additions and 419 deletions.
3 changes: 2 additions & 1 deletion tests/erc-20-pool-factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
dataSourceMock
} from "matchstick-as/assembly/index"
import { Address, BigInt, dataSource } from "@graphprotocol/graph-ts"
import { createPool, mockGetRatesAndFees } from "./utils/common"
import { createPool } from "./utils/common"
import { mockGetRatesAndFees } from "./utils/mock-contract-calls"

import { FIVE_PERCENT_BI, MAX_PRICE, ONE_BI, ZERO_BI } from "../src/utils/constants"

Expand Down
14 changes: 2 additions & 12 deletions tests/erc-20-pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,9 @@ import {
assertBucketUpdate,
assertLendUpdate,
assertPoolUpdate,
createPool,
mockGetAuctionInfo,
mockGetAuctionStatus,
mockGetBorrowerInfo,
mockGetBucketInfo,
mockGetBurnInfo,
mockGetCurrentBurnEpoch,
mockGetDebtInfo,
mockGetLPBValueInQuote,
mockGetRatesAndFees,
mockPoolInfoUtilsPoolUpdateCalls,
mockTokenBalance
createPool
} from "./utils/common"
import { mockGetAuctionInfo, mockGetAuctionStatus, mockGetBorrowerInfo, mockGetBucketInfo, mockGetBurnInfo, mockGetCurrentBurnEpoch, mockGetDebtInfo, mockGetLPBValueInQuote, mockGetLenderInfo, mockGetRatesAndFees, mockPoolInfoUtilsPoolUpdateCalls, mockTokenBalance } from "./utils/mock-contract-calls"
import { BucketInfo, getBucketId } from "../src/utils/pool/bucket"
import { addressToBytes, wadToDecimal } from "../src/utils/convert"
import { FIVE_PERCENT_BI, MAX_PRICE, MAX_PRICE_BI, MAX_PRICE_INDEX, ONE_BI, ONE_PERCENT_BI, ONE_WAD_BI, TWO_BI, ZERO_ADDRESS, ZERO_BD, ZERO_BI } from "../src/utils/constants"
Expand Down
3 changes: 2 additions & 1 deletion tests/erc-721-pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import { handleAddCollateralNFT, handleAddQuoteToken, handleDrawDebtNFT, handleR
import { createAddCollateralNFTEvent, createAddQuoteTokenEvent, createDrawDebtNFTEvent, createRepayDebtEvent, createMergeOrRemoveCollateralNFTEvent, createRemoveCollateralEvent, createKickEvent, createAuctionNFTSettleEvent, createSettleEvent, createTakeEvent, createBucketTakeEvent, createBucketTakeLPAwardedEvent, createTransferLPEvent } from "./utils/erc-721-pool-utils"

import { FIVE_PERCENT_BI, MAX_PRICE, MAX_PRICE_BI, MAX_PRICE_INDEX, ONE_BI, ONE_PERCENT_BI, ONE_WAD_BI, TWO_BI, ZERO_ADDRESS, ZERO_BD, ZERO_BI } from "../src/utils/constants"
import { assertBucketUpdate, assertLendUpdate, create721Pool, createAndHandleAddQuoteTokenEvent, createPool, mockGetAuctionInfo, mockGetAuctionStatus, mockGetBorrowerInfo, mockGetBucketInfo, mockGetDebtInfo, mockGetLPBValueInQuote, mockGetLenderInfo, mockGetRatesAndFees, mockPoolInfoUtilsPoolUpdateCalls, mockTokenBalance } from "./utils/common"
import { assertBucketUpdate, assertLendUpdate, create721Pool, createAndHandleAddQuoteTokenEvent, createPool } from "./utils/common"
import { mockGetAuctionInfo, mockGetAuctionStatus, mockGetBorrowerInfo, mockGetBucketInfo, mockGetDebtInfo, mockGetLPBValueInQuote, mockGetLenderInfo, mockGetRatesAndFees, mockPoolInfoUtilsPoolUpdateCalls, mockTokenBalance } from "./utils/mock-contract-calls"
import { BucketInfo, getBucketId } from "../src/utils/pool/bucket"
import { addressToBytes, wadToDecimal } from "../src/utils/convert"
import { DebtInfo } from "../src/utils/pool/pool"
Expand Down
2 changes: 1 addition & 1 deletion tests/grant-fund.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
ZERO_BI,
} from "../src/utils/constants";
import { addressToBytes, bigIntToBytes, decimalToWad, wadToDecimal } from "../src/utils/convert";
import { mockGetDistributionId, mockGetFundedProposalSlate, mockGetTreasury, mockGetVotesFunding, mockGetVotesScreening } from "./utils/common";
import { mockGetDistributionId, mockGetFundedProposalSlate, mockGetTreasury, mockGetVotesFunding, mockGetVotesScreening } from "./utils/mock-contract-calls";
import { getDistributionPeriodVoteId, getFundingVoteId, getScreeningVoteId } from "../src/utils/grants/voter";

// Tests structure (matchstick-as >=0.5.0)
Expand Down
3 changes: 2 additions & 1 deletion tests/position-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { Address, BigInt, Bytes } from "@graphprotocol/graph-ts"
import { handleApproval, handleBurn, handleMemorializePosition, handleMint, handleMoveLiquidity, handleRedeemPosition } from "../src/mappings/position-manager"
import { assertPosition, createApprovalEvent, createBurnEvent, createMemorializePositionEvent, createMintEvent, createMoveLiquidityEvent, createRedeemPositionEvent, mintPosition } from "./utils/position-manager-utils"
import { bigIntToBytes, wadToDecimal } from "../src/utils/convert"
import { create721Pool, mockGetLPBValueInQuote, mockGetLenderInfo, mockGetPoolKey, mockGetTokenName, mockGetTokenSymbol } from "./utils/common"
import { create721Pool } from "./utils/common"
import { mockGetLPBValueInQuote, mockGetLenderInfo, mockGetPoolKey, mockGetTokenName, mockGetTokenSymbol } from "./utils/mock-contract-calls"
import { Lend } from "../generated/schema"
import { getLendId, loadOrCreateLend } from "../src/utils/pool/lend"
import { getBucketId } from "../src/utils/pool/bucket"
Expand Down
Loading

0 comments on commit c1fffee

Please sign in to comment.