Skip to content

Commit

Permalink
Merge pull request #733 from oceanprotocol/issue-732-system-test-nonce
Browse files Browse the repository at this point in the history
fix system tests. Running old version of node?
  • Loading branch information
paulo-ocean authored Oct 24, 2024
2 parents d114cb9 + 7d47387 commit 2a62160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- develop
tags:
- '**'
pull_request:
Expand Down Expand Up @@ -259,7 +258,7 @@ jobs:
with:
repository: 'oceanprotocol/ocean-node'
path: 'ocean-node'
ref: ${{ github.event_name == 'pull_request' && github.head_ref || 'develop' }}
ref: ${{ github.event_name == 'pull_request' && github.head_ref || 'main' }}

- name: Start Ocean Node
working-directory: ${{ github.workspace }}/ocean-node
Expand Down
11 changes: 4 additions & 7 deletions src/components/database/DatabaseFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
AbstractDdoStateDatabase,
AbstractIndexerDatabase,
AbstractLogDatabase,
AbstractNonceDatabase,
AbstractOrderDatabase
} from './BaseDatabase.js'
import {
Expand Down Expand Up @@ -35,8 +34,6 @@ import { SQLLiteNonceDatabase } from './SQLLiteNonceDatabase.js'
export class DatabaseFactory {
private static databaseMap = {
elasticsearch: {
nonce: (config: OceanNodeDBConfig) =>
new SQLLiteNonceDatabase(config, typesenseSchemas.nonceSchemas),
ddo: (config: OceanNodeDBConfig) =>
new ElasticsearchDdoDatabase(config, elasticSchemas.ddoSchemas),
indexer: (config: OceanNodeDBConfig) => new ElasticsearchIndexerDatabase(config),
Expand All @@ -48,8 +45,6 @@ export class DatabaseFactory {
metadataQuery: () => new ElasticSearchMetadataQuery()
},
typesense: {
nonce: (config: OceanNodeDBConfig) =>
new SQLLiteNonceDatabase(config, typesenseSchemas.nonceSchemas),
ddo: (config: OceanNodeDBConfig) =>
new TypesenseDdoDatabase(config, typesenseSchemas.ddoSchemas),
indexer: (config: OceanNodeDBConfig) =>
Expand Down Expand Up @@ -80,8 +75,10 @@ export class DatabaseFactory {
return databaseCreator(config) as T
}

static createNonceDatabase(config: OceanNodeDBConfig): Promise<AbstractNonceDatabase> {
return this.createDatabase('nonce', config)
static async createNonceDatabase(
config: OceanNodeDBConfig
): Promise<SQLLiteNonceDatabase> {
return await new SQLLiteNonceDatabase(config, typesenseSchemas.nonceSchemas)
}

static createDdoDatabase(config: OceanNodeDBConfig): Promise<AbstractDdoDatabase> {
Expand Down
8 changes: 1 addition & 7 deletions src/components/database/SQLLiteNonceDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ export class SQLLiteNonceDatabase extends AbstractNonceDatabase {
constructor(config: OceanNodeDBConfig, schema: TypesenseSchema) {
super(config, schema)
return (async (): Promise<SQLLiteNonceDatabase> => {
// Fall back to SQLite
DATABASE_LOGGER.logMessageWithEmoji(
'Nonce Database initiated with SQLite provider',
true,
GENERIC_EMOJIS.EMOJI_CROSS_MARK,
LOG_LEVELS_STR.LEVEL_WARN
)
DATABASE_LOGGER.info('Nonce Database initiated with SQLite provider')

// Ensure the directory exists before instantiating SQLiteProvider
const dbDir = path.dirname('databases/nonceDatabase.sqlite')
Expand Down

0 comments on commit 2a62160

Please sign in to comment.