Skip to content

Commit

Permalink
instruction: Derive everything for wasm build
Browse files Browse the repository at this point in the history
#### Problem

As noticed in
solana-labs/solana-program-library#7489, the
wasm build for `Instruction` doesn't contain `Clone`. This is because we
missed the derivations for the wasm version of `Instruction` in
anza-xyz#1658.

#### Summary of changes

Looking back through that PR, I noticed that we only missed those
additional derives on `Instruction`, so just fix those in `Instruction`.

Since this is fixing a small regression for wasm builds, I think we
should backport the change to v2.1.
  • Loading branch information
joncinque committed Nov 13, 2024
1 parent bb2c926 commit e4b1f2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdk/instruction/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ pub struct Instruction {
/// is fixed. This must not diverge from the regular non-wasm Instruction struct.
#[cfg(all(feature = "std", target_arch = "wasm32"))]
#[wasm_bindgen::prelude::wasm_bindgen]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct Instruction {
#[wasm_bindgen(skip)]
pub program_id: Pubkey,
Expand Down

0 comments on commit e4b1f2e

Please sign in to comment.