Refactor contracts-* exports so none in test dir so npmignore works as intended
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import { constants as testConstants } from '@0x/contracts-test-utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
|
||||
const TEN_DAYS = 10 * 24 * 60 * 60;
|
||||
const PPM = 10 ** 6;
|
||||
export const constants = {
|
||||
TOKEN_MULTIPLIER: testConstants.DUMMY_TOKEN_DECIMALS,
|
||||
INITIAL_POOL_ID: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
||||
SECOND_POOL_ID: '0x0000000000000000000000000000000000000000000000000000000000000002',
|
||||
NIL_POOL_ID: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
||||
NIL_ADDRESS: '0x0000000000000000000000000000000000000000',
|
||||
INITIAL_EPOCH: new BigNumber(1),
|
||||
DEFAULT_PARAMS: {
|
||||
epochDurationInSeconds: new BigNumber(TEN_DAYS),
|
||||
rewardDelegatedStakeWeight: new BigNumber(PPM * 0.9),
|
||||
minimumPoolStake: new BigNumber(10).pow(testConstants.DUMMY_TOKEN_DECIMALS).times(100),
|
||||
cobbDouglasAlphaNumerator: new BigNumber(2),
|
||||
cobbDouglasAlphaDenominator: new BigNumber(3),
|
||||
},
|
||||
PPM,
|
||||
ONE_DAY_IN_SECONDS: 24 * 60 * 60,
|
||||
};
|
@@ -1,130 +0,0 @@
|
||||
import { Numberish } from '@0x/contracts-test-utils';
|
||||
import { BigNumber } from '@0x/utils';
|
||||
import { DecodedLogArgs, LogWithDecodedArgs } from 'ethereum-types';
|
||||
|
||||
import { constants } from './constants';
|
||||
|
||||
export interface StakingParams {
|
||||
epochDurationInSeconds: Numberish;
|
||||
rewardDelegatedStakeWeight: Numberish;
|
||||
minimumPoolStake: Numberish;
|
||||
cobbDouglasAlphaNumerator: Numberish;
|
||||
cobbDouglasAlphaDenominator: Numberish;
|
||||
}
|
||||
|
||||
export interface StakerBalances {
|
||||
zrxBalance: BigNumber;
|
||||
stakeBalance: BigNumber;
|
||||
stakeBalanceInVault: BigNumber;
|
||||
activatableStakeBalance: BigNumber;
|
||||
activatedStakeBalance: BigNumber;
|
||||
deactivatedStakeBalance: BigNumber;
|
||||
timeLockedStakeBalance: BigNumber;
|
||||
}
|
||||
|
||||
export interface DelegatorBalances extends StakerBalances {
|
||||
delegatedStakeBalance: BigNumber;
|
||||
stakeDelegatedToPoolByOwner: BigNumber[];
|
||||
stakeDelegatedToPool: BigNumber[];
|
||||
}
|
||||
|
||||
export interface SimulationParams {
|
||||
users: string[];
|
||||
numberOfPools: number;
|
||||
poolOperatorShares: number[];
|
||||
stakeByPoolOperator: BigNumber[];
|
||||
numberOfMakers: number;
|
||||
numberOfMakersPerPool: number[];
|
||||
protocolFeesByMaker: BigNumber[];
|
||||
numberOfDelegators: number;
|
||||
numberOfDelegatorsPerPool: number[];
|
||||
stakeByDelegator: BigNumber[];
|
||||
expectedFeesByPool: BigNumber[];
|
||||
expectedPayoutByPool: BigNumber[];
|
||||
expectedPayoutByPoolOperator: BigNumber[];
|
||||
expectedMembersPayoutByPool: BigNumber[];
|
||||
expectedPayoutByDelegator: BigNumber[];
|
||||
exchangeAddress: string;
|
||||
delegateInNextEpoch: boolean;
|
||||
withdrawByUndelegating: boolean;
|
||||
}
|
||||
|
||||
export interface EndOfEpochInfo {
|
||||
closingEpoch: BigNumber;
|
||||
activePoolIds: string[];
|
||||
rewardsAvailable: BigNumber;
|
||||
totalFeesCollected: BigNumber;
|
||||
totalWeightedStake: BigNumber;
|
||||
}
|
||||
|
||||
export interface StoredBalance {
|
||||
currentEpoch: BigNumber;
|
||||
currentEpochBalance: BigNumber;
|
||||
nextEpochBalance: BigNumber;
|
||||
}
|
||||
|
||||
export interface StakeBalanceByPool {
|
||||
[key: string]: StoredBalance;
|
||||
}
|
||||
|
||||
export enum StakeStatus {
|
||||
Undelegated,
|
||||
Delegated,
|
||||
}
|
||||
|
||||
export class StakeInfo {
|
||||
public status: StakeStatus;
|
||||
public poolId: string;
|
||||
|
||||
constructor(status: StakeStatus, poolId?: string) {
|
||||
this.status = status;
|
||||
this.poolId = poolId !== undefined ? poolId : constants.NIL_POOL_ID;
|
||||
}
|
||||
}
|
||||
|
||||
export interface StakeBalances {
|
||||
currentEpoch: BigNumber;
|
||||
zrxBalance: BigNumber;
|
||||
stakeBalance: BigNumber;
|
||||
stakeBalanceInVault: BigNumber;
|
||||
undelegatedStakeBalance: StoredBalance;
|
||||
delegatedStakeBalance: StoredBalance;
|
||||
globalUndelegatedStakeBalance: StoredBalance;
|
||||
globalDelegatedStakeBalance: StoredBalance;
|
||||
delegatedStakeByPool: StakeBalanceByPool;
|
||||
totalDelegatedStakeByPool: StakeBalanceByPool;
|
||||
}
|
||||
|
||||
export interface RewardBalanceByPoolId {
|
||||
[key: string]: BigNumber;
|
||||
}
|
||||
|
||||
export interface OperatorShareByPoolId {
|
||||
[key: string]: BigNumber;
|
||||
}
|
||||
|
||||
export interface OperatorBalanceByPoolId {
|
||||
[key: string]: BigNumber;
|
||||
}
|
||||
|
||||
export interface BalanceByOwner {
|
||||
[key: string]: BigNumber;
|
||||
}
|
||||
|
||||
export interface RewardByPoolId {
|
||||
[key: string]: BigNumber;
|
||||
}
|
||||
|
||||
export interface DelegatorBalancesByPoolId {
|
||||
[key: string]: BalanceByOwner;
|
||||
}
|
||||
|
||||
export interface OperatorByPoolId {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface DelegatorsByPoolId {
|
||||
[key: string]: string[];
|
||||
}
|
||||
|
||||
export type DecodedLogs = Array<LogWithDecodedArgs<DecodedLogArgs>>;
|
Reference in New Issue
Block a user