import { BigNumber } from "bignumber.js" ; import * as Units from "../../../../test_utils/units" ; import { SimpleInterestContractTerms , SimpleInterestParameters , } from "../../../../factories/terms_contract_parameters" ; import { DummyTokenContract } from "../../../../../../types/generated/dummy_token" ; import { SignedDebtOrder } from "../../../../../../types/kernel/debt_order" ; export const DEFAULT_REGISTER_TERM_START_ARGS = { principalAmount : Units . ether ( 1 ) , interestRateFixedPoint : Units . interestRateFixedPoint ( 2.5 ) , amortizationUnitType : new BigNumber ( 1 ) , termLengthUnits : new BigNumber ( 4 ) , invokedByDebtKernel : true , principalTokenInRegistry : true , succeeds : true , reverts : false , termsContractParameters : ( terms ) => SimpleInterestParameters . pack ( terms ) , } ; export const DEFAULT_REGISTER_REPAYMENT_ARGS = { principalAmount : Units . ether ( 1 ) , interestRateFixedPoint : Units . interestRateFixedPoint ( 2.5 ) , amortizationUnitType : new BigNumber ( 1 ) , termLengthUnits : new BigNumber ( 4 ) , repaymentAmount : Units . ether ( 1.29 ) , repaymentToken : ( principalToken , otherToken ) => principalToken , debtOrder : ( debtOrder ) => debtOrder , principalTokenInRegistry : true , repayFromRouter : true , succeeds : true , reverts : false , } ; export interface RegisterRepaymentScenario { description : string ; principalAmount : BigNumber ; interestRateFixedPoint : BigNumber ; amortizationUnitType : BigNumber ; termLengthUnits : BigNumber ; repaymentAmount : BigNumber ; repaymentToken : ( principalToken : DummyTokenContract , otherToken : DummyTokenContract ) => DummyTokenContract ; debtOrder : ( debtOrder : SignedDebtOrder ) => SignedDebtOrder ; principalTokenInRegistry : boolean ; succeeds : boolean ; reverts : boolean ; repayFromRouter : boolean ; } export interface RegisterTermStartScenario { description : string ; principalAmount : BigNumber ; interestRateFixedPoint : BigNumber ; amortizationUnitType : BigNumber ; termLengthUnits : BigNumber ; termsContractParameters : ( terms : SimpleInterestContractTerms ) => string ; principalTokenInRegistry : boolean ; succeeds : boolean ; reverts : boolean ; invokedByDebtKernel : boolean ; } export interface UnpackParametersFromBytesScenario { input : string ; expectedTerms : SimpleInterestContractTerms ; }