From 0c28f18b5a08c81965f7322bd9b3b4c87efe560d Mon Sep 17 00:00:00 2001 From: Jon C Date: Mon, 30 Dec 2024 09:23:08 -0500 Subject: [PATCH] Fix formatting for new renderer --- clients/rust/src/generated/instructions/add_memo.rs | 3 ++- scripts/generate-clients.mjs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/clients/rust/src/generated/instructions/add_memo.rs b/clients/rust/src/generated/instructions/add_memo.rs index 5f3c1a41..0b8835e8 100644 --- a/clients/rust/src/generated/instructions/add_memo.rs +++ b/clients/rust/src/generated/instructions/add_memo.rs @@ -39,7 +39,8 @@ impl AddMemo { } } -#[derive(BorshDeserialize, BorshSerialize)] +#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct AddMemoInstructionData {} impl AddMemoInstructionData { diff --git a/scripts/generate-clients.mjs b/scripts/generate-clients.mjs index 95dac89a..d83d59fe 100644 --- a/scripts/generate-clients.mjs +++ b/scripts/generate-clients.mjs @@ -3,7 +3,7 @@ import 'zx/globals'; import { createFromRoot } from 'codama'; import { renderVisitor as renderJavaScriptVisitor } from '@codama/renderers-js'; import { renderVisitor as renderRustVisitor } from '@codama/renderers-rust'; -import { workingDirectory } from './utils.mjs'; +import { getToolchainArgument, workingDirectory } from './utils.mjs'; // Instanciate Codama. const codama = createFromRoot( @@ -24,5 +24,6 @@ codama.accept( renderRustVisitor(path.join(rustClient, 'src', 'generated'), { formatCode: true, crateFolder: rustClient, + toolchain: getToolchainArgument('format'), }) );