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

fix(node): allow to import node package without postgres #757

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/tests/postgres.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('postgres agents', () => {
}

// loading the postgres wallet plugin
await loadPostgresPlugin(storageConfig.config, storageConfig.credentials)
loadPostgresPlugin(storageConfig.config, storageConfig.credentials)

aliceAgent = new Agent(alicePostgresConfig.config, alicePostgresConfig.agentDependencies)
aliceAgent.registerInboundTransport(new SubjectInboundTransport(aliceMessages))
Expand Down
3 changes: 1 addition & 2 deletions packages/node/src/PostgresPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ type NativeIndyPostgres = {
init_storagetype: (arg0: string, arg1: string) => number
}

export const indyPostgresStorage = getLibrary() as NativeIndyPostgres

export interface WalletStorageConfig {
url: string
wallet_scheme: WalletScheme
Expand All @@ -96,6 +94,7 @@ export interface IndyPostgresStorageConfig {
}

export function loadPostgresPlugin(config: WalletStorageConfig, credentials: WalletStorageCredentials) {
const indyPostgresStorage = getLibrary() as NativeIndyPostgres
indyPostgresStorage.postgresstorage_init()
indyPostgresStorage.init_storagetype(JSON.stringify(config), JSON.stringify(credentials))
return true
Expand Down