Skip to content

Commit

Permalink
resolves #1067
Browse files Browse the repository at this point in the history
  • Loading branch information
rsercano committed Jul 24, 2019
1 parent 059035a commit 2a8e424
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/grpc/GrpcService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,11 @@ class GrpcService {
const currencies = this.service.listCurrencies();
const response = new xudrpc.ListCurrenciesResponse();

currencies.forEach((currency) => {
currencies.currencies.forEach((currency) => {
const resultCurrency = new xudrpc.Currency();
resultCurrency.setDigits(currency.decimalPlaces);
resultCurrency.setTickerSymbol(currency.id);
resultCurrency.setGlobalIdentifier('TODO');
resultCurrency.setGlobalIdentifier(currencies.tokenIdentifiers[currency.id] || 'unknown');
response.getCurrenciesList().push(resultCurrency);
});

Expand Down
2 changes: 1 addition & 1 deletion lib/orderbook/OrderBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class OrderBook extends EventEmitter {
}

public get currencies() {
return this.currencyInstances;
return { currencies: this.currencyInstances, tokenIdentifiers: this.pool.getTokenIdentifiers() };
}

constructor({ logger, models, thresholds, pool, swaps, nosanityswaps, nobalancechecks, nomatching = false }:
Expand Down
4 changes: 4 additions & 0 deletions lib/p2p/Pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ class Pool extends EventEmitter {
return this.nodeState.addresses;
}

public getTokenIdentifiers() {
return this.nodeState.tokenIdentifiers;
}

public getTokenIdentifier(currency: string) {
return this.nodeState.tokenIdentifiers[currency];
}
Expand Down

0 comments on commit 2a8e424

Please sign in to comment.