Skip to content

Commit 7557433

Browse files
committed
[cli] Remove anti oracle requests validate command
1 parent 8894f6e commit 7557433

File tree

11 files changed

+21
-195
lines changed

11 files changed

+21
-195
lines changed

cli/anti.cabal

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ library
119119
Oracle.Token.Cli
120120
Oracle.Token.Options
121121
Oracle.Types
122-
Oracle.Validate.Cli
123122
Oracle.Validate.DownloadAssets
124-
Oracle.Validate.Options
125123
Oracle.Validate.Request
126124
Oracle.Validate.Requests.Config
127125
Oracle.Validate.Requests.ManageWhiteList

cli/docs/oracle-role.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,10 @@ You can review the token info anytime with
1818

1919

2020
```bash
21-
anti oracle token get | jq '.result'
21+
anti token | jq '.result'
2222
```
23-
## Validating requests
23+
In the requests field you will notice the `validation` field, which will be set to `validated` for all requests that have been validated .
2424

25-
You can use the validate command to automate the process of oracling the requests
26-
27-
```bash
28-
anti oracle requests validate
29-
```
3025

3126
## Updating the anti token
3227

cli/docs/requester-role.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ anti requester register-user --platform github --username alice --pubkeyhash AAA
2424

2525
As with all other requests, once submitted regularly you have to wait for the oracle to merge your request into the Antithesis token.
2626

27-
You can use the `anti oracle token get` command to inspect your pending requests in the Antithesis token.
27+
You can use the `anti token` command to inspect your pending requests in the Antithesis token.
2828

2929
You can use the `anti facts` command to query the Antithesis token and see if your user is part of the facts.
3030

3131
```bash
32-
anti oracle token get | jq '.result.requests' "
32+
anti token | jq '.result.requests' "
3333
```
3434
3535
Until your requests is there, you cannot proceed with the next steps.
@@ -50,6 +50,3 @@ To unregister a user, you can use the `anti requester unregister-user` command.
5050
```bash
5151
anti requester unregister-user --platform github --username alice --pubkeyhash AAAAC3NzaC1lZDI1NTE5AAAAIO773JHqlyLm5XzOjSe+Q5yFJyLFuMLL6+n63t4t7HR8
5252
```
53-
54-
55-

cli/src/Oracle/Cli.hs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@ module Oracle.Cli
66
import Control.Monad.Catch (MonadMask)
77
import Control.Monad.IO.Class (MonadIO (..))
88
import Core.Context (WithContext)
9-
import Core.Types.Basic (TokenId)
109
import Oracle.Config.Cli (ConfigCmd (..), configCmd)
1110
import Oracle.Token.Cli (TokenCommand, tokenCmdCore)
12-
import Oracle.Validate.Cli (ValidateCommand, validateCmd)
1311

1412
data OracleCommand a where
1513
OracleTokenCommand :: TokenCommand a -> OracleCommand a
16-
OracleValidateCommand
17-
:: TokenId -> ValidateCommand a -> OracleCommand a
1814
OracleSetConfigCommand
1915
:: ConfigCmd a -> OracleCommand a
2016

@@ -27,8 +23,4 @@ oracleCmd
2723
-> WithContext m a
2824
oracleCmd = \case
2925
OracleTokenCommand tokenCommand -> tokenCmdCore tokenCommand
30-
OracleValidateCommand tokenId validateCommand -> do
31-
validateCmd
32-
tokenId
33-
validateCommand
3426
OracleSetConfigCommand configCommand -> configCmd configCommand

cli/src/Oracle/Options.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module Oracle.Options
33
, oracleCommandParser
44
) where
55

6-
import Core.Options (tokenIdOption)
76
import Lib.Box (Box (..), fmapBox)
87
import OptEnvConf
98
( Parser
@@ -13,18 +12,13 @@ import OptEnvConf
1312
import Oracle.Cli (OracleCommand (..))
1413
import Oracle.Config.Options (configCommandParser)
1514
import Oracle.Token.Options (tokenCommandParser)
16-
import Oracle.Validate.Options (validateCommandParser)
1715

1816
oracleCommandParser
1917
:: Parser (Box OracleCommand)
2018
oracleCommandParser =
2119
commands
2220
[ command "token" "Manage tokens"
2321
$ fmapBox OracleTokenCommand <$> tokenCommandParser
24-
, command "requests" "Manage requests"
25-
$ fmap Box . OracleValidateCommand
26-
<$> tokenIdOption
27-
<*> validateCommandParser
2822
, command "config" "Manage configuration"
2923
$ fmapBox OracleSetConfigCommand <$> configCommandParser
3024
]

cli/src/Oracle/Validate/Cli.hs

Lines changed: 0 additions & 112 deletions
This file was deleted.

cli/src/Oracle/Validate/Options.hs

Lines changed: 0 additions & 28 deletions
This file was deleted.

cli/test-E2E/scenarios/lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ being_requester (){
104104

105105
include_requests() {
106106
being_oracle
107-
validation=$(anti oracle requests validate)
108-
references=$(echo "$validation" | jq -r '.result | .[] | select(.validation == "validated") | .reference')
107+
validation=$(anti token)
108+
references=$(echo "$validation" | jq -r '.result.requests | .[] | select(.validation == "validated") | .request.outputRefId')
109109
if [ -z "$references" ]; then
110110
log "No references validated: $validation"
111111
exit 1

cli/test-E2E/scenarios/retractions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ being_requester
3939
outputRef=$(getOutputRef "$result")
4040
anti retract -o "$outputRef"
4141

42-
result=$(anti oracle token get | jq '.result.requests')
42+
result=$(anti token | jq '.result.requests')
4343
if [[ "$result" == "[]" ]]; then
4444
log "Test passed: User registration successfully retracted"
4545
else

cli/test-E2E/scenarios/validateATestRun.sh

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ result=$(anti requester register-user \
3333
outputRef=$(getOutputRef "$result")
3434

3535
log "Pending requests for the anti oracle token:"
36-
anti oracle token get | jq '.result.requests | .[]'
36+
anti token | jq '.result.requests | .[]'
3737

38-
log "Validating the requests pending for the anti oracle token..."
39-
anti oracle requests validate | jq -r '.result'
4038

4139
log "Updating the anti oracle token with output reference $outputRef..."
4240
anti oracle token update -o "$outputRef" >/dev/null
@@ -53,10 +51,7 @@ result=$(anti requester register-role \
5351
outputRef=$(getOutputRef "$result")
5452

5553
log "Pending requests for the anti oracle token:"
56-
anti oracle token get | jq '.result.requests | .[]'
57-
58-
log "Validating the requests pending for the anti oracle token..."
59-
anti oracle requests validate | jq -r '.result'
54+
anti token | jq '.result.requests | .[]'
6055

6156
log "Updating the anti oracle token with output reference $outputRef..."
6257
anti oracle token update -o "$outputRef" >/dev/null
@@ -75,10 +70,7 @@ result=$(anti requester create-test \
7570

7671
outputRef=$(getOutputRef "$result")
7772
log "Pending requests for the anti oracle token:"
78-
anti oracle token get | jq '.result.requests | .[]'
79-
80-
log "Validating the requests pending for the anti oracle token..."
81-
anti oracle requests validate | jq -r '.result'
73+
anti token | jq '.result.requests | .[]'
8274

8375
log "Updating the anti oracle token with output reference $outputRef..."
8476
anti oracle token update -o "$outputRef" >/dev/null

0 commit comments

Comments
 (0)