Skip to content

Commit ec03f2a

Browse files
committed
refactor(networks): unify Naga environment module names and remove backward compatibility methods
1 parent 0131659 commit ec03f2a

File tree

4 files changed

+5
-28
lines changed

4 files changed

+5
-28
lines changed

packages/networks/src/networks/vNaga/envs/naga-dev/naga-dev.module.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@ import { createChainManager } from './chain-manager/createChainManager';
33
import { nagaDevEnvironment } from './naga-dev.env';
44
import type { ExpectedAccountOrWalletClient } from '../../shared/managers/contract-manager/createContractsManager';
55

6-
const baseModule = createBaseModule({
6+
const nagaDev = createBaseModule({
77
networkConfig: nagaDevEnvironment.getConfig(),
88
moduleName: nagaDevEnvironment.getNetworkName(),
99
createChainManager: (account: ExpectedAccountOrWalletClient) =>
1010
createChainManager(account),
1111
});
1212

13-
// Add getChainManager method for backward compatibility
14-
const nagaDev = {
15-
...baseModule,
16-
getChainManager: (accountOrWalletClient: ExpectedAccountOrWalletClient) =>
17-
createChainManager(accountOrWalletClient),
18-
};
19-
2013
export type NagaDevUnifiedModule = typeof nagaDev;
2114
export { nagaDev };

packages/networks/src/networks/vNaga/envs/naga-local/naga-local.module.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { ExpectedAccountOrWalletClient } from '../../shared/managers/contra
55

66
const baseModule = createBaseModule({
77
networkConfig: nagaLocalEnvironment.getConfig(),
8-
moduleName: 'naga-local',
8+
moduleName: nagaLocalEnvironment.getNetworkName(),
99
createChainManager: (account: ExpectedAccountOrWalletClient) =>
1010
createChainManager(account),
1111
});
@@ -15,9 +15,6 @@ const nagaLocal = {
1515
...baseModule,
1616
// Local environment specific getter for private key
1717
getPrivateKey: () => nagaLocalEnvironment.getPrivateKey(),
18-
// Add getChainManager method for backward compatibility
19-
getChainManager: (accountOrWalletClient: ExpectedAccountOrWalletClient) =>
20-
createChainManager(accountOrWalletClient),
2118
};
2219

2320
export type NagaLocal = typeof nagaLocal;

packages/networks/src/networks/vNaga/envs/naga-staging/naga-staging.module.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@ import { createChainManager } from './chain-manager/createChainManager';
33
import { nagaStagingEnvironment } from './naga-staging.env';
44
import type { ExpectedAccountOrWalletClient } from '../../shared/managers/contract-manager/createContractsManager';
55

6-
const baseModule = createBaseModule({
6+
const nagaStaging = createBaseModule({
77
networkConfig: nagaStagingEnvironment.getConfig(),
88
moduleName: 'naga-staging',
99
createChainManager: (account: ExpectedAccountOrWalletClient) =>
1010
createChainManager(account),
1111
});
1212

13-
// Add getChainManager method for backward compatibility
14-
const nagaStaging = {
15-
...baseModule,
16-
getChainManager: (accountOrWalletClient: ExpectedAccountOrWalletClient) =>
17-
createChainManager(accountOrWalletClient),
18-
};
19-
2013
export type NagaStaging = typeof nagaStaging;
2114
export { nagaStaging };

packages/networks/src/networks/vNaga/envs/naga-test/naga-test.module.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@ import { createChainManager } from './chain-manager/createChainManager';
33
import { nagaTestEnvironment } from './naga-test.env';
44
import type { ExpectedAccountOrWalletClient } from '../../shared/managers/contract-manager/createContractsManager';
55

6-
const baseModule = createBaseModule({
6+
const nagaTest = createBaseModule({
77
networkConfig: nagaTestEnvironment.getConfig(),
8-
moduleName: 'naga-test',
8+
moduleName: nagaTestEnvironment.getNetworkName(),
99
createChainManager: (account: ExpectedAccountOrWalletClient) =>
1010
createChainManager(account),
1111
});
1212

13-
const nagaTest = {
14-
...baseModule,
15-
getChainManager: (accountOrWalletClient: ExpectedAccountOrWalletClient) =>
16-
createChainManager(accountOrWalletClient),
17-
};
18-
1913
export type NagaTest = typeof nagaTest;
2014
export { nagaTest };

0 commit comments

Comments
 (0)