Skip to content

Commit

Permalink
v2.1: instruction: Derive everything for wasm build (backport of #3606)…
Browse files Browse the repository at this point in the history
… (#3610)

instruction: Derive everything for wasm build (#3606)

#### 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
#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.

(cherry picked from commit d3bce9f)

Co-authored-by: Jon C <[email protected]>
  • Loading branch information
mergify[bot] and joncinque authored Nov 18, 2024
1 parent 7dd23ab commit 3bbabb3
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 3bbabb3

Please sign in to comment.