Skip to content

Commit

Permalink
Clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
philipjames44 committed Nov 1, 2023
1 parent 48433be commit dcf97d5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/chains/penumbra/penumbra.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@ const grpc = require('@grpc/grpc-js');

export class PenumbraController {
static balances(req: BalancesRequest): Promise<any> {
// TODO: Validate request
console.log("Start..")

return new Promise((resolve, reject) => {
// Make connection
const client = new ViewProtocolServiceClient(
PenumbraConfig.config.network.rpcURL,
grpc.credentials.createInsecure()
);
console.log('Making request...');

// Get balances
const call = client.balances(req);
const responses: any[] = [];

call.on('data', (response: any) => {
const balanceObject = BalancesResponse.toObject(false, response);
console.log(balanceObject);
//console.log(balanceObject);
responses.push(balanceObject);
});

call.on('end', () => {
console.log('Streaming ended.');
resolve(responses);
});

Expand All @@ -50,6 +45,6 @@ async function getBalances() {

getBalances();

// Run this file locally
// To run this file locally
// npm install -g ts-node typescript '@types/node'
// ts-node src/chains/penumbra/penumbra.controller.ts

0 comments on commit dcf97d5

Please sign in to comment.