Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added ability to refresh the pool manually #1623

Merged
2 changes: 1 addition & 1 deletion packages/indy-vdr/src/IndyVdrApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { multiSignRequest, signRequest } from './utils/sign'
@injectable()
export class IndyVdrApi {
private agentContext: AgentContext
private indyVdrPoolService: IndyVdrPoolService
public indyVdrPoolService: IndyVdrPoolService
wadeking98 marked this conversation as resolved.
Show resolved Hide resolved

public constructor(agentContext: AgentContext, indyVdrPoolService: IndyVdrPoolService) {
this.agentContext = agentContext
Expand Down
7 changes: 7 additions & 0 deletions packages/indy-vdr/src/pool/IndyVdrPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ export class IndyVdrPool {
}
}

/**
* Get the transactions for a pool
*/
public get transactions() {
return this.pool.transactions
}

private get pool(): indyVdrPool {
if (!this._pool) this.connect()
if (!this._pool) throw new IndyVdrError('Pool is not connected.')
Expand Down
7 changes: 7 additions & 0 deletions packages/indy-vdr/src/pool/IndyVdrPoolService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ export class IndyVdrPoolService {
return Promise.allSettled(this.pools.map((pool) => pool.refreshConnection()))
}

/**
* Get all pool transactions
*/
public getAllPoolTransactions() {
return Promise.allSettled(this.pools.map((pool) => pool.transactions))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a promise right? So then allSettled is not needed I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pool.transactions returns a promise

}

/**
* Get the most appropriate pool for the given indyNamespace
*/
Expand Down
Loading