Readability Improvements

This commit is contained in:
Greg Hysen
2019-09-05 03:35:03 -07:00
parent b5be162fa2
commit da83f75a13
18 changed files with 220 additions and 197 deletions

View File

@@ -64,7 +64,7 @@ export class Simulation {
await this._withdrawRewardForStakingPoolMemberForDelegatorsByUndelegatingAsync(this._p);
}
// @TODO cleanup state and verify the staking contract is empty
// @TODO cleanup status and verify the staking contract is empty
}
private async _withdrawRewardForStakingPoolMemberForDelegatorsByUndelegatingAsync(

View File

@@ -203,27 +203,27 @@ export class StakingWrapper {
}
public async moveStakeAsync(
owner: string,
_fromState: {
state: number,
_fromStatus: {
status: number,
poolId?: string
},
_toState: {
state: number,
_toStatus: {
status: number,
poolId?: string
},
amount: BigNumber,
): Promise<TransactionReceiptWithDecodedLogs> {
const fromState = {
state: _fromState.state,
poolId: _fromState.poolId !== undefined ? _fromState.poolId : constants.NIL_POOL_ID
const fromStatus = {
status: _fromStatus.status,
poolId: _fromStatus.poolId !== undefined ? _fromStatus.poolId : constants.NIL_POOL_ID
};
const toState = {
state: _toState.state,
poolId: _toState.poolId !== undefined ? _toState.poolId : constants.NIL_POOL_ID
const toStatus = {
status: _toStatus.status,
poolId: _toStatus.poolId !== undefined ? _toStatus.poolId : constants.NIL_POOL_ID
};
const calldata = this.getStakingContract().moveStake.getABIEncodedTransactionData(
fromState,
toState,
fromStatus,
toStatus,
amount,
);
const txReceipt = await this._executeTransactionAsync(calldata, owner);

View File

@@ -50,11 +50,11 @@ export interface SimulationParams {
}
export interface StakeBalance {
current: BigNumber,
next: BigNumber,
currentEpochBalance: BigNumber,
nextEpochBalance: BigNumber,
}
export enum StakeStateId {
export enum StakeStatus {
ACTIVE,
INACTIVE,
DELEGATED