Fix EthTransaction to ethereum crate (#3030)

* Fix (alhabetically sorted??) EthTransaction

* EthTransaction from ethereum crate
This commit is contained in:
Jaco Greeff
2021-01-07 19:45:37 +01:00
committed by GitHub
parent 6c61708eff
commit 679f4103e1
3 changed files with 58 additions and 39 deletions
+4 -1
View File
@@ -19,7 +19,7 @@ import type { ContractConstructorSpec, ContractContractSpec, ContractCryptoHashe
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, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionCondition, EthTransactionRequest, EthTransactionStatus, EthWork, EthereumAccountId, EthereumLookupSource, EthereumSignature } from '@polkadot/types/interfaces/eth';
import type { EthAccount, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, 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 { 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';
@@ -1931,6 +1931,9 @@ declare module '@polkadot/types/types/registry' {
EthTransaction: EthTransaction;
'Option<EthTransaction>': Option<EthTransaction>;
'Vec<EthTransaction>': Vec<EthTransaction>;
EthTransactionAction: EthTransactionAction;
'Option<EthTransactionAction>': Option<EthTransactionAction>;
'Vec<EthTransactionAction>': Vec<EthTransactionAction>;
EthTransactionCondition: EthTransactionCondition;
'Option<EthTransactionCondition>': Option<EthTransactionCondition>;
'Vec<EthTransactionCondition>': Vec<EthTransactionCondition>;
@@ -176,26 +176,46 @@ const types: DefinitionsTypes = {
}
},
EthTransaction: {
blockHash: 'Option<H256>',
blockNumber: 'Option<U256>',
chainId: 'Option<u64>',
condition: 'Option<EthTransactionCondition>',
creates: 'Option<H160>',
from: 'H160',
gas: 'U256',
gasPrice: 'U256',
hash: 'H256',
input: 'Bytes',
nonce: 'U256',
publicKey: 'Option<H512>',
r: 'U256',
raw: 'Bytes',
s: 'U256',
standardV: 'U256',
to: 'Option<H160>',
transactionIndex: 'Option<U256>',
v: 'U256',
value: 'U256'
gasPrice: 'U256',
gasLimit: 'U256',
action: 'EthTransactionAction',
value: 'U256',
input: 'Bytes',
// TransactionSignature (embedded)
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',
Create: 'Null'
}
},
EthTransactionCondition: {
_enum: {
+15 -19
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, H512 } from '@polkadot/types/interfaces/runtime';
import type { BlockNumber, H160, H2048, H256 } from '@polkadot/types/interfaces/runtime';
/** @name EthAccount */
export interface EthAccount extends Struct {
@@ -211,26 +211,22 @@ export interface EthSyncStatus extends Enum {
/** @name EthTransaction */
export interface EthTransaction extends Struct {
readonly blockHash: Option<H256>;
readonly blockNumber: Option<U256>;
readonly chainId: Option<u64>;
readonly condition: Option<EthTransactionCondition>;
readonly creates: Option<H160>;
readonly from: H160;
readonly gas: U256;
readonly gasPrice: U256;
readonly hash: H256;
readonly input: Bytes;
readonly nonce: U256;
readonly publicKey: Option<H512>;
readonly r: U256;
readonly raw: Bytes;
readonly s: U256;
readonly standardV: U256;
readonly to: Option<H160>;
readonly transactionIndex: Option<U256>;
readonly v: U256;
readonly gasPrice: U256;
readonly gasLimit: U256;
readonly action: EthTransactionAction;
readonly value: U256;
readonly input: Bytes;
readonly v: u64;
readonly r: H256;
readonly s: H256;
}
/** @name EthTransactionAction */
export interface EthTransactionAction extends Enum {
readonly isCall: boolean;
readonly asCall: H160;
readonly isCreate: boolean;
}
/** @name EthTransactionCondition */