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.
- Changed instruction codegen internals to support
*_with_program_id()
- Changed
IdlFormat
trait def to make dependency andCargo.toml
writing 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.rs
not importingsolana_program::pubkey::Pubkey
if 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
derive
feature tobytemuck
dependency
- Program ID now defaults to
TH1S1SNoTAVAL1DPUBKEYDoNoTUSE11111111111111
instead of system program ID if ID not provided in IDL *IxData
,*ProgramIx
and anchor accounts no longer implementBorshSerialize
since it does not follow the borsh spec. The methods have been moved to their intrinsic impl.- Change
*IxData
and*ProgramIx
s'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
*IxArgs
struct if no instruction args. - No longer generates
*Accounts
*Keys
structs and*_verify_account_keys()
function if instruction has no account inputs. - All reference types for
*Keys
and*Accounts
have been changed to pass by value since they implCopy
- Replaced
solana-program
dependency withbs58
From <XKeys> for [AccountMeta; LEN]
now uses direct struct initialization instead of theAccountMeta
constructor functions
*_verify_account_privileges()
functions now returnErr((&AccountInfo, ProgramError))
on err where&AccountInfo
is the first offending account.
- Removed unused macro
gen_body_newtype_slice
- Simple support for Pod/zero copy typedefs with the
-z
option
- made more stuff
pub
for the lib
*_verify_account_privileges()
generated function for instructions*_verify_account_keys()
generated function for instructions
- document
--program-id
default values in--help
- all internal modules are now
pub
to allow people to use the library
- Removed variable lifetimes from the various
AccountInfo
s in*Accounts
. They all now share the same lifetime'info
- Changed the various
*IxData
structs to own the*IxArgs
structs instead of a reference
impl From<[Pubkey; *_IX_ACCOUNTS_LEN]> for *Keys
for easier indexingimpl From<&[AccountInfo; *_IX_ACCOUNTS_LEN]> for *Accounts
for easier CPIsdeserialize
method for*IxData
. Not usingBorshDeserialize
trait due to breaking change in trait def between 0.9 and 0.10derive(PartialEq)
for all typedefs and*IxArgs
and*IxData
**Account
for anchor accounts newtype that includes the discriminant in borsh serde- Added
--program-id
option 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
*IxArgs
to be PascalCase per rust convention instead of camelCase in the IDL
- Bug that wasn't including the generated
errors
module into the crate
--serde-vers
to configureserde
as an optional dependency for the generated crate
- Allow toml maps to be passed to the various
--*-vers
options to allow for values like"workspace = true"
- Upgrade default solana-program version to
^1.16
and borsh version to^0.10
- Handle inner
Accounts<'_>
struct for anchor.
defined
types being incorrectly converted to pascal casemetadata
field is now optional for anchor IDLs and program address is set to11111111111111111111111111111111
, with warning logged, if not present
- Support for tuple enums
Initial release