Skip to content

Implement version specific types for status 'omitted' methods #115

Open
@tcharding

Description

@tcharding

Currently we have a status 'omitted' that was meant to imply that we intentionally omitted adding a type. For example if method returns a std lib type

$ bt17 help pruneblockchain
pruneblockchain

Arguments:
1. "height"       (numeric, required) The block height to prune up to. May be set to a discrete height, or a unix timestamp
                  to prune blocks whose block time is at least 2 hours older than the provided timestamp.

Result:
n    (numeric) Height of the last block pruned.

This has the problem that later versions of the method might change and we will not catch it.

It would be better to add a version specific type, implement in the client, and an integration test that calls the method. Even for null, which is currently does as follows:

                match self.call("submitblock", &[into_json(hex)?]) {
                    Ok(serde_json::Value::Null) => Ok(()),
                    Ok(res) => Err(Error::Returned(res.to_string())),
                    Err(err) => Err(err.into()),
                }

Note that doing this also requires updating the method in verify (e.g., verify::metho::v17) to use Method::new_no_model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions