Commit Graph

18 Commits

Author SHA1 Message Date
behzad nouri 9ee53e594d
patches clippy errors from new rust nightly release (#28028) 2022-09-23 20:57:27 +00:00
Christian Kamm 90b8a3a44d
Remove KeypairInsecureClone trait and add insecure_clone() instead (#27396)
See discussion in #26248
2022-09-12 14:59:41 +00:00
Justin Malčić 632752d2f9
Add `Signers` impls for `Arc<dyn Signer>` (#27000)
* Add `Signers` impls for `Arc<dyn Signer>`

* Reformat
2022-08-09 13:05:59 +02:00
Christian Kamm cf58640937
Keypair: implement clone() (#26248)
* Keypair: implement clone()

This was not implemented upstream in ed25519-dalek to force everyone to
think twice before creating another copy of a potentially sensitive
private key in memory.

See https://github.com/dalek-cryptography/ed25519-dalek/issues/76

However, there are now 9 instances of
  Keypair::from_bytes(&keypair.to_bytes())
in the solana codebase and it would be preferable to have a function.

In particular since this also comes up when writing programs and can
cause users to either start messing with lifetimes or discover the
from_bytes() workaround themselves.

This patch opts to not implement the Clone trait. This avoids automatic
use in order to preserve some of the original "let developers think
twice about this" intention.

* Use Keypair::clone
2022-08-06 11:54:38 -06:00
HaoranYi 3564b5d389
typo (#25771) 2022-06-03 20:50:52 +00:00
Michael Vines b05c7d91ed Fix derive_partial_eq_without_eq clippy lint 2022-05-22 22:22:21 -07:00
Justin Starry f804ccdece
Store address table lookups in blockstore and bigtable (#22402) 2022-01-14 15:24:41 +08:00
Michael Vines 488dc37fec Add wasm bindings for `Pubkey` and `Keypair` 2021-12-09 15:53:58 -08:00
Michael Vines b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
Brooks Prumo 96360f3139 clippy: Use `unwrap_or_default()`
Clippy was unhappy:

```text
error: use of `.unwrap_or_else(..)` to construct default value
   --> sdk/src/signer/keypair.rs:171:27
    |
171 |     let derivation_path = derivation_path.unwrap_or_else(DerivationPath::default);
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `derivation_path.unwrap_or_default()`
    |
    = note: `-D clippy::unwrap-or-else-default` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_else_default
```
2021-08-23 11:17:21 -05:00
Trent Nelson 2af5ec4f57 sdk: add `is_interactive()` method `Signer` trait 2021-07-03 07:33:59 +00:00
Tyera Eulberg b437b0a49d
Add bip32 support to solana-keygen recover (#17180)
* Fix spelling

* Add validator for  SignerSources

* Add helper to generate Keypair from supporting SignerSources

* Add bip32 support to solana-keygen recover

* Make SignerSourceKind const strs, use for Debug impl and URI schemes
2021-05-12 19:33:11 +00:00
Trent Nelson dbac38702a sdk: keypair - drop superfluous iter() 2021-05-11 13:07:58 -06:00
Trent Nelson 967840aed6 sdk: Move `signers` module into `signer` module 2021-05-11 13:07:58 -06:00
Trent Nelson b71e4bdc61 sdk: Move `NullSigner` to `signer` module 2021-05-11 13:07:58 -06:00
Trent Nelson 12bf6c06c3 sdk: Move `Presigner` to `signer` module 2021-05-11 13:07:58 -06:00
Trent Nelson 0eba6eb401 sdk: Move `Keypair` to `signer` module 2021-05-11 13:07:58 -06:00
Trent Nelson af6f3d776e sdk: Move `Signer` trait to own module 2021-05-11 13:07:58 -06:00