Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Fine-tune Known RPC Method Typings #379

Closed
harrysolovay opened this issue Nov 10, 2022 · 4 comments · Fixed by #405
Closed

Fine-tune Known RPC Method Typings #379

harrysolovay opened this issue Nov 10, 2022 · 4 comments · Fixed by #405
Assignees

Comments

@harrysolovay
Copy link
Contributor

harrysolovay commented Nov 10, 2022

...

state_getChildKeys: TODO_NARROW_METHOD_TYPE;
state_getChildReadProof: TODO_NARROW_METHOD_TYPE;
state_getChildStorage: TODO_NARROW_METHOD_TYPE;
state_getChildStorageHash: TODO_NARROW_METHOD_TYPE;
state_getChildStorageSize: TODO_NARROW_METHOD_TYPE;
sudo_unstable_p2pDiscover(multiaddr: U.HexEncoded<MultiAddress>): void;
sudo_unstable_version(): string;
syncstate_genSyncSpec: TODO_NARROW_METHOD_TYPE;
transaction_unstable_unwatch(subscription: SubId): void;
chainHead_unstable_body(followSubscription: U.HexHash, networkConfig?: T.NetworkConfig): string;
chainHead_unstable_call(
  hash: U.HexHash | null,
  fn: string,
  callParameters: U.Hex,
  networkConfig?: T.NetworkConfig,
): string;
chainHead_unstable_genesisHash(): U.HexHash;
chainHead_unstable_header(followSubscription: string, hash: U.HexHash): U.Hex | null;
chainHead_unstable_stopBody(subscription: string): void;
chainHead_unstable_stopCall(subscription: string): void;
chainHead_unstable_stopStorage(subscription: string): void;
chainHead_unstable_storage(
  follow_subscription: SubId,
  hash: U.HexHash,
  key: U.Hex,
  childKey?: U.Hex,
  networkConfig?: T.NetworkConfig,
): string;
chainHead_unstable_unfollow(followSubscription: SubId): void;
chainHead_unstable_unpin(followSubscription: SubId, hash: U.HexHash): void;
chainSpec_unstable_chainName(): string;
chainSpec_unstable_genesisHash(): string;
chainSpec_unstable_properties(): unknown;
chainSpec_getBlockStats(at: U.HexHash): T.BlockStats | null;
chainSpec_createBlock: TODO_NARROW_METHOD_TYPE;
chainSpec_finalizeBlock: TODO_NARROW_METHOD_TYPE;
rpc_methods(): T.RpcMethods;
// subscriptions
chainHead_unstable_follow(runtimeUpdates: boolean): T.ChainHeadUnstableFollowEvent;
transaction_unstable_submitAndWatch(transaction: U.Hex): unknown;
{
  /** Invalid JSON was received by the server. */
  ParseError: [-32700];
  /** The JSON sent is not a valid Request object. */
  InvalidRequest: [-32600];
  /** The method does not exist / is not available. */
  MethodNotFound: [-32601];
  /** Invalid method parameter(s). */
  InvalidParams: [-32602];
  /** Internal JSON-RPC error. */
  InternalError: [-32603];
  /**
   * Other internal server error.
   * Contains a more precise error code and a custom message.
   * Error code must be in the range -32000 to -32099 included.
   */
  ServerError: [number];
  /**
   * Method-specific error.
   * Contains a more precise error code and a custom message.
   * Error code must be outside of the range -32000 to -32700.
   */
  MethodError: [number];
};
@tjjfvi
Copy link
Contributor

tjjfvi commented Nov 11, 2022

I believe all of the unknown methods are smoldot-related

@harrysolovay
Copy link
Contributor Author

@harrysolovay harrysolovay added this to the 0.1.0 Release milestone Nov 11, 2022
@kratico kratico moved this to In Progress in Capi Nov 15, 2022
@kratico
Copy link
Contributor

kratico commented Nov 15, 2022

@harrysolovay @tjjfvi Would you remind me the scope of this task?
So far, I took the list from the description and added the smoldot type signature from https://github.com/paritytech/smoldot/blob/ae334e77b477c6e6d0dc38d3a4429f0038bad20b/src/json_rpc/methods.rs#L334-L485

Open questions

I committed a some types to #405

@harrysolovay
Copy link
Contributor Author

Is the list complete?

Not sure... I believe the complete list should be in this file (permalinked).

Shall I add all smoldot methods from the rpc_methods call?

In the case of Smoldot-related typings let's get a solid foundation and then kindly ping Pierre for a full review of the Smoldot integration.

Regarding the description errors, I guess that these are all from smoldot, right?

Yes :)

Repository owner moved this from In Progress to Properly Done in Capi Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants