Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

deprecates Pubkey::new in favor of Pubkey::{,try_}from #29805

Merged
merged 1 commit into from
Jan 21, 2023

Conversation

behzadnouri
Copy link
Contributor

Problem

Pubkey::new lacks type safety.

Summary of Changes

The commit deprecates Pubkey::new and instead implements TryFrom<&[u8]> and TryFrom<Vec<u8>> for Pubkey.

@behzadnouri behzadnouri force-pushed the deprecate-pubkey-new branch 2 times, most recently from caa599c to bb35857 Compare January 20, 2023 22:07
@behzadnouri behzadnouri changed the title deprecates Pubkey::new and implements Pubkey::try_from deprecates Pubkey::new in favor of Pubkey::try_from Jan 20, 2023
Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

sdk/program/src/pubkey.rs Show resolved Hide resolved
sdk/program/src/pubkey.rs Outdated Show resolved Hide resolved
sdk/program/src/wasm/pubkey.rs Outdated Show resolved Hide resolved
storage-proto/src/convert.rs Outdated Show resolved Hide resolved
rpc/src/rpc.rs Show resolved Hide resolved
rpc/src/rpc.rs Show resolved Hide resolved
The commit deprecates Pubkey::new which lacks type-safety and instead
implements TryFrom<&[u8]> and TryFrom<Vec<u8>> for Pubkey.
t-nelson
t-nelson previously approved these changes Jan 21, 2023
Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes lgtm, thanks!

r+ ci

@behzadnouri behzadnouri changed the title deprecates Pubkey::new in favor of Pubkey::try_from deprecates Pubkey::new in favor of Pubkey::{,try_}from Jan 21, 2023
@mergify mergify bot dismissed t-nelson’s stale review January 21, 2023 16:03

Pull request has been modified.

@behzadnouri behzadnouri merged commit 272e667 into solana-labs:master Jan 21, 2023
@behzadnouri behzadnouri deleted the deprecate-pubkey-new branch January 21, 2023 18:06
mergify bot pushed a commit that referenced this pull request Jan 21, 2023
The commit deprecates Pubkey::new which lacks type-safety and instead
implements TryFrom<&[u8]> and TryFrom<Vec<u8>> for Pubkey.

(cherry picked from commit 272e667)

# Conflicts:
#	runtime/src/accounts_db.rs
#	runtime/src/accounts_hash.rs
#	runtime/src/ancient_append_vecs.rs
#	runtime/src/append_vec.rs
#	runtime/src/bank.rs
#	runtime/src/storable_accounts.rs
#	streamer/src/tls_certificates.rs
#	transaction-status/src/parse_instruction.rs
behzadnouri added a commit that referenced this pull request Jan 24, 2023
…) (#29816)

* deprecates Pubkey::new in favor of Pubkey::{,try_}from (#29805)

The commit deprecates Pubkey::new which lacks type-safety and instead
implements TryFrom<&[u8]> and TryFrom<Vec<u8>> for Pubkey.

(cherry picked from commit 272e667)

# Conflicts:
#	runtime/src/accounts_db.rs
#	runtime/src/accounts_hash.rs
#	runtime/src/ancient_append_vecs.rs
#	runtime/src/append_vec.rs
#	runtime/src/bank.rs
#	runtime/src/storable_accounts.rs
#	streamer/src/tls_certificates.rs
#	transaction-status/src/parse_instruction.rs

* resolves mergify merge conflicts

* bumps solana_bpf_rust_sanity

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants