Skip to content

Commit e4b1f2e

Browse files
committed
instruction: Derive everything for wasm build
#### 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.
1 parent bb2c926 commit e4b1f2e

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)