Skip to content

Commit

Permalink
test latest types bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Jan 23, 2024
1 parent 5d973f0 commit fb45ce0
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 31 deletions.
4 changes: 2 additions & 2 deletions packages/eth-providers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test:e2e": "vitest --run --config vitest.config.e2e.ts"
},
"peerDependencies": {
"@acala-network/api": "~6.0.5",
"@acala-network/api": "6.0.6-1",
"@polkadot/api": "^10.11.1"
},
"dependencies": {
Expand All @@ -23,7 +23,7 @@
"lru-cache": "~7.8.2"
},
"devDependencies": {
"@acala-network/api": "~6.0.5",
"@acala-network/api": "6.0.6-1",
"@types/bn.js": "~5.1.0",
"@types/lru-cache": "~7.6.1",
"dotenv": "~10.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/eth-providers/src/bodhi-provider.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ApiPromise } from '@polkadot/api';
import { BaseProvider } from './base-provider';
import { options } from '@acala-network/api';
import { withAcalaTypes } from '@acala-network/api';
import type { ApiOptions } from '@polkadot/api/types';

export class BodhiProvider extends BaseProvider {
constructor(apiOptions: ApiOptions) {
super();
const api = new ApiPromise(options(apiOptions));
const api = new ApiPromise(withAcalaTypes(apiOptions));
this.setApi(api);
}

Expand Down
8 changes: 3 additions & 5 deletions packages/eth-providers/src/rpc-provider.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { ApiPromise, WsProvider } from '@polkadot/api';
import { acalaRuntime, acalaTypesBundle } from '@acala-network/types';

import { BaseProvider, BaseProviderOptions } from './base-provider';
import { withAcalaTypes } from '@acala-network/api';

export class EvmRpcProvider extends BaseProvider {
constructor(endpoint: string | string[], opts?: BaseProviderOptions) {
super(opts);

const api = new ApiPromise({
const api = new ApiPromise(withAcalaTypes({
provider: new WsProvider(endpoint),
runtime: acalaRuntime,
typesBundle: acalaTypesBundle,
});
}));

this.setApi(api);
}
Expand Down
8 changes: 3 additions & 5 deletions packages/eth-rpc-adapter/src/wrapped-provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiPromise, WsProvider } from '@polkadot/api';
import { BaseProvider, BaseProviderOptions } from '@acala-network/eth-providers/base-provider';
import { acalaRuntime, acalaTypesBundle } from '@acala-network/types';
import { withAcalaTypes } from '@acala-network/api';
import tracer from 'dd-trace';

const TRACE_METHODS = [
Expand Down Expand Up @@ -85,11 +85,9 @@ export class EvmRpcProviderWithTrace extends BaseProviderWithTrace {
constructor(endpoint: string | string[], opts?: BaseProviderOptions) {
super(opts);

const api = new ApiPromise({
const api = new ApiPromise(withAcalaTypes({
provider: new WsProvider(endpoint),
runtime: acalaRuntime,
typesBundle: acalaTypesBundle,
});
}));

this.setApi(api);
}
Expand Down
34 changes: 17 additions & 17 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fb45ce0

Please sign in to comment.