From f4f61be32272524ea887a7882892e9b9dbe5f5fa Mon Sep 17 00:00:00 2001 From: r4bbit <445106+0x-r4bbit@users.noreply.github.com> Date: Mon, 25 May 2026 16:56:54 +0200 Subject: [PATCH] chore(Makefile): add `idl` command to `Makefile` --- Makefile | 9 +++++++-- twap_oracle/methods/guest/src/bin/twap_oracle.rs | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 01034df..cdb4652 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ -.PHONY: clippy clippy-guest clippy-all test fmt +.PHONY: clippy clippy-guest clippy-all test fmt idl clippy: RISC0_SKIP_BUILD=1 cargo clippy --workspace --all-targets -- -D warnings clippy-guest: - for manifest in token/methods/guest/Cargo.toml amm/methods/guest/Cargo.toml ata/methods/guest/Cargo.toml stablecoin/methods/guest/Cargo.toml; do \ + for manifest in token/methods/guest/Cargo.toml amm/methods/guest/Cargo.toml ata/methods/guest/Cargo.toml stablecoin/methods/guest/Cargo.toml twap_oracle/methods/guest/Cargo.toml; do \ cargo clippy --manifest-path "$$manifest" --all-targets -- -D warnings || exit 1; \ done @@ -15,3 +15,8 @@ test: fmt: cargo +nightly fmt --all + +idl: + for program in token amm ata stablecoin twap_oracle; do \ + cargo run -p idl-gen -- "$$program/methods/guest/src/bin/$$program.rs" > "artifacts/$$program-idl.json" || exit 1; \ + done diff --git a/twap_oracle/methods/guest/src/bin/twap_oracle.rs b/twap_oracle/methods/guest/src/bin/twap_oracle.rs index b480c08..1deb385 100644 --- a/twap_oracle/methods/guest/src/bin/twap_oracle.rs +++ b/twap_oracle/methods/guest/src/bin/twap_oracle.rs @@ -1,7 +1,8 @@ -#![no_main] +#![cfg_attr(not(test), no_main)] use spel_framework::prelude::*; +#[cfg(not(test))] risc0_zkvm::guest::entry!(main); #[lez_program(instruction = "twap_oracle_core::Instruction")]