All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Updated all dependencies to latest compatible versions.
- Anchor event struct fields are now public.
bytes_to_u8feature that replaces all generated primitive instances ofbyteswithu8.
- Anchor
accountsandtypedefsgenerated names now conform to Rust PascalCase convention.
- Changed instruction codegen internals to support
*_with_program_id() - Changed
IdlFormattrait def to make dependency andCargo.tomlwriting more dyn - Now panics instead of continuing if accounts with the same name are detected in the any IDL instruction.
- bincode support
*_ix_with_program_id(),*_invoke_with_program_id(),*_invoke_signed_with_program_id()
- imports for
instructions.rsnot importingsolana_program::pubkey::Pubkeyif no instruction has accounts but some args has pubkey
- Removed instruction function generics
- split
_verify_account_privileges()to be composed of 2 separate functions:_verify_writable_privileges()and_verify_signer_privileges()
- Add required
derivefeature tobytemuckdependency
- Program ID now defaults to
TH1S1SNoTAVAL1DPUBKEYDoNoTUSE11111111111111instead of system program ID if ID not provided in IDL *IxData,*ProgramIxand anchor accounts no longer implementBorshSerializesince it does not follow the borsh spec. The methods have been moved to their intrinsic impl.- Change
*IxDataand*ProgramIxs'deserialize()fn signature to accept&[u8]instead of&mut &[u8].&mut &[u8]was previously used for borsh compatibility. - No longer generates
*_verify_account_privileges()function if instruction has no privileged accounts (only non-signer and non-writable accounts). - No longer generates
*IxArgsstruct if no instruction args. - No longer generates
*Accounts*Keysstructs and*_verify_account_keys()function if instruction has no account inputs. - All reference types for
*Keysand*Accountshave been changed to pass by value since they implCopy - Replaced
solana-programdependency withbs58
From <XKeys> for [AccountMeta; LEN]now uses direct struct initialization instead of theAccountMetaconstructor functions
*_verify_account_privileges()functions now returnErr((&AccountInfo, ProgramError))on err where&AccountInfois the first offending account.
- Removed unused macro
gen_body_newtype_slice
- Simple support for Pod/zero copy typedefs with the
-zoption
- made more stuff
pubfor the lib
*_verify_account_privileges()generated function for instructions*_verify_account_keys()generated function for instructions
- document
--program-iddefault values in--help - all internal modules are now
pubto allow people to use the library
- Removed variable lifetimes from the various
AccountInfos in*Accounts. They all now share the same lifetime'info - Changed the various
*IxDatastructs to own the*IxArgsstructs instead of a reference
impl From<[Pubkey; *_IX_ACCOUNTS_LEN]> for *Keysfor easier indexingimpl From<&[AccountInfo; *_IX_ACCOUNTS_LEN]> for *Accountsfor easier CPIsdeserializemethod for*IxData. Not usingBorshDeserializetrait due to breaking change in trait def between 0.9 and 0.10derive(PartialEq)for all typedefs and*IxArgsand*IxData**Accountfor anchor accounts newtype that includes the discriminant in borsh serde- Added
--program-idoption to allow setting of custom program IDs to accomodate anchor IDLs not containing their program IDs.
- internals refactored to enable dynamic modules for the generated crate
- Anchor: standardize
*IxArgsto be PascalCase per rust convention instead of camelCase in the IDL
- Bug that wasn't including the generated
errorsmodule into the crate
--serde-versto configureserdeas an optional dependency for the generated crate
- Allow toml maps to be passed to the various
--*-versoptions to allow for values like"workspace = true"
- Upgrade default solana-program version to
^1.16and borsh version to^0.10
- Handle inner
Accounts<'_>struct for anchor.
definedtypes being incorrectly converted to pascal casemetadatafield is now optional for anchor IDLs and program address is set to11111111111111111111111111111111, with warning logged, if not present
- Support for tuple enums
Initial release