Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
SBPF_PROGRAM_PACKAGES: "['program', 'pinocchio-program']"
RUST_PACKAGES: "['interface', 'program', 'mollusk_harness', 'pinocchio-interface', 'pinocchio-program']"
WASM_PACKAGES: "['interface', 'program']"
IDL_PACKAGES: "['pinocchio-interface']"
MIRI_PACKAGES: "['pinocchio-program']"

jobs:
Expand All @@ -20,6 +21,7 @@ jobs:
SBPF_PROGRAM_PACKAGES: ${{ steps.compute.outputs.SBPF_PROGRAM_PACKAGES }}
RUST_PACKAGES: ${{ steps.compute.outputs.RUST_PACKAGES }}
WASM_PACKAGES: ${{ steps.compute.outputs.WASM_PACKAGES }}
IDL_PACKAGES: ${{ steps.compute.outputs.IDL_PACKAGES }}
MIRI_PACKAGES: ${{ steps.compute.outputs.MIRI_PACKAGES }}
RUST_TOOLCHAIN_NIGHTLY: ${{ steps.compute.outputs.RUST_TOOLCHAIN_NIGHTLY }}
SOLANA_CLI_VERSION: ${{ steps.compute.outputs.SOLANA_CLI_VERSION }}
Expand All @@ -34,6 +36,7 @@ jobs:
echo "SBPF_PROGRAM_PACKAGES=${{ env.SBPF_PROGRAM_PACKAGES }}" >> $GITHUB_OUTPUT
echo "RUST_PACKAGES=${{ env.RUST_PACKAGES }}" >> $GITHUB_OUTPUT
echo "WASM_PACKAGES=${{ env.WASM_PACKAGES }}" >> $GITHUB_OUTPUT
echo "IDL_PACKAGES=${{ env.IDL_PACKAGES }}" >> $GITHUB_OUTPUT
echo "MIRI_PACKAGES=${{ env.MIRI_PACKAGES }}" >> $GITHUB_OUTPUT
echo "RUST_TOOLCHAIN_NIGHTLY=$(make rust-toolchain-nightly)" >> "$GITHUB_OUTPUT"
echo "SOLANA_CLI_VERSION=$(make solana-cli-version)" >> "$GITHUB_OUTPUT"
Expand All @@ -45,6 +48,7 @@ jobs:
sbpf-program-packages: ${{ needs.set_env.outputs.SBPF_PROGRAM_PACKAGES }}
rust-packages: ${{ needs.set_env.outputs.RUST_PACKAGES }}
wasm-packages: ${{ needs.set_env.outputs.WASM_PACKAGES }}
idl-packages: ${{ needs.set_env.outputs.IDL_PACKAGES }}
rustfmt-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }}
clippy-toolchain: ${{ needs.set_env.outputs.RUST_TOOLCHAIN_NIGHTLY }}
solana-cli-version: ${{ needs.set_env.outputs.SOLANA_CLI_VERSION }}
Expand Down
240 changes: 238 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ cargo-nightly:
generate-clients:
@echo "No JavaScript clients to generate"

generate-idl-%:
@cargo install --locked --version =0.7.3 codama-cli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: for the future, rather than installing in the makefile target, it would be better for the generic action to install required tooling -- for example, the spellcheck job installs cargo-spellcheck and the audit job installs cargo-audit: https://github.com/solana-program/actions/blob/cf2614dd80f3646bc730ea75be989e4ed61383ae/.github/workflows/main.yml#L150

However, maybe we should expect the codama-cli to change a lot over the next year or two. When we feel that it's "stable", then we can add the installation in the generic action

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why not set codama-cli as a dev dependency on the workspace?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, Rust doesn't really have a mechanism for bins at the workspace level, similar to the pnpm <BIN> commands in JS. You install the bin for the user using cargo install and that's it.

(Or you use something like a nix shell, but that's a topic for another day 😁 )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, maybe we should expect the codama-cli to change a lot over the next year or two. When we feel that it's "stable", then we can add the installation in the generic action

Makes sense! Though, if we shipped and used tagged versions of solana-program/actions, breaking changes in those jobs wouldn't affect consumers. May be worth revisiting later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can do that if you promise to do all the downstream repo upgrades for every bump 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

codama-rs generate-idl $(call make-path,$*) -o $(call make-path,$*)/idl.json --pretty $(ARGS)

audit:
cargo audit \
--ignore RUSTSEC-2022-0093 \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# associated-token-account
The SPL Associated Token Account program and its clients
The SPL Associated Token Account program
5 changes: 5 additions & 0 deletions pinocchio/interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ edition = "2021"
[lib]
crate-type = ["rlib"]

[features]
codama = ["dep:codama", "dep:codama-macros"]

[dependencies]
codama = { version = "0.7.3", optional = true }
codama-macros = { version = "0.7.3", optional = true }
solana-address = { version = "2.2.0", features = ["decode"] }

[package.metadata.solana]
Expand Down
16 changes: 16 additions & 0 deletions pinocchio/interface/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# `pinocchio-associated-token-account-interface`

Pinocchio instructions and types for interacting with the Associated Token Account program.

## Codama

This crate includes Codama macros.

Generate the IDL from repo root:

```bash
make generate-idl-pinocchio-interface
```

This writes:

```text
pinocchio/interface/idl.json
```
Loading