Skip to content

Commit

Permalink
sdk: Limited Borsh 0.9 support (Pubkey and helpers) (#32511)
Browse files Browse the repository at this point in the history
* sdk: Implement Borsh 0.9 traits on Pubkey

* Alphabetize cargo.toml

* Add backwards-compatible borsh file

* Add borsh0_10.rs for more clarity

* Deprecate `borsh` utils, use borsh0_10 everywhere

* Mark borsh 0.9 helpers as deprecated

* Add macros for deriving helper impls

* Add borsh 0.9 tests

* Refactor tests into macro

(cherry picked from commit 8c14886)

# Conflicts:
#	sdk/src/lib.rs
  • Loading branch information
joncinque authored and mergify[bot] committed Aug 2, 2023
1 parent 79c8bac commit 8763141
Show file tree
Hide file tree
Showing 12 changed files with 359 additions and 256 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion program-runtime/src/compute_budget.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
crate::prioritization_fee::{PrioritizationFeeDetails, PrioritizationFeeType},
solana_sdk::{
borsh::try_from_slice_unchecked,
borsh0_10::try_from_slice_unchecked,
compute_budget::{self, ComputeBudgetInstruction},
entrypoint::HEAP_LENGTH as MIN_HEAP_FRAME_BYTES,
instruction::{CompiledInstruction, InstructionError},
Expand Down
1 change: 1 addition & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/src/cost_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use {
ComputeBudget, DEFAULT_INSTRUCTION_COMPUTE_UNIT_LIMIT, MAX_COMPUTE_UNIT_LIMIT,
},
solana_sdk::{
borsh::try_from_slice_unchecked,
borsh0_10::try_from_slice_unchecked,
compute_budget::{self, ComputeBudgetInstruction},
feature_set::{
add_set_tx_loaded_accounts_data_size_instruction, remove_deprecated_request_unit_ix,
Expand Down
1 change: 1 addition & 0 deletions sdk/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rust-version = "1.68.0" # solana platform-tools rust version
bincode = { workspace = true }
blake3 = { workspace = true, features = ["digest", "traits-preview"] }
borsh = { workspace = true }
borsh0-9 = { package = "borsh", version = "0.9.3" }
bs58 = { workspace = true }
bv = { workspace = true, features = ["serde"] }
bytemuck = { workspace = true, features = ["derive"] }
Expand Down
Loading

0 comments on commit 8763141

Please sign in to comment.