Update ETH types (#3439)

* Update ETH types

* Build
This commit is contained in:
Jaco
2021-04-25 16:34:42 +02:00
committed by GitHub
parent 9123f1d805
commit 5f57ecb2e1
5 changed files with 105 additions and 72 deletions
+8 -2
View File
@@ -21,7 +21,7 @@ import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot
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 { 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, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth';
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 { EvmAccount, EvmLog, EvmVicinity, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
import type { AnySignature, EcdsaSignature, Ed25519Signature, 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';
@@ -41,7 +41,7 @@ import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/ty
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, CodecHash, Consensus, ConsensusEngineId, Digest, DigestItem, EncodedJustification, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H1024, H128, H160, H2048, H256, H32, H512, H64, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, Justifications, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, MultiSigner, OpaqueCall, Origin, OriginCaller, PalletId, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, SignedBlockWithJustification, SignedBlockWithJustifications, Slot, StorageData, StorageProof, TransactionPriority, U32F32, ValidatorId, ValidatorIdOf, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
@@ -385,6 +385,7 @@ declare module '@polkadot/types/types/registry' {
'Option<EthTransactionAction>': Option<EthTransactionAction>;
'Option<EthTransactionCondition>': Option<EthTransactionCondition>;
'Option<EthTransactionRequest>': Option<EthTransactionRequest>;
'Option<EthTransactionSignature>': Option<EthTransactionSignature>;
'Option<EthTransactionStatus>': Option<EthTransactionStatus>;
'Option<EthWork>': Option<EthWork>;
'Option<Event>': Option<Event>;
@@ -457,6 +458,7 @@ declare module '@polkadot/types/types/registry' {
'Option<H160>': Option<H160>;
'Option<H2048>': Option<H2048>;
'Option<H256>': Option<H256>;
'Option<H32>': Option<H32>;
'Option<H512>': Option<H512>;
'Option<H64>': Option<H64>;
'Option<Hash>': Option<Hash>;
@@ -1177,6 +1179,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<EthTransactionAction>': Vec<EthTransactionAction>;
'Vec<EthTransactionCondition>': Vec<EthTransactionCondition>;
'Vec<EthTransactionRequest>': Vec<EthTransactionRequest>;
'Vec<EthTransactionSignature>': Vec<EthTransactionSignature>;
'Vec<EthTransactionStatus>': Vec<EthTransactionStatus>;
'Vec<EthWork>': Vec<EthWork>;
'Vec<Event>': Vec<Event>;
@@ -1249,6 +1252,7 @@ declare module '@polkadot/types/types/registry' {
'Vec<H160>': Vec<H160>;
'Vec<H2048>': Vec<H2048>;
'Vec<H256>': Vec<H256>;
'Vec<H32>': Vec<H32>;
'Vec<H512>': Vec<H512>;
'Vec<H64>': Vec<H64>;
'Vec<Hash>': Vec<Hash>;
@@ -1969,6 +1973,7 @@ declare module '@polkadot/types/types/registry' {
EthTransactionAction: EthTransactionAction;
EthTransactionCondition: EthTransactionCondition;
EthTransactionRequest: EthTransactionRequest;
EthTransactionSignature: EthTransactionSignature;
EthTransactionStatus: EthTransactionStatus;
EthWork: EthWork;
Event: Event;
@@ -2041,6 +2046,7 @@ declare module '@polkadot/types/types/registry' {
H160: H160;
H2048: H2048;
H256: H256;
H32: H32;
H512: H512;
H64: H64;
Hash: Hash;
@@ -24,6 +24,28 @@ const types: DefinitionsTypes = {
storageProof: 'Vec<EthStorageProof>'
},
EthBlock: {
header: 'EthHeader',
transactions: 'Vec<EthTransaction>',
ommers: 'Vec<EthHeader>'
},
EthHeader: {
parentHash: 'H256',
ommersHash: 'H256',
beneficiary: 'H160',
stateRoot: 'H256',
transactionsRoot: 'H256',
receiptsRoot: 'H256',
logsBloom: 'EthBloom',
difficulty: 'U256',
number: 'U256',
gasLimit: 'U256',
gasUsed: 'U256',
timestamp: 'u64',
extraData: 'Bytes',
mixMash: 'H256',
nonce: 'H64'
},
EthRichBlock: {
_alias: {
blockHash: 'hash',
blockSize: 'size'
@@ -40,7 +62,7 @@ const types: DefinitionsTypes = {
gasUsed: 'U256',
gasLimit: 'U256',
extraData: 'Bytes',
logsBloom: 'H2048',
logsBloom: 'EthBloom',
timestamp: 'U256',
difficulty: 'U256',
totalDifficulty: 'Option<U256>',
@@ -95,7 +117,7 @@ const types: DefinitionsTypes = {
Null: 'Null'
}
},
EthHeader: {
EthRichHeader: {
_alias: {
blockHash: 'hash',
blockSize: 'size'
@@ -112,7 +134,7 @@ const types: DefinitionsTypes = {
gasUsed: 'U256',
gasLimit: 'U256',
extraData: 'Bytes',
logsBloom: 'H2048',
logsBloom: 'EthBloom',
timestamp: 'U256',
difficulty: 'U256',
sealFields: 'Vec<Bytes>',
@@ -142,11 +164,9 @@ const types: DefinitionsTypes = {
contractAddress: 'Option<H160>',
logs: 'Vec<EthLog>',
root: 'Option<H256>',
logsBloom: 'H2048',
logsBloom: 'EthBloom',
statusCode: 'Option<U64>'
},
EthRichBlock: 'EthBlock',
EthRichHeader: 'EthHeader',
EthStorageProof: {
key: 'U256',
value: 'U256',
@@ -189,35 +209,13 @@ const types: DefinitionsTypes = {
action: 'EthTransactionAction',
value: 'U256',
input: 'Bytes',
// TransactionSignature (embedded)
signature: 'EthTransactionSignature'
},
EthTransactionSignature: {
v: 'u64',
r: 'H256',
s: 'H256'
},
// as per the RPC definition
// TODO: Check these, re-add
// EthTransaction: {
// // hash in Rust
// transactionHash: 'H256',
// nonce: 'U256',
// blockHash: 'Option<H256>',
// blockNumber: 'Option<U256>',
// transactionIndex: 'Option<U256>',
// from: 'H160',
// to: 'Option<H160>',
// value: 'U256',
// gasPrice: 'U256',
// gas: 'U256',
// input: 'Bytes',
// creates: 'Option<H160>',
// raw: 'Bytes',
// publicKey: 'Option<H512>',
// chainId: 'Option<U64>',
// standardV: 'U256',
// v: 'U256',
// r: 'U256',
// s: 'U256'
// },
EthTransactionAction: {
_enum: {
Call: 'H160',
+63 -38
View File
@@ -2,7 +2,7 @@
/* eslint-disable */
import type { Bytes, Enum, GenericEthereumAccountId, GenericEthereumLookupSource, Option, Struct, U256, U64, U8aFixed, Vec, bool, u32, u64 } from '@polkadot/types';
import type { BlockNumber, H160, H2048, H256 } from '@polkadot/types/interfaces/runtime';
import type { BlockNumber, H160, H2048, H256, H64 } from '@polkadot/types/interfaces/runtime';
/** @name EthAccount */
export interface EthAccount extends Struct {
@@ -17,26 +17,9 @@ export interface EthAccount extends Struct {
/** @name EthBlock */
export interface EthBlock extends Struct {
readonly blockHash: Option<H256>;
readonly parentHash: H256;
readonly sha3Uncles: H256;
readonly author: H160;
readonly miner: H160;
readonly stateRoot: H256;
readonly transactionsRoot: H256;
readonly receiptsRoot: H256;
readonly number: Option<U256>;
readonly gasUsed: U256;
readonly gasLimit: U256;
readonly extraData: Bytes;
readonly logsBloom: H2048;
readonly timestamp: U256;
readonly difficulty: U256;
readonly totalDifficulty: Option<U256>;
readonly sealFields: Vec<Bytes>;
readonly uncles: Vec<H256>;
readonly header: EthHeader;
readonly transactions: Vec<EthTransaction>;
readonly blockSize: Option<U256>;
readonly ommers: Vec<EthHeader>;
}
/** @name EthBloom */
@@ -112,23 +95,21 @@ export interface EthFilterTopicInner extends Enum {
/** @name EthHeader */
export interface EthHeader extends Struct {
readonly blockHash: Option<H256>;
readonly parentHash: H256;
readonly sha3Uncles: H256;
readonly author: H160;
readonly miner: H160;
readonly ommersHash: H256;
readonly beneficiary: H160;
readonly stateRoot: H256;
readonly transactionsRoot: H256;
readonly receiptsRoot: H256;
readonly number: Option<U256>;
readonly gasUsed: U256;
readonly gasLimit: U256;
readonly extraData: Bytes;
readonly logsBloom: H2048;
readonly timestamp: U256;
readonly logsBloom: EthBloom;
readonly difficulty: U256;
readonly sealFields: Vec<Bytes>;
readonly blockSize: Option<U256>;
readonly number: U256;
readonly gasLimit: U256;
readonly gasUsed: U256;
readonly timestamp: u64;
readonly extraData: Bytes;
readonly mixMash: H256;
readonly nonce: H64;
}
/** @name EthLog */
@@ -158,15 +139,54 @@ export interface EthReceipt extends Struct {
readonly contractAddress: Option<H160>;
readonly logs: Vec<EthLog>;
readonly root: Option<H256>;
readonly logsBloom: H2048;
readonly logsBloom: EthBloom;
readonly statusCode: Option<U64>;
}
/** @name EthRichBlock */
export interface EthRichBlock extends EthBlock {}
export interface EthRichBlock extends Struct {
readonly blockHash: Option<H256>;
readonly parentHash: H256;
readonly sha3Uncles: H256;
readonly author: H160;
readonly miner: H160;
readonly stateRoot: H256;
readonly transactionsRoot: H256;
readonly receiptsRoot: H256;
readonly number: Option<U256>;
readonly gasUsed: U256;
readonly gasLimit: U256;
readonly extraData: Bytes;
readonly logsBloom: EthBloom;
readonly timestamp: U256;
readonly difficulty: U256;
readonly totalDifficulty: Option<U256>;
readonly sealFields: Vec<Bytes>;
readonly uncles: Vec<H256>;
readonly transactions: Vec<EthTransaction>;
readonly blockSize: Option<U256>;
}
/** @name EthRichHeader */
export interface EthRichHeader extends EthHeader {}
export interface EthRichHeader extends Struct {
readonly blockHash: Option<H256>;
readonly parentHash: H256;
readonly sha3Uncles: H256;
readonly author: H160;
readonly miner: H160;
readonly stateRoot: H256;
readonly transactionsRoot: H256;
readonly receiptsRoot: H256;
readonly number: Option<U256>;
readonly gasUsed: U256;
readonly gasLimit: U256;
readonly extraData: Bytes;
readonly logsBloom: EthBloom;
readonly timestamp: U256;
readonly difficulty: U256;
readonly sealFields: Vec<Bytes>;
readonly blockSize: Option<U256>;
}
/** @name EthStorageProof */
export interface EthStorageProof extends Struct {
@@ -226,9 +246,7 @@ export interface EthTransaction extends Struct {
readonly action: EthTransactionAction;
readonly value: U256;
readonly input: Bytes;
readonly v: u64;
readonly r: H256;
readonly s: H256;
readonly signature: EthTransactionSignature;
}
/** @name EthTransactionAction */
@@ -257,6 +275,13 @@ export interface EthTransactionRequest extends Struct {
readonly nonce: Option<U256>;
}
/** @name EthTransactionSignature */
export interface EthTransactionSignature extends Struct {
readonly v: u64;
readonly r: H256;
readonly s: H256;
}
/** @name EthTransactionStatus */
export interface EthTransactionStatus extends Struct {
readonly transactionHash: H256;
@@ -62,8 +62,9 @@ export default {
normal: 'Weight',
operational: 'Weight'
},
H32: '[u8; 8; H32]',
H64: '[u8; 8; H64]',
H128: '[u8; 16; H64]',
H128: '[u8; 16; H128]',
H160: '[u8; 20; H160]',
H256: '[u8; 32; H256]',
H512: '[u8; 64; H512]',
@@ -123,6 +123,9 @@ export interface H2048 extends U8aFixed {}
/** @name H256 */
export interface H256 extends U8aFixed {}
/** @name H32 */
export interface H32 extends U8aFixed {}
/** @name H512 */
export interface H512 extends U8aFixed {}