Complete EthereumRuntimeRPCApi runtime (#5003)
This commit is contained in:
@@ -27,7 +27,7 @@ import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, De
|
||||
import type { BlockStats } from '@polkadot/types/interfaces/dev';
|
||||
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 { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, 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, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
|
||||
import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
|
||||
import type { EvmAccount, EvmCallInfo, EvmCreateInfo, 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 { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
|
||||
@@ -387,6 +387,8 @@ declare module '@polkadot/types/types/registry' {
|
||||
EthHeader: EthHeader;
|
||||
EthLog: EthLog;
|
||||
EthReceipt: EthReceipt;
|
||||
EthReceiptV0: EthReceiptV0;
|
||||
EthReceiptV3: EthReceiptV3;
|
||||
EthRichBlock: EthRichBlock;
|
||||
EthRichHeader: EthRichHeader;
|
||||
EthStorageProof: EthStorageProof;
|
||||
|
||||
@@ -257,6 +257,9 @@ const types: DefinitionsTypes = objectSpread({}, V0, V1, V2, {
|
||||
logsBloom: 'EthBloom',
|
||||
statusCode: 'Option<U64>'
|
||||
},
|
||||
// not convinced, however the original commit matches, so... (maybe V3 is incorrect?)
|
||||
EthReceiptV0: 'EthReceipt',
|
||||
EthReceiptV3: 'EthReceipt',
|
||||
EthStorageProof: {
|
||||
key: 'U256',
|
||||
value: 'U256',
|
||||
|
||||
@@ -142,11 +142,41 @@ export const runtime: DefinitionsCall = {
|
||||
],
|
||||
type: 'Result<EvmCreateInfo, DispatchError>'
|
||||
},
|
||||
current_all: {
|
||||
description: 'Return all the current data for a block in a single runtime call.',
|
||||
params: [],
|
||||
type: '(Option<BlockV2>, Option<Vec<ReceiptV0>>, Option<Vec<TransactionStatus>>)'
|
||||
},
|
||||
current_block: {
|
||||
description: 'Return the current block.',
|
||||
params: [],
|
||||
type: 'BlockV2'
|
||||
},
|
||||
current_receipts: {
|
||||
description: 'Return the current receipt.',
|
||||
params: [],
|
||||
type: 'Option<Vec<EthReceiptV3>>'
|
||||
},
|
||||
current_transaction_statuses: {
|
||||
description: 'Return the current transaction status.',
|
||||
params: [],
|
||||
type: 'Option<Vec<EthTransactionStatus>>'
|
||||
},
|
||||
elasticity: {
|
||||
description: 'Return the elasticity multiplier.',
|
||||
params: [],
|
||||
type: 'Option<Permill>'
|
||||
},
|
||||
extrinsic_filter: {
|
||||
description: 'Receives a `Vec<OpaqueExtrinsic>` and filters all the ethereum transactions.',
|
||||
params: [
|
||||
{
|
||||
name: 'xts',
|
||||
type: 'Vec<Extrinsic>'
|
||||
}
|
||||
],
|
||||
type: 'Vec<TransactionV2>'
|
||||
},
|
||||
gas_price: {
|
||||
description: 'Returns FixedGasPrice::min_gas_price',
|
||||
params: [],
|
||||
@@ -168,8 +198,6 @@ export const runtime: DefinitionsCall = {
|
||||
}
|
||||
},
|
||||
version: 4
|
||||
// TODO This is _very_ incomplete, missing everything from this point onwards is missing -
|
||||
// https://github.com/paritytech/frontier/blob/87e60b9b67ab31f4ea7285c949997337bb76ffd0/primitives/rpc/src/lib.rs#L131
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -223,6 +223,12 @@ export interface EthReceipt extends Struct {
|
||||
readonly statusCode: Option<U64>;
|
||||
}
|
||||
|
||||
/** @name EthReceiptV0 */
|
||||
export interface EthReceiptV0 extends EthReceipt {}
|
||||
|
||||
/** @name EthReceiptV3 */
|
||||
export interface EthReceiptV3 extends EthReceipt {}
|
||||
|
||||
/** @name EthRichBlock */
|
||||
export interface EthRichBlock extends Struct {
|
||||
readonly blockHash: Option<H256>;
|
||||
|
||||
Reference in New Issue
Block a user