Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Commit b7e168b

Browse files
committed
Remove unused wrapper functions
1 parent a2701dd commit b7e168b

File tree

2 files changed

+0
-209
lines changed

2 files changed

+0
-209
lines changed

src/wrappers/strategies/AssetPairManagerV2Wrapper.ts

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -38,42 +38,6 @@ export class AssetPairManagerV2Wrapper {
3838
this.contracts = new StrategyContractWrapper(this.web3);
3939
}
4040

41-
/**
42-
* Calls an AssetPairManagerV2's intialPropose function. This function kicks off a propose cycle on the
43-
* manager by checking that the time and price constraints have been met then logging a timestamp used later in the
44-
* process to confirm the signal.
45-
*
46-
* @param managerAddress Address of the rebalancing manager contract
47-
* @return The hash of the resulting transaction.
48-
*/
49-
public async initialPropose(
50-
managerAddress: Address,
51-
txOpts?: Tx,
52-
): Promise<string> {
53-
const assetPairManagerInstance = await this.contracts.loadAssetPairManagerV2ContractAsync(managerAddress);
54-
const txOptions = await generateTxOpts(this.web3, txOpts);
55-
56-
return await assetPairManagerInstance.initialPropose.sendTransactionAsync(txOptions);
57-
}
58-
59-
/**
60-
* Calls an AssetPairManagerV2's confirmPropose function. This function again checks to make sure that
61-
* price and time constraints have been satisfied. After that it generates the new allocation proposal and sends the
62-
* results to the Rebalancing Set Token to kick off the official rebalance.
63-
*
64-
* @param managerAddress Address of the rebalancing manager contract
65-
* @return The hash of the resulting transaction.
66-
*/
67-
public async confirmPropose(
68-
managerAddress: Address,
69-
txOpts?: Tx,
70-
): Promise<string> {
71-
const assetPairManagerInstance = await this.contracts.loadAssetPairManagerV2ContractAsync(managerAddress);
72-
const txOptions = await generateTxOpts(this.web3, txOpts);
73-
74-
return await assetPairManagerInstance.confirmPropose.sendTransactionAsync(txOptions);
75-
}
76-
7741
/**
7842
* Update liquidator used by Rebalancing Set.
7943
*
@@ -170,32 +134,6 @@ export class AssetPairManagerV2Wrapper {
170134
);
171135
}
172136

173-
/**
174-
* Calls an AssetPairManagerV2's canInitialPropose function. Returns whether initialPropose can be called
175-
* without reverting.
176-
*
177-
* @param managerAddress Address of the rebalancing manager contract
178-
* @return Boolean indicating whether initialPropose can be successfully called
179-
*/
180-
public async canInitialPropose(managerAddress: Address): Promise<boolean> {
181-
const assetPairManagerInstance = await this.contracts.loadAssetPairManagerV2ContractAsync(managerAddress);
182-
183-
return await assetPairManagerInstance.canInitialPropose.callAsync();
184-
}
185-
186-
/**
187-
* Calls an AssetPairManagerV2's canConfirmPropose function. Returns whether confirmPropose can be called
188-
* without reverting.
189-
*
190-
* @param managerAddress Address of the rebalancing manager contract
191-
* @return Boolean indicating whether confirmPropose can be successfully called
192-
*/
193-
public async canConfirmPropose(managerAddress: Address): Promise<boolean> {
194-
const assetPairManagerInstance = await this.contracts.loadAssetPairManagerV2ContractAsync(managerAddress);
195-
196-
return await assetPairManagerInstance.canConfirmPropose.callAsync();
197-
}
198-
199137
public async core(managerAddress: Address): Promise<Address> {
200138
const assetPairManagerInstance = await this.contracts.loadAssetPairManagerV2ContractAsync(managerAddress);
201139

test/integration/wrappers/strategies/AssetPairManagerV2Wrapper.spec.ts

Lines changed: 0 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ import {
7878
deployTimeSeriesFeedAsync,
7979
deployTokensSpecifyingDecimals,
8080
deployWhiteListContract,
81-
increaseChainTimeAsync,
8281
initializeManagerAsync,
8382
} from '@test/helpers';
8483
import {
@@ -578,152 +577,6 @@ describe('AssetPairManagerV2Wrapper', () => {
578577
});
579578
});
580579

