Skip to content

Commit

Permalink
refresh pool on connect
Browse files Browse the repository at this point in the history
Signed-off-by: wadeking98 <[email protected]>
  • Loading branch information
wadeking98 committed Oct 30, 2023
1 parent 71a525e commit 011ff7d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
diff --git a/build/pool/IndyVdrPool.d.ts b/build/pool/IndyVdrPool.d.ts
index cff86a7a020c7c6152a7c08f4ce0cb4e83b3838d..8b2cde35e778b85d7d76c6d32c2c636751718bcb 100644
--- a/build/pool/IndyVdrPool.d.ts
+++ b/build/pool/IndyVdrPool.d.ts
@@ -30,7 +30,7 @@ export declare class IndyVdrPool {
constructor(poolConfig: IndyVdrPoolConfig);
get indyNamespace(): string;
get config(): IndyVdrPoolConfig;
- connect(): void;
+ connect(): Promise<void>;
private get pool();
close(): void;
prepareWriteRequest<Request extends IndyVdrRequest>(agentContext: AgentContext, request: Request, signingKey: Key, endorserDid?: string): Promise<Request>;
diff --git a/build/pool/IndyVdrPool.js b/build/pool/IndyVdrPool.js
index 0ec57415429a0b97844b2d65a8ee83f68ad10466..1c693e7381dc19209ec928d26a05eb65b2e8d9f5 100644
--- a/build/pool/IndyVdrPool.js
+++ b/build/pool/IndyVdrPool.js
@@ -15,7 +15,7 @@ class IndyVdrPool {
get config() {
return this.poolConfig;
}
- connect() {
+ async connect() {
if (this._pool) {
throw new error_1.IndyVdrError('Cannot connect to pool, already connected.');
}
@@ -24,10 +24,11 @@ class IndyVdrPool {
transactions: this.config.genesisTransactions,
},
});
+ await this._pool.refresh()
}
- get pool() {
+ async pool() {
if (!this._pool)
- this.connect();
+ await this.connect();
if (!this._pool)
throw new error_1.IndyVdrError('Pool is not connected.');
return this._pool;
@@ -60,7 +61,7 @@ class IndyVdrPool {
* @param writeRequest
*/
async submitRequest(writeRequest) {
- return await this.pool.submitRequest(writeRequest);
+ return await (await this.pool()).submitRequest(writeRequest);
}
async appendTaa(request) {
const authorAgreement = await this.getTransactionAuthorAgreement();
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@aries-framework/react-hooks@^0.4.2": "patch:@aries-framework/react-hooks@npm:0.4.2#./.yarn/patches/@aries-framework-react-hooks-npm-0.4.2-84b7eb8764.patch",
"@aries-framework/[email protected]": "patch:@aries-framework/react-native@npm:0.3.3#./.yarn/patches/@aries-framework-react-native-npm-0.3.3-bb75ece22d.patch",
"@aries-framework/anoncreds@^0.4.0": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch",
"@aries-framework/[email protected]": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch"
"@aries-framework/[email protected]": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch",
"@aries-framework/indy-vdr@^0.4.0": "patch:@aries-framework/indy-vdr@npm%3A0.4.0#./.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch"
}
}

0 comments on commit 011ff7d

Please sign in to comment.