Skip to content

Commit

Permalink
WASM: rename randomized_public_key to randomized_public_key_pair
Browse files Browse the repository at this point in the history
This method returns a struct which also has a `randomized_public_key`
method, which results in code like this:

```rs
let r = x.randomized_public_key();
let p = r.randomized_public_key();
```

... which is very ambiguous/confusing. With this PR, the above code
becomes:

```rs
let r = x.randomized_public_key_pair();
let p = r.randomized_public_key();
```
  • Loading branch information
andiflabs committed Feb 13, 2025
1 parent 7f2a680 commit fa1b8f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ironfish-rust-wasm/src/keys/view_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl ViewKey {
self.0.nullifier_deriving_key.into()
}

#[wasm_bindgen(js_name = randomizedPublicKey)]
#[wasm_bindgen(js_name = randomizedPublicKeyPair)]
pub fn randomized_public_key_pair(&self) -> RandomizedPublicKeyPair {
let (r, s) = self.0.randomized_public_key(thread_rng());
RandomizedPublicKeyPair::new(r.into(), s.into())
Expand Down

0 comments on commit fa1b8f7

Please sign in to comment.