581-
describe('initialPropose', async () => {
582-
let subjectManagerAddress: Address;
583-
584-
beforeEach(async () => {
585-
subjectManagerAddress = assetPairManagerV2.address;
586-
587-
// Elapse the rebalance interval
588-
await increaseChainTimeAsync(web3, ONE_DAY_IN_SECONDS);
589-
});
590-
591-
async function subject(): Promise<string> {
592-
return await assetPairManagerV2Wrapper.initialPropose(
593-
subjectManagerAddress,
594-
);
595-
}
596-
597-
test('sets the recentInitialProposeTimestamp properly', async () => {
598-
const txnHash = await subject();
599-
const { blockNumber } = await web3.eth.getTransactionReceipt(txnHash);
600-
const { timestamp } = await web3.eth.getBlock(blockNumber);
601-
602-
const lastTimestamp = await assetPairManagerV2Wrapper.recentInitialProposeTimestamp(
603-
subjectManagerAddress,
604-
);
605-
expect(lastTimestamp).to.bignumber.equal(timestamp);
606-
});
607-
});
608-
609-
describe('confirmPropose', async () => {
610-
let subjectManagerAddress: Address;
611-
612-
beforeEach(async () => {
613-
subjectManagerAddress = assetPairManagerV2.address;
614-
615-
// Elapse the rebalance interval
616-
await increaseChainTimeAsync(web3, ONE_DAY_IN_SECONDS);
617-
await assetPairManagerV2.initialPropose.sendTransactionAsync();
618-
619-
// Issue currentSetToken
620-
await core.issue.sendTransactionAsync(
621-
initialBaseCollateral.address,
622-
ether(9),
623-
{from: DEFAULT_ACCOUNT },
624-
);
625-
await approveForTransferAsync([initialBaseCollateral], transferProxy.address);
626-
627-
// Use issued currentSetToken to issue rebalancingSetToken
628-
await core.issue.sendTransactionAsync(
629-
rebalancingSetToken.address,
630-
ether(7),
631-
{from: DEFAULT_ACCOUNT },
632-
);
633-
634-
// Elapse the signal confirmation period
635-
await increaseChainTimeAsync(web3, ONE_HOUR_IN_SECONDS.mul(7));
636-
});
637-
638-
async function subject(): Promise<string> {
639-
return await assetPairManagerV2Wrapper.confirmPropose(
640-
subjectManagerAddress,
641-
);
642-
}
643-
644-
test('sets the rebalancing Set into rebalance period', async () => {
645-
await subject();
646-
const rebalanceStateEnum = new BigNumber(2);
647-
const rebalancingSetState = await rebalancingSetToken.rebalanceState.callAsync();
648-
649-
expect(rebalancingSetState).to.bignumber.equal(rebalanceStateEnum);
650-
});
651-
});
652-
653-
describe('canInitialPropose', async () => {
654-
let subjectManagerAddress: Address;
655-
let subjectTimeFastForward: BigNumber;
656-
657-
beforeEach(async () => {
658-
subjectManagerAddress = assetPairManagerV2.address;
659-
subjectTimeFastForward = ONE_DAY_IN_SECONDS;
660-
});
661-
662-
async function subject(): Promise<boolean> {
663-
await increaseChainTimeAsync(web3, subjectTimeFastForward);
664-
return await assetPairManagerV2Wrapper.canInitialPropose(
665-
subjectManagerAddress,
666-
);
667-
}
668-
669-
test('sets the recentInitialProposeTimestamp properly', async () => {
670-
const canInitialPropose = await subject();
671-
672-
expect(canInitialPropose).to.be.true;
673-
});
674-
675-
describe('when initialPropose not valid', async () => {
676-
beforeEach(async () => {
677-
subjectTimeFastForward = ZERO;
678-
});
679-
680-
test('returns false', async () => {
681-
const canInitialPropose = await subject();
682-
683-
expect(canInitialPropose).to.be.false;
684-
});
685-
});
686-
});
687-
688-
describe('canConfirmPropose', async () => {
689-
let subjectManagerAddress: Address;
690-
let subjectTimeFastForward: BigNumber;
691-
692-
beforeEach(async () => {
693-
subjectManagerAddress = assetPairManagerV2.address;
694-
subjectTimeFastForward = ONE_HOUR_IN_SECONDS.mul(7);
695-
696-
// Elapse the rebalance interval
697-
await increaseChainTimeAsync(web3, ONE_DAY_IN_SECONDS);
698-
await assetPairManagerV2.initialPropose.sendTransactionAsync();
699-
});
700-
701-
async function subject(): Promise<boolean> {
702-
await increaseChainTimeAsync(web3, subjectTimeFastForward);
703-
return await assetPairManagerV2Wrapper.canConfirmPropose(
704-
subjectManagerAddress,
705-
);
706-
}
707-
708-
test('sets the recentInitialProposeTimestamp properly', async () => {
709-
const canInitialPropose = await subject();
710-
711-
expect(canInitialPropose).to.be.true;
712-
});
713-
714-
describe('when initialPropose not valid', async () => {
715-
beforeEach(async () => {
716-
subjectTimeFastForward = ZERO;
717-
});
718-
719-
test('returns false', async () => {
720-
const canInitialPropose = await subject();
721-
722-
expect(canInitialPropose).to.be.false;
723-
});
724-
});
725-
});
726-
727580
describe('setLiquidator', async () => {
728581
let subjectNewLiquidator: Address;
729582
let subjectManagerAddress: Address;

0 commit comments

Comments
 (0)