Skip to content

Commit 9e93f0f

Browse files
authored
chore: update public key recovery example in docs (#1638)
When viewing the [docs hub example](https://docs.fuel.network/docs/fuels-rs/wallets/signing/#signing) on how to recover a public key, the variable name provided is `recovered_address`. This is misleading and leads to confusion as the recovered type is a `PublicKey` https://github.com/FuelLabs/fuel-vm/blob/09c500838b734603970c62d414e0e95825f44773/fuel-crypto/src/secp256/signature.rs#L140C56-L140C65. This has been updated to a more appropriate name. # Checklist - [x] All **changes** are **covered** by **tests** (or not applicable) - [x] All **changes** are **documented** (or not applicable) - [x] I **reviewed** the **entire PR** myself (preferably, on GH UI) - [x] I **described** all **Breaking Changes** (or there's none)
1 parent 966d34b commit 9e93f0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/fuels-accounts/src/signers/private_key.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ mod tests {
109109
)?
110110
);
111111

112-
// Recover address that signed the message
113-
let recovered_address = signature.recover(&message)?;
112+
// Recover the public key that signed the message
113+
let recovered_pub_key: PublicKey = signature.recover(&message)?;
114114

115-
assert_eq!(signer.address().hash(), recovered_address.hash());
115+
assert_eq!(signer.address().hash(), recovered_pub_key.hash());
116116

117117
// Verify signature
118-
signature.verify(&recovered_address, &message)?;
118+
signature.verify(&recovered_pub_key, &message)?;
119119
// ANCHOR_END: sign_message
120120

121121
Ok(())

0 commit comments

Comments
 (0)