Using the `--state` flag on `query deployment list` gives unexpected behavior
If I run with a flag of --state matched I get this result
~/ovrclk/akash/akash --node=tcp://86.109.8.123:26657 --chain-id=local --home=$PWD/home query deployment list --owner akash1sknuhqt6d84h7xxstjpfe2xx2pc75ky07v03wh --state matched
Error: rpc error: code = InvalidArgument desc = invalid state value: invalid request
Which seems to indicate the server can't filter by that, or something similar. It should be possible, or we should not even allow the request to go on to the RPC node.
Switching to `--state active' gives even more confusing results
$ ~/ovrclk/akash/akash --node=tcp://86.109.8.123:26657 --chain-id=local --home=$PWD/home query deployment list --owner akash1sknuhqt6d84h7xxstjpfe2xx2pc75ky07v03wh --limit 1 --state active
deployments:
- deployment:
deployment_id:
dseq: "82208"
owner: akash1sknuhqt6d84h7xxstjpfe2xx2pc75ky07v03wh
state: active
version: 8rXnYMqTxTVIc312SU24mwjYEffptTOqB/2TS/UdZwc=
groups:
- group_id:
dseq: "82208"
gseq: 1
owner: akash1sknuhqt6d84h7xxstjpfe2xx2pc75ky07v03wh
group_spec:
name: westcoast
order_bid_duration: "12342"
requirements:
attributes: []
signed_by:
all_of: []
any_of: []
resources:
- count: 1
price:
amount: "9999"
denom: uakt
resources:
cpu:
attributes: []
units:
val: "100"
endpoints:
- kind: SHARED_HTTP
memory:
attributes: []
quantity:
val: "16777216"
storage:
attributes: []
quantity:
val: "134217728"
state: matched
version: null
pagination:
next_key: YWthc2gxc2tudWhxdDZkODRoN3h4c3RqcGZlMnh4MnBjNzVreTA3djAzd2gAAAAAAAFMcw==
total: "0"
The returned deployment actually says "state: matched", which does not seem right at all
Having the same error when using --state matched
So I think what is happening here is it only filters on deployment state, not group state (part of a deployment). I'm just going to update the CLI to validate the --state flag before it sends it to the RPC server. There is no reason to send the request if the provided value is invalid.