Skip to content

Commit 0fb6239

Browse files
committed
fix
1 parent 745860a commit 0fb6239

5 files changed

Lines changed: 37 additions & 28 deletions

File tree

chopsticks/wasm/acala-2310.wasm

8.26 KB
Binary file not shown.

packages/eth-providers/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"test:coverage": "yarn test --run --coverage"
1212
},
1313
"peerDependencies": {
14-
"@acala-network/api": "~6.2.0",
14+
"@acala-network/api": "~6.3.0",
1515
"@polkadot/api": "^16.4.8"
1616
},
1717
"dependencies": {
@@ -24,7 +24,7 @@
2424
"lru-cache": "~7.8.2"
2525
},
2626
"devDependencies": {
27-
"@acala-network/api": "~6.2.0",
27+
"@acala-network/api": "~6.3.0",
2828
"@polkadot/api": "^16.4.8",
2929
"@types/bn.js": "^5.1.5",
3030
"@types/lru-cache": "~7.6.1",

packages/eth-providers/src/base-provider.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -958,12 +958,21 @@ export abstract class BaseProvider extends AbstractProvider {
958958
const blockHash = at ?? this.bestBlockHash;
959959
const apiAt = await apiCache.getApiAt(this.api, blockHash);
960960

961-
const u8a = extrinsic.toU8a();
962961
const lenIncreaseAfterSignature = 100; // approximate length increase after signature
963-
const feeDetails = await apiAt.call.transactionPaymentCallApi.queryCallFeeDetails(
964-
u8a,
965-
u8a.length + lenIncreaseAfterSignature,
966-
);
962+
let feeDetails = null;
963+
if (!apiAt.call.transactionPaymentCallApi) {
964+
// for old api
965+
feeDetails = await apiAt.call.transactionPaymentApi.queryFeeDetails(
966+
extrinsic.toU8a(),
967+
extrinsic.toU8a().length + lenIncreaseAfterSignature,
968+
);
969+
} else {
970+
// for new api with runtime 2310
971+
feeDetails = await apiAt.call.transactionPaymentCallApi.queryCallFeeDetails(
972+
extrinsic,
973+
extrinsic.toU8a().length + lenIncreaseAfterSignature,
974+
);
975+
}
967976
const { baseFee, lenFee, adjustedWeightFee } = feeDetails.inclusionFee.unwrap();
968977

969978
const nativeTxFee = BigNumber.from(

packages/eth-providers/src/utils/queryStoarge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const queryStorage = async <T extends Codec = Codec>(
3333

3434
// we convert to Uint8Array since it maps to the raw encoding, all
3535
// data will be correctly encoded (incl. numbers, excl. :code)
36-
const input = value === null
36+
const input = (value === null || value.isEmpty)
3737
? null
3838
: u8aToU8a(
3939
entry.meta.modifier.isOptional

yarn.lock

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ __metadata:
55
version: 6
66
cacheKey: 8
77

8-
"@acala-network/api-derive@npm:6.2.0":
9-
version: 6.2.0
10-
resolution: "@acala-network/api-derive@npm:6.2.0"
8+
"@acala-network/api-derive@npm:6.3.0":
9+
version: 6.3.0
10+
resolution: "@acala-network/api-derive@npm:6.3.0"
1111
dependencies:
12-
"@acala-network/types": 6.2.0
12+
"@acala-network/types": 6.3.0
1313
peerDependencies:
14-
"@polkadot/api": ^14
15-
checksum: e243d5c4afb54744ea80dfc61706ba536c1433874acd8e881c00c7b717e39c63558049202c6f08d9d0406878dc8be7f073201943f254e3026d004e9466f496ee
14+
"@polkadot/api": ^16
15+
checksum: ebf26806f072e89233f3446ec8edab813bb3cfe63e38b285a99ff91dd0a37400a9b9c98758f7aa107e033f822db322ee4a0bf05e8d978a734a81a3c173c1b93e
1616
languageName: node
1717
linkType: hard
1818

19-
"@acala-network/api@npm:~6.2.0":
20-
version: 6.2.0
21-
resolution: "@acala-network/api@npm:6.2.0"
19+
"@acala-network/api@npm:~6.3.0":
20+
version: 6.3.0
21+
resolution: "@acala-network/api@npm:6.3.0"
2222
dependencies:
23-
"@acala-network/api-derive": 6.2.0
24-
"@acala-network/types": 6.2.0
23+
"@acala-network/api-derive": 6.3.0
24+
"@acala-network/types": 6.3.0
2525
peerDependencies:
26-
"@polkadot/api": ^14
27-
checksum: e4e2f5e2b9189c18c794d2a40b3b6e8bae32a02aa2dc5c9e0ad9f536d7be50a01f2266e2ad7887bb5eadb1e4aed8fd880fb30ed7ed99e028e97d89386ecf9848
26+
"@polkadot/api": ^16
27+
checksum: ba1306d20fb6dcf1877a477e02abeb591f0a878ed4caf1e188441c5633d5f7c37eb31f011cfa12353be4015ce2a7f9b9ac08b3c866093aed204f7b0fed1970df
2828
languageName: node
2929
linkType: hard
3030

@@ -53,7 +53,7 @@ __metadata:
5353
version: 0.0.0-use.local
5454
resolution: "@acala-network/eth-providers@workspace:packages/eth-providers"
5555
dependencies:
56-
"@acala-network/api": ~6.2.0
56+
"@acala-network/api": ~6.3.0
5757
"@acala-network/contracts": 4.3.4
5858
"@acala-network/eth-transactions": "workspace:*"
5959
"@polkadot/api": ^16.4.8
@@ -67,7 +67,7 @@ __metadata:
6767
lru-cache: ~7.8.2
6868
vitest: ^2.1.1
6969
peerDependencies:
70-
"@acala-network/api": ~6.2.0
70+
"@acala-network/api": ~6.3.0
7171
"@polkadot/api": ^16.4.8
7272
languageName: unknown
7373
linkType: soft
@@ -134,12 +134,12 @@ __metadata:
134134
languageName: unknown
135135
linkType: soft
136136

137-
"@acala-network/types@npm:6.2.0":
138-
version: 6.2.0
139-
resolution: "@acala-network/types@npm:6.2.0"
137+
"@acala-network/types@npm:6.3.0":
138+
version: 6.3.0
139+
resolution: "@acala-network/types@npm:6.3.0"
140140
peerDependencies:
141-
"@polkadot/api": ^14
142-
checksum: 570a9e75a2e7c02a2b4ec02c8bf3fcc41e81ffee748bc997fea3c4d055f3b60827562f94027a47f8e6b760eaa6d4b5ecee9f795821ae20fed581116a6d3ba980
141+
"@polkadot/api": ^16
142+
checksum: c6e4fa204cba7be233a24ef6feccedcecc66270faed115c7c42939de6d4147c79a66f72c8c7decd7a7427fb6c3f667b52e7e7351b56d8f926415f03ca0858367
143143
languageName: node
144144
linkType: hard
145145

0 commit comments

Comments
 (0)