Closed samuelvanderwaal closed 4 months ago
Latest commit: 7d0c49f0433ecd3bf57f984b0d0d645e6bbd03a4
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Nice, thanks for improving the program template!
It looks like we currently don't import the system-program
crate though so we get the following error when we try and cargo check
the generated program.
Should we add this to the program's Cargo.toml
? Or should we just inline the ID
here?
Nice, thanks for improving the program template!
It looks like we currently don't import the
system-program
crate though so we get the following error when we try andcargo check
the generated program.Should we add this to the program's
Cargo.toml
? Or should we just inline theID
here?
The Cargo.toml
already has the solana_program
crate which is where system_program
module comes from so I just needed to add it to the utils.rs
import statement. The commit I just pushed should fix the issue.
Oh I see! Awesome, just waiting for CI to pass and then I'll merge and publish a new release.
This adds a minor performance improvement to the
close_account
function in the Shank example Counter Program utils file. Instead of filling the account with zeros, a more efficient way to close accounts is to reassign to the system program and then realloc the length to zero. This is how Anchor does it, for example.