Skip to content

Commit

Permalink
fix: blockchain reference
Browse files Browse the repository at this point in the history
  • Loading branch information
dated committed Mar 6, 2019
1 parent 7760535 commit 337bd5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core-api/src/versions/2/delegates/methods.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { app } from "@arkecosystem/core-container";
import { Database } from "@arkecosystem/core-interfaces";
import { Blockchain, Database } from "@arkecosystem/core-interfaces";
import { orderBy } from "@arkecosystem/utils";
import Boom from "boom";
import { blocksRepository } from "../../../repositories";
Expand All @@ -8,6 +8,7 @@ import { paginate, respondWithResource, respondWithCollection, toPagination } fr

const config = app.getConfig();
const databaseService = app.resolvePlugin<Database.IDatabaseService>("database");
const blockchain = app.resolvePlugin<Blockchain.IBlockchain>("blockchain");

const index = async request => {
const delegates = await databaseService.delegates.findAll({
Expand All @@ -20,7 +21,7 @@ const index = async request => {

const active = async request => {
const delegates = await databaseService.delegates.getActiveAtHeight(
request.query.height || this.blockchain.getLastHeight()
request.query.height || blockchain.getLastHeight()
);

if (!delegates.length) {
Expand Down

0 comments on commit 337bd5b

Please sign in to comment.