Skip to content

Commit

Permalink
removes unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
Amuhar committed Nov 25, 2024
1 parent 6ae3d29 commit e7be612
Show file tree
Hide file tree
Showing 19 changed files with 176 additions and 988 deletions.
2 changes: 1 addition & 1 deletion src/provider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export * from './provider.constants';
export * from './provider.mock';
export * from './provider.module';
export * from './provider.service';
export * from './provider.ganache';
export * from './provider.test';
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { Configuration } from 'common/config';
import { RpcBatchProvider, RpcProvider } from './interfaces';
import { ProviderService } from './provider.service';

export const GANACHE_PORT = 8545;
export const GANACHE_URL = `http://127.0.0.1:${GANACHE_PORT}`;
export const TEST_SERVER_PORT = 8545;
export const TEST_SERVER_URL = `http://127.0.0.1:${TEST_SERVER_PORT}`;

const getProviderFactory = () => {
return async (): Promise<RpcProvider> => {
class FormatterGanache extends Formatter {
class FormatterTest extends Formatter {
blockTag(blockTag: any): any {
if (typeof blockTag === 'object' && blockTag != null) {
return 'latest';
Expand All @@ -24,25 +24,25 @@ const getProviderFactory = () => {

static getFormatter(): Formatter {
if (this._formatter == null) {
this._formatter = new FormatterGanache();
this._formatter = new FormatterTest();
}
return this._formatter;
}

clone() {
return new Provider(GANACHE_URL);
return new Provider(TEST_SERVER_URL);
}
}

return new Provider(GANACHE_URL);
return new Provider(TEST_SERVER_URL);
};
};

@Module({})
export class GanacheProviderModule {
export class TestProviderModule {
static forRoot(): DynamicModule {
return {
module: GanacheProviderModule,
module: TestProviderModule,
global: true,
providers: [
ProviderService,
Expand Down
3 changes: 2 additions & 1 deletion test/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const SLEEP_FOR_RESULT = 3_000;
export const BAD_WC =
'0x010000000000000000000000b9d7934878b5fb9610b3fe8a5e441e8fad7e291f';

export const GANACHE_PORT = 8545;
export const TEST_SERVER_PORT = 8545;
export const TEST_SERVER_URL = 'http://127.0.0.1:8545';

// BLS key for the validator
export const BLS_PRIV_KEY =
Expand Down
Loading

0 comments on commit e7be612

Please sign in to comment.