Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message for query utxo #2957

Closed
wants to merge 2 commits into from

Conversation

newhoggy
Copy link
Contributor

@newhoggy newhoggy commented Jul 23, 2021

Fixes #2954

@newhoggy newhoggy force-pushed the better-error-message-for-query-utxo branch from a4abbce to 9aa0f3c Compare July 23, 2021 11:56
@newhoggy
Copy link
Contributor Author

$ cardano-cli query utxo --tx-in 'ef0e0a63ec342c267c8618d8988edaca361a38820532040502da1b76ebc43986#1' --testnet-magic 42
Command failed: query utxo  Error: Unsupported version.
This query requires at least NodeToClientV_9 but negotiated NodeToClientV_8
Perhaps the query you have made is in test development.

@newhoggy newhoggy force-pushed the better-error-message-for-query-utxo branch 4 times, most recently from e558683 to 9bf901e Compare July 27, 2021 11:39
@newhoggy newhoggy force-pushed the better-error-message-for-query-utxo branch 3 times, most recently from 93a57cc to ed8ba37 Compare July 31, 2021 06:13
@newhoggy newhoggy force-pushed the better-error-message-for-query-utxo branch from ed8ba37 to e9afcaa Compare August 9, 2021 03:49
@newhoggy newhoggy force-pushed the better-error-message-for-query-utxo branch from e9afcaa to 6f82ed9 Compare September 6, 2021 12:44
@@ -161,6 +164,13 @@ data LocalNodeConnectInfo mode =
localNodeSocketPath :: FilePath
}

type MinNodeToClientVersion = NodeToClientVersion

data QueryError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should implement an Error instance for this,

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I have some thoughts on another way we can go about this.

queryNodeLocalState = queryNodeLocalStateWithVersion NodeToClientV_1

queryNodeLocalStateWithVersion :: forall mode result.
NodeToClientVersion
Copy link
Contributor

@Jimbo4350 Jimbo4350 Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent?

Also, is there a query that will return available queries for a given node version? Or maybe we can define a function in cardano-api like NodeToClientVersion -> ([QueryInMode mode result], [QueryInEra era]) that we can use to determine what is available rather than adding an additional function where you have to manually specify the required node version.

@newhoggy newhoggy force-pushed the better-error-message-for-query-utxo branch 2 times, most recently from b80e25f to f7d8073 Compare November 4, 2021 13:19
@newhoggy newhoggy requested a review from Jimbo4350 November 4, 2021 13:20
@newhoggy newhoggy force-pushed the better-error-message-for-query-utxo branch from f7d8073 to 63b1919 Compare November 9, 2021 10:05
@newhoggy newhoggy force-pushed the better-error-message-for-query-utxo branch from 63b1919 to c755c85 Compare November 19, 2021 23:44
@newhoggy
Copy link
Contributor Author

Re-implemented in #4788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Some cardano-cli queries do not work without "TestEnableDevelopmentNetworkProtocols" set to true
2 participants