Commit Graph

156 Commits

Author SHA1 Message Date
Jean Marchand (Exotic Markets) 38bbb21c33
lang: remove the state and interface attributes (#2285) 2022-12-22 16:33:44 +00:00
Henry-E 4bef8c40ef
Switch to using @coral-xyz/anchor packages (#2318) 2022-12-16 13:21:50 +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
Jean Marchand (Exotic Markets) fad05805d8
spl: change serum-dex to openbook-dex (#2308)
* Change serum-dex by openbook-dex

* Change serum-dex by openbook-dex in tests

* Fix swap

* Fix cfo

* Downgrade openbook

* Disable cfo and update changelog

* Revert lock file

* minor grammar

* update the pubkey to open dex

* Remove @solana/web3.js from ts package.json

Co-authored-by: Henry-E <henry.elder@adaptcentre.ie>
Co-authored-by: henrye <henry@notanemail>
2022-12-12 16:12:33 +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
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 c864cd5d4f019e6bd5f93641e01bd82fc74041d4.

* 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
Henry-E 09b829d1a3
Identity com bugfix/robust fetch nullable (#2301)
* ts: Fixed `.fetchNullable()` to be robust towards accounts only holding a balance

* update changelog to new PR id

* prettier

Co-authored-by: Martin Riedel <web@riedel-it.de>
Co-authored-by: henrye <henry@notanemail>
2022-12-07 10:54:45 +00:00
skrrb 6814ce646e
cli: run a subset of the test suites (#1864)
* cli: run subset of tests with --run

* changelog

* test

* fix run test path

* test: added missing package.json

* cli: run subset of tests with --run

* changelog

* test

* fix run test path

* test: added missing package.json

Co-authored-by: Armani Ferrante <armaniferrante@gmail.com>
Co-authored-by: henrye <henry@notanemail>
2022-12-06 21:42:10 +00:00
Henry-E 66e4295fe0
drop rust version to allow earlier CLIs to compile (#2289)
* drop back rust version to allow earlier cli to compile

* update solana program to 1.13.5 latest mainnet version

Co-authored-by: henrye <henry@notanemail>
2022-11-29 11:36:48 +00:00
Henry-E 19e00e5d8f
Don't allow the payer to be initialized as a program account (#2284)
* don't allow people to initialize the payer as a program account

* update changelog

* accidentally commented out part of another test

Co-authored-by: henrye <henry@notanemail>
2022-11-25 15:12:58 +00:00
Jean Marchand (Exotic Markets) c0d3ff2d77
tests: Fix multiple suites example (#2279) 2022-11-23 10:48:46 +00:00
Henry-E 5291a7b6ff
Update rust to v1.62 (#2272)
* update rust from v1.56 to v1.65

* remove unnecessary borrows to appease clippy

* stop clippy complaining for now

* use 1.64 instead because of CI stuff

* update CHANGLEOG

* just seeing if the cli version is affecting the available rust version

* ok, back to 1.62

Co-authored-by: henrye <henry@notanemail>
2022-11-22 16:13:45 +00:00
Henry-E afbbbb0330
Trying to stop `zero-copy` test failing (#2274)
* trying out different solutions to zero copy issue (none work yet)

* using a newer version of the CLI should fix the issue

* re update solana client version

* add cargo.lock for some reason

* comment out broken test, get help later

* clippy doesn't like the new option

Co-authored-by: henrye <henry@notanemail>
2022-11-22 15:40:07 +00:00
Callum McIntyre 982799b7e6
Fix panic parsing seeds when account has qualified path (#2268)
* Fix panic parsing seeds when account has qualified path

* Add a test for seed derivation with account using type with path
2022-11-22 11:10:05 +00:00
Jean Marchand (Exotic Markets) 8ce18c36db
spl: Update instructions and remove rent from constraints (#2265)
* Update spl instructions and remove the rent sys_var from constraints

* Fix initialize mint

* Update changelog and fix examples

* Remove oversights
2022-11-19 12:59:14 +00:00
acheron af115999c6
ts: Remove SPL coders from Anchor package (#2155)
* ts: Remove SPL coders from Anchor package

* Replace old SPL custom coder tests

* Build and link new SPL packages before tests and decode token account for AccountStore

* Fix Github actions ts setup

* Fix u64 buffer length

* Update submodules

* Update CHANGELOG

* Checkout correct submodule commits

* Add filler program to generate idls in order for anchor test to pass
2022-11-17 14:17:22 +00:00
Jean Marchand b107cbe94f
lang: Fix parsing for bytes literals in the IDL (#2261)
* lang: Fix parsing of some constants

* Fix lint + changelog
2022-11-16 15:59:09 +00:00
Deep Mehta e8618a588f
replace getRecentBlockhash to getLatestBlockhash (#2205) 2022-11-14 16:59:36 +00:00
omahs 43ab991852
Fix: typos (#2236)
Fix: typos
2022-11-14 16:57:41 +00:00
Noah Prince feff131ab0
fix: Nested pda types and account resolution for pdas (#2259) 2022-11-13 21:45:41 -05:00
Henry-E 7a0a37e0f8
Update solana to version 1.13.3 (#2239)
* upgrade solana version to 1.13.3

* get everything to compile correctly

* update to using struct constructor to avoid deprecated field usage

* update deprecated functions

* more fixes to pass tests

* update auction-house submodule commit

* update the swap submodule

Co-authored-by: henrye <henry@notanemail>
2022-10-29 15:23:13 +01:00
Sammy Harris fa1249836e
Feat: Update AccountsClose to be safe to call manually (#2209)
* fix other lints to make the test pass

(cherry picked from commit d6e43c1ed6a176caa60dfdabe406ec125c3d34cf)

* update close to make it safe to call manually

* fix test script

* re-add safety warnings for deprecated account types

* update close checking logic

* readd logic for deprecated methods

* add additional checks to account_loader in exit
2022-10-21 17:06:54 +01:00
Totoro 8e66d5bb5f
Add support for idl enum tuples, enchance types (#2185) 2022-10-18 10:13:23 -04:00
Sammy Harris 3da28dbc5f
fix: ignore non Accounts in safety checks (#2201) 2022-10-13 23:08:02 -04:00
Sammy Harris 5647510615
chore: bump @solana/web3.js in anchor-ts (#2227) 2022-10-13 23:06:51 -04:00
Henry-E d83efcdc3a
update solana web3 package to 1.64.0 (#2223)
* update solana web3 package to 1.64.0

* fix some missing packages; update changelog

* fix weird prettier thing messing with changelog

* also upgrade the yarn.lock in tests
2022-10-13 11:20:32 +01:00
Noah Prince fd467df932
feat: Derive has_one's from other programs, recursively search custom resolvers (#2208) 2022-10-08 00:33:18 -04:00
Noah Prince 436791b039
feat: Recursively derive seeds and add custom account resolver (#2194) 2022-09-21 16:32:24 -04:00
Totoro 5ae52cae13
fix IDL types parsing (#2176) 2022-09-12 08:04:11 -04:00
Noah Prince e69e50daaf
feat: Add has_one relations inference so you don't need to pass accounts that are referenced by a has_one (#2160) 2022-09-10 12:52:59 -04:00
acheron 5a025b949e
ts: Add SPL Anchor packages (#2143) 2022-08-22 21:57:56 -04:00
Armani Ferrante 6baed77eb5
v0.25.0 (#2031) 2022-07-05 16:32:55 -04:00
Matthew Callens c47fb2877e
lang: adjust `realloc` implementation to safeguard max increase and idempotency (#1986) 2022-07-05 15:54:40 -04:00
Armani Ferrante 9b61bbc626
bump solana-program version (#2027) 2022-07-04 23:58:31 -04:00
Sohrab 55e0c5d9dd
fix: align links to coral-xyz/anchor github repo (#1988) 2022-06-19 22:16:16 -04:00
Armani Ferrante 1ec9af7e21
Revert "lang: add `realloc` constraint group (#1943)" (#1984)
This reverts commit 7fe39c61ad.
2022-06-17 17:16:10 -04:00
Matthew Callens 7fe39c61ad
lang: add `realloc` constraint group (#1943) 2022-06-04 20:25:28 -04:00
Daniel Marin a5dbc7b850
ts: setup associated token program idl (#1939) 2022-06-01 14:51:44 -04:00
Daniel Marin 707ebf26e7
feat: Setup a coder for SystemProgram (#1920) 2022-05-26 13:03:44 +02:00
ebrightfield ed15922f1a
Add docs field to idl (#1561) 2022-04-21 16:37:41 -04:00
Tom Linton b885c7b68c
tests: Add CLI IDL command tests (#1808) 2022-04-20 17:38:45 -04:00
Paul 9a9dc95305
tests: fix anchor-lang dependency paths (#1809) 2022-04-19 14:59:17 -04:00
Paul 42663eda25
ci: ci should error if tests have typescript errors (#1801) 2022-04-17 15:54:28 -04:00
Armani Ferrante 0b4c7b0c73
v0.24.2 (#1788) 2022-04-13 19:44:18 -04:00
Paul d07853e9ef
fix anchor-init ci and bpf-upgradeable-state package.json (#1781) 2022-04-12 19:29:52 -04:00
Armani Ferrante d491f0ba1d
v0.24.1 (#1779) 2022-04-12 18:50:33 -04:00
Paul b665f28b16
update anchor ts dep paths (#1778) 2022-04-12 18:16:04 -04:00
Paul fb149f96a1
update yarn lockfile, fix cli template, and fix ci (#1770) 2022-04-12 15:02:06 -04:00
Armani Ferrante b0f263214d
v0.24.0 (#1769) 2022-04-12 10:52:06 -04:00
Paul 6bd9879dd6
lang: codegen improvements (#1766) 2022-04-11 21:28:21 -04:00