Skip to content

Commit 3bbabb3

Browse files
v2.1: instruction: Derive everything for wasm build (backport of #3606) (#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]>
1 parent 7dd23ab commit 3bbabb3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sdk/instruction/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ pub struct Instruction {
105105
/// is fixed. This must not diverge from the regular non-wasm Instruction struct.
106106
#[cfg(all(feature = "std", target_arch = "wasm32"))]
107107
#[wasm_bindgen::prelude::wasm_bindgen]
108+
#[cfg_attr(
109+
feature = "serde",
110+
derive(serde_derive::Serialize, serde_derive::Deserialize)
111+
)]
112+
#[derive(Debug, PartialEq, Eq, Clone)]
108113
pub struct Instruction {
109114
#[wasm_bindgen(skip)]
110115
pub program_id: Pubkey,

0 commit comments

Comments
 (0)