Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Use unique DSR deposit/withdraw history event types
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelelliot committed Dec 3, 2019
1 parent 5f292b1 commit 661821b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/dai-plugin-mcd/src/EventHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export async function getDsrEventHistory(service, address, cache) {
.filter(({ topics }) => parseWeiNumeric(topics[3]) !== '0')
.map(({ blockNumber: block, transactionHash: txHash, topics }) => {
return {
type: 'DEPOSIT',
type: 'DSR_DEPOSIT',
order: 0,
block,
txHash,
Expand All @@ -314,8 +314,8 @@ export async function getDsrEventHistory(service, address, cache) {
.filter(({ topics }) => parseWeiNumeric(topics[3]) !== '0')
.map(({ blockNumber: block, transactionHash: txHash, topics }) => {
return {
type: 'WITHDRAW',
order: 0,
type: 'DSR_WITHDRAW',
order: 1,
block,
txHash,
amount: parseWeiNumeric(topics[3]),
Expand Down
4 changes: 2 additions & 2 deletions packages/dai-plugin-mcd/test/SavingsService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ describe('Savings Service', () => {
await service.join(MDAI(3));
const events = await service.getEventHistory(proxyAddress);

const depositEventIdx = findIndex(events, { type: 'DEPOSIT' });
const withdrawEventIdx = findIndex(events, { type: 'WITHDRAW' });
const depositEventIdx = findIndex(events, { type: 'DSR_DEPOSIT' });
const withdrawEventIdx = findIndex(events, { type: 'DSR_WITHDRAW' });

expect(depositEventIdx).toBeGreaterThan(-1);
expect(events[depositEventIdx].gem).toEqual('DAI');
Expand Down

0 comments on commit 661821b

Please sign in to comment.