Commit Graph

369 Commits

Author SHA1 Message Date
acheron b5f4796156
Add `IdlBuild` trait (#2629) 2023-09-15 23:59:18 +02:00
acheron 4955a92593
Add byte slice(`&[u8]`) support for `idl-build` (#2622) 2023-09-08 10:01:51 +02:00
Will dcf5928f3f
lang: `Box` the inner enums of `anchor_lang::error::Error` (#2600)
Co-authored-by: acheron <acheroncrypto@gmail.com>
2023-08-30 19:28:51 +02:00
Will a7205af5df
lang: `associated_token` constraints don't work when setting `token_program` (#2603)
Co-authored-by: acheron <acheroncrypto@gmail.com>
2023-08-23 22:10:08 +02:00
acheron abfdc4e88f
chore: Remove duplicate dependency and and alphabetize features (#2590) 2023-08-05 23:47:06 +02:00
Proph3t be8764b8a8
Fix typo in account.rs docs (#2587) 2023-08-01 22:23:48 +02:00
acheron cad868a052
Make the new IDL features explicit (#2582) 2023-07-29 23:49:17 +02:00
acheron 4604fbea9c
cli: Automatically decide IDL generation method (#2578) 2023-07-22 16:39:05 +02:00
Jean Marchand (Exotic Markets) c548c85dff
chore: Remove unused crates (#2577) 2023-07-22 12:43:56 +02:00
Jean Marchand (Exotic Markets) 2bb3237da6
chore: Fix clippy lints (#2576) 2023-07-21 11:04:52 +02:00
acheron b7e91d4d0d
Remove IDL `path` field (#2564) 2023-07-11 19:05:14 +02:00
Krešimir Klas 6ef6b79a6c
IDL generation through compilation (#2011)
Co-authored-by: acheron <acheroncrypto@gmail.com>
2023-07-08 19:59:30 +02:00
Noah Prince 0225b7c0fd
lang: Allow polymorphic CPI calls matching an interface (#2559) 2023-07-07 23:30:38 +02:00
Jean Marchand (Exotic Markets) 9ff7dfcf6f
lang: Support for `const` in the `InitSpace` macro (#2555) 2023-07-05 10:05:37 +02:00
acheron e55cd3e646
lang: Add `Lamports` trait (#2552) 2023-07-01 22:59:36 +02:00
Jean Marchand (Exotic Markets) 5624bfe0ff
lang: Fix typo in the doc (#2551) 2023-06-29 13:35:38 +02:00
acheron e1afcbf71e
v0.28.0 (#2527) 2023-06-09 18:00:35 +02:00
acheron c7c73194d8
Allow wider range of dependency versions to reduce dependency issues (#2524) 2023-06-08 18:59:44 +02:00
acheron 6df34e7678
Update crate authors and remove outdated registry (#2522) 2023-06-07 19:12:56 +02:00
Jean Marchand (Exotic Markets) 1705d16376
docs: Add doc for InitSpace macro (#2521) 2023-06-07 16:29:23 +02:00
Sarfaraz Nawaz 835dc5b07f
lang: Rename derive_anchor_deserialize -> derive_init_space (#2510) 2023-06-04 19:50:03 +02:00
acheron 1c6f86e5f7
Upgrade Solana to 1.16.0 (#2512) 2023-06-04 13:09:39 +02:00
Noah Gundotra 23b90bffc0
Feature: CPI Events API (#2438)
Co-authored-by: acheron <acheroncrypto@gmail.com>
2023-05-26 18:36:46 +02:00
CanardMandarin 714d524863
lang: Add error message when Mint and TokenAccount with `init` are not ordered correctly (#2484) 2023-05-09 16:17:11 +02:00
CanardMandarin d1ddf00293
lang: Fix incorrectly checking the first init constraint (#2483) 2023-05-07 11:03:37 +02:00
Proph3t 876ef41610
docs: fix broken links in `AccountLoader` docs (#2473) 2023-04-27 10:53:04 +02:00
CanardMandarin 2e89b79c51
fix: used identifiers in handler (#2464) 2023-04-22 21:26:22 +02:00
Elliot Kennedy 670b4f5005
Add `token_program` constraint to token, mint, and associated token accounts (#2460) 2023-04-19 10:43:24 +02:00
Nick Garfield fbd0688903
Replace unsafe arithmetic with checked_add (#2448) 2023-03-30 11:44:12 -04:00
Britt Cyr 7ee4a7a047
Fix unsafe add (#2444) 2023-03-24 12:03:33 -05:00
Henry-E 3b45144787
v0.27.0 (#2428) 2023-03-08 13:28:23 +00:00
Henry-E 45fa9bd3ba
Update Solana-program and rust-version (#2420) 2023-03-02 17:23:16 +00:00
Jon Cinque 777f2eace1
interface: Support multiple programs with the same interface via token-2022 (#2386) 2023-02-27 10:55:08 +00:00
Jean Marchand (Exotic Markets) eef9888c82
lang: remove ConstraintLiteral (#2379) 2023-02-06 17:41:38 +00:00
Jean Marchand (Exotic Markets) c76641f861
lang: remove deprecated accounts (#2375) 2023-02-06 16:46:09 +00:00
nojob1 872d084e00
--fix clippy (#2388) 2023-02-06 11:16:23 +00:00
Henry-E 21c3b3c7b5
fix misaligned bytes in test (#2373) 2023-01-26 17:40:49 +00:00
Christian Kamm ed2769ef28
Make zero copy safe by default, add `account(zero_copy(unsafe))` feature. (#2330) 2023-01-26 14:46:57 +00:00
Henry-E 2a05075760
Update IDL program (#2365) 2023-01-26 11:32:30 +00:00
Jean Marchand (Exotic Markets) a0ef4ed7a4
lang: add the InitSpace macro (#2346) 2023-01-26 11:22:48 +00:00
Henry-E 74009921a1
Fix clippy lints (#2362) 2023-01-17 13:17:44 +00:00
CurriedOtter 6e776c5e7b
make constraint group fields public (#2360) 2023-01-16 20:24:35 -06:00
Christian Kamm 27bb695685
Idl: Limit account size to 60kb, allow closing idl accounts (#2329) 2023-01-05 13:25:21 +00:00
Jean Marchand (Exotic Markets) 38bbb21c33
lang: remove the state and interface attributes (#2285) 2022-12-22 16:33:44 +00:00
Henry-E 347c225a27
v0.26.0 (#2315)
* v0.26.0

* update packages

* typedocs

Co-authored-by: henrye <henry@notanemail>
2022-12-15 16:12:22 +00:00
Henry-E f79f9dab74
Use less heap intensive error mapping (#2313)
* less heap intensive error mapping

* add changelog

* try returning the error

* dumb match statements instead

* missing commas

Co-authored-by: henrye <henry@notanemail>
2022-12-14 17:03:57 +00:00
Adithya Narayan b662ff1460
cli: `anchor account` subcommand to read program account (#1923)
* Setup account subcommand skeleton

* Move IDL deserialization code to syn module

* Change HashMap to serde_json

* Add enum deserialization

* Add account subcommand to docs

* Fix lint

* Add validation for account type

* Fix solana-sdk dependency version

* Fix clippy warnings

* Move IDL deserialization code to cli module

* Remove debug print

* Add integration tests

* Update documentation with example

* Fix clippy warnings

* Fix leftover merge conflict

* run prettier

Co-authored-by: Henry-E <henry.elder@adaptcentre.ie>
Co-authored-by: henrye <henry@notanemail>
2022-12-12 16:11:26 +00:00
Henry-E 03eff348db
only add public enums to the IDL (#2310)
Co-authored-by: henrye <henry@notanemail>
2022-12-12 16:10:47 +00:00
Sammy Harris 484628070c
Feat: Optional Positional Accounts (#2101)
* optional accounts initial implementation

* cargo fmt

* panic if Account related traits are run on none

* Allow empty accounts to deserialize to None for optional accounts

* implement constraints for optional accounts

* optional accounts to idl gen

* accountstruct helper method

* implemented to_account_metas and infos

* add test program

* Rename optional to is_optional

* added more traits

* added TryKey error

* fix has_one

* update prelude

* is_optional

* add is_optional helper method

* Add TryAccountInfos trait

* improve constraint parser

* initial work on TryToAccountInfo

* Rename to TryToAccountInfo

* finished implementing tryToAccountInfo

* Using program method

* Formatting

* Fix program function call

* Remove function return borrow

* Fix access to program field

* finished implementing tryToAccountInfo

* add exit try_to_account_infos

* descriptive ID path

* try_to_account_info

* fix close constraint

* update test files

* completed typescript optional accounts implementation

* fix try accounts for init

* update tests

* fix to_account_metas

* update tests

* fix linting

* remove types/node

* update yarn.lock maybe?

* update optional test

* update optional test

* update optional rust cli test

* fix linting and tests

* fix tests

* update try_accounts to pass in accs during constraint gen

* Add default impl for TryToAccountInfos

* Removed TryToAccountInfos trait

* Formatting

* remove unneccesary traits and improve constraint gen drastically

* fix exit generation

* clippy

* improve cross check error message

* improve comments

* more comments

* update constraints hopefully good now?

* add new errors to ts client

* add new errors to ts client

* update optional test

* update anchor ts client

* update misc crate

* linting

* temporarily comment out optional rs tests

* update ts

* remove local test files

* linting

* optional client tests

* fix other lints to make the test pass

* remove comments

* remove misc-optional for now

* update optional program

* update optional program and client tests again

* update optional program and client tests again again

* added initialize tests that should pass

* undo unrelated anchor.toml change

* update close on optional program and improve tests

* update optional program again.

* update optional program and optional tests

* fix has one error message

* fix client example tests

* update lockfile

* update lockfile

* regenerate lockfile

* reset lockfile

* reset ts yarn lockfile

* update no caching tests

* update exit codegen to use generate_optional_check

* remove `try_to_account_infos`

* update parser to ignore method calls in constraints

* refactor and improve optional checks in constraints

* add misc-optional program and tests

* enable cpi for optional tests

* Revert "enable cpi for optional tests"

This reverts commit c864cd5d4f.

* simplify misc tests

* update version

* fix rust version and resolve merge conflicts

* prevent Option on composite accounts

* hopefully fixed ts stuff?

* hopefully fixed ts stuff?

* testing

* hopefully done?

* update misc test

* fix optional tests

* fix ts

* fix ts again!

* linting urg

* allow-missing-optionals feature

* fix client tests

* add bnjs types to tests

Co-authored-by: febo <febo@kent.ac.uk>
Co-authored-by: Henry-E <henry.elder@adaptcentre.ie>
2022-12-12 15:32:59 +00:00
Lucas Steuernagel 0ba2195ec7
Add support for 256-bit integers in the IDL (#2260)
* Add support for 256-bit integers in the IDL

Signed-off-by: Lucas Steuernagel <lucas.tnagel@gmail.com>

* Fix lint warnings

Signed-off-by: Lucas Steuernagel <lucas.tnagel@gmail.com>
2022-12-05 15:45:07 +00:00