Skip to content

Commit

Permalink
return only acceptance, not resource
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamISZ committed Apr 1, 2024
1 parent 5682bec commit 7a9a37b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,9 @@ Configuration file: '/home/user/.config/autct/default-config.toml'
mode = "request"
... other config settings
We received this resource: soup-for-you
Request was accepted by the Autct verifier! The proof is valid and the (unknown) pubkey is unused.
```


(Process currently verified working on Ubuntu 22.04, Debian 12 and Windows 10)

# Testing
Expand Down
4 changes: 2 additions & 2 deletions docs/utxo-keysets.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ https://github.com/AdamISZ/aut-ct-test-cases/blob/master/src/filter_utxos.py

(See the notes on the repo; install with `pip install .` before running the script).

Example yntax:
Example syntax:

```
python3 filter_utxos 500000 utxos16Mar.sqlite autct-830000-500000-0-2-1024.aks
python3 filter_utxos.py 500000 utxos16Mar.sqlite autct-830000-500000-0-2-1024.aks
```

... noting that here, I'm using an example of the key filename syntax defined in Appendix 1 [here](./protocol-utxo.md).
Expand Down
3 changes: 2 additions & 1 deletion src/autct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ async fn run_request(autctcfg: AutctConfig) -> Result<(), Box<dyn Error>> {
// codes defined in lib.rs
// TODO: create some callback structure to receive the resource
match rest.accepted {
1 => println!("We received this resource: {}", rest.resource_string.unwrap()),
// deliberately verbose message here to help testers understand:
1 => println!("Request was accepted by the Autct verifier! The proof is valid and the (unknown) pubkey is unused."),
-1 => println!("Request rejected, PedDLEQ proof does not match the tree."),
-2 => println!("Request rejected, PedDLEQ proof is invalid."),
-3 => println!("Request rejected, proofs are valid but key image is reused."),
Expand Down
8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ pub mod rpc {
pub context_label: String,
pub application_label: String,
pub accepted: i32,
// TODO possibly remove this;
// the resource string will be the
// responsibility of the caller,
// for now we just leave a default string
// that could be used somehow in future versions:
pub resource_string: Option<String>,
pub key_image: Option<String>,
}
Expand Down Expand Up @@ -196,8 +201,7 @@ pub mod rpc {
println!("Verifying curve tree passed and it matched the key image. Here is the key image: {}",
str_E);
resp.accepted = 1;
// TODO create some callback structure to generate
// the resource (probably taking the full Request as argument)
// as per comment in Response struct:
resp.resource_string = Some("soup-for-you".to_string());
resp.key_image = Some(str_E);
Ok(resp)
Expand Down

0 comments on commit 7a9a37b

Please sign in to comment.