diff --git a/test/suites/smoke/test-historic-compatibility.ts b/test/suites/smoke/test-historic-compatibility.ts index fb19951979..c08d9d3bf6 100644 --- a/test/suites/smoke/test-historic-compatibility.ts +++ b/test/suites/smoke/test-historic-compatibility.ts @@ -51,7 +51,7 @@ describeSuite({ if (skipTest.skip) { log( "No test data available for " + - `${skipTest.networkName} #${skipTest.chainId} , skipping test.` + `${skipTest.networkName} #${skipTest.chainId} , skipping test.` ); return; // TODO: replace this with this.skip() when added to vitest } @@ -77,7 +77,7 @@ describeSuite({ if (a.error === true) { log( `Failure tracing in runtime ${a.runtime}, blocknumber ${a.blockNumber} ` + - `: ${a.result}` + `: ${a.result}` ); return true; } @@ -94,8 +94,8 @@ describeSuite({ if (skipTest.skip) { log( "No test data available for " + - `${skipTest.networkName} #${skipTest.chainId}` + - " , skipping test." + `${skipTest.networkName} #${skipTest.chainId}` + + " , skipping test." ); return; // TODO: replace this with this.skip() when added to vitest } @@ -121,7 +121,7 @@ describeSuite({ if (a.error === true) { log( `Failure fetching txn receipt on runtime ${a.runtime}, blocknumber ${a.blockNumber}` + - ` and result: ${JSON.stringify(a.result)}` + ` and result: ${JSON.stringify(a.result)}` ); return true; } @@ -142,6 +142,17 @@ describeSuite({ }, }); + it({ + id: "C350", + title: "can call eth_pendingTransactions", + test: async function () { + const result = await (context.ethers().provider as ethers.JsonRpcProvider).send( + "eth_pendingTransactions", + [] + ); + }, + }); + it({ id: "C400", title: "can call eth_syncing", @@ -261,7 +272,7 @@ describeSuite({ if (skipTest.skip) { log( "No test data available for" + - `${skipTest.networkName} #${skipTest.chainId} , skipping test.` + `${skipTest.networkName} #${skipTest.chainId} , skipping test.` ); return; // TODO: replace this with this.skip() when added to vitest } diff --git a/tools/generate-rpc-types.ts b/tools/generate-rpc-types.ts index 6bf8995521..e5c30f75fd 100644 --- a/tools/generate-rpc-types.ts +++ b/tools/generate-rpc-types.ts @@ -1,19 +1,19 @@ export declare type DefinitionTypeType = string; export declare type DefinitionTypeEnum = | { - _enum: DefinitionTypeType[]; - } + _enum: DefinitionTypeType[]; + } | { - _enum: Record; - }; + _enum: Record; + }; export declare type DefinitionTypeSet = { _set: Record; }; export declare type DefinitionTypeStruct = | Record | ({ - _alias?: Record; - } & Record); + _alias?: Record; + } & Record); export declare type DefinitionType = | string | DefinitionTypeEnum @@ -64,7 +64,7 @@ export default function rpcTypes(): Record ]), chainId: generateDescription( "Returns the chain ID used for transaction signing at " + - "the current best block. None is returned if not available.", + "the current best block. None is returned if not available.", "U64" ), coinbase: generateDescription("Returns block author.", "H160"), @@ -154,7 +154,7 @@ export default function rpcTypes(): Record ), getWork: generateDescription( "Returns the hash of the current block, the seedHash," + - " and the boundary condition to be met.", + " and the boundary condition to be met.", "Work" ), hashrate: generateDescription( @@ -166,6 +166,10 @@ export default function rpcTypes(): Record "Returns protocol version encoded as a string (quotes are necessary).", "u64" ), + pendingTransactions: generateDescription( + "Returns a list of pending transactions.", + "Vec" + ), sendRawTransaction: generateDescription( "Sends signed transaction, returning its hash.", "BoxFuture", diff --git a/typescript-api/src/moonbase/interfaces/augment-api-rpc.ts b/typescript-api/src/moonbase/interfaces/augment-api-rpc.ts index 2b8daa38dd..0f1ce8b3f5 100644 --- a/typescript-api/src/moonbase/interfaces/augment-api-rpc.ts +++ b/typescript-api/src/moonbase/interfaces/augment-api-rpc.ts @@ -230,13 +230,13 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { callRequest: | ContractCallRequest | { - origin?: any; - dest?: any; - value?: any; - gasLimit?: any; - storageDepositLimit?: any; - inputData?: any; - } + origin?: any; + dest?: any; + value?: any; + gasLimit?: any; + storageDepositLimit?: any; + inputData?: any; + } | string | Uint8Array, at?: BlockHash | string | Uint8Array @@ -323,14 +323,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { request: | EthCallRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array @@ -349,14 +349,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { request: | EthCallRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array @@ -517,6 +517,8 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { newPendingTransactionFilter: AugmentedRpc<() => Observable>; /** Returns protocol version encoded as a string (quotes are necessary). */ protocolVersion: AugmentedRpc<() => Observable>; + /** Returns a list of pending transactions. */ + pendingTransactions: AugmentedRpc<() => Observable>>; /** Sends signed transaction, returning its hash. */ sendRawTransaction: AugmentedRpc<(bytes: Bytes | string | Uint8Array) => Observable>; /** Sends transaction; will block waiting for signer to return the transaction hash */ @@ -525,14 +527,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { tx: | EthTransactionRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array ) => Observable diff --git a/typescript-api/src/moonbeam/interfaces/augment-api-rpc.ts b/typescript-api/src/moonbeam/interfaces/augment-api-rpc.ts index 2b8daa38dd..3b9cf47115 100644 --- a/typescript-api/src/moonbeam/interfaces/augment-api-rpc.ts +++ b/typescript-api/src/moonbeam/interfaces/augment-api-rpc.ts @@ -230,13 +230,13 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { callRequest: | ContractCallRequest | { - origin?: any; - dest?: any; - value?: any; - gasLimit?: any; - storageDepositLimit?: any; - inputData?: any; - } + origin?: any; + dest?: any; + value?: any; + gasLimit?: any; + storageDepositLimit?: any; + inputData?: any; + } | string | Uint8Array, at?: BlockHash | string | Uint8Array @@ -323,14 +323,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { request: | EthCallRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array @@ -349,14 +349,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { request: | EthCallRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array @@ -518,6 +518,8 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { /** Returns protocol version encoded as a string (quotes are necessary). */ protocolVersion: AugmentedRpc<() => Observable>; /** Sends signed transaction, returning its hash. */ + /** Returns a list of pending transactions. */ + pendingTransactions: AugmentedRpc<() => Observable>>; sendRawTransaction: AugmentedRpc<(bytes: Bytes | string | Uint8Array) => Observable>; /** Sends transaction; will block waiting for signer to return the transaction hash */ sendTransaction: AugmentedRpc< @@ -525,14 +527,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { tx: | EthTransactionRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array ) => Observable diff --git a/typescript-api/src/moonriver/interfaces/augment-api-rpc.ts b/typescript-api/src/moonriver/interfaces/augment-api-rpc.ts index 2b8daa38dd..0f1ce8b3f5 100644 --- a/typescript-api/src/moonriver/interfaces/augment-api-rpc.ts +++ b/typescript-api/src/moonriver/interfaces/augment-api-rpc.ts @@ -230,13 +230,13 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { callRequest: | ContractCallRequest | { - origin?: any; - dest?: any; - value?: any; - gasLimit?: any; - storageDepositLimit?: any; - inputData?: any; - } + origin?: any; + dest?: any; + value?: any; + gasLimit?: any; + storageDepositLimit?: any; + inputData?: any; + } | string | Uint8Array, at?: BlockHash | string | Uint8Array @@ -323,14 +323,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { request: | EthCallRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array @@ -349,14 +349,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { request: | EthCallRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array @@ -517,6 +517,8 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { newPendingTransactionFilter: AugmentedRpc<() => Observable>; /** Returns protocol version encoded as a string (quotes are necessary). */ protocolVersion: AugmentedRpc<() => Observable>; + /** Returns a list of pending transactions. */ + pendingTransactions: AugmentedRpc<() => Observable>>; /** Sends signed transaction, returning its hash. */ sendRawTransaction: AugmentedRpc<(bytes: Bytes | string | Uint8Array) => Observable>; /** Sends transaction; will block waiting for signer to return the transaction hash */ @@ -525,14 +527,14 @@ declare module "@polkadot/rpc-core/types/jsonrpc" { tx: | EthTransactionRequest | { - from?: any; - to?: any; - gasPrice?: any; - gas?: any; - value?: any; - data?: any; - nonce?: any; - } + from?: any; + to?: any; + gasPrice?: any; + gas?: any; + value?: any; + data?: any; + nonce?: any; + } | string | Uint8Array ) => Observable