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

Commit

Permalink
add vulcanize as a config param to the liquidations service
Browse files Browse the repository at this point in the history
  • Loading branch information
b-pmcg committed Apr 22, 2021
1 parent b8e9aea commit ebd5335
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions packages/dai-plugin-liquidations/src/LiquidationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ const medianizers = {
export default class LiquidationService extends PublicService {
constructor(name = 'liquidation') {
super(name, ['web3', 'smartContract']);
this.vulcanize = true;
}

initialize(settings) {
if (settings.vulcanize === 'false') {
this.vulcanize = false;
}
}

connect() {
Expand Down Expand Up @@ -141,9 +148,9 @@ export default class LiquidationService extends PublicService {
});
}

async getAllClips(ilk, options = { vulcanize: true }) {
async getAllClips(ilk) {
const tail = await this.getTail(ilk);
if (options.vulcanize) {
if (this.vulcanize) {
const response = await this.getQueryResponse(
this.serverUrl,
this._buildAllClipsQuery(ilk)
Expand Down
4 changes: 2 additions & 2 deletions packages/dai-plugin-liquidations/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const MCD_CLIP_LINK_A = 'MCD_CLIP_LINK_A';
export const MCD_DOG = 'MCD_DOG';

export default {
addConfig: function(config) {
addConfig: function(config, { vulcanize = true }) {
const contractAddresses = {
kovan: require('../contracts/addresses/kovan.json'),
mainnet: require('../contracts/addresses/mainnet.json')
Expand All @@ -29,7 +29,7 @@ export default {
return {
...config,
additionalServices: ['liquidation'],
liquidation: LiquidationService,
liquidation: [LiquidationService, { vulcanize }],
smartContract: { addContracts }
};
}
Expand Down

0 comments on commit ebd5335

Please sign in to comment.