Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3f5c65b5d | ||
|
|
7f94137b2d | ||
|
|
d65587f58d | ||
|
|
8959455401 | ||
|
|
8e40e38bd6 | ||
|
|
c646717576 |
@@ -39,3 +39,5 @@
|
|||||||
6.0.4
|
6.0.4
|
||||||
6.0.5
|
6.0.5
|
||||||
6.1.2
|
6.1.2
|
||||||
|
|
||||||
|
6.4.2
|
||||||
@@ -1,5 +1,16 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 6.4.2 Oct 18, 2021
|
||||||
|
|
||||||
|
Upgrade priority: Low. Recommended for Westmint runtime 500+
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Ensure `SignerPayload` correctly serializes `Option` with `None`
|
||||||
|
- Add Ethereum `BlockV{0, 1, 2}` types, aligning with latest Frontier
|
||||||
|
- Additional tests for metadata serialization/de-serialization
|
||||||
|
|
||||||
|
|
||||||
## 6.4.1 Oct 17, 2021
|
## 6.4.1 Oct 17, 2021
|
||||||
|
|
||||||
Upgrade priority: Low. Recommended for Kusama & Polkadot runtime 9110+
|
Upgrade priority: Low. Recommended for Kusama & Polkadot runtime 9110+
|
||||||
|
|||||||
+1
-1
@@ -35,6 +35,6 @@
|
|||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
"copyfiles": "^2.4.1"
|
"copyfiles": "^2.4.1"
|
||||||
},
|
},
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"packageManager": "yarn@3.0.1"
|
"packageManager": "yarn@3.0.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/api-contract",
|
"name": "@polkadot/api-contract",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.15.4",
|
"@babel/runtime": "^7.15.4",
|
||||||
"@polkadot/api": "6.4.1",
|
"@polkadot/api": "6.4.2",
|
||||||
"@polkadot/types": "6.4.1",
|
"@polkadot/types": "6.4.2",
|
||||||
"@polkadot/util": "^7.5.1",
|
"@polkadot/util": "^7.5.1",
|
||||||
"rxjs": "^7.4.0"
|
"rxjs": "^7.4.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/api-contract', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/api-contract', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/api-derive",
|
"name": "@polkadot/api-derive",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
"description": "Common functions used across Polkadot, derived from RPC calls and storage queries.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@@ -20,15 +20,15 @@
|
|||||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.15.4",
|
"@babel/runtime": "^7.15.4",
|
||||||
"@polkadot/api": "6.4.1",
|
"@polkadot/api": "6.4.2",
|
||||||
"@polkadot/rpc-core": "6.4.1",
|
"@polkadot/rpc-core": "6.4.2",
|
||||||
"@polkadot/types": "6.4.1",
|
"@polkadot/types": "6.4.2",
|
||||||
"@polkadot/util": "^7.5.1",
|
"@polkadot/util": "^7.5.1",
|
||||||
"@polkadot/util-crypto": "^7.5.1",
|
"@polkadot/util-crypto": "^7.5.1",
|
||||||
"rxjs": "^7.4.0"
|
"rxjs": "^7.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/keyring": "^7.5.1",
|
"@polkadot/keyring": "^7.5.1",
|
||||||
"@polkadot/rpc-provider": "6.4.1"
|
"@polkadot/rpc-provider": "6.4.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/api-derive', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/api-derive', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/api",
|
"name": "@polkadot/api",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
"description": "Promise and RxJS wrappers around the Polkadot JS RPC",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@@ -20,12 +20,12 @@
|
|||||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.15.4",
|
"@babel/runtime": "^7.15.4",
|
||||||
"@polkadot/api-derive": "6.4.1",
|
"@polkadot/api-derive": "6.4.2",
|
||||||
"@polkadot/keyring": "^7.5.1",
|
"@polkadot/keyring": "^7.5.1",
|
||||||
"@polkadot/rpc-core": "6.4.1",
|
"@polkadot/rpc-core": "6.4.2",
|
||||||
"@polkadot/rpc-provider": "6.4.1",
|
"@polkadot/rpc-provider": "6.4.2",
|
||||||
"@polkadot/types": "6.4.1",
|
"@polkadot/types": "6.4.2",
|
||||||
"@polkadot/types-known": "6.4.1",
|
"@polkadot/types-known": "6.4.2",
|
||||||
"@polkadot/util": "^7.5.1",
|
"@polkadot/util": "^7.5.1",
|
||||||
"@polkadot/util-crypto": "^7.5.1",
|
"@polkadot/util-crypto": "^7.5.1",
|
||||||
"eventemitter3": "^4.0.7",
|
"eventemitter3": "^4.0.7",
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/api', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/api', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/rpc-core",
|
"name": "@polkadot/rpc-core",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
"description": "A JavaScript wrapper for the Polkadot JsonRPC interface",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@@ -20,8 +20,8 @@
|
|||||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
|
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.15.4",
|
"@babel/runtime": "^7.15.4",
|
||||||
"@polkadot/rpc-provider": "6.4.1",
|
"@polkadot/rpc-provider": "6.4.2",
|
||||||
"@polkadot/types": "6.4.1",
|
"@polkadot/types": "6.4.2",
|
||||||
"@polkadot/util": "^7.5.1",
|
"@polkadot/util": "^7.5.1",
|
||||||
"rxjs": "^7.4.0"
|
"rxjs": "^7.4.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/rpc-core', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/rpc-core', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/rpc-provider",
|
"name": "@polkadot/rpc-provider",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Transport providers for the API",
|
"description": "Transport providers for the API",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.15.4",
|
"@babel/runtime": "^7.15.4",
|
||||||
"@polkadot/types": "6.4.1",
|
"@polkadot/types": "6.4.2",
|
||||||
"@polkadot/util": "^7.5.1",
|
"@polkadot/util": "^7.5.1",
|
||||||
"@polkadot/util-crypto": "^7.5.1",
|
"@polkadot/util-crypto": "^7.5.1",
|
||||||
"@polkadot/x-fetch": "^7.5.1",
|
"@polkadot/x-fetch": "^7.5.1",
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/keyring": "^7.5.1",
|
"@polkadot/keyring": "^7.5.1",
|
||||||
"@polkadot/types": "6.4.1",
|
"@polkadot/types": "6.4.2",
|
||||||
"mock-socket": "^9.0.5",
|
"mock-socket": "^9.0.5",
|
||||||
"nock": "^13.1.3"
|
"nock": "^13.1.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/rpc-provider', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/rpc-provider', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/typegen",
|
"name": "@polkadot/typegen",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Type generation scripts",
|
"description": "Type generation scripts",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@@ -29,10 +29,10 @@
|
|||||||
"@babel/core": "^7.15.8",
|
"@babel/core": "^7.15.8",
|
||||||
"@babel/register": "^7.15.3",
|
"@babel/register": "^7.15.3",
|
||||||
"@babel/runtime": "^7.15.4",
|
"@babel/runtime": "^7.15.4",
|
||||||
"@polkadot/api": "6.4.1",
|
"@polkadot/api": "6.4.2",
|
||||||
"@polkadot/rpc-provider": "6.4.1",
|
"@polkadot/rpc-provider": "6.4.2",
|
||||||
"@polkadot/types": "6.4.1",
|
"@polkadot/types": "6.4.2",
|
||||||
"@polkadot/types-support": "6.4.1",
|
"@polkadot/types-support": "6.4.2",
|
||||||
"@polkadot/util": "^7.5.1",
|
"@polkadot/util": "^7.5.1",
|
||||||
"handlebars": "^4.7.7",
|
"handlebars": "^4.7.7",
|
||||||
"websocket": "^1.0.34",
|
"websocket": "^1.0.34",
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/typegen', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/typegen', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/types-known",
|
"name": "@polkadot/types-known",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Known type definitions",
|
"description": "Known type definitions",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.15.4",
|
"@babel/runtime": "^7.15.4",
|
||||||
"@polkadot/networks": "^7.5.1",
|
"@polkadot/networks": "^7.5.1",
|
||||||
"@polkadot/types": "6.4.1",
|
"@polkadot/types": "6.4.2",
|
||||||
"@polkadot/util": "^7.5.1"
|
"@polkadot/util": "^7.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types-known', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/types-known', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/types-support",
|
"name": "@polkadot/types-support",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Supporting files for types, mostly for testing",
|
"description": "Supporting files for types, mostly for testing",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types-support', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/types-support', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@polkadot/types",
|
"name": "@polkadot/types",
|
||||||
"version": "6.4.1",
|
"version": "6.4.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Implementation of the Parity codec",
|
"description": "Implementation of the Parity codec",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/keyring": "^7.5.1",
|
"@polkadot/keyring": "^7.5.1",
|
||||||
"@polkadot/types-support": "6.4.1",
|
"@polkadot/types-support": "6.4.2",
|
||||||
"@types/bn.js": "^4.11.6",
|
"@types/bn.js": "^4.11.6",
|
||||||
"bn.js": "^4.12.0"
|
"bn.js": "^4.12.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData
|
|||||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||||
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||||
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
||||||
import type { EthAccount, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth';
|
import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
|
||||||
import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
|
import type { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
|
||||||
import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
|
import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
|
||||||
import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
|
import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
|
||||||
@@ -155,6 +155,9 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
BlockTraceEvent: BlockTraceEvent;
|
BlockTraceEvent: BlockTraceEvent;
|
||||||
BlockTraceEventData: BlockTraceEventData;
|
BlockTraceEventData: BlockTraceEventData;
|
||||||
BlockTraceSpan: BlockTraceSpan;
|
BlockTraceSpan: BlockTraceSpan;
|
||||||
|
BlockV0: BlockV0;
|
||||||
|
BlockV1: BlockV1;
|
||||||
|
BlockV2: BlockV2;
|
||||||
BlockWeights: BlockWeights;
|
BlockWeights: BlockWeights;
|
||||||
BodyId: BodyId;
|
BodyId: BodyId;
|
||||||
BodyPart: BodyPart;
|
BodyPart: BodyPart;
|
||||||
@@ -293,6 +296,8 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
DownwardMessage: DownwardMessage;
|
DownwardMessage: DownwardMessage;
|
||||||
EcdsaSignature: EcdsaSignature;
|
EcdsaSignature: EcdsaSignature;
|
||||||
Ed25519Signature: Ed25519Signature;
|
Ed25519Signature: Ed25519Signature;
|
||||||
|
EIP1559Transaction: EIP1559Transaction;
|
||||||
|
EIP2930Transaction: EIP2930Transaction;
|
||||||
ElectionCompute: ElectionCompute;
|
ElectionCompute: ElectionCompute;
|
||||||
ElectionPhase: ElectionPhase;
|
ElectionPhase: ElectionPhase;
|
||||||
ElectionResult: ElectionResult;
|
ElectionResult: ElectionResult;
|
||||||
@@ -314,7 +319,10 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
ErrorMetadataV13: ErrorMetadataV13;
|
ErrorMetadataV13: ErrorMetadataV13;
|
||||||
ErrorMetadataV14: ErrorMetadataV14;
|
ErrorMetadataV14: ErrorMetadataV14;
|
||||||
ErrorMetadataV9: ErrorMetadataV9;
|
ErrorMetadataV9: ErrorMetadataV9;
|
||||||
|
EthAccessList: EthAccessList;
|
||||||
|
EthAccessListItem: EthAccessListItem;
|
||||||
EthAccount: EthAccount;
|
EthAccount: EthAccount;
|
||||||
|
EthAddress: EthAddress;
|
||||||
EthBlock: EthBlock;
|
EthBlock: EthBlock;
|
||||||
EthBloom: EthBloom;
|
EthBloom: EthBloom;
|
||||||
EthCallRequest: EthCallRequest;
|
EthCallRequest: EthCallRequest;
|
||||||
@@ -522,6 +530,7 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
LastRuntimeUpgradeInfo: LastRuntimeUpgradeInfo;
|
LastRuntimeUpgradeInfo: LastRuntimeUpgradeInfo;
|
||||||
LeasePeriod: LeasePeriod;
|
LeasePeriod: LeasePeriod;
|
||||||
LeasePeriodOf: LeasePeriodOf;
|
LeasePeriodOf: LeasePeriodOf;
|
||||||
|
LegacyTransaction: LegacyTransaction;
|
||||||
Limits: Limits;
|
Limits: Limits;
|
||||||
LimitsTo264: LimitsTo264;
|
LimitsTo264: LimitsTo264;
|
||||||
LocalValidationData: LocalValidationData;
|
LocalValidationData: LocalValidationData;
|
||||||
@@ -951,6 +960,9 @@ declare module '@polkadot/types/types/registry' {
|
|||||||
TransactionInfo: TransactionInfo;
|
TransactionInfo: TransactionInfo;
|
||||||
TransactionPriority: TransactionPriority;
|
TransactionPriority: TransactionPriority;
|
||||||
TransactionStorageProof: TransactionStorageProof;
|
TransactionStorageProof: TransactionStorageProof;
|
||||||
|
TransactionV0: TransactionV0;
|
||||||
|
TransactionV1: TransactionV1;
|
||||||
|
TransactionV2: TransactionV2;
|
||||||
TransactionValidityError: TransactionValidityError;
|
TransactionValidityError: TransactionValidityError;
|
||||||
TransientValidationData: TransientValidationData;
|
TransientValidationData: TransientValidationData;
|
||||||
TreasuryProposal: TreasuryProposal;
|
TreasuryProposal: TreasuryProposal;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ describe('Option', (): void => {
|
|||||||
expect(new Option(registry, Text, undefined).isNone).toBe(true);
|
expect(new Option(registry, Text, undefined).isNone).toBe(true);
|
||||||
expect(new Option(registry, Text, null).isNone).toBe(true);
|
expect(new Option(registry, Text, null).isNone).toBe(true);
|
||||||
expect(new Option(registry, Text, 'test').isNone).toBe(false);
|
expect(new Option(registry, Text, 'test').isNone).toBe(false);
|
||||||
|
expect(new Option(registry, Text, '0x').isNone).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('converts an option to an option', (): void => {
|
it('converts an option to an option', (): void => {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function decodeOptionU8a (registry: Registry, Type: Constructor, value: Uint8Arr
|
|||||||
|
|
||||||
/** @internal */
|
/** @internal */
|
||||||
function decodeOption (registry: Registry, typeName: Constructor | string, value?: unknown): Codec {
|
function decodeOption (registry: Registry, typeName: Constructor | string, value?: unknown): Codec {
|
||||||
if (isNull(value) || isUndefined(value) || value instanceof Null) {
|
if (isNull(value) || isUndefined(value) || value instanceof Null || value === '0x') {
|
||||||
return new Null(registry);
|
return new Null(registry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -459,9 +459,9 @@ export class TypeRegistry implements Registry {
|
|||||||
// setup the available extensions
|
// setup the available extensions
|
||||||
this.setSignedExtensions(
|
this.setSignedExtensions(
|
||||||
signedExtensions || (
|
signedExtensions || (
|
||||||
metadata.asLatest.extrinsic.version.gt(BN_ZERO)
|
this.#metadata.extrinsic.version.gt(BN_ZERO)
|
||||||
// FIXME Use the extension and their injected types
|
// FIXME Use the extension and their injected types
|
||||||
? metadata.asLatest.extrinsic.signedExtensions.map(({ identifier }) => identifier.toString())
|
? this.#metadata.extrinsic.signedExtensions.map(({ identifier }) => identifier.toString())
|
||||||
: fallbackExtensions
|
: fallbackExtensions
|
||||||
),
|
),
|
||||||
userExtensions
|
userExtensions
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import type { Codec, ISignerPayload, Registry, SignerPayloadJSON, SignerPayloadR
|
|||||||
import { u8aToHex } from '@polkadot/util';
|
import { u8aToHex } from '@polkadot/util';
|
||||||
|
|
||||||
import { Compact } from '../codec/Compact';
|
import { Compact } from '../codec/Compact';
|
||||||
|
import { Option } from '../codec/Option';
|
||||||
import { Struct } from '../codec/Struct';
|
import { Struct } from '../codec/Struct';
|
||||||
import { Vec } from '../codec/Vec';
|
import { Vec } from '../codec/Vec';
|
||||||
import { Text } from '../primitive/Text';
|
import { Text } from '../primitive/Text';
|
||||||
@@ -120,7 +121,13 @@ export class GenericSignerPayload extends Struct implements ISignerPayload, Sign
|
|||||||
return {
|
return {
|
||||||
// add any explicit overrides we may have
|
// add any explicit overrides we may have
|
||||||
...(Object.keys(this._extraTypes).reduce<Record<string, string>>((map, key) => {
|
...(Object.keys(this._extraTypes).reduce<Record<string, string>>((map, key) => {
|
||||||
map[key] = (this.get(key) as Codec).toHex();
|
const value = this.get(key) as Codec;
|
||||||
|
const isOption = value instanceof Option;
|
||||||
|
|
||||||
|
// Don't include Option.isNone
|
||||||
|
if (!isOption || value.isSome) {
|
||||||
|
map[key] = value.toHex();
|
||||||
|
}
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}, {})),
|
}, {})),
|
||||||
|
|||||||
@@ -10,12 +10,94 @@ import type { DefinitionsTypes } from '../../types';
|
|||||||
|
|
||||||
import { rpc } from './rpc';
|
import { rpc } from './rpc';
|
||||||
|
|
||||||
|
const V0: DefinitionsTypes = {
|
||||||
|
BlockV0: {
|
||||||
|
header: 'EthHeader',
|
||||||
|
transactions: 'Vec<TransactionV0>',
|
||||||
|
ommers: 'Vec<EthHeader>'
|
||||||
|
},
|
||||||
|
LegacyTransaction: {
|
||||||
|
nonce: 'U256',
|
||||||
|
gasPrice: 'U256',
|
||||||
|
gasLimit: 'U256',
|
||||||
|
action: 'EthTransactionAction',
|
||||||
|
value: 'U256',
|
||||||
|
input: 'Bytes',
|
||||||
|
signature: 'EthTransactionSignature'
|
||||||
|
},
|
||||||
|
TransactionV0: 'LegacyTransaction'
|
||||||
|
};
|
||||||
|
|
||||||
|
const V1: DefinitionsTypes = {
|
||||||
|
BlockV1: {
|
||||||
|
header: 'EthHeader',
|
||||||
|
transactions: 'Vec<TransactionV1>',
|
||||||
|
ommers: 'Vec<EthHeader>'
|
||||||
|
},
|
||||||
|
EIP2930Transaction: {
|
||||||
|
chainId: 'u64',
|
||||||
|
nonce: 'U256',
|
||||||
|
gasPrice: 'U256',
|
||||||
|
gasLimit: 'U256',
|
||||||
|
action: 'EthTransactionAction',
|
||||||
|
value: 'U256',
|
||||||
|
input: 'Bytes',
|
||||||
|
accessList: 'EthAccessList',
|
||||||
|
oddYParity: 'bool',
|
||||||
|
r: 'H256',
|
||||||
|
s: 'H256'
|
||||||
|
},
|
||||||
|
TransactionV1: {
|
||||||
|
_enum: {
|
||||||
|
Legacy: 'LegacyTransaction',
|
||||||
|
EIP2930: 'EIP2930Transaction'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const V2: DefinitionsTypes = {
|
||||||
|
BlockV2: {
|
||||||
|
header: 'EthHeader',
|
||||||
|
transactions: 'Vec<TransactionV2>',
|
||||||
|
ommers: 'Vec<EthHeader>'
|
||||||
|
},
|
||||||
|
EIP1559Transaction: {
|
||||||
|
chainId: 'u64',
|
||||||
|
nonce: 'U256',
|
||||||
|
maxPriorityFeePerGas: 'U256',
|
||||||
|
maxFeePerGas: 'U256',
|
||||||
|
gasLimit: 'U256',
|
||||||
|
action: 'EthTransactionAction',
|
||||||
|
value: 'U256',
|
||||||
|
input: 'Bytes',
|
||||||
|
accessList: 'EthAccessList',
|
||||||
|
oddYParity: 'bool',
|
||||||
|
r: 'H256',
|
||||||
|
s: 'H256'
|
||||||
|
},
|
||||||
|
TransactionV2: {
|
||||||
|
_enum: {
|
||||||
|
Legacy: 'LegacyTransaction',
|
||||||
|
EIP2930: 'EIP2930Transaction',
|
||||||
|
EIP1559: 'EIP1559Transaction'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const types: DefinitionsTypes = {
|
const types: DefinitionsTypes = {
|
||||||
|
...V0,
|
||||||
|
...V1,
|
||||||
|
...V2,
|
||||||
EthereumAccountId: 'GenericEthereumAccountId',
|
EthereumAccountId: 'GenericEthereumAccountId',
|
||||||
EthereumLookupSource: 'GenericEthereumLookupSource',
|
EthereumLookupSource: 'GenericEthereumLookupSource',
|
||||||
EthereumSignature: '[u8; 65]',
|
EthereumSignature: '[u8; 65]',
|
||||||
|
EthAccessListItem: {
|
||||||
|
address: 'EthAddress',
|
||||||
|
slots: 'Vec<H256>'
|
||||||
|
},
|
||||||
|
EthAccessList: 'Vec<EthAccessListItem>',
|
||||||
EthAccount: {
|
EthAccount: {
|
||||||
address: 'H160',
|
address: 'EthAddress',
|
||||||
balance: 'U256',
|
balance: 'U256',
|
||||||
nonce: 'U256',
|
nonce: 'U256',
|
||||||
codeHash: 'H256',
|
codeHash: 'H256',
|
||||||
@@ -23,6 +105,7 @@ const types: DefinitionsTypes = {
|
|||||||
accountProof: 'Vec<Bytes>',
|
accountProof: 'Vec<Bytes>',
|
||||||
storageProof: 'Vec<EthStorageProof>'
|
storageProof: 'Vec<EthStorageProof>'
|
||||||
},
|
},
|
||||||
|
EthAddress: 'H160',
|
||||||
EthBlock: {
|
EthBlock: {
|
||||||
header: 'EthHeader',
|
header: 'EthHeader',
|
||||||
transactions: 'Vec<EthTransaction>',
|
transactions: 'Vec<EthTransaction>',
|
||||||
@@ -31,7 +114,7 @@ const types: DefinitionsTypes = {
|
|||||||
EthHeader: {
|
EthHeader: {
|
||||||
parentHash: 'H256',
|
parentHash: 'H256',
|
||||||
ommersHash: 'H256',
|
ommersHash: 'H256',
|
||||||
beneficiary: 'H160',
|
beneficiary: 'EthAddress',
|
||||||
stateRoot: 'H256',
|
stateRoot: 'H256',
|
||||||
transactionsRoot: 'H256',
|
transactionsRoot: 'H256',
|
||||||
receiptsRoot: 'H256',
|
receiptsRoot: 'H256',
|
||||||
@@ -53,8 +136,8 @@ const types: DefinitionsTypes = {
|
|||||||
blockHash: 'Option<H256>',
|
blockHash: 'Option<H256>',
|
||||||
parentHash: 'H256',
|
parentHash: 'H256',
|
||||||
sha3Uncles: 'H256',
|
sha3Uncles: 'H256',
|
||||||
author: 'H160',
|
author: 'EthAddress',
|
||||||
miner: 'H160',
|
miner: 'EthAddress',
|
||||||
stateRoot: 'H256',
|
stateRoot: 'H256',
|
||||||
transactionsRoot: 'H256',
|
transactionsRoot: 'H256',
|
||||||
receiptsRoot: 'H256',
|
receiptsRoot: 'H256',
|
||||||
@@ -73,8 +156,8 @@ const types: DefinitionsTypes = {
|
|||||||
},
|
},
|
||||||
EthBloom: 'H2048',
|
EthBloom: 'H2048',
|
||||||
EthCallRequest: {
|
EthCallRequest: {
|
||||||
from: 'Option<H160>',
|
from: 'Option<EthAddress>',
|
||||||
to: 'Option<H160>',
|
to: 'Option<EthAddress>',
|
||||||
gasPrice: 'Option<U256>',
|
gasPrice: 'Option<U256>',
|
||||||
gas: 'Option<U256>',
|
gas: 'Option<U256>',
|
||||||
value: 'Option<U256>',
|
value: 'Option<U256>',
|
||||||
@@ -90,8 +173,8 @@ const types: DefinitionsTypes = {
|
|||||||
},
|
},
|
||||||
EthFilterAddress: {
|
EthFilterAddress: {
|
||||||
_enum: {
|
_enum: {
|
||||||
Single: 'H160',
|
Single: 'EthAddress',
|
||||||
Multiple: 'Vec<H160>',
|
Multiple: 'Vec<EthAddress>',
|
||||||
Null: 'Null'
|
Null: 'Null'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -125,8 +208,8 @@ const types: DefinitionsTypes = {
|
|||||||
blockHash: 'Option<H256>',
|
blockHash: 'Option<H256>',
|
||||||
parentHash: 'H256',
|
parentHash: 'H256',
|
||||||
sha3Uncles: 'H256',
|
sha3Uncles: 'H256',
|
||||||
author: 'H160',
|
author: 'EthAddress',
|
||||||
miner: 'H160',
|
miner: 'EthAddress',
|
||||||
stateRoot: 'H256',
|
stateRoot: 'H256',
|
||||||
transactionsRoot: 'H256',
|
transactionsRoot: 'H256',
|
||||||
receiptsRoot: 'H256',
|
receiptsRoot: 'H256',
|
||||||
@@ -141,7 +224,7 @@ const types: DefinitionsTypes = {
|
|||||||
blockSize: 'Option<U256>'
|
blockSize: 'Option<U256>'
|
||||||
},
|
},
|
||||||
EthLog: {
|
EthLog: {
|
||||||
address: 'H160',
|
address: 'EthAddress',
|
||||||
topics: 'Vec<H256>',
|
topics: 'Vec<H256>',
|
||||||
data: 'Bytes',
|
data: 'Bytes',
|
||||||
blockHash: 'Option<H256>',
|
blockHash: 'Option<H256>',
|
||||||
@@ -156,12 +239,12 @@ const types: DefinitionsTypes = {
|
|||||||
transactionHash: 'Option<H256>',
|
transactionHash: 'Option<H256>',
|
||||||
transactionIndex: 'Option<U256>',
|
transactionIndex: 'Option<U256>',
|
||||||
blockHash: 'Option<H256>',
|
blockHash: 'Option<H256>',
|
||||||
from: 'Option<H160>',
|
from: 'Option<EthAddress>',
|
||||||
to: 'Option<H160>',
|
to: 'Option<EthAddress>',
|
||||||
blockNumber: 'Option<U256>',
|
blockNumber: 'Option<U256>',
|
||||||
cumulativeGasUsed: 'U256',
|
cumulativeGasUsed: 'U256',
|
||||||
gasUsed: 'Option<U256>',
|
gasUsed: 'Option<U256>',
|
||||||
contractAddress: 'Option<H160>',
|
contractAddress: 'Option<EthAddress>',
|
||||||
logs: 'Vec<EthLog>',
|
logs: 'Vec<EthLog>',
|
||||||
root: 'Option<H256>',
|
root: 'Option<H256>',
|
||||||
logsBloom: 'EthBloom',
|
logsBloom: 'EthBloom',
|
||||||
@@ -202,15 +285,7 @@ const types: DefinitionsTypes = {
|
|||||||
None: 'Null'
|
None: 'Null'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
EthTransaction: {
|
EthTransaction: 'LegacyTransaction',
|
||||||
nonce: 'U256',
|
|
||||||
gasPrice: 'U256',
|
|
||||||
gasLimit: 'U256',
|
|
||||||
action: 'EthTransactionAction',
|
|
||||||
value: 'U256',
|
|
||||||
input: 'Bytes',
|
|
||||||
signature: 'EthTransactionSignature'
|
|
||||||
},
|
|
||||||
EthTransactionSignature: {
|
EthTransactionSignature: {
|
||||||
v: 'u64',
|
v: 'u64',
|
||||||
r: 'H256',
|
r: 'H256',
|
||||||
@@ -229,8 +304,8 @@ const types: DefinitionsTypes = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
EthTransactionRequest: {
|
EthTransactionRequest: {
|
||||||
from: 'Option<H160>',
|
from: 'Option<EthAddress>',
|
||||||
to: 'Option<H160>',
|
to: 'Option<EthAddress>',
|
||||||
gasPrice: 'Option<U256>',
|
gasPrice: 'Option<U256>',
|
||||||
gas: 'Option<U256>',
|
gas: 'Option<U256>',
|
||||||
value: 'Option<U256>',
|
value: 'Option<U256>',
|
||||||
@@ -240,9 +315,9 @@ const types: DefinitionsTypes = {
|
|||||||
EthTransactionStatus: {
|
EthTransactionStatus: {
|
||||||
transactionHash: 'H256',
|
transactionHash: 'H256',
|
||||||
transactionIndex: 'u32',
|
transactionIndex: 'u32',
|
||||||
from: 'H160',
|
from: 'EthAddress',
|
||||||
to: 'Option<H160>',
|
to: 'Option<EthAddress>',
|
||||||
contractAddress: 'Option<H160>',
|
contractAddress: 'Option<EthAddress>',
|
||||||
logs: 'Vec<EthLog>',
|
logs: 'Vec<EthLog>',
|
||||||
logsBloom: 'EthBloom'
|
logsBloom: 'EthBloom'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,9 +4,70 @@
|
|||||||
import type { Bytes, Enum, GenericEthereumAccountId, GenericEthereumLookupSource, Option, Struct, U256, U64, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types';
|
import type { Bytes, Enum, GenericEthereumAccountId, GenericEthereumLookupSource, Option, Struct, U256, U64, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types';
|
||||||
import type { BlockNumber, H160, H2048, H256, H64 } from '@polkadot/types/interfaces/runtime';
|
import type { BlockNumber, H160, H2048, H256, H64 } from '@polkadot/types/interfaces/runtime';
|
||||||
|
|
||||||
|
/** @name BlockV0 */
|
||||||
|
export interface BlockV0 extends Struct {
|
||||||
|
readonly header: EthHeader;
|
||||||
|
readonly transactions: Vec<TransactionV0>;
|
||||||
|
readonly ommers: Vec<EthHeader>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @name BlockV1 */
|
||||||
|
export interface BlockV1 extends Struct {
|
||||||
|
readonly header: EthHeader;
|
||||||
|
readonly transactions: Vec<TransactionV1>;
|
||||||
|
readonly ommers: Vec<EthHeader>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @name BlockV2 */
|
||||||
|
export interface BlockV2 extends Struct {
|
||||||
|
readonly header: EthHeader;
|
||||||
|
readonly transactions: Vec<TransactionV2>;
|
||||||
|
readonly ommers: Vec<EthHeader>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @name EIP1559Transaction */
|
||||||
|
export interface EIP1559Transaction extends Struct {
|
||||||
|
readonly chainId: u64;
|
||||||
|
readonly nonce: U256;
|
||||||
|
readonly maxPriorityFeePerGas: U256;
|
||||||
|
readonly maxFeePerGas: U256;
|
||||||
|
readonly gasLimit: U256;
|
||||||
|
readonly action: EthTransactionAction;
|
||||||
|
readonly value: U256;
|
||||||
|
readonly input: Bytes;
|
||||||
|
readonly accessList: EthAccessList;
|
||||||
|
readonly oddYParity: bool;
|
||||||
|
readonly r: H256;
|
||||||
|
readonly s: H256;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @name EIP2930Transaction */
|
||||||
|
export interface EIP2930Transaction extends Struct {
|
||||||
|
readonly chainId: u64;
|
||||||
|
readonly nonce: U256;
|
||||||
|
readonly gasPrice: U256;
|
||||||
|
readonly gasLimit: U256;
|
||||||
|
readonly action: EthTransactionAction;
|
||||||
|
readonly value: U256;
|
||||||
|
readonly input: Bytes;
|
||||||
|
readonly accessList: EthAccessList;
|
||||||
|
readonly oddYParity: bool;
|
||||||
|
readonly r: H256;
|
||||||
|
readonly s: H256;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @name EthAccessList */
|
||||||
|
export interface EthAccessList extends Vec<EthAccessListItem> {}
|
||||||
|
|
||||||
|
/** @name EthAccessListItem */
|
||||||
|
export interface EthAccessListItem extends Struct {
|
||||||
|
readonly address: EthAddress;
|
||||||
|
readonly slots: Vec<H256>;
|
||||||
|
}
|
||||||
|
|
||||||
/** @name EthAccount */
|
/** @name EthAccount */
|
||||||
export interface EthAccount extends Struct {
|
export interface EthAccount extends Struct {
|
||||||
readonly address: H160;
|
readonly address: EthAddress;
|
||||||
readonly balance: U256;
|
readonly balance: U256;
|
||||||
readonly nonce: U256;
|
readonly nonce: U256;
|
||||||
readonly codeHash: H256;
|
readonly codeHash: H256;
|
||||||
@@ -15,6 +76,9 @@ export interface EthAccount extends Struct {
|
|||||||
readonly storageProof: Vec<EthStorageProof>;
|
readonly storageProof: Vec<EthStorageProof>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @name EthAddress */
|
||||||
|
export interface EthAddress extends H160 {}
|
||||||
|
|
||||||
/** @name EthBlock */
|
/** @name EthBlock */
|
||||||
export interface EthBlock extends Struct {
|
export interface EthBlock extends Struct {
|
||||||
readonly header: EthHeader;
|
readonly header: EthHeader;
|
||||||
@@ -27,8 +91,8 @@ export interface EthBloom extends H2048 {}
|
|||||||
|
|
||||||
/** @name EthCallRequest */
|
/** @name EthCallRequest */
|
||||||
export interface EthCallRequest extends Struct {
|
export interface EthCallRequest extends Struct {
|
||||||
readonly from: Option<H160>;
|
readonly from: Option<EthAddress>;
|
||||||
readonly to: Option<H160>;
|
readonly to: Option<EthAddress>;
|
||||||
readonly gasPrice: Option<U256>;
|
readonly gasPrice: Option<U256>;
|
||||||
readonly gas: Option<U256>;
|
readonly gas: Option<U256>;
|
||||||
readonly value: Option<U256>;
|
readonly value: Option<U256>;
|
||||||
@@ -57,9 +121,9 @@ export interface EthFilter extends Struct {
|
|||||||
/** @name EthFilterAddress */
|
/** @name EthFilterAddress */
|
||||||
export interface EthFilterAddress extends Enum {
|
export interface EthFilterAddress extends Enum {
|
||||||
readonly isSingle: boolean;
|
readonly isSingle: boolean;
|
||||||
readonly asSingle: H160;
|
readonly asSingle: EthAddress;
|
||||||
readonly isMultiple: boolean;
|
readonly isMultiple: boolean;
|
||||||
readonly asMultiple: Vec<H160>;
|
readonly asMultiple: Vec<EthAddress>;
|
||||||
readonly isNull: boolean;
|
readonly isNull: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +161,7 @@ export interface EthFilterTopicInner extends Enum {
|
|||||||
export interface EthHeader extends Struct {
|
export interface EthHeader extends Struct {
|
||||||
readonly parentHash: H256;
|
readonly parentHash: H256;
|
||||||
readonly ommersHash: H256;
|
readonly ommersHash: H256;
|
||||||
readonly beneficiary: H160;
|
readonly beneficiary: EthAddress;
|
||||||
readonly stateRoot: H256;
|
readonly stateRoot: H256;
|
||||||
readonly transactionsRoot: H256;
|
readonly transactionsRoot: H256;
|
||||||
readonly receiptsRoot: H256;
|
readonly receiptsRoot: H256;
|
||||||
@@ -114,7 +178,7 @@ export interface EthHeader extends Struct {
|
|||||||
|
|
||||||
/** @name EthLog */
|
/** @name EthLog */
|
||||||
export interface EthLog extends Struct {
|
export interface EthLog extends Struct {
|
||||||
readonly address: H160;
|
readonly address: EthAddress;
|
||||||
readonly topics: Vec<H256>;
|
readonly topics: Vec<H256>;
|
||||||
readonly data: Bytes;
|
readonly data: Bytes;
|
||||||
readonly blockHash: Option<H256>;
|
readonly blockHash: Option<H256>;
|
||||||
@@ -131,12 +195,12 @@ export interface EthReceipt extends Struct {
|
|||||||
readonly transactionHash: Option<H256>;
|
readonly transactionHash: Option<H256>;
|
||||||
readonly transactionIndex: Option<U256>;
|
readonly transactionIndex: Option<U256>;
|
||||||
readonly blockHash: Option<H256>;
|
readonly blockHash: Option<H256>;
|
||||||
readonly from: Option<H160>;
|
readonly from: Option<EthAddress>;
|
||||||
readonly to: Option<H160>;
|
readonly to: Option<EthAddress>;
|
||||||
readonly blockNumber: Option<U256>;
|
readonly blockNumber: Option<U256>;
|
||||||
readonly cumulativeGasUsed: U256;
|
readonly cumulativeGasUsed: U256;
|
||||||
readonly gasUsed: Option<U256>;
|
readonly gasUsed: Option<U256>;
|
||||||
readonly contractAddress: Option<H160>;
|
readonly contractAddress: Option<EthAddress>;
|
||||||
readonly logs: Vec<EthLog>;
|
readonly logs: Vec<EthLog>;
|
||||||
readonly root: Option<H256>;
|
readonly root: Option<H256>;
|
||||||
readonly logsBloom: EthBloom;
|
readonly logsBloom: EthBloom;
|
||||||
@@ -148,8 +212,8 @@ export interface EthRichBlock extends Struct {
|
|||||||
readonly blockHash: Option<H256>;
|
readonly blockHash: Option<H256>;
|
||||||
readonly parentHash: H256;
|
readonly parentHash: H256;
|
||||||
readonly sha3Uncles: H256;
|
readonly sha3Uncles: H256;
|
||||||
readonly author: H160;
|
readonly author: EthAddress;
|
||||||
readonly miner: H160;
|
readonly miner: EthAddress;
|
||||||
readonly stateRoot: H256;
|
readonly stateRoot: H256;
|
||||||
readonly transactionsRoot: H256;
|
readonly transactionsRoot: H256;
|
||||||
readonly receiptsRoot: H256;
|
readonly receiptsRoot: H256;
|
||||||
@@ -172,8 +236,8 @@ export interface EthRichHeader extends Struct {
|
|||||||
readonly blockHash: Option<H256>;
|
readonly blockHash: Option<H256>;
|
||||||
readonly parentHash: H256;
|
readonly parentHash: H256;
|
||||||
readonly sha3Uncles: H256;
|
readonly sha3Uncles: H256;
|
||||||
readonly author: H160;
|
readonly author: EthAddress;
|
||||||
readonly miner: H160;
|
readonly miner: EthAddress;
|
||||||
readonly stateRoot: H256;
|
readonly stateRoot: H256;
|
||||||
readonly transactionsRoot: H256;
|
readonly transactionsRoot: H256;
|
||||||
readonly receiptsRoot: H256;
|
readonly receiptsRoot: H256;
|
||||||
@@ -239,15 +303,7 @@ export interface EthSyncStatus extends Enum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @name EthTransaction */
|
/** @name EthTransaction */
|
||||||
export interface EthTransaction extends Struct {
|
export interface EthTransaction extends LegacyTransaction {}
|
||||||
readonly nonce: U256;
|
|
||||||
readonly gasPrice: U256;
|
|
||||||
readonly gasLimit: U256;
|
|
||||||
readonly action: EthTransactionAction;
|
|
||||||
readonly value: U256;
|
|
||||||
readonly input: Bytes;
|
|
||||||
readonly signature: EthTransactionSignature;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @name EthTransactionAction */
|
/** @name EthTransactionAction */
|
||||||
export interface EthTransactionAction extends Enum {
|
export interface EthTransactionAction extends Enum {
|
||||||
@@ -266,8 +322,8 @@ export interface EthTransactionCondition extends Enum {
|
|||||||
|
|
||||||
/** @name EthTransactionRequest */
|
/** @name EthTransactionRequest */
|
||||||
export interface EthTransactionRequest extends Struct {
|
export interface EthTransactionRequest extends Struct {
|
||||||
readonly from: Option<H160>;
|
readonly from: Option<EthAddress>;
|
||||||
readonly to: Option<H160>;
|
readonly to: Option<EthAddress>;
|
||||||
readonly gasPrice: Option<U256>;
|
readonly gasPrice: Option<U256>;
|
||||||
readonly gas: Option<U256>;
|
readonly gas: Option<U256>;
|
||||||
readonly value: Option<U256>;
|
readonly value: Option<U256>;
|
||||||
@@ -286,9 +342,9 @@ export interface EthTransactionSignature extends Struct {
|
|||||||
export interface EthTransactionStatus extends Struct {
|
export interface EthTransactionStatus extends Struct {
|
||||||
readonly transactionHash: H256;
|
readonly transactionHash: H256;
|
||||||
readonly transactionIndex: u32;
|
readonly transactionIndex: u32;
|
||||||
readonly from: H160;
|
readonly from: EthAddress;
|
||||||
readonly to: Option<H160>;
|
readonly to: Option<EthAddress>;
|
||||||
readonly contractAddress: Option<H160>;
|
readonly contractAddress: Option<EthAddress>;
|
||||||
readonly logs: Vec<EthLog>;
|
readonly logs: Vec<EthLog>;
|
||||||
readonly logsBloom: EthBloom;
|
readonly logsBloom: EthBloom;
|
||||||
}
|
}
|
||||||
@@ -301,4 +357,36 @@ export interface EthWork extends Struct {
|
|||||||
readonly number: Option<u64>;
|
readonly number: Option<u64>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @name LegacyTransaction */
|
||||||
|
export interface LegacyTransaction extends Struct {
|
||||||
|
readonly nonce: U256;
|
||||||
|
readonly gasPrice: U256;
|
||||||
|
readonly gasLimit: U256;
|
||||||
|
readonly action: EthTransactionAction;
|
||||||
|
readonly value: U256;
|
||||||
|
readonly input: Bytes;
|
||||||
|
readonly signature: EthTransactionSignature;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @name TransactionV0 */
|
||||||
|
export interface TransactionV0 extends LegacyTransaction {}
|
||||||
|
|
||||||
|
/** @name TransactionV1 */
|
||||||
|
export interface TransactionV1 extends Enum {
|
||||||
|
readonly isLegacy: boolean;
|
||||||
|
readonly asLegacy: LegacyTransaction;
|
||||||
|
readonly isEip2930: boolean;
|
||||||
|
readonly asEip2930: EIP2930Transaction;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @name TransactionV2 */
|
||||||
|
export interface TransactionV2 extends Enum {
|
||||||
|
readonly isLegacy: boolean;
|
||||||
|
readonly asLegacy: LegacyTransaction;
|
||||||
|
readonly isEip2930: boolean;
|
||||||
|
readonly asEip2930: EIP2930Transaction;
|
||||||
|
readonly isEip1559: boolean;
|
||||||
|
readonly asEip1559: EIP1559Transaction;
|
||||||
|
}
|
||||||
|
|
||||||
export type PHANTOM_ETH = 'eth';
|
export type PHANTOM_ETH = 'eth';
|
||||||
|
|||||||
@@ -125,16 +125,39 @@ export function defaultValues (registry: Registry, { data, fails = [] }: Check,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function serialize (registry: Registry, { data }: Check): void {
|
||||||
|
const metadata = new Metadata(registry, data);
|
||||||
|
|
||||||
|
it('serializes to hex in the same form as retrieved', (): void => {
|
||||||
|
expect(metadata.toHex()).toEqual(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
// NOTE Assuming the first passes this is actually something that doesn't test
|
||||||
|
// anything new. If the first line in this function passed and the above values
|
||||||
|
// are equivalent, this would be as well.
|
||||||
|
it.skip('can construct from a re-serialized form', (): void => {
|
||||||
|
expect(
|
||||||
|
() => new Metadata(registry, metadata.toHex())
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
|
// as used in the extension
|
||||||
|
it('can construct from asCallsOnly.toHex()', (): void => {
|
||||||
|
expect(
|
||||||
|
() => new Metadata(registry, metadata.asCallsOnly.toHex())
|
||||||
|
).not.toThrow();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function testMeta (version: number, matchers: Record<string, Check>, withFallback = true): void {
|
export function testMeta (version: number, matchers: Record<string, Check>, withFallback = true): void {
|
||||||
describe(`MetadataV${version}`, (): void => {
|
describe(`MetadataV${version}`, (): void => {
|
||||||
describe.each(Object.keys(matchers))('%s', (type): void => {
|
describe.each(Object.keys(matchers))('%s', (type): void => {
|
||||||
const matcher = matchers[type];
|
const matcher = matchers[type];
|
||||||
const registry = new TypeRegistry();
|
const registry = new TypeRegistry();
|
||||||
|
|
||||||
|
serialize(registry, matcher);
|
||||||
decodeLatestMeta(registry, type, version, matcher);
|
decodeLatestMeta(registry, type, version, matcher);
|
||||||
|
|
||||||
toLatest(registry, version, matcher);
|
toLatest(registry, version, matcher);
|
||||||
|
|
||||||
defaultValues(registry, matcher, true, withFallback);
|
defaultValues(registry, matcher, true, withFallback);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Auto-generated by @polkadot/dev, do not edit
|
// Auto-generated by @polkadot/dev, do not edit
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/types', version: '6.4.1' };
|
export const packageInfo = { name: '@polkadot/types', version: '6.4.2' };
|
||||||
|
|||||||
@@ -1833,40 +1833,40 @@ __metadata:
|
|||||||
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
|
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime": ^7.15.4
|
"@babel/runtime": ^7.15.4
|
||||||
"@polkadot/api": 6.4.1
|
"@polkadot/api": 6.4.2
|
||||||
"@polkadot/types": 6.4.1
|
"@polkadot/types": 6.4.2
|
||||||
"@polkadot/util": ^7.5.1
|
"@polkadot/util": ^7.5.1
|
||||||
rxjs: ^7.4.0
|
rxjs: ^7.4.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@polkadot/api-derive@6.4.1, @polkadot/api-derive@workspace:packages/api-derive":
|
"@polkadot/api-derive@6.4.2, @polkadot/api-derive@workspace:packages/api-derive":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
|
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime": ^7.15.4
|
"@babel/runtime": ^7.15.4
|
||||||
"@polkadot/api": 6.4.1
|
"@polkadot/api": 6.4.2
|
||||||
"@polkadot/keyring": ^7.5.1
|
"@polkadot/keyring": ^7.5.1
|
||||||
"@polkadot/rpc-core": 6.4.1
|
"@polkadot/rpc-core": 6.4.2
|
||||||
"@polkadot/rpc-provider": 6.4.1
|
"@polkadot/rpc-provider": 6.4.2
|
||||||
"@polkadot/types": 6.4.1
|
"@polkadot/types": 6.4.2
|
||||||
"@polkadot/util": ^7.5.1
|
"@polkadot/util": ^7.5.1
|
||||||
"@polkadot/util-crypto": ^7.5.1
|
"@polkadot/util-crypto": ^7.5.1
|
||||||
rxjs: ^7.4.0
|
rxjs: ^7.4.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@polkadot/api@6.4.1, @polkadot/api@workspace:packages/api":
|
"@polkadot/api@6.4.2, @polkadot/api@workspace:packages/api":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@polkadot/api@workspace:packages/api"
|
resolution: "@polkadot/api@workspace:packages/api"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime": ^7.15.4
|
"@babel/runtime": ^7.15.4
|
||||||
"@polkadot/api-derive": 6.4.1
|
"@polkadot/api-derive": 6.4.2
|
||||||
"@polkadot/keyring": ^7.5.1
|
"@polkadot/keyring": ^7.5.1
|
||||||
"@polkadot/rpc-core": 6.4.1
|
"@polkadot/rpc-core": 6.4.2
|
||||||
"@polkadot/rpc-provider": 6.4.1
|
"@polkadot/rpc-provider": 6.4.2
|
||||||
"@polkadot/types": 6.4.1
|
"@polkadot/types": 6.4.2
|
||||||
"@polkadot/types-known": 6.4.1
|
"@polkadot/types-known": 6.4.2
|
||||||
"@polkadot/util": ^7.5.1
|
"@polkadot/util": ^7.5.1
|
||||||
"@polkadot/util-crypto": ^7.5.1
|
"@polkadot/util-crypto": ^7.5.1
|
||||||
eventemitter3: ^4.0.7
|
eventemitter3: ^4.0.7
|
||||||
@@ -1991,26 +1991,26 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@polkadot/rpc-core@6.4.1, @polkadot/rpc-core@workspace:packages/rpc-core":
|
"@polkadot/rpc-core@6.4.2, @polkadot/rpc-core@workspace:packages/rpc-core":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
|
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime": ^7.15.4
|
"@babel/runtime": ^7.15.4
|
||||||
"@polkadot/keyring": ^7.5.1
|
"@polkadot/keyring": ^7.5.1
|
||||||
"@polkadot/rpc-provider": 6.4.1
|
"@polkadot/rpc-provider": 6.4.2
|
||||||
"@polkadot/types": 6.4.1
|
"@polkadot/types": 6.4.2
|
||||||
"@polkadot/util": ^7.5.1
|
"@polkadot/util": ^7.5.1
|
||||||
rxjs: ^7.4.0
|
rxjs: ^7.4.0
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@polkadot/rpc-provider@6.4.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
|
"@polkadot/rpc-provider@6.4.2, @polkadot/rpc-provider@workspace:packages/rpc-provider":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
|
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime": ^7.15.4
|
"@babel/runtime": ^7.15.4
|
||||||
"@polkadot/keyring": ^7.5.1
|
"@polkadot/keyring": ^7.5.1
|
||||||
"@polkadot/types": 6.4.1
|
"@polkadot/types": 6.4.2
|
||||||
"@polkadot/util": ^7.5.1
|
"@polkadot/util": ^7.5.1
|
||||||
"@polkadot/util-crypto": ^7.5.1
|
"@polkadot/util-crypto": ^7.5.1
|
||||||
"@polkadot/x-fetch": ^7.5.1
|
"@polkadot/x-fetch": ^7.5.1
|
||||||
@@ -2038,10 +2038,10 @@ __metadata:
|
|||||||
"@babel/core": ^7.15.8
|
"@babel/core": ^7.15.8
|
||||||
"@babel/register": ^7.15.3
|
"@babel/register": ^7.15.3
|
||||||
"@babel/runtime": ^7.15.4
|
"@babel/runtime": ^7.15.4
|
||||||
"@polkadot/api": 6.4.1
|
"@polkadot/api": 6.4.2
|
||||||
"@polkadot/rpc-provider": 6.4.1
|
"@polkadot/rpc-provider": 6.4.2
|
||||||
"@polkadot/types": 6.4.1
|
"@polkadot/types": 6.4.2
|
||||||
"@polkadot/types-support": 6.4.1
|
"@polkadot/types-support": 6.4.2
|
||||||
"@polkadot/util": ^7.5.1
|
"@polkadot/util": ^7.5.1
|
||||||
"@types/websocket": ^1.0.4
|
"@types/websocket": ^1.0.4
|
||||||
"@types/yargs": ^17.0.4
|
"@types/yargs": ^17.0.4
|
||||||
@@ -2057,18 +2057,18 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@polkadot/types-known@6.4.1, @polkadot/types-known@workspace:packages/types-known":
|
"@polkadot/types-known@6.4.2, @polkadot/types-known@workspace:packages/types-known":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@polkadot/types-known@workspace:packages/types-known"
|
resolution: "@polkadot/types-known@workspace:packages/types-known"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime": ^7.15.4
|
"@babel/runtime": ^7.15.4
|
||||||
"@polkadot/networks": ^7.5.1
|
"@polkadot/networks": ^7.5.1
|
||||||
"@polkadot/types": 6.4.1
|
"@polkadot/types": 6.4.2
|
||||||
"@polkadot/util": ^7.5.1
|
"@polkadot/util": ^7.5.1
|
||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@polkadot/types-support@6.4.1, @polkadot/types-support@workspace:packages/types-support":
|
"@polkadot/types-support@6.4.2, @polkadot/types-support@workspace:packages/types-support":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@polkadot/types-support@workspace:packages/types-support"
|
resolution: "@polkadot/types-support@workspace:packages/types-support"
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -2077,13 +2077,13 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@polkadot/types@6.4.1, @polkadot/types@workspace:packages/types":
|
"@polkadot/types@6.4.2, @polkadot/types@workspace:packages/types":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@polkadot/types@workspace:packages/types"
|
resolution: "@polkadot/types@workspace:packages/types"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime": ^7.15.4
|
"@babel/runtime": ^7.15.4
|
||||||
"@polkadot/keyring": ^7.5.1
|
"@polkadot/keyring": ^7.5.1
|
||||||
"@polkadot/types-support": 6.4.1
|
"@polkadot/types-support": 6.4.2
|
||||||
"@polkadot/util": ^7.5.1
|
"@polkadot/util": ^7.5.1
|
||||||
"@polkadot/util-crypto": ^7.5.1
|
"@polkadot/util-crypto": ^7.5.1
|
||||||
"@types/bn.js": ^4.11.6
|
"@types/bn.js": ^4.11.6
|
||||||
|
|||||||
Reference in New Issue
Block a